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

#include "sipAPI_grid.h"

        #include <wx/grid.h>

        #include <wx/grid.h>
        #include <wx/dc.h>
        #include <wx/gdicmn.h>


class sipwxGridCornerHeaderRenderer : public  ::wxGridCornerHeaderRenderer
{
public:
    sipwxGridCornerHeaderRenderer();
    sipwxGridCornerHeaderRenderer(const  ::wxGridCornerHeaderRenderer&);
    virtual ~sipwxGridCornerHeaderRenderer();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    void DrawBorder(const  ::wxGrid&, ::wxDC&, ::wxRect&) const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxGridCornerHeaderRenderer(const sipwxGridCornerHeaderRenderer &);
    sipwxGridCornerHeaderRenderer &operator = (const sipwxGridCornerHeaderRenderer &);

    char sipPyMethods[1];
};

sipwxGridCornerHeaderRenderer::sipwxGridCornerHeaderRenderer():  ::wxGridCornerHeaderRenderer(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxGridCornerHeaderRenderer::sipwxGridCornerHeaderRenderer(const  ::wxGridCornerHeaderRenderer& a0):  ::wxGridCornerHeaderRenderer(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

void sipwxGridCornerHeaderRenderer::DrawBorder(const  ::wxGrid& grid, ::wxDC& dc, ::wxRect& rect) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[0]),sipPySelf,sipName_GridCornerHeaderRenderer,sipName_DrawBorder);

    if (!sipMeth)
        return;

    extern void sipVH__grid_15(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::wxGrid&, ::wxDC&, ::wxRect&);

    sipVH__grid_15(sipGILState, 0, sipPySelf, sipMeth, grid, dc, rect);
}


PyDoc_STRVAR(doc_wxGridCornerHeaderRenderer_DrawBorder, "DrawBorder(grid, dc, rect)\n"
"\n"
"Called by the grid to draw the corner window border.");

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

    {
        const  ::wxGrid* grid;
         ::wxDC* dc;
         ::wxRect* rect;
        int rectState = 0;
        const  ::wxGridCornerHeaderRenderer *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9J9J1", &sipSelf, sipType_wxGridCornerHeaderRenderer, &sipCpp, sipType_wxGrid, &grid, sipType_wxDC, &dc, sipType_wxRect, &rect, &rectState))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_GridCornerHeaderRenderer, sipName_DrawBorder);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DrawBorder(*grid,*dc,*rect);
            Py_END_ALLOW_THREADS
            sipReleaseType(rect,sipType_wxRect,rectState);

            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_GridCornerHeaderRenderer, sipName_DrawBorder, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxGridCornerHeaderRenderer *>(sipCppV);
    else
        delete reinterpret_cast< ::wxGridCornerHeaderRenderer *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxGridCornerHeaderRenderer();
            Py_END_ALLOW_THREADS

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxGridCornerHeaderRenderer* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxGridCornerHeaderRenderer[] = {
    {SIP_MLNAME_CAST(sipName_DrawBorder), SIP_MLMETH_CAST(meth_wxGridCornerHeaderRenderer_DrawBorder), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxGridCornerHeaderRenderer_DrawBorder)}
};

PyDoc_STRVAR(doc_wxGridCornerHeaderRenderer, "Base class for corner window renderer.");


sipClassTypeDef sipTypeDef__grid_wxGridCornerHeaderRenderer = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_wxGridCornerHeaderRenderer,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_GridCornerHeaderRenderer,
        {0, 0, 1},
        1, methods_wxGridCornerHeaderRenderer,
        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_wxGridCornerHeaderRenderer,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxGridCornerHeaderRenderer,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxGridCornerHeaderRenderer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxGridCornerHeaderRenderer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
