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

#include "wobblywindowsconfig.h"

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

#include <QDebug>

using namespace KWin;

namespace KWin {

class WobblyWindowsConfigHelper
{
  public:
    WobblyWindowsConfigHelper() noexcept : q(nullptr) {}
    ~WobblyWindowsConfigHelper() noexcept { delete q; q = nullptr; }
    WobblyWindowsConfigHelper(const WobblyWindowsConfigHelper&) = delete;
    WobblyWindowsConfigHelper& operator=(const WobblyWindowsConfigHelper&) = delete;
    WobblyWindowsConfig *q;
};

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

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

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

WobblyWindowsConfig::WobblyWindowsConfig( KSharedConfig::Ptr config )
  : KConfigSkeleton( std::move( config ) )
{
  Q_ASSERT(!s_globalWobblyWindowsConfig()->q);
  s_globalWobblyWindowsConfig()->q = this;
  setCurrentGroup( QStringLiteral( "Effect-wobblywindows" ) );

  KConfigSkeleton::ItemUInt  *itemWobblynessLevel;
  itemWobblynessLevel = new KConfigSkeleton::ItemUInt( currentGroup(), QStringLiteral( "WobblynessLevel" ), mWobblynessLevel, 0 );
  addItem( itemWobblynessLevel, QStringLiteral( "WobblynessLevel" ) );
  KConfigSkeleton::ItemString  *itemSettings;
  itemSettings = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Settings" ), mSettings, QStringLiteral( "Auto" ) );
  addItem( itemSettings, QStringLiteral( "Settings" ) );
  KConfigSkeleton::ItemBool  *itemMoveWobble;
  itemMoveWobble = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "MoveWobble" ), mMoveWobble, true );
  addItem( itemMoveWobble, QStringLiteral( "MoveWobble" ) );
  KConfigSkeleton::ItemBool  *itemResizeWobble;
  itemResizeWobble = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ResizeWobble" ), mResizeWobble, true );
  addItem( itemResizeWobble, QStringLiteral( "ResizeWobble" ) );
  KConfigSkeleton::ItemBool  *itemAdvancedMode;
  itemAdvancedMode = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AdvancedMode" ), mAdvancedMode, false );
  addItem( itemAdvancedMode, QStringLiteral( "AdvancedMode" ) );
  KConfigSkeleton::ItemDouble  *itemStiffness;
  itemStiffness = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "Stiffness" ), mStiffness, 15 );
  addItem( itemStiffness, QStringLiteral( "Stiffness" ) );
  KConfigSkeleton::ItemDouble  *itemDrag;
  itemDrag = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "Drag" ), mDrag, 80 );
  addItem( itemDrag, QStringLiteral( "Drag" ) );
  KConfigSkeleton::ItemDouble  *itemMoveFactor;
  itemMoveFactor = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "MoveFactor" ), mMoveFactor, 10 );
  addItem( itemMoveFactor, QStringLiteral( "MoveFactor" ) );
  KConfigSkeleton::ItemDouble  *itemXTesselation;
  itemXTesselation = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "XTesselation" ), mXTesselation, 20 );
  addItem( itemXTesselation, QStringLiteral( "XTesselation" ) );
  KConfigSkeleton::ItemDouble  *itemYTesselation;
  itemYTesselation = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "YTesselation" ), mYTesselation, 20 );
  addItem( itemYTesselation, QStringLiteral( "YTesselation" ) );
  KConfigSkeleton::ItemDouble  *itemMinVelocity;
  itemMinVelocity = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "MinVelocity" ), mMinVelocity, 0.0 );
  addItem( itemMinVelocity, QStringLiteral( "MinVelocity" ) );
  KConfigSkeleton::ItemDouble  *itemMaxVelocity;
  itemMaxVelocity = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "MaxVelocity" ), mMaxVelocity, 1000.0 );
  addItem( itemMaxVelocity, QStringLiteral( "MaxVelocity" ) );
  KConfigSkeleton::ItemDouble  *itemStopVelocity;
  itemStopVelocity = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "StopVelocity" ), mStopVelocity, 0.5 );
  addItem( itemStopVelocity, QStringLiteral( "StopVelocity" ) );
  KConfigSkeleton::ItemDouble  *itemMinAcceleration;
  itemMinAcceleration = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "MinAcceleration" ), mMinAcceleration, 0.0 );
  addItem( itemMinAcceleration, QStringLiteral( "MinAcceleration" ) );
  KConfigSkeleton::ItemDouble  *itemMaxAcceleration;
  itemMaxAcceleration = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "MaxAcceleration" ), mMaxAcceleration, 1000.0 );
  addItem( itemMaxAcceleration, QStringLiteral( "MaxAcceleration" ) );
  KConfigSkeleton::ItemDouble  *itemStopAcceleration;
  itemStopAcceleration = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "StopAcceleration" ), mStopAcceleration, 5.0 );
  addItem( itemStopAcceleration, QStringLiteral( "StopAcceleration" ) );
}

WobblyWindowsConfig::~WobblyWindowsConfig()
{
  if (s_globalWobblyWindowsConfig.exists() && !s_globalWobblyWindowsConfig.isDestroyed()) {
    s_globalWobblyWindowsConfig()->q = nullptr;
  }
}

