/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.16
 *
 *     Copyright: (c) 2018 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();
    }
    void _wxRegionIterator_Next(wxRegionIterator* self)
    {
        self->operator++();
    }


PyDoc_STRVAR(doc_wxRegionIterator_GetH, "GetH() -> Coord\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 SIPLong_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_GetH, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_GetHeight, "GetHeight() -> Coord\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 SIPLong_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_GetRect, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_GetW, "GetW() -> Coord\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 SIPLong_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_GetW, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_GetWidth, "GetWidth() -> Coord\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 SIPLong_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_GetWidth, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_GetX, "GetX() -> Coord\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 SIPLong_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_GetX, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_GetY, "GetY() -> Coord\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 SIPLong_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_HaveRects, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_Reset, "Reset()\n"
"Reset(region)\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;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_Reset, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRegionIterator_Next, "Next()\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;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_RegionIterator, sipName_Next, SIP_NULLPTR);

    return SIP_NULLPTR;
}


extern "C" {static int slot_wxRegionIterator___nonzero__(PyObject *);}
static int slot_wxRegionIterator___nonzero__(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___nonzero__(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_wxObject)
        return static_cast< ::wxObject *>(sipCpp);

    return sipCppV;
}


/* 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 assign_wxRegionIterator(void *, SIP_SSIZE_T, void *);}
static void assign_wxRegionIterator(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxRegionIterator *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxRegionIterator *>(sipSrc);
}


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


extern "C" {static void *copy_wxRegionIterator(const void *, SIP_SSIZE_T);}
static void *copy_wxRegionIterator(const void *sipSrc, SIP_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[] = {{358, 255, 1}};


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


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

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()\n"
"RegionIterator(region)\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},
        10, 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,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxRegionIterator,
    assign_wxRegionIterator,
    array_wxRegionIterator,
    copy_wxRegionIterator,
    release_wxRegionIterator,
    cast_wxRegionIterator,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
