/*
 * 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 sipwxGridHeaderLabelsRenderer : public ::wxGridHeaderLabelsRenderer
{
public:
    sipwxGridHeaderLabelsRenderer();
    sipwxGridHeaderLabelsRenderer(const ::wxGridHeaderLabelsRenderer&);
    virtual ~sipwxGridHeaderLabelsRenderer();

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

    char sipPyMethods[2];
};

sipwxGridHeaderLabelsRenderer::sipwxGridHeaderLabelsRenderer(): ::wxGridHeaderLabelsRenderer(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

void sipwxGridHeaderLabelsRenderer::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)
    {
        ::wxGridHeaderLabelsRenderer::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 sipwxGridHeaderLabelsRenderer::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), sipName_GridHeaderLabelsRenderer, sipName_DrawBorder);

    if (!sipMeth)
        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_wxGridHeaderLabelsRenderer_DrawBorder, "DrawBorder(grid, dc, rect) -> None\n"
"\n"
"Called by the grid to draw the border around the cell header.");

extern "C" {static PyObject *meth_wxGridHeaderLabelsRenderer_DrawBorder(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxGridHeaderLabelsRenderer_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 ::wxGridHeaderLabelsRenderer *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9J9J1", &sipSelf, sipType_wxGridHeaderLabelsRenderer, &sipCpp, sipType_wxGrid, &grid, sipType_wxDC, &dc, sipType_wxRect, &rect, &rectState))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_GridHeaderLabelsRenderer, 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;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridHeaderLabelsRenderer, sipName_DrawBorder, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridHeaderLabelsRenderer_DrawLabel, "DrawLabel(grid, dc, value, rect, horizAlign, vertAlign, textOrientation) -> None\n"
"\n"
"Called by the grid to draw the specified label.");

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

    {
        const ::wxGrid* grid;
        ::wxDC* dc;
        const ::wxString* value;
        int valueState = 0;
        const ::wxRect* rect;
        int rectState = 0;
        int horizAlign;
        int vertAlign;
        int textOrientation;
        const ::wxGridHeaderLabelsRenderer *sipCpp;

        static const char *sipKwdList[] = {
            sipName_grid,
            sipName_dc,
            sipName_value,
            sipName_rect,
            sipName_horizAlign,
            sipName_vertAlign,
            sipName_textOrientation,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9J9J1J1iii", &sipSelf, sipType_wxGridHeaderLabelsRenderer, &sipCpp, sipType_wxGrid, &grid, sipType_wxDC, &dc, sipType_wxString, &value, &valueState, sipType_wxRect, &rect, &rectState, &horizAlign, &vertAlign, &textOrientation))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxGridHeaderLabelsRenderer::DrawLabel(*grid, *dc, *value, *rect, horizAlign, vertAlign, textOrientation) : sipCpp->DrawLabel(*grid, *dc, *value, *rect, horizAlign, vertAlign, textOrientation));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(value), sipType_wxString, valueState);
            sipReleaseType(const_cast< ::wxRect *>(rect), sipType_wxRect, rectState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridHeaderLabelsRenderer, sipName_DrawLabel, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxGridHeaderLabelsRenderer *>(sipCppV);
    else
        delete reinterpret_cast< ::wxGridHeaderLabelsRenderer *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxGridHeaderLabelsRenderer* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxGridHeaderLabelsRenderer[] = {
    {sipName_DrawBorder, SIP_MLMETH_CAST(meth_wxGridHeaderLabelsRenderer_DrawBorder), METH_VARARGS|METH_KEYWORDS, doc_wxGridHeaderLabelsRenderer_DrawBorder},
    {sipName_DrawLabel, SIP_MLMETH_CAST(meth_wxGridHeaderLabelsRenderer_DrawLabel), METH_VARARGS|METH_KEYWORDS, doc_wxGridHeaderLabelsRenderer_DrawLabel}
};

PyDoc_STRVAR(doc_wxGridHeaderLabelsRenderer, "Base class for header cells renderers.");


sipClassTypeDef sipTypeDef__grid_wxGridHeaderLabelsRenderer = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_wxGridHeaderLabelsRenderer,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_GridHeaderLabelsRenderer,
        {0, 0, 1},
        2, methods_wxGridHeaderLabelsRenderer,
        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_wxGridHeaderLabelsRenderer,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxGridHeaderLabelsRenderer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGridHeaderLabelsRenderer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxGridHeaderLabelsRenderer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxGridHeaderLabelsRenderer),
};
