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

#include "cubeconfig.h"

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

#include <QDebug>

using namespace KWin;

namespace KWin {

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

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

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

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

CubeConfig::CubeConfig(  KSharedConfig::Ptr config  )
  : KConfigSkeleton( config )
{
  Q_ASSERT(!s_globalCubeConfig()->q);
  s_globalCubeConfig()->q = this;
  setCurrentGroup( QStringLiteral( "Effect-Cube" ) );

  QList<int> defaultBorderActivate;

  KConfigSkeleton::ItemIntList  *itemBorderActivate;
  itemBorderActivate = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "BorderActivate" ), mBorderActivate, defaultBorderActivate );
  addItem( itemBorderActivate, QStringLiteral( "BorderActivate" ) );
  QList<int> defaultBorderActivateCylinder;

  KConfigSkeleton::ItemIntList  *itemBorderActivateCylinder;
  itemBorderActivateCylinder = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "BorderActivateCylinder" ), mBorderActivateCylinder, defaultBorderActivateCylinder );
  addItem( itemBorderActivateCylinder, QStringLiteral( "BorderActivateCylinder" ) );
  QList<int> defaultBorderActivateSphere;

  KConfigSkeleton::ItemIntList  *itemBorderActivateSphere;
  itemBorderActivateSphere = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "BorderActivateSphere" ), mBorderActivateSphere, defaultBorderActivateSphere );
  addItem( itemBorderActivateSphere, QStringLiteral( "BorderActivateSphere" ) );
  QList<int> defaultTouchBorderActivate;

  KConfigSkeleton::ItemIntList  *itemTouchBorderActivate;
  itemTouchBorderActivate = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TouchBorderActivate" ), mTouchBorderActivate, defaultTouchBorderActivate );
  addItem( itemTouchBorderActivate, QStringLiteral( "TouchBorderActivate" ) );
  QList<int> defaultTouchBorderActivateCylinder;

  KConfigSkeleton::ItemIntList  *itemTouchBorderActivateCylinder;
  itemTouchBorderActivateCylinder = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TouchBorderActivateCylinder" ), mTouchBorderActivateCylinder, defaultTouchBorderActivateCylinder );
  addItem( itemTouchBorderActivateCylinder, QStringLiteral( "TouchBorderActivateCylinder" ) );
  QList<int> defaultTouchBorderActivateSphere;

  KConfigSkeleton::ItemIntList  *itemTouchBorderActivateSphere;
  itemTouchBorderActivateSphere = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TouchBorderActivateSphere" ), mTouchBorderActivateSphere, defaultTouchBorderActivateSphere );
  addItem( itemTouchBorderActivateSphere, QStringLiteral( "TouchBorderActivateSphere" ) );
  KConfigSkeleton::ItemInt  *itemRotationDuration;
  itemRotationDuration = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "RotationDuration" ), mRotationDuration, 0 );
  addItem( itemRotationDuration, QStringLiteral( "RotationDuration" ) );
  KConfigSkeleton::ItemInt  *itemOpacity;
  itemOpacity = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Opacity" ), mOpacity, 80 );
  addItem( itemOpacity, QStringLiteral( "Opacity" ) );
  KConfigSkeleton::ItemBool  *itemOpacityDesktopOnly;
  itemOpacityDesktopOnly = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "OpacityDesktopOnly" ), mOpacityDesktopOnly, false );
  addItem( itemOpacityDesktopOnly, QStringLiteral( "OpacityDesktopOnly" ) );
  KConfigSkeleton::ItemBool  *itemDisplayDesktopName;
  itemDisplayDesktopName = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "DisplayDesktopName" ), mDisplayDesktopName, true );
  addItem( itemDisplayDesktopName, QStringLiteral( "DisplayDesktopName" ) );
  KConfigSkeleton::ItemBool  *itemReflection;
  itemReflection = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Reflection" ), mReflection, true );
  addItem( itemReflection, QStringLiteral( "Reflection" ) );
  KConfigSkeleton::ItemColor  *itemBackgroundColor;
  itemBackgroundColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "BackgroundColor" ), mBackgroundColor, QColor(Qt::black) );
  addItem( itemBackgroundColor, QStringLiteral( "BackgroundColor" ) );
  KConfigSkeleton::ItemColor  *itemCapColor;
  itemCapColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "CapColor" ), mCapColor, QColor(KColorScheme(QPalette::Active, KColorScheme::Window).background().color()) );
  addItem( itemCapColor, QStringLiteral( "CapColor" ) );
  KConfigSkeleton::ItemString  *itemCapPath;
  itemCapPath = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "CapPath" ), mCapPath, QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("cubecap.png")) );
  addItem( itemCapPath, QStringLiteral( "CapPath" ) );
  KConfigSkeleton::ItemBool  *itemTexturedCaps;
  itemTexturedCaps = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "TexturedCaps" ), mTexturedCaps, true );
  addItem( itemTexturedCaps, QStringLiteral( "TexturedCaps" ) );
  KConfigSkeleton::ItemBool  *itemCaps;
  itemCaps = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Caps" ), mCaps, true );
  addItem( itemCaps, QStringLiteral( "Caps" ) );
  KConfigSkeleton::ItemBool  *itemCloseOnMouseRelease;
  itemCloseOnMouseRelease = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "CloseOnMouseRelease" ), mCloseOnMouseRelease, false );
  addItem( itemCloseOnMouseRelease, QStringLiteral( "CloseOnMouseRelease" ) );
  KConfigSkeleton::ItemBool  *itemTabBox;
  itemTabBox = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "TabBox" ), mTabBox, false );
  addItem( itemTabBox, QStringLiteral( "TabBox" ) );
  KConfigSkeleton::ItemInt  *itemZPosition;
  itemZPosition = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "ZPosition" ), mZPosition, 100 );
  addItem( itemZPosition, QStringLiteral( "ZPosition" ) );
  KConfigSkeleton::ItemUrl  *itemWallpaper;
  itemWallpaper = new KConfigSkeleton::ItemUrl( currentGroup(), QStringLiteral( "Wallpaper" ), mWallpaper );
  addItem( itemWallpaper, QStringLiteral( "Wallpaper" ) );
  KConfigSkeleton::ItemInt  *itemCapDeformation;
  itemCapDeformation = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "CapDeformation" ), mCapDeformation, 0 );
  addItem( itemCapDeformation, QStringLiteral( "CapDeformation" ) );
  KConfigSkeleton::ItemBool  *itemInvertKeys;
  itemInvertKeys = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "InvertKeys" ), mInvertKeys, false );
  addItem( itemInvertKeys, QStringLiteral( "InvertKeys" ) );
  KConfigSkeleton::ItemBool  *itemInvertMouse;
  itemInvertMouse = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "InvertMouse" ), mInvertMouse, false );
  addItem( itemInvertMouse, QStringLiteral( "InvertMouse" ) );
  KConfigSkeleton::ItemBool  *itemZOrdering;
  itemZOrdering = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ZOrdering" ), mZOrdering, false );
  addItem( itemZOrdering, QStringLiteral( "ZOrdering" ) );
}

CubeConfig::~CubeConfig()
{
  s_globalCubeConfig()->q = nullptr;
}

