
/*

  KLayout Layout Viewer
  Copyright (C) 2006-2016 Matthias Koefferlein

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*/

/**
*  @file gsiDeclQColormap.cc 
*
*  DO NOT EDIT THIS FILE. 
*  This file has been created automatically
*/

#include "gsiQtGui.h"
#include "gsiDeclQtTypeTraits.h"
#include "gsiDeclQColormap_Enums.h"
#include <memory>

// -----------------------------------------------------------------------
// class QColormap

//  Constructor QColormap::QColormap(const QColormap &colormap)


static void _init_ctor_QColormap_2223 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("colormap");
  decl->add_arg<const QColormap & > (argspec_0);
  decl->set_return_new<QColormap *> ();
}

static void _call_ctor_QColormap_2223 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const QColormap &arg1 = args.read<const QColormap & > ();
  ret.write<QColormap *> (new QColormap (arg1));
}

static qt_gsi::GenericStaticMethod *_create_ctor_QColormap_2223 ()
{
  return new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QColormap::QColormap(const QColormap &colormap)\nThis method creates an object of class QColormap.", &_init_ctor_QColormap_2223, &_call_ctor_QColormap_2223);
}

// const QColor QColormap::colorAt(unsigned int pixel)


static void _init_f_colorAt_c1772 (qt_gsi::GenericMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("pixel");
  decl->add_arg<unsigned int > (argspec_0);
  decl->set_return<const QColor > ();
}

static void _call_f_colorAt_c1772 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  unsigned int arg1 = args.read<unsigned int > ();
  ret.write<const QColor > ((const QColor)((QColormap *)cls)->colorAt (arg1));
}

static qt_gsi::GenericMethod *_create_f_colorAt_c1772 ()
{
  return new qt_gsi::GenericMethod ("colorAt", "@brief Method const QColor QColormap::colorAt(unsigned int pixel)\n", true, &_init_f_colorAt_c1772, &_call_f_colorAt_c1772);
}

// const QVector<QColor> QColormap::colormap()


static void _init_f_colormap_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<qt_gsi::Converter<QVector<QColor> >::target_type > ();
}

static void _call_f_colormap_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<qt_gsi::Converter<QVector<QColor> >::target_type > ((qt_gsi::Converter<QVector<QColor> >::target_type)qt_gsi::CppToQtAdaptor<QVector<QColor> >(((QColormap *)cls)->colormap ()));
}

static qt_gsi::GenericMethod *_create_f_colormap_c0 ()
{
  return new qt_gsi::GenericMethod ("colormap", "@brief Method const QVector<QColor> QColormap::colormap()\n", true, &_init_f_colormap_c0, &_call_f_colormap_c0);
}

// int QColormap::depth()


static void _init_f_depth_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<int > ();
}

static void _call_f_depth_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<int > ((int)((QColormap *)cls)->depth ());
}

static qt_gsi::GenericMethod *_create_f_depth_c0 ()
{
  return new qt_gsi::GenericMethod ("depth", "@brief Method int QColormap::depth()\n", true, &_init_f_depth_c0, &_call_f_depth_c0);
}

// QColormap::Mode QColormap::mode()


static void _init_f_mode_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<qt_gsi::Converter<QColormap::Mode>::target_type > ();
}

static void _call_f_mode_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<qt_gsi::Converter<QColormap::Mode>::target_type > ((qt_gsi::Converter<QColormap::Mode>::target_type)qt_gsi::CppToQtAdaptor<QColormap::Mode>(((QColormap *)cls)->mode ()));
}

static qt_gsi::GenericMethod *_create_f_mode_c0 ()
{
  return new qt_gsi::GenericMethod ("mode", "@brief Method QColormap::Mode QColormap::mode()\n", true, &_init_f_mode_c0, &_call_f_mode_c0);
}

// QColormap &QColormap::operator=(const QColormap &colormap)


static void _init_f_operator_eq__2223 (qt_gsi::GenericMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("colormap");
  decl->add_arg<const QColormap & > (argspec_0);
  decl->set_return<QColormap & > ();
}

static void _call_f_operator_eq__2223 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const QColormap &arg1 = args.read<const QColormap & > ();
  ret.write<QColormap & > ((QColormap &)((QColormap *)cls)->operator= (arg1));
}

static qt_gsi::GenericMethod *_create_f_operator_eq__2223 ()
{
  return new qt_gsi::GenericMethod ("assign", "@brief Method QColormap &QColormap::operator=(const QColormap &colormap)\n", false, &_init_f_operator_eq__2223, &_call_f_operator_eq__2223);
}

// unsigned int QColormap::pixel(const QColor &color)


static void _init_f_pixel_c1905 (qt_gsi::GenericMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("color");
  decl->add_arg<const QColor & > (argspec_0);
  decl->set_return<unsigned int > ();
}

static void _call_f_pixel_c1905 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const QColor &arg1 = args.read<const QColor & > ();
  ret.write<unsigned int > ((unsigned int)((QColormap *)cls)->pixel (arg1));
}

static qt_gsi::GenericMethod *_create_f_pixel_c1905 ()
{
  return new qt_gsi::GenericMethod ("pixel", "@brief Method unsigned int QColormap::pixel(const QColor &color)\n", true, &_init_f_pixel_c1905, &_call_f_pixel_c1905);
}

// int QColormap::size()


static void _init_f_size_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<int > ();
}

static void _call_f_size_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<int > ((int)((QColormap *)cls)->size ());
}

static qt_gsi::GenericMethod *_create_f_size_c0 ()
{
  return new qt_gsi::GenericMethod ("size", "@brief Method int QColormap::size()\n", true, &_init_f_size_c0, &_call_f_size_c0);
}

// static void QColormap::cleanup()


static void _init_f_cleanup_0 (qt_gsi::GenericStaticMethod *decl)
{
  decl->set_return<void > ();
}

static void _call_f_cleanup_0 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  QColormap::cleanup ();
}

static qt_gsi::GenericStaticMethod *_create_f_cleanup_0 ()
{
  return new qt_gsi::GenericStaticMethod ("cleanup", "@brief Static method void QColormap::cleanup()\nThis method is static and can be called without an instance.", &_init_f_cleanup_0, &_call_f_cleanup_0);
}

// static QColormap QColormap::instance(int screen)


static void _init_f_instance_767 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("screen", true, "-1");
  decl->add_arg<int > (argspec_0);
  decl->set_return<QColormap > ();
}

static void _call_f_instance_767 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  int arg1 = args ? args.read<int > () : (int)(-1);
  ret.write<QColormap > ((QColormap)QColormap::instance (arg1));
}

static qt_gsi::GenericStaticMethod *_create_f_instance_767 ()
{
  return new qt_gsi::GenericStaticMethod ("instance", "@brief Static method QColormap QColormap::instance(int screen)\nThis method is static and can be called without an instance.", &_init_f_instance_767, &_call_f_instance_767);
}


namespace gsi
{
gsi::Class<QColormap> decl_QColormap ("QColormap",
  gsi::Methods(_create_ctor_QColormap_2223 ()) +
  gsi::Methods(_create_f_colorAt_c1772 ()) +
  gsi::Methods(_create_f_colormap_c0 ()) +
  gsi::Methods(_create_f_depth_c0 ()) +
  gsi::Methods(_create_f_mode_c0 ()) +
  gsi::Methods(_create_f_operator_eq__2223 ()) +
  gsi::Methods(_create_f_pixel_c1905 ()) +
  gsi::Methods(_create_f_size_c0 ()) +
  gsi::Methods(_create_f_cleanup_0 ()) +
  gsi::Methods(_create_f_instance_767 ()),
  "@qt\n@brief Binding of QColormap");

}


//  Implementation of the enum wrapper class for QColormap::Mode
namespace qt_gsi
{

static QColormap_Mode_Enum *c_1_QColormap_Mode_Enum () { return new QColormap_Mode_Enum (QColormap::Direct); }
static QColormap_Mode_Enum *c_2_QColormap_Mode_Enum () { return new QColormap_Mode_Enum (QColormap::Indexed); }
static QColormap_Mode_Enum *c_3_QColormap_Mode_Enum () { return new QColormap_Mode_Enum (QColormap::Gray); }

static gsi::Methods mkdefs_QColormap_Mode () {
  return
    gsi::constant ("Direct", &qt_gsi::c_1_QColormap_Mode_Enum, "@brief Enum constant QColormap::Direct") +
    gsi::constant ("Indexed", &qt_gsi::c_2_QColormap_Mode_Enum, "@brief Enum constant QColormap::Indexed") +
    gsi::constant ("Gray", &qt_gsi::c_3_QColormap_Mode_Enum, "@brief Enum constant QColormap::Gray");
}

static std::string to_s_QColormap_Mode_Enum (const QColormap_Mode_Enum *e)
{
  if (e->value () == QColormap::Direct) { return tl::sprintf ("Direct (%u)", (unsigned int) e->value ()); }
  if (e->value () == QColormap::Indexed) { return tl::sprintf ("Indexed (%u)", (unsigned int) e->value ()); }
  if (e->value () == QColormap::Gray) { return tl::sprintf ("Gray (%u)", (unsigned int) e->value ()); }
  return std::string ("(not a valid enum evalue)");
}

static unsigned int to_i_QColormap_Mode_Enum (const QColormap_Mode_Enum *e)
{
  return (unsigned int) e->value ();
}

static QColormap_Mode_Enum *from_i_QColormap_Mode_Enum (unsigned int i)
{
  return new QColormap_Mode_Enum ((QColormap::Mode) i);
}

static bool equalQColormap_Mode_Enum (const QColormap_Mode_Enum *e, QColormap_Mode_Enum d)
{
  return e->value () == d.value ();
}

static bool equal2QColormap_Mode_Enum (const QColormap_Mode_Enum *e, unsigned int i)
{
  return (unsigned int) e->value () == i;
}

static QColormap_Mode_Enums oropQColormap_Mode_Enums (const QColormap_Mode_Enums *e, const QColormap_Mode_Enums &d)
{
  return e->flags () | d.flags ();
}

static QColormap_Mode_Enums andopQColormap_Mode_Enums (const QColormap_Mode_Enums *e, const QColormap_Mode_Enums &d)
{
  return e->flags () & d.flags ();
}

static QColormap_Mode_Enums xoropQColormap_Mode_Enums (const QColormap_Mode_Enums *e, const QColormap_Mode_Enums &d)
{
  return e->flags () ^ d.flags ();
}

static std::string to_s_QColormap_Mode_Enums (const QColormap_Mode_Enums *e)
{
  std::string l;
  if (e->testFlag (QColormap::Direct)) { if (!l.empty ()) l += "|"; l += "Direct"; }
  if (e->testFlag (QColormap::Indexed)) { if (!l.empty ()) l += "|"; l += "Indexed"; }
  if (e->testFlag (QColormap::Gray)) { if (!l.empty ()) l += "|"; l += "Gray"; }
  return tl::sprintf ("%u (%s)", (unsigned int) (e->flags ()), l);
}

static int to_i_QColormap_Mode_Enums (const QColormap_Mode_Enums *e)
{
  return int (e->flags ());
}

static bool testFlag_QColormap_Mode_Enums (const QColormap_Mode_Enums *e, const QColormap_Mode_Enum &d)
{
  return e->flags ().testFlag (d.value ());
}

}

namespace gsi
{

//  Declarations for QFlags<enum> wrapper class
gsi::Class<qt_gsi::QColormap_Mode_Enums> decl_QColormap_Mode_Enums ("QColormap_QFlags_Mode",
  gsi::method_ext ("|", &qt_gsi::oropQColormap_Mode_Enums, gsi::arg ("other"), "@brief 'or' operator between two flag sets") +
  gsi::method_ext ("&", &qt_gsi::andopQColormap_Mode_Enums, gsi::arg ("other"), "@brief 'and' operator between two flag sets") +
  gsi::method_ext ("^", &qt_gsi::xoropQColormap_Mode_Enums, gsi::arg ("other"), "@brief 'xor' operator between two flag sets") +
  gsi::method_ext ("to_s|inspect", &qt_gsi::to_s_QColormap_Mode_Enums, "@brief Converts the flag set to a string") +
  gsi::method_ext ("to_i", &qt_gsi::to_i_QColormap_Mode_Enums, "@brief Returns the integer value encoding the flag set") +
  gsi::method_ext ("testFlag", &qt_gsi::testFlag_QColormap_Mode_Enums, gsi::arg ("flag"), "@brief Tests whether the flag is contained in the flag set"),
  "@qt\n@brief This class represents the QFlags<QColormap::Mode> flag set");

//  Declarations for enum wrapper class
gsi::Class<qt_gsi::QColormap_Mode_Enum> decl_QColormap_Mode_Enum (decl_QColormap_Mode_Enums, "QColormap_Mode",
  qt_gsi::mkdefs_QColormap_Mode () +
  gsi::method_ext ("to_s|inspect", &qt_gsi::to_s_QColormap_Mode_Enum, "@brief Converts the enum class to a string") +
  gsi::method_ext ("to_i", &qt_gsi::to_i_QColormap_Mode_Enum, "@brief Converts the enum class to an integer") +
  gsi::method_ext ("==", &qt_gsi::equalQColormap_Mode_Enum, gsi::arg ("other"), "@brief Compares the enum class against an enum of it's own type") +
  gsi::method_ext ("==", &qt_gsi::equal2QColormap_Mode_Enum, gsi::arg ("other"), "@brief Compares the enum class against an integer") +
  gsi::constructor ("new", &qt_gsi::from_i_QColormap_Mode_Enum, gsi::arg ("value"), "@brief Creates the enum object from an integer"),
  "@qt\n@brief This class represents the QColormap::Mode enum");

//  Inject the declarations into the parent
static gsi::ClassExt<QColormap> inject_QColormap_Mode_Enum_in_parent (qt_gsi::mkdefs_QColormap_Mode ());
static gsi::ClassExt<QColormap> decl_QColormap_Mode_Enum_as_child (decl_QColormap_Mode_Enum, "Mode");

}

