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

#include "mousemarkconfig.h"

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

#include <QDebug>

using namespace KWin;

namespace KWin {

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

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

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

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

MouseMarkConfig::MouseMarkConfig( KSharedConfig::Ptr config )
  : KConfigSkeleton( std::move( config ) )
{
  Q_ASSERT(!s_globalMouseMarkConfig()->q);
  s_globalMouseMarkConfig()->q = this;
  setCurrentGroup( QStringLiteral( "Effect-mousemark" ) );

  KConfigSkeleton::ItemUInt  *itemLineWidth;
  itemLineWidth = new KConfigSkeleton::ItemUInt( currentGroup(), QStringLiteral( "LineWidth" ), mLineWidth, 3 );
  addItem( itemLineWidth, QStringLiteral( "LineWidth" ) );
  KConfigSkeleton::ItemColor  *itemColor;
  itemColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "Color" ), mColor, QColor( 255,0,0 ) );
  addItem( itemColor, QStringLiteral( "Color" ) );
  KConfigSkeleton::ItemBool  *itemFreedrawmeta;
  itemFreedrawmeta = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Freedrawmeta" ), mFreedrawmeta, true );
  addItem( itemFreedrawmeta, QStringLiteral( "Freedrawmeta" ) );
  KConfigSkeleton::ItemBool  *itemFreedrawcontrol;
  itemFreedrawcontrol = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Freedrawcontrol" ), mFreedrawcontrol, false );
  addItem( itemFreedrawcontrol, QStringLiteral( "Freedrawcontrol" ) );
  KConfigSkeleton::ItemBool  *itemFreedrawalt;
  itemFreedrawalt = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Freedrawalt" ), mFreedrawalt, false );
  addItem( itemFreedrawalt, QStringLiteral( "Freedrawalt" ) );
  KConfigSkeleton::ItemBool  *itemFreedrawshift;
  itemFreedrawshift = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Freedrawshift" ), mFreedrawshift, true );
  addItem( itemFreedrawshift, QStringLiteral( "Freedrawshift" ) );
  KConfigSkeleton::ItemBool  *itemArrowdrawmeta;
  itemArrowdrawmeta = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Arrowdrawmeta" ), mArrowdrawmeta, true );
  addItem( itemArrowdrawmeta, QStringLiteral( "Arrowdrawmeta" ) );
  KConfigSkeleton::ItemBool  *itemArrowdrawcontrol;
  itemArrowdrawcontrol = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Arrowdrawcontrol" ), mArrowdrawcontrol, true );
  addItem( itemArrowdrawcontrol, QStringLiteral( "Arrowdrawcontrol" ) );
  KConfigSkeleton::ItemBool  *itemArrowdrawalt;
  itemArrowdrawalt = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Arrowdrawalt" ), mArrowdrawalt, false );
  addItem( itemArrowdrawalt, QStringLiteral( "Arrowdrawalt" ) );
  KConfigSkeleton::ItemBool  *itemArrowdrawshift;
  itemArrowdrawshift = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Arrowdrawshift" ), mArrowdrawshift, true );
  addItem( itemArrowdrawshift, QStringLiteral( "Arrowdrawshift" ) );
}

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

