/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.8.5
 *
 *     Copyright: (c) 2020 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 sipwxGridCornerHeaderRendererDefault : public ::wxGridCornerHeaderRendererDefault
{
public:
    sipwxGridCornerHeaderRendererDefault();
    sipwxGridCornerHeaderRendererDefault(const ::wxGridCornerHeaderRendererDefault&);
    virtual ~sipwxGridCornerHeaderRendererDefault();

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

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[2];
};

sipwxGridCornerHeaderRendererDefault::sipwxGridCornerHeaderRendererDefault(): ::wxGridCornerHeaderRendererDefault(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

void sipwxGridCornerHeaderRendererDefault::DrawLabel(const ::wxGrid& grid, ::wxDC& dc, const ::wxString& value, const ::wxRect& rect, int horizAlign, int vertAlign, int textOrientation) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[0]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_DrawLabel);

    if (!sipMeth)
    {
        ::wxGridCornerHeaderRendererDefault::DrawLabel(grid, dc, value, rect, horizAlign, vertAlign, textOrientation);
        return;
    }

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

    sipVH__grid_20(sipGILState, 0, sipPySelf, sipMeth, grid, dc, value, rect, horizAlign, vertAlign, textOrientation);
}

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

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[1]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_DrawBorder);

    if (!sipMeth)
    {
        ::wxGridCornerHeaderRendererDefault::DrawBorder(grid, dc, rect);
        return;
    }

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

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


PyDoc_STRVAR(doc_wxGridCornerHeaderRendererDefault_DrawBorder, "DrawBorder(grid, dc, rect)\n"
"\n"
"Implement border drawing for the corner window.");

extern "C" {static PyObject *meth_wxGridCornerHeaderRendererDefault_DrawBorder(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGridCornerHeaderRendererDefault_DrawBorder(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

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

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9J9J1", &sipSelf, sipType_wxGridCornerHeaderRendererDefault, &sipCpp, sipType_wxGrid, &grid, sipType_wxDC, &dc, sipType_wxRect, &rect, &rectState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridCornerHeaderRendererDefault::DrawBorder(*grid, *dc, *rect) : 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;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCornerHeaderRendererDefault, sipName_DrawBorder, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxGridCornerHeaderRendererDefault)
        return sipCppV;

    sipCppV = ((const sipClassTypeDef *)sipType_wxGridCornerHeaderRenderer)->ctd_cast(static_cast<::wxGridCornerHeaderRenderer *>(sipCpp), targetType);
    if (sipCppV)
        return sipCppV;

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxGridCornerHeaderRendererDefault *>(sipCppV);
    else
        delete reinterpret_cast<::wxGridCornerHeaderRendererDefault *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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


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


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxGridCornerHeaderRendererDefault* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxGridCornerHeaderRendererDefault[] = {
    {sipName_DrawBorder, SIP_MLMETH_CAST(meth_wxGridCornerHeaderRendererDefault_DrawBorder), METH_VARARGS|METH_KEYWORDS, doc_wxGridCornerHeaderRendererDefault_DrawBorder}
};

PyDoc_STRVAR(doc_wxGridCornerHeaderRendererDefault, "Default corner window renderer.");


sipClassTypeDef sipTypeDef__grid_wxGridCornerHeaderRendererDefault = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxGridCornerHeaderRendererDefault,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_GridCornerHeaderRendererDefault,
        {0, 0, 1},
        1, methods_wxGridCornerHeaderRendererDefault,
        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_wxGridCornerHeaderRendererDefault,
    -1,
    -1,
    supers_wxGridCornerHeaderRendererDefault,
    SIP_NULLPTR,
    init_type_wxGridCornerHeaderRendererDefault,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGridCornerHeaderRendererDefault,
    assign_wxGridCornerHeaderRendererDefault,
    array_wxGridCornerHeaderRendererDefault,
    copy_wxGridCornerHeaderRendererDefault,
    release_wxGridCornerHeaderRendererDefault,
    cast_wxGridCornerHeaderRendererDefault,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
