/*
 * 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/object.h>
        #include <wx/kbdstate.h>
        #include <wx/event.h>
        #include <wx/gdicmn.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxGridSizeEvent : public ::wxGridSizeEvent
{
public:
    sipwxGridSizeEvent();
    sipwxGridSizeEvent(int, ::wxEventType, ::wxObject*, int, int, int, const ::wxKeyboardState&);
    sipwxGridSizeEvent(const ::wxGridSizeEvent&);
    virtual ~sipwxGridSizeEvent();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    ::wxEvent* Clone() const SIP_OVERRIDE;
    ::wxEventCategory GetEventCategory() const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[2];
};

sipwxGridSizeEvent::sipwxGridSizeEvent(): ::wxGridSizeEvent(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxGridSizeEvent::sipwxGridSizeEvent(int id, ::wxEventType type, ::wxObject*obj, int rowOrCol, int x, int y, const ::wxKeyboardState& kbd): ::wxGridSizeEvent(id, type, obj, rowOrCol, x, y, kbd), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxEvent* sipwxGridSizeEvent::Clone() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxGridSizeEvent::Clone();

    extern ::wxEvent* sipVH__grid_69(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH__grid_69(sipGILState, 0, sipPySelf, sipMeth);
}

::wxEventCategory sipwxGridSizeEvent::GetEventCategory() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxGridSizeEvent::GetEventCategory();

    extern ::wxEventCategory sipVH__grid_68(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH__grid_68(sipGILState, 0, sipPySelf, sipMeth);
}


PyDoc_STRVAR(doc_wxGridSizeEvent_AltDown, "AltDown() -> bool\n"
"\n"
"Returns true if the Alt key was down at the time of the event.");

extern "C" {static PyObject *meth_wxGridSizeEvent_AltDown(PyObject *, PyObject *);}
static PyObject *meth_wxGridSizeEvent_AltDown(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxGridSizeEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridSizeEvent, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->AltDown();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridSizeEvent, sipName_AltDown, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridSizeEvent_ControlDown, "ControlDown() -> bool\n"
"\n"
"Returns true if the Control key was down at the time of the event.");

extern "C" {static PyObject *meth_wxGridSizeEvent_ControlDown(PyObject *, PyObject *);}
static PyObject *meth_wxGridSizeEvent_ControlDown(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxGridSizeEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridSizeEvent, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->ControlDown();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridSizeEvent, sipName_ControlDown, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridSizeEvent_GetPosition, "GetPosition() -> wx.Point\n"
"\n"
"Position in pixels at which the event occurred.");

extern "C" {static PyObject *meth_wxGridSizeEvent_GetPosition(PyObject *, PyObject *);}
static PyObject *meth_wxGridSizeEvent_GetPosition(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxGridSizeEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridSizeEvent, &sipCpp))
        {
            ::wxPoint*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxPoint(sipCpp->GetPosition());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromNewType(sipRes, sipType_wxPoint, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridSizeEvent, sipName_GetPosition, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridSizeEvent_GetRowOrCol, "GetRowOrCol() -> int\n"
"\n"
"Row or column at that was resized.");

extern "C" {static PyObject *meth_wxGridSizeEvent_GetRowOrCol(PyObject *, PyObject *);}
static PyObject *meth_wxGridSizeEvent_GetRowOrCol(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxGridSizeEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridSizeEvent, &sipCpp))
        {
            int sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetRowOrCol();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridSizeEvent, sipName_GetRowOrCol, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridSizeEvent_MetaDown, "MetaDown() -> bool\n"
"\n"
"Returns true if the Meta key was down at the time of the event.");

extern "C" {static PyObject *meth_wxGridSizeEvent_MetaDown(PyObject *, PyObject *);}
static PyObject *meth_wxGridSizeEvent_MetaDown(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxGridSizeEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridSizeEvent, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->MetaDown();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridSizeEvent, sipName_MetaDown, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridSizeEvent_ShiftDown, "ShiftDown() -> bool\n"
"\n"
"Returns true if the Shift key was down at the time of the event.");

extern "C" {static PyObject *meth_wxGridSizeEvent_ShiftDown(PyObject *, PyObject *);}
static PyObject *meth_wxGridSizeEvent_ShiftDown(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::wxGridSizeEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridSizeEvent, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->ShiftDown();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridSizeEvent, sipName_ShiftDown, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridSizeEvent_Clone, "Clone(self) -> Event|None");

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

    {
        const ::wxGridSizeEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxGridSizeEvent, &sipCpp))
        {
            ::wxEvent*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp->::wxGridSizeEvent::Clone() : sipCpp->Clone());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromNewType(sipRes, sipType_wxEvent, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridSizeEvent, sipName_Clone, doc_wxGridSizeEvent_Clone);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxGridSizeEvent)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxGridSizeEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxGridSizeEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxGridSizeEvent();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
            {
                delete sipCpp;
                return SIP_NULLPTR;
            }

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        int id;
        ::wxEventType type;
        ::wxObject* obj;
        int rowOrCol = -1;
        int x = -1;
        int y = -1;
        const ::wxKeyboardState& kbddef = wxKeyboardState();
        const ::wxKeyboardState* kbd = &kbddef;

        static const char *sipKwdList[] = {
            sipName_id,
            sipName_type,
            sipName_obj,
            sipName_rowOrCol,
            sipName_x,
            sipName_y,
            sipName_kbd,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "iiJ8|iiiJ9", &id, &type, sipType_wxObject, &obj, &rowOrCol, &x, &y, sipType_wxKeyboardState, &kbd))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxGridSizeEvent(id, type, obj, rowOrCol, x, y, *kbd);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
            {
                delete sipCpp;
                return SIP_NULLPTR;
            }

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxGridSizeEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_wxGridSizeEvent[] = {{17, 0, 1}};


static PyMethodDef methods_wxGridSizeEvent[] = {
    {sipName_AltDown, meth_wxGridSizeEvent_AltDown, METH_VARARGS, doc_wxGridSizeEvent_AltDown},
    {sipName_Clone, meth_wxGridSizeEvent_Clone, METH_VARARGS, doc_wxGridSizeEvent_Clone},
    {sipName_ControlDown, meth_wxGridSizeEvent_ControlDown, METH_VARARGS, doc_wxGridSizeEvent_ControlDown},
    {sipName_GetPosition, meth_wxGridSizeEvent_GetPosition, METH_VARARGS, doc_wxGridSizeEvent_GetPosition},
    {sipName_GetRowOrCol, meth_wxGridSizeEvent_GetRowOrCol, METH_VARARGS, doc_wxGridSizeEvent_GetRowOrCol},
    {sipName_MetaDown, meth_wxGridSizeEvent_MetaDown, METH_VARARGS, doc_wxGridSizeEvent_MetaDown},
    {sipName_ShiftDown, meth_wxGridSizeEvent_ShiftDown, METH_VARARGS, doc_wxGridSizeEvent_ShiftDown}
};

sipVariableDef variables_wxGridSizeEvent[] = {
    {PropertyVariable, sipName_RowOrCol, &methods_wxGridSizeEvent[4], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Position, &methods_wxGridSizeEvent[3], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxGridSizeEvent, "GridSizeEvent() -> None\n"
"GridSizeEvent(id, type, obj, rowOrCol=-1, x=-1, y=-1, kbd=wx.KeyboardState()) -> None\n"
"\n"
"This event class contains information about a row/column resize event.");


sipClassTypeDef sipTypeDef__grid_wxGridSizeEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxGridSizeEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_GridSizeEvent,
        {0, 0, 1},
        7, methods_wxGridSizeEvent,
        0, SIP_NULLPTR,
        2, variables_wxGridSizeEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxGridSizeEvent,
    -1,
    -1,
    supers_wxGridSizeEvent,
    SIP_NULLPTR,
    init_type_wxGridSizeEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGridSizeEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxGridSizeEvent,
    cast_wxGridSizeEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxGridSizeEvent),
};
