
/*

  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 gsiDeclQContextMenuEvent.cc 
*
*  DO NOT EDIT THIS FILE. 
*  This file has been created automatically
*/

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

// -----------------------------------------------------------------------
// class QContextMenuEvent

// const QPoint &QContextMenuEvent::globalPos()


static void _init_f_globalPos_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<const QPoint & > ();
}

static void _call_f_globalPos_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<const QPoint & > ((const QPoint &)((QContextMenuEvent *)cls)->globalPos ());
}

static qt_gsi::GenericMethod *_create_f_globalPos_c0 ()
{
  return new qt_gsi::GenericMethod ("globalPos", "@brief Method const QPoint &QContextMenuEvent::globalPos()\n", true, &_init_f_globalPos_c0, &_call_f_globalPos_c0);
}

// int QContextMenuEvent::globalX()


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

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

static qt_gsi::GenericMethod *_create_f_globalX_c0 ()
{
  return new qt_gsi::GenericMethod ("globalX", "@brief Method int QContextMenuEvent::globalX()\n", true, &_init_f_globalX_c0, &_call_f_globalX_c0);
}

// int QContextMenuEvent::globalY()


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

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

static qt_gsi::GenericMethod *_create_f_globalY_c0 ()
{
  return new qt_gsi::GenericMethod ("globalY", "@brief Method int QContextMenuEvent::globalY()\n", true, &_init_f_globalY_c0, &_call_f_globalY_c0);
}

// const QPoint &QContextMenuEvent::pos()


static void _init_f_pos_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<const QPoint & > ();
}

static void _call_f_pos_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<const QPoint & > ((const QPoint &)((QContextMenuEvent *)cls)->pos ());
}

static qt_gsi::GenericMethod *_create_f_pos_c0 ()
{
  return new qt_gsi::GenericMethod ("pos", "@brief Method const QPoint &QContextMenuEvent::pos()\n", true, &_init_f_pos_c0, &_call_f_pos_c0);
}

// QContextMenuEvent::Reason QContextMenuEvent::reason()


static void _init_f_reason_c0 (qt_gsi::GenericMethod *decl)
{
  decl->set_return<qt_gsi::Converter<QContextMenuEvent::Reason>::target_type > ();
}

static void _call_f_reason_c0 (const qt_gsi::GenericMethod *decl, void *cls, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  ret.write<qt_gsi::Converter<QContextMenuEvent::Reason>::target_type > ((qt_gsi::Converter<QContextMenuEvent::Reason>::target_type)qt_gsi::CppToQtAdaptor<QContextMenuEvent::Reason>(((QContextMenuEvent *)cls)->reason ()));
}

static qt_gsi::GenericMethod *_create_f_reason_c0 ()
{
  return new qt_gsi::GenericMethod ("reason", "@brief Method QContextMenuEvent::Reason QContextMenuEvent::reason()\n", true, &_init_f_reason_c0, &_call_f_reason_c0);
}

// int QContextMenuEvent::x()


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

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

static qt_gsi::GenericMethod *_create_f_x_c0 ()
{
  return new qt_gsi::GenericMethod ("x", "@brief Method int QContextMenuEvent::x()\n", true, &_init_f_x_c0, &_call_f_x_c0);
}

// int QContextMenuEvent::y()


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

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

static qt_gsi::GenericMethod *_create_f_y_c0 ()
{
  return new qt_gsi::GenericMethod ("y", "@brief Method int QContextMenuEvent::y()\n", true, &_init_f_y_c0, &_call_f_y_c0);
}

namespace gsi
{
extern gsi::Class<QInputEvent> decl_QInputEvent;

gsi::Class<QContextMenuEvent> decl_QContextMenuEvent (decl_QInputEvent, "QContextMenuEvent_Native",
  gsi::Methods(_create_f_globalPos_c0 ()) +
  gsi::Methods(_create_f_globalX_c0 ()) +
  gsi::Methods(_create_f_globalY_c0 ()) +
  gsi::Methods(_create_f_pos_c0 ()) +
  gsi::Methods(_create_f_reason_c0 ()) +
  gsi::Methods(_create_f_x_c0 ()) +
  gsi::Methods(_create_f_y_c0 ()),
  "@hide\n@alias QContextMenuEvent");
}


class QContextMenuEvent_Adaptor : public QContextMenuEvent, public qt_gsi::QtObjectBase
{
public:

  virtual ~QContextMenuEvent_Adaptor();

  //  [adaptor ctor] QContextMenuEvent::QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos, const QPoint &globalPos, QFlags<Qt::KeyboardModifier> modifiers)
  QContextMenuEvent_Adaptor(QContextMenuEvent::Reason reason, const QPoint &pos, const QPoint &globalPos, QFlags<Qt::KeyboardModifier> modifiers) : QContextMenuEvent(reason, pos, globalPos, modifiers)
  {
    qt_gsi::QtObjectBase::init (this);
  }

  //  [adaptor ctor] QContextMenuEvent::QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos, const QPoint &globalPos)
  QContextMenuEvent_Adaptor(QContextMenuEvent::Reason reason, const QPoint &pos, const QPoint &globalPos) : QContextMenuEvent(reason, pos, globalPos)
  {
    qt_gsi::QtObjectBase::init (this);
  }

  //  [adaptor ctor] QContextMenuEvent::QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos)
  QContextMenuEvent_Adaptor(QContextMenuEvent::Reason reason, const QPoint &pos) : QContextMenuEvent(reason, pos)
  {
    qt_gsi::QtObjectBase::init (this);
  }

  
};

QContextMenuEvent_Adaptor::~QContextMenuEvent_Adaptor() { }

//  Constructor QContextMenuEvent::QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos, const QPoint &globalPos, QFlags<Qt::KeyboardModifier> modifiers) (adaptor class)

static void _init_ctor_QContextMenuEvent_Adaptor_9494 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("reason");
  decl->add_arg<const qt_gsi::Converter<QContextMenuEvent::Reason>::target_type & > (argspec_0);
  static gsi::ArgSpecBase argspec_1 ("pos");
  decl->add_arg<const QPoint & > (argspec_1);
  static gsi::ArgSpecBase argspec_2 ("globalPos");
  decl->add_arg<const QPoint & > (argspec_2);
  static gsi::ArgSpecBase argspec_3 ("modifiers");
  decl->add_arg<const qt_gsi::Converter<QFlags<Qt::KeyboardModifier> >::target_type & > (argspec_3);
  decl->set_return_new<QContextMenuEvent_Adaptor *> ();
}

static void _call_ctor_QContextMenuEvent_Adaptor_9494 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const qt_gsi::Converter<QContextMenuEvent::Reason>::target_type & arg1 = args.read<const qt_gsi::Converter<QContextMenuEvent::Reason>::target_type & > ();
  const QPoint &arg2 = args.read<const QPoint & > ();
  const QPoint &arg3 = args.read<const QPoint & > ();
  const qt_gsi::Converter<QFlags<Qt::KeyboardModifier> >::target_type & arg4 = args.read<const qt_gsi::Converter<QFlags<Qt::KeyboardModifier> >::target_type & > ();
  ret.write<QContextMenuEvent_Adaptor *> (new QContextMenuEvent_Adaptor (qt_gsi::QtToCppAdaptor<QContextMenuEvent::Reason>(arg1).cref(), arg2, arg3, qt_gsi::QtToCppAdaptor<QFlags<Qt::KeyboardModifier> >(arg4).cref()));
}

static qt_gsi::GenericStaticMethod *_create_ctor_QContextMenuEvent_Adaptor_9494 ()
{
  return new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QContextMenuEvent::QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos, const QPoint &globalPos, QFlags<Qt::KeyboardModifier> modifiers)\nThis method creates an object of class QContextMenuEvent.", &_init_ctor_QContextMenuEvent_Adaptor_9494, &_call_ctor_QContextMenuEvent_Adaptor_9494);
}

//  Constructor QContextMenuEvent::QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos, const QPoint &globalPos) (adaptor class)

static void _init_ctor_QContextMenuEvent_Adaptor_6525 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("reason");
  decl->add_arg<const qt_gsi::Converter<QContextMenuEvent::Reason>::target_type & > (argspec_0);
  static gsi::ArgSpecBase argspec_1 ("pos");
  decl->add_arg<const QPoint & > (argspec_1);
  static gsi::ArgSpecBase argspec_2 ("globalPos");
  decl->add_arg<const QPoint & > (argspec_2);
  decl->set_return_new<QContextMenuEvent_Adaptor *> ();
}

static void _call_ctor_QContextMenuEvent_Adaptor_6525 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const qt_gsi::Converter<QContextMenuEvent::Reason>::target_type & arg1 = args.read<const qt_gsi::Converter<QContextMenuEvent::Reason>::target_type & > ();
  const QPoint &arg2 = args.read<const QPoint & > ();
  const QPoint &arg3 = args.read<const QPoint & > ();
  ret.write<QContextMenuEvent_Adaptor *> (new QContextMenuEvent_Adaptor (qt_gsi::QtToCppAdaptor<QContextMenuEvent::Reason>(arg1).cref(), arg2, arg3));
}

static qt_gsi::GenericStaticMethod *_create_ctor_QContextMenuEvent_Adaptor_6525 ()
{
  return new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QContextMenuEvent::QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos, const QPoint &globalPos)\nThis method creates an object of class QContextMenuEvent.", &_init_ctor_QContextMenuEvent_Adaptor_6525, &_call_ctor_QContextMenuEvent_Adaptor_6525);
}

//  Constructor QContextMenuEvent::QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos) (adaptor class)

static void _init_ctor_QContextMenuEvent_Adaptor_4717 (qt_gsi::GenericStaticMethod *decl)
{
  static gsi::ArgSpecBase argspec_0 ("reason");
  decl->add_arg<const qt_gsi::Converter<QContextMenuEvent::Reason>::target_type & > (argspec_0);
  static gsi::ArgSpecBase argspec_1 ("pos");
  decl->add_arg<const QPoint & > (argspec_1);
  decl->set_return_new<QContextMenuEvent_Adaptor *> ();
}

static void _call_ctor_QContextMenuEvent_Adaptor_4717 (const qt_gsi::GenericStaticMethod *decl, gsi::SerialArgs &args, gsi::SerialArgs &ret) 
{
  const qt_gsi::Converter<QContextMenuEvent::Reason>::target_type & arg1 = args.read<const qt_gsi::Converter<QContextMenuEvent::Reason>::target_type & > ();
  const QPoint &arg2 = args.read<const QPoint & > ();
  ret.write<QContextMenuEvent_Adaptor *> (new QContextMenuEvent_Adaptor (qt_gsi::QtToCppAdaptor<QContextMenuEvent::Reason>(arg1).cref(), arg2));
}

static qt_gsi::GenericStaticMethod *_create_ctor_QContextMenuEvent_Adaptor_4717 ()
{
  return new qt_gsi::GenericStaticMethod ("new", "@brief Constructor QContextMenuEvent::QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint &pos)\nThis method creates an object of class QContextMenuEvent.", &_init_ctor_QContextMenuEvent_Adaptor_4717, &_call_ctor_QContextMenuEvent_Adaptor_4717);
}

namespace gsi
{

extern gsi::Class<QContextMenuEvent> decl_QContextMenuEvent;

gsi::Class<QContextMenuEvent_Adaptor> decl_QContextMenuEvent_Adaptor (decl_QContextMenuEvent, "QContextMenuEvent",
  gsi::Methods(_create_ctor_QContextMenuEvent_Adaptor_9494 ()) +
  gsi::Methods(_create_ctor_QContextMenuEvent_Adaptor_6525 ()) +
  gsi::Methods(_create_ctor_QContextMenuEvent_Adaptor_4717 ()),
  "@qt\n@brief Binding of QContextMenuEvent");

}


//  Implementation of the enum wrapper class for QContextMenuEvent::Reason
namespace qt_gsi
{

static QContextMenuEvent_Reason_Enum *c_1_QContextMenuEvent_Reason_Enum () { return new QContextMenuEvent_Reason_Enum (QContextMenuEvent::Mouse); }
static QContextMenuEvent_Reason_Enum *c_2_QContextMenuEvent_Reason_Enum () { return new QContextMenuEvent_Reason_Enum (QContextMenuEvent::Keyboard); }
static QContextMenuEvent_Reason_Enum *c_3_QContextMenuEvent_Reason_Enum () { return new QContextMenuEvent_Reason_Enum (QContextMenuEvent::Other); }

static gsi::Methods mkdefs_QContextMenuEvent_Reason () {
  return
    gsi::constant ("Mouse", &qt_gsi::c_1_QContextMenuEvent_Reason_Enum, "@brief Enum constant QContextMenuEvent::Mouse") +
    gsi::constant ("Keyboard", &qt_gsi::c_2_QContextMenuEvent_Reason_Enum, "@brief Enum constant QContextMenuEvent::Keyboard") +
    gsi::constant ("Other", &qt_gsi::c_3_QContextMenuEvent_Reason_Enum, "@brief Enum constant QContextMenuEvent::Other");
}

static std::string to_s_QContextMenuEvent_Reason_Enum (const QContextMenuEvent_Reason_Enum *e)
{
  if (e->value () == QContextMenuEvent::Mouse) { return tl::sprintf ("Mouse (%u)", (unsigned int) e->value ()); }
  if (e->value () == QContextMenuEvent::Keyboard) { return tl::sprintf ("Keyboard (%u)", (unsigned int) e->value ()); }
  if (e->value () == QContextMenuEvent::Other) { return tl::sprintf ("Other (%u)", (unsigned int) e->value ()); }
  return std::string ("(not a valid enum evalue)");
}

static unsigned int to_i_QContextMenuEvent_Reason_Enum (const QContextMenuEvent_Reason_Enum *e)
{
  return (unsigned int) e->value ();
}

static QContextMenuEvent_Reason_Enum *from_i_QContextMenuEvent_Reason_Enum (unsigned int i)
{
  return new QContextMenuEvent_Reason_Enum ((QContextMenuEvent::Reason) i);
}

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

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

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

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

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

static std::string to_s_QContextMenuEvent_Reason_Enums (const QContextMenuEvent_Reason_Enums *e)
{
  std::string l;
  if (e->testFlag (QContextMenuEvent::Mouse)) { if (!l.empty ()) l += "|"; l += "Mouse"; }
  if (e->testFlag (QContextMenuEvent::Keyboard)) { if (!l.empty ()) l += "|"; l += "Keyboard"; }
  if (e->testFlag (QContextMenuEvent::Other)) { if (!l.empty ()) l += "|"; l += "Other"; }
  return tl::sprintf ("%u (%s)", (unsigned int) (e->flags ()), l);
}

static int to_i_QContextMenuEvent_Reason_Enums (const QContextMenuEvent_Reason_Enums *e)
{
  return int (e->flags ());
}

static bool testFlag_QContextMenuEvent_Reason_Enums (const QContextMenuEvent_Reason_Enums *e, const QContextMenuEvent_Reason_Enum &d)
{
  return e->flags ().testFlag (d.value ());
}

}

namespace gsi
{

//  Declarations for QFlags<enum> wrapper class
gsi::Class<qt_gsi::QContextMenuEvent_Reason_Enums> decl_QContextMenuEvent_Reason_Enums ("QContextMenuEvent_QFlags_Reason",
  gsi::method_ext ("|", &qt_gsi::oropQContextMenuEvent_Reason_Enums, gsi::arg ("other"), "@brief 'or' operator between two flag sets") +
  gsi::method_ext ("&", &qt_gsi::andopQContextMenuEvent_Reason_Enums, gsi::arg ("other"), "@brief 'and' operator between two flag sets") +
  gsi::method_ext ("^", &qt_gsi::xoropQContextMenuEvent_Reason_Enums, gsi::arg ("other"), "@brief 'xor' operator between two flag sets") +
  gsi::method_ext ("to_s|inspect", &qt_gsi::to_s_QContextMenuEvent_Reason_Enums, "@brief Converts the flag set to a string") +
  gsi::method_ext ("to_i", &qt_gsi::to_i_QContextMenuEvent_Reason_Enums, "@brief Returns the integer value encoding the flag set") +
  gsi::method_ext ("testFlag", &qt_gsi::testFlag_QContextMenuEvent_Reason_Enums, gsi::arg ("flag"), "@brief Tests whether the flag is contained in the flag set"),
  "@qt\n@brief This class represents the QFlags<QContextMenuEvent::Reason> flag set");

//  Declarations for enum wrapper class
gsi::Class<qt_gsi::QContextMenuEvent_Reason_Enum> decl_QContextMenuEvent_Reason_Enum (decl_QContextMenuEvent_Reason_Enums, "QContextMenuEvent_Reason",
  qt_gsi::mkdefs_QContextMenuEvent_Reason () +
  gsi::method_ext ("to_s|inspect", &qt_gsi::to_s_QContextMenuEvent_Reason_Enum, "@brief Converts the enum class to a string") +
  gsi::method_ext ("to_i", &qt_gsi::to_i_QContextMenuEvent_Reason_Enum, "@brief Converts the enum class to an integer") +
  gsi::method_ext ("==", &qt_gsi::equalQContextMenuEvent_Reason_Enum, gsi::arg ("other"), "@brief Compares the enum class against an enum of it's own type") +
  gsi::method_ext ("==", &qt_gsi::equal2QContextMenuEvent_Reason_Enum, gsi::arg ("other"), "@brief Compares the enum class against an integer") +
  gsi::constructor ("new", &qt_gsi::from_i_QContextMenuEvent_Reason_Enum, gsi::arg ("value"), "@brief Creates the enum object from an integer"),
  "@qt\n@brief This class represents the QContextMenuEvent::Reason enum");

//  Inject the declarations into the parent
static gsi::ClassExt<QContextMenuEvent> inject_QContextMenuEvent_Reason_Enum_in_parent (qt_gsi::mkdefs_QContextMenuEvent_Reason ());
static gsi::ClassExt<QContextMenuEvent> decl_QContextMenuEvent_Reason_Enum_as_child (decl_QContextMenuEvent_Reason_Enum, "Reason");

}

