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

#include "diminactiveconfig.h"

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

#include <QDebug>

using namespace KWin;

namespace KWin {

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

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

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

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

DimInactiveConfig::DimInactiveConfig(  KSharedConfig::Ptr config  )
  : KConfigSkeleton( config )
{
  Q_ASSERT(!s_globalDimInactiveConfig()->q);
  s_globalDimInactiveConfig()->q = this;
  setCurrentGroup( QStringLiteral( "Effect-DimInactive" ) );

  KConfigSkeleton::ItemInt  *itemStrength;
  itemStrength = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Strength" ), mStrength, 25 );
  addItem( itemStrength, QStringLiteral( "Strength" ) );
  KConfigSkeleton::ItemBool  *itemDimPanels;
  itemDimPanels = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "DimPanels" ), mDimPanels, false );
  addItem( itemDimPanels, QStringLiteral( "DimPanels" ) );
  KConfigSkeleton::ItemBool  *itemDimDesktop;
  itemDimDesktop = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "DimDesktop" ), mDimDesktop, false );
  addItem( itemDimDesktop, QStringLiteral( "DimDesktop" ) );
  KConfigSkeleton::ItemBool  *itemDimKeepAbove;
  itemDimKeepAbove = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "DimKeepAbove" ), mDimKeepAbove, false );
  addItem( itemDimKeepAbove, QStringLiteral( "DimKeepAbove" ) );
  KConfigSkeleton::ItemBool  *itemDimByGroup;
  itemDimByGroup = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "DimByGroup" ), mDimByGroup, true );
  addItem( itemDimByGroup, QStringLiteral( "DimByGroup" ) );
  KConfigSkeleton::ItemBool  *itemDimFullScreen;
  itemDimFullScreen = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "DimFullScreen" ), mDimFullScreen, true );
  addItem( itemDimFullScreen, QStringLiteral( "DimFullScreen" ) );
}

DimInactiveConfig::~DimInactiveConfig()
{
  s_globalDimInactiveConfig()->q = nullptr;
}

