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

#include "sipAPI_core.h"
        #include <wx/region.h>
        #include <wx/region.h>
        #include <wx/gdicmn.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>
    int _wxRegionIterator___nonzero__(wxRegionIterator* self)
    {
        return (int)self->operator bool();
    }
    int _wxRegionIterator___bool__(wxRegionIterator* self)
    {
        return (int)self->operator bool();
    }
    void _wxRegionIterator_Next(wxRegionIterator* self)
    {
        self->operator++();
    }


PyDoc_STRVAR(doc_wxRegionIterator_GetH, "GetH() -> int\n"
"\n"
"An alias for GetHeight().");

extern "C" {static PyObject *meth_wxRegionIterator_GetH(PyObject *, PyObject *);}
static PyObject *meth_wxRegionIterator_GetH(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxRegionIterator *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRegionIterator, &sipCpp))
        {
            ::wxCoord sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetH();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_GetH, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_GetHeight, "GetHeight() -> int\n"
"\n"
"Returns the height value for the current region.");

extern "C" {static PyObject *meth_wxRegionIterator_GetHeight(PyObject *, PyObject *);}
static PyObject *meth_wxRegionIterator_GetHeight(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxRegionIterator *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRegionIterator, &sipCpp))
        {
            ::wxCoord sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetHeight();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_GetHeight, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_GetRect, "GetRect() -> Rect\n"
"\n"
"Returns the current rectangle.");

extern "C" {static PyObject *meth_wxRegionIterator_GetRect(PyObject *, PyObject *);}
static PyObject *meth_wxRegionIterator_GetRect(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxRegionIterator *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRegionIterator, &sipCpp))
        {
            ::wxRect*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxRect(sipCpp->GetRect());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromNewType(sipRes, sipType_wxRect, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_GetRect, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_GetW, "GetW() -> int\n"
"\n"
"An alias for GetWidth().");

extern "C" {static PyObject *meth_wxRegionIterator_GetW(PyObject *, PyObject *);}
static PyObject *meth_wxRegionIterator_GetW(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxRegionIterator *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRegionIterator, &sipCpp))
        {
            ::wxCoord sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetW();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_GetW, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_GetWidth, "GetWidth() -> int\n"
"\n"
"Returns the width value for the current region.");

extern "C" {static PyObject *meth_wxRegionIterator_GetWidth(PyObject *, PyObject *);}
static PyObject *meth_wxRegionIterator_GetWidth(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxRegionIterator *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRegionIterator, &sipCpp))
        {
            ::wxCoord sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetWidth();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_GetWidth, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_GetX, "GetX() -> int\n"
"\n"
"Returns the x value for the current region.");

extern "C" {static PyObject *meth_wxRegionIterator_GetX(PyObject *, PyObject *);}
static PyObject *meth_wxRegionIterator_GetX(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxRegionIterator *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRegionIterator, &sipCpp))
        {
            ::wxCoord sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetX();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_GetX, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_GetY, "GetY() -> int\n"
"\n"
"Returns the y value for the current region.");

extern "C" {static PyObject *meth_wxRegionIterator_GetY(PyObject *, PyObject *);}
static PyObject *meth_wxRegionIterator_GetY(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxRegionIterator *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRegionIterator, &sipCpp))
        {
            ::wxCoord sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetY();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_GetY, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_HaveRects, "HaveRects() -> bool\n"
"\n"
"Returns true if there are still some rectangles; otherwise returns\n"
"false.");

extern "C" {static PyObject *meth_wxRegionIterator_HaveRects(PyObject *, PyObject *);}
static PyObject *meth_wxRegionIterator_HaveRects(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxRegionIterator *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRegionIterator, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->HaveRects();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_HaveRects, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_Reset, "Reset() -> None\n"
"Reset(region) -> None\n"
"\n"
"Resets the iterator to the beginning of the rectangles.\n"
"");

extern "C" {static PyObject *meth_wxRegionIterator_Reset(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxRegionIterator_Reset(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        ::wxRegionIterator *sipCpp;

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, SIP_NULLPTR, "B", &sipSelf, sipType_wxRegionIterator, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Reset();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const ::wxRegion* region;
        ::wxRegionIterator *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxRegionIterator, &sipCpp, sipType_wxRegion, &region))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Reset(*region);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_Reset, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator___nonzero__, "__nonzero__() -> bool\n"
"\n"
"Returns true while there are still rectangles available in the\n"
"iteration.");

extern "C" {static PyObject *meth_wxRegionIterator___nonzero__(PyObject *, PyObject *);}
static PyObject *meth_wxRegionIterator___nonzero__(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        ::wxRegionIterator *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRegionIterator, &sipCpp))
        {
            int sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxRegionIterator___nonzero__(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName___nonzero__, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_Next, "Next() -> None\n"
"\n"
"Move the iterator to the next rectangle in the region.");

extern "C" {static PyObject *meth_wxRegionIterator_Next(PyObject *, PyObject *);}
static PyObject *meth_wxRegionIterator_Next(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        ::wxRegionIterator *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRegionIterator, &sipCpp))
        {
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        _wxRegionIterator_Next(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_Next, SIP_NULLPTR);

    return SIP_NULLPTR;
}


extern "C" {static int slot_wxRegionIterator___bool__(PyObject *);}
static int slot_wxRegionIterator___bool__(PyObject *sipSelf)
{
    ::wxRegionIterator *sipCpp = reinterpret_cast< ::wxRegionIterator *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_wxRegionIterator));

    if (!sipCpp)
        return -1;


    {
        {
            int sipRes = 0;
            int sipIsErr = 0;
        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxRegionIterator___bool__(sipCpp);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return -1;

            return sipRes;
        }
    }

    return 0;
}


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

    if (targetType == sipType_wxRegionIterator)
        return sipCppV;

    if (targetType == sipType_wxObject)
        return static_cast< ::wxObject *>(sipCpp);

    return SIP_NULLPTR;
}


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

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

    Py_END_ALLOW_THREADS
}


extern "C" {static void *array_wxRegionIterator(Py_ssize_t);}
static void *array_wxRegionIterator(Py_ssize_t sipNrElem)
{
    return new ::wxRegionIterator[sipNrElem];
}


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


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


extern "C" {static void *copy_wxRegionIterator(const void *, Py_ssize_t);}
static void *copy_wxRegionIterator(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new ::wxRegionIterator(reinterpret_cast<const ::wxRegionIterator *>(sipSrc)[sipSrcIdx]);
}


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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxRegionIterator();
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    {
        const ::wxRegion* region;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxRegion, &region))
        {
        if (!wxPyCheckForApp()) return NULL;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxRegionIterator(*region);
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    {
        const ::wxRegionIterator* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_wxRegionIterator, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxRegionIterator(*a0);
            Py_END_ALLOW_THREADS

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


/* Define this type's Python slots. */
static sipPySlotDef slots_wxRegionIterator[] = {
    {(void *)slot_wxRegionIterator___bool__, bool_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_wxRegionIterator[] = {
    {sipName_GetH, meth_wxRegionIterator_GetH, METH_VARARGS, doc_wxRegionIterator_GetH},
    {sipName_GetHeight, meth_wxRegionIterator_GetHeight, METH_VARARGS, doc_wxRegionIterator_GetHeight},
    {sipName_GetRect, meth_wxRegionIterator_GetRect, METH_VARARGS, doc_wxRegionIterator_GetRect},
    {sipName_GetW, meth_wxRegionIterator_GetW, METH_VARARGS, doc_wxRegionIterator_GetW},
    {sipName_GetWidth, meth_wxRegionIterator_GetWidth, METH_VARARGS, doc_wxRegionIterator_GetWidth},
    {sipName_GetX, meth_wxRegionIterator_GetX, METH_VARARGS, doc_wxRegionIterator_GetX},
    {sipName_GetY, meth_wxRegionIterator_GetY, METH_VARARGS, doc_wxRegionIterator_GetY},
    {sipName_HaveRects, meth_wxRegionIterator_HaveRects, METH_VARARGS, doc_wxRegionIterator_HaveRects},
    {sipName_Next, meth_wxRegionIterator_Next, METH_VARARGS, doc_wxRegionIterator_Next},
    {sipName_Reset, SIP_MLMETH_CAST(meth_wxRegionIterator_Reset), METH_VARARGS|METH_KEYWORDS, doc_wxRegionIterator_Reset},
    {sipName___nonzero__, meth_wxRegionIterator___nonzero__, METH_VARARGS, doc_wxRegionIterator___nonzero__}
};

sipVariableDef variables_wxRegionIterator[] = {
    {PropertyVariable, sipName_Y, &methods_wxRegionIterator[6], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_X, &methods_wxRegionIterator[5], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Width, &methods_wxRegionIterator[4], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_W, &methods_wxRegionIterator[3], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Rect, &methods_wxRegionIterator[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Height, &methods_wxRegionIterator[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_H, &methods_wxRegionIterator[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxRegionIterator, "RegionIterator() -> None\n"
"RegionIterator(region) -> None\n"
"\n"
"This class is used to iterate through the rectangles in a region,\n"
"typically when examining the damaged regions of a window within an\n"
"OnPaint call.");


sipClassTypeDef sipTypeDef__core_wxRegionIterator = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxRegionIterator,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_RegionIterator,
        {0, 0, 1},
        11, methods_wxRegionIterator,
        0, SIP_NULLPTR,
        7, variables_wxRegionIterator,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxRegionIterator,
    -1,
    -1,
    supers_wxRegionIterator,
    slots_wxRegionIterator,
    init_type_wxRegionIterator,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxRegionIterator,
    assign_wxRegionIterator,
    array_wxRegionIterator,
    copy_wxRegionIterator,
    release_wxRegionIterator,
    cast_wxRegionIterator,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxRegionIterator,
    sizeof (::wxRegionIterator),
};
