/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.15.1
 *
 *     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 sipwxGridColumnHeaderRendererDefault : public ::wxGridColumnHeaderRendererDefault
{
public:
    sipwxGridColumnHeaderRendererDefault();
    sipwxGridColumnHeaderRendererDefault(const ::wxGridColumnHeaderRendererDefault&);
    virtual ~sipwxGridColumnHeaderRendererDefault();

    /*
     * 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:
    sipwxGridColumnHeaderRendererDefault(const sipwxGridColumnHeaderRendererDefault &);
    sipwxGridColumnHeaderRendererDefault &operator = (const sipwxGridColumnHeaderRendererDefault &);

    char sipPyMethods[2];
};

sipwxGridColumnHeaderRendererDefault::sipwxGridColumnHeaderRendererDefault(): ::wxGridColumnHeaderRendererDefault(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

void sipwxGridColumnHeaderRendererDefault::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)
    {
        ::wxGridColumnHeaderRendererDefault::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 sipwxGridColumnHeaderRendererDefault::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)
    {
        ::wxGridColumnHeaderRendererDefault::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_wxGridColumnHeaderRendererDefault_DrawBorder, "DrawBorder(grid, dc, rect) -> None\n"
"\n"
"Implement border drawing for the column labels.");

extern "C" {static PyObject *meth_wxGridColumnHeaderRendererDefault_DrawBorder(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGridColumnHeaderRendererDefault_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 ::wxGridColumnHeaderRendererDefault *sipCpp;

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

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

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridColumnHeaderRendererDefault::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_GridColumnHeaderRendererDefault, sipName_DrawBorder, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxGridColumnHeaderRendererDefault)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxGridColumnHeaderRendererDefault *>(sipCppV);
    else
        delete reinterpret_cast< ::wxGridColumnHeaderRendererDefault *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


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


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


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


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxGridColumnHeaderRendererDefault* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxGridColumnHeaderRendererDefault[] = {
    {sipName_DrawBorder, SIP_MLMETH_CAST(meth_wxGridColumnHeaderRendererDefault_DrawBorder), METH_VARARGS|METH_KEYWORDS, doc_wxGridColumnHeaderRendererDefault_DrawBorder}
};

PyDoc_STRVAR(doc_wxGridColumnHeaderRendererDefault, "Default column header renderer.");


sipClassTypeDef sipTypeDef__grid_wxGridColumnHeaderRendererDefault = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxGridColumnHeaderRendererDefault,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_GridColumnHeaderRendererDefault,
        {0, 0, 1},
        1, methods_wxGridColumnHeaderRendererDefault,
        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_wxGridColumnHeaderRendererDefault,
    -1,
    -1,
    supers_wxGridColumnHeaderRendererDefault,
    SIP_NULLPTR,
    init_type_wxGridColumnHeaderRendererDefault,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGridColumnHeaderRendererDefault,
    assign_wxGridColumnHeaderRendererDefault,
    array_wxGridColumnHeaderRendererDefault,
    copy_wxGridColumnHeaderRendererDefault,
    release_wxGridColumnHeaderRendererDefault,
    cast_wxGridColumnHeaderRendererDefault,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxGridColumnHeaderRendererDefault,
    sizeof (::wxGridColumnHeaderRendererDefault),
};
