/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.16
 *
 *     Copyright: (c) 2018 by Total Control Software
 *     License:   wxWindows License
 */

#include "sipAPI_propgrid.h"

        #include <wx/propgrid/propgridpagestate.h>

        #include <wx/propgrid/propgridpagestate.h>
        #include <wx/propgrid/property.h>
        #include <wx/propgrid/propgridpagestate.h>


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_wxPropertyGridIterator(void *, const sipTypeDef *);}
static void *cast_wxPropertyGridIterator(void *sipCppV, const sipTypeDef *targetType)
{
     ::wxPropertyGridIterator *sipCpp = reinterpret_cast< ::wxPropertyGridIterator *>(sipCppV);

    if (targetType == sipType_wxPropertyGridIteratorBase)
        return static_cast< ::wxPropertyGridIteratorBase *>(sipCpp);

    return sipCppV;
}


/* Call the instance's destructor. */
extern "C" {static void release_wxPropertyGridIterator(void *, int);}
static void release_wxPropertyGridIterator(void *sipCppV, int)
{
    Py_BEGIN_ALLOW_THREADS

    delete reinterpret_cast< ::wxPropertyGridIterator *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void assign_wxPropertyGridIterator(void *, SIP_SSIZE_T, void *);}
static void assign_wxPropertyGridIterator(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxPropertyGridIterator *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxPropertyGridIterator *>(sipSrc);
}


extern "C" {static void *array_wxPropertyGridIterator(SIP_SSIZE_T);}
static void *array_wxPropertyGridIterator(SIP_SSIZE_T sipNrElem)
{
    return new  ::wxPropertyGridIterator[sipNrElem];
}


extern "C" {static void *copy_wxPropertyGridIterator(const void *, SIP_SSIZE_T);}
static void *copy_wxPropertyGridIterator(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new  ::wxPropertyGridIterator(reinterpret_cast<const  ::wxPropertyGridIterator *>(sipSrc)[sipSrcIdx]);
}


extern "C" {static void dealloc_wxPropertyGridIterator(sipSimpleWrapper *);}
static void dealloc_wxPropertyGridIterator(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_wxPropertyGridIterator(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_wxPropertyGridIterator(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_wxPropertyGridIterator(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::wxPropertyGridIterator *sipCpp = SIP_NULLPTR;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxPropertyGridIterator();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
            {
                delete sipCpp;
                return SIP_NULLPTR;
            }

            return sipCpp;
        }
    }

    {
         ::wxPropertyGridPageState* state;
        int flags = wxPG_ITERATE_DEFAULT;
         ::wxPGProperty* property = 0;
        int dir = 1;

        static const char *sipKwdList[] = {
            sipName_state,
            sipName_flags,
            sipName_property,
            sipName_dir,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8|iJ8i", sipType_wxPropertyGridPageState, &state, &flags, sipType_wxPGProperty, &property, &dir))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxPropertyGridIterator(state,flags,property,dir);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
            {
                delete sipCpp;
                return SIP_NULLPTR;
            }

            return sipCpp;
        }
    }

    {
         ::wxPropertyGridPageState* state;
        int flags;
        int startPos;
        int dir = 0;

        static const char *sipKwdList[] = {
            sipName_state,
            sipName_flags,
            sipName_startPos,
            sipName_dir,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8ii|i", sipType_wxPropertyGridPageState, &state, &flags, &startPos, &dir))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxPropertyGridIterator(state,flags,startPos,dir);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
            {
                delete sipCpp;
                return SIP_NULLPTR;
            }

            return sipCpp;
        }
    }

    {
        const  ::wxPropertyGridIterator* it;

        static const char *sipKwdList[] = {
            sipName_it,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxPropertyGridIterator, &it))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxPropertyGridIterator(*it);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
            {
                delete sipCpp;
                return SIP_NULLPTR;
            }

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_wxPropertyGridIterator[] = {{68, 255, 1}};

PyDoc_STRVAR(doc_wxPropertyGridIterator, "PropertyGridIterator()\n"
"PropertyGridIterator(state, flags=PG_ITERATE_DEFAULT, property=None, dir=1)\n"
"PropertyGridIterator(state, flags, startPos, dir=0)\n"
"PropertyGridIterator(it)");


sipClassTypeDef sipTypeDef__propgrid_wxPropertyGridIterator = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxPropertyGridIterator,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_PropertyGridIterator,
        {0, 0, 1},
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxPropertyGridIterator,
    -1,
    -1,
    supers_wxPropertyGridIterator,
    SIP_NULLPTR,
    init_type_wxPropertyGridIterator,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxPropertyGridIterator,
    assign_wxPropertyGridIterator,
    array_wxPropertyGridIterator,
    copy_wxPropertyGridIterator,
    release_wxPropertyGridIterator,
    cast_wxPropertyGridIterator,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
