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

#include "presentwindowsconfig.h"

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

#include <QDebug>

using namespace KWin;

namespace KWin {

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

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

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

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

PresentWindowsConfig::PresentWindowsConfig( KSharedConfig::Ptr config )
  : KConfigSkeleton( std::move( config ) )
{
  Q_ASSERT(!s_globalPresentWindowsConfig()->q);
  s_globalPresentWindowsConfig()->q = this;
  setCurrentGroup( QStringLiteral( "Effect-PresentWindows" ) );

  KConfigSkeleton::ItemInt  *itemLayoutMode;
  itemLayoutMode = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "LayoutMode" ), mLayoutMode, 0 );
  addItem( itemLayoutMode, QStringLiteral( "LayoutMode" ) );
  KConfigSkeleton::ItemBool  *itemDrawWindowCaptions;
  itemDrawWindowCaptions = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "DrawWindowCaptions" ), mDrawWindowCaptions, true );
  addItem( itemDrawWindowCaptions, QStringLiteral( "DrawWindowCaptions" ) );
  KConfigSkeleton::ItemBool  *itemDrawWindowIcons;
  itemDrawWindowIcons = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "DrawWindowIcons" ), mDrawWindowIcons, true );
  addItem( itemDrawWindowIcons, QStringLiteral( "DrawWindowIcons" ) );
  KConfigSkeleton::ItemBool  *itemAllowClosingWindows;
  itemAllowClosingWindows = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "AllowClosingWindows" ), mAllowClosingWindows, true );
  addItem( itemAllowClosingWindows, QStringLiteral( "AllowClosingWindows" ) );
  KConfigSkeleton::ItemBool  *itemIgnoreMinimized;
  itemIgnoreMinimized = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "IgnoreMinimized" ), mIgnoreMinimized, false );
  addItem( itemIgnoreMinimized, QStringLiteral( "IgnoreMinimized" ) );
  KConfigSkeleton::ItemBool  *itemShowPanel;
  itemShowPanel = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "ShowPanel" ), mShowPanel, true );
  addItem( itemShowPanel, QStringLiteral( "ShowPanel" ) );
  KConfigSkeleton::ItemInt  *itemAccuracy;
  itemAccuracy = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Accuracy" ), mAccuracy, 1 );
  addItem( itemAccuracy, QStringLiteral( "Accuracy" ) );
  KConfigSkeleton::ItemBool  *itemFillGaps;
  itemFillGaps = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "FillGaps" ), mFillGaps, true );
  addItem( itemFillGaps, QStringLiteral( "FillGaps" ) );
  KConfigSkeleton::ItemInt  *itemLeftButtonWindow;
  itemLeftButtonWindow = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "LeftButtonWindow" ), mLeftButtonWindow, 1 );
  addItem( itemLeftButtonWindow, QStringLiteral( "LeftButtonWindow" ) );
  KConfigSkeleton::ItemInt  *itemMiddleButtonWindow;
  itemMiddleButtonWindow = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "MiddleButtonWindow" ), mMiddleButtonWindow, 0 );
  addItem( itemMiddleButtonWindow, QStringLiteral( "MiddleButtonWindow" ) );
  KConfigSkeleton::ItemInt  *itemRightButtonWindow;
  itemRightButtonWindow = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "RightButtonWindow" ), mRightButtonWindow, 2 );
  addItem( itemRightButtonWindow, QStringLiteral( "RightButtonWindow" ) );
  KConfigSkeleton::ItemInt  *itemLeftButtonDesktop;
  itemLeftButtonDesktop = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "LeftButtonDesktop" ), mLeftButtonDesktop, 2 );
  addItem( itemLeftButtonDesktop, QStringLiteral( "LeftButtonDesktop" ) );
  KConfigSkeleton::ItemInt  *itemMiddleButtonDesktop;
  itemMiddleButtonDesktop = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "MiddleButtonDesktop" ), mMiddleButtonDesktop, 0 );
  addItem( itemMiddleButtonDesktop, QStringLiteral( "MiddleButtonDesktop" ) );
  KConfigSkeleton::ItemInt  *itemRightButtonDesktop;
  itemRightButtonDesktop = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "RightButtonDesktop" ), mRightButtonDesktop, 0 );
  addItem( itemRightButtonDesktop, QStringLiteral( "RightButtonDesktop" ) );
  QList<int> defaultBorderActivate;

  KConfigSkeleton::ItemIntList  *itemBorderActivate;
  itemBorderActivate = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "BorderActivate" ), mBorderActivate, defaultBorderActivate );
  addItem( itemBorderActivate, QStringLiteral( "BorderActivate" ) );
  KConfigSkeleton::ItemIntList  *itemBorderActivateAll;
  itemBorderActivateAll = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "BorderActivateAll" ), mBorderActivateAll, QList<int>() << int(ElectricTopLeft) );
  addItem( itemBorderActivateAll, QStringLiteral( "BorderActivateAll" ) );
  QList<int> defaultBorderActivateClass;

  KConfigSkeleton::ItemIntList  *itemBorderActivateClass;
  itemBorderActivateClass = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "BorderActivateClass" ), mBorderActivateClass, defaultBorderActivateClass );
  addItem( itemBorderActivateClass, QStringLiteral( "BorderActivateClass" ) );
  QList<int> defaultTouchBorderActivate;

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

  KConfigSkeleton::ItemIntList  *itemTouchBorderActivateAll;
  itemTouchBorderActivateAll = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TouchBorderActivateAll" ), mTouchBorderActivateAll, defaultTouchBorderActivateAll );
  addItem( itemTouchBorderActivateAll, QStringLiteral( "TouchBorderActivateAll" ) );
  QList<int> defaultTouchBorderActivateClass;

  KConfigSkeleton::ItemIntList  *itemTouchBorderActivateClass;
  itemTouchBorderActivateClass = new KConfigSkeleton::ItemIntList( currentGroup(), QStringLiteral( "TouchBorderActivateClass" ), mTouchBorderActivateClass, defaultTouchBorderActivateClass );
  addItem( itemTouchBorderActivateClass, QStringLiteral( "TouchBorderActivateClass" ) );
}

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

