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

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

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[2];
};

sipwxGridRowHeaderRenderer::sipwxGridRowHeaderRenderer():  ::wxGridRowHeaderRenderer(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

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

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[0]), const_cast<sipSimpleWrapper **>(&sipPySelf), sipName_GridRowHeaderRenderer, 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);
}

void sipwxGridRowHeaderRenderer::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[1]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_DrawLabel);

    if (!sipMeth)
    {
         ::wxGridRowHeaderRenderer::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);
}


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

    if (targetType == sipType_wxGridRowHeaderRenderer)
        return sipCppV;

    if (targetType == sipType_wxGridHeaderLabelsRenderer)
        return static_cast< ::wxGridHeaderLabelsRenderer *>(sipCpp);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxGridRowHeaderRenderer *>(sipCppV);
    else
        delete reinterpret_cast< ::wxGridRowHeaderRenderer *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxGridRowHeaderRenderer* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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

PyDoc_STRVAR(doc_wxGridRowHeaderRenderer, "Base class for row headers renderer.");


sipClassTypeDef sipTypeDef__grid_wxGridRowHeaderRenderer = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_wxGridRowHeaderRenderer,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        sipNameNr_GridRowHeaderRenderer,
        {0, 0, 1},
        0, SIP_NULLPTR,
        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_wxGridRowHeaderRenderer,
    -1,
    -1,
    supers_wxGridRowHeaderRenderer,
    SIP_NULLPTR,
    init_type_wxGridRowHeaderRenderer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGridRowHeaderRenderer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxGridRowHeaderRenderer,
    cast_wxGridRowHeaderRenderer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
