/*
 * 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/overlay.h>

        #include <wx/overlay.h>
        #include <wx/dc.h>


class sipwxDCOverlay : public  ::wxDCOverlay
{
public:
    sipwxDCOverlay( ::wxOverlay&, ::wxDC*,int,int,int,int);
    sipwxDCOverlay( ::wxOverlay&, ::wxDC*);
    ~sipwxDCOverlay();

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxDCOverlay(const sipwxDCOverlay &);
    sipwxDCOverlay &operator = (const sipwxDCOverlay &);
};

sipwxDCOverlay::sipwxDCOverlay( ::wxOverlay& overlay, ::wxDC*dc,int x,int y,int width,int height):  ::wxDCOverlay(overlay,dc,x,y,width,height), sipPySelf(SIP_NULLPTR)
{
}

sipwxDCOverlay::sipwxDCOverlay( ::wxOverlay& overlay, ::wxDC*dc):  ::wxDCOverlay(overlay,dc), sipPySelf(SIP_NULLPTR)
{
}

sipwxDCOverlay::~sipwxDCOverlay()
{
    sipInstanceDestroyedEx(&sipPySelf);
}


PyDoc_STRVAR(doc_wxDCOverlay_Clear, "Clear()\n"
"\n"
"Clears the layer, restoring the state at the last init.");

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

    {
         ::wxDCOverlay *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxDCOverlay, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Clear();
            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_DCOverlay, sipName_Clear, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxDCOverlay *>(sipCppV);
    else
        delete reinterpret_cast< ::wxDCOverlay *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void dealloc_wxDCOverlay(sipSimpleWrapper *);}
static void dealloc_wxDCOverlay(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipwxDCOverlay *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_wxDCOverlay(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_wxDCOverlay(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_wxDCOverlay(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    sipwxDCOverlay *sipCpp = SIP_NULLPTR;

    {
         ::wxOverlay* overlay;
         ::wxDC* dc;
        PyObject *dcKeep;
        int x;
        int y;
        int width;
        int height;

        static const char *sipKwdList[] = {
            sipName_overlay,
            sipName_dc,
            sipName_x,
            sipName_y,
            sipName_width,
            sipName_height,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9@J8iiii", sipType_wxOverlay, &overlay, &dcKeep, sipType_wxDC, &dc, &x, &y, &width, &height))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxDCOverlay(*overlay,dc,x,y,width,height);
            Py_END_ALLOW_THREADS

            sipKeepReference((PyObject *)sipSelf, -22, dcKeep);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
         ::wxOverlay* overlay;
         ::wxDC* dc;
        PyObject *dcKeep;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9@J8", sipType_wxOverlay, &overlay, &dcKeep, sipType_wxDC, &dc))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxDCOverlay(*overlay,dc);
            Py_END_ALLOW_THREADS

            sipKeepReference((PyObject *)sipSelf, -23, dcKeep);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxDCOverlay[] = {
    {SIP_MLNAME_CAST(sipName_Clear), meth_wxDCOverlay_Clear, METH_VARARGS, SIP_MLDOC_CAST(doc_wxDCOverlay_Clear)}
};

PyDoc_STRVAR(doc_wxDCOverlay, "DCOverlay(overlay, dc, x, y, width, height)\n"
"DCOverlay(overlay, dc)\n"
"\n"
"Connects an overlay with a drawing DC.");


sipClassTypeDef sipTypeDef__core_wxDCOverlay = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxDCOverlay,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_DCOverlay,
        {0, 0, 1},
        1, methods_wxDCOverlay,
        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_wxDCOverlay,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxDCOverlay,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxDCOverlay,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxDCOverlay,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
