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

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

    char sipPyMethods[2];
};

sipwxGridColumnHeaderRenderer::sipwxGridColumnHeaderRenderer():  ::wxGridColumnHeaderRenderer(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

void sipwxGridColumnHeaderRenderer::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_GridColumnHeaderRenderer,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 sipwxGridColumnHeaderRenderer::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]),sipPySelf,SIP_NULLPTR,sipName_DrawLabel);

    if (!sipMeth)
    {
         ::wxGridColumnHeaderRenderer::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_wxGridColumnHeaderRenderer(void *, const sipTypeDef *);}
static void *cast_wxGridColumnHeaderRenderer(void *sipCppV, const sipTypeDef *targetType)
{
     ::wxGridColumnHeaderRenderer *sipCpp = reinterpret_cast< ::wxGridColumnHeaderRenderer *>(sipCppV);

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

    return sipCppV;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxGridColumnHeaderRenderer *>(sipCppV);
    else
        delete reinterpret_cast< ::wxGridColumnHeaderRenderer *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxGridColumnHeaderRenderer* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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

PyDoc_STRVAR(doc_wxGridColumnHeaderRenderer, "Base class for column headers renderer.");


sipClassTypeDef sipTypeDef__grid_wxGridColumnHeaderRenderer = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_wxGridColumnHeaderRenderer,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_GridColumnHeaderRenderer,
        {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_wxGridColumnHeaderRenderer,
    -1,
    -1,
    supers_wxGridColumnHeaderRenderer,
    SIP_NULLPTR,
    init_type_wxGridColumnHeaderRenderer,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxGridColumnHeaderRenderer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxGridColumnHeaderRenderer,
    cast_wxGridColumnHeaderRenderer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
