/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.15.1
 *
 *     Copyright: (c) 2020 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_wxPropertyGridIterator)
        return sipCppV;

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

    return SIP_NULLPTR;
}


/* 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 *array_wxPropertyGridIterator(Py_ssize_t);}
static void *array_wxPropertyGridIterator(Py_ssize_t sipNrElem)
{
    return new ::wxPropertyGridIterator[sipNrElem];
}


extern "C" {static void array_delete_wxPropertyGridIterator(void *);}
static void array_delete_wxPropertyGridIterator(void *sipCpp)
{
    delete[] reinterpret_cast< ::wxPropertyGridIterator *>(sipCpp);
}


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


extern "C" {static void *copy_wxPropertyGridIterator(const void *, Py_ssize_t);}
static void *copy_wxPropertyGridIterator(const void *sipSrc, Py_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[] = {{69, 255, 1}};

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


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,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxPropertyGridIterator,
    assign_wxPropertyGridIterator,
    array_wxPropertyGridIterator,
    copy_wxPropertyGridIterator,
    release_wxPropertyGridIterator,
    cast_wxPropertyGridIterator,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxPropertyGridIterator,
    sizeof (::wxPropertyGridIterator),
};
