/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.15.1
 *
 *     Copyright: (c) 2020 by Total Control Software
 *     License:   wxWindows License
 */

#include "sipAPI_dataview.h"
        #include <wx/treelist.h>
        #include <wx/event.h>
        #include <wx/treelist.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxTreeListEvent : public ::wxTreeListEvent
{
public:
    sipwxTreeListEvent();
    sipwxTreeListEvent(const ::wxTreeListEvent&);
    virtual ~sipwxTreeListEvent();

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

    char sipPyMethods[2];
};

sipwxTreeListEvent::sipwxTreeListEvent(): ::wxTreeListEvent(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxEvent* sipwxTreeListEvent::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 ::wxTreeListEvent::Clone();

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

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

::wxEventCategory sipwxTreeListEvent::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 ::wxTreeListEvent::GetEventCategory();

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

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


PyDoc_STRVAR(doc_wxTreeListEvent_GetItem, "GetItem() -> TreeListItem\n"
"\n"
"Return the item affected by the event.");

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

    {
        const ::wxTreeListEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxTreeListItem(sipCpp->GetItem());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_TreeListEvent, sipName_GetItem, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeListEvent_GetOldCheckedState, "GetOldCheckedState() -> wx.CheckBoxState\n"
"\n"
"Return the previous state of the item checkbox.");

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

    {
        const ::wxTreeListEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTreeListEvent, &sipCpp))
        {
            ::wxCheckBoxState sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetOldCheckedState();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_wxCheckBoxState);
        }
    }

    sipNoMethod(sipParseErr, sipName_TreeListEvent, sipName_GetOldCheckedState, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeListEvent_GetColumn, "GetColumn() -> int\n"
"\n"
"Return the column affected by the event.");

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

    {
        const ::wxTreeListEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTreeListEvent, &sipCpp))
        {
            uint sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetColumn();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromUnsignedLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_TreeListEvent, sipName_GetColumn, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const ::wxTreeListEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_TreeListEvent, sipName_Clone, doc_wxTreeListEvent_Clone);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxTreeListEvent)
        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_wxTreeListEvent(void *, int);}
static void release_wxTreeListEvent(void *sipCppV, int sipState)
{
    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxTreeListEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxTreeListEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxTreeListEvent();
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxTreeListEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxTreeListEvent[] = {
    {sipName_Clone, meth_wxTreeListEvent_Clone, METH_VARARGS, doc_wxTreeListEvent_Clone},
    {sipName_GetColumn, meth_wxTreeListEvent_GetColumn, METH_VARARGS, doc_wxTreeListEvent_GetColumn},
    {sipName_GetItem, meth_wxTreeListEvent_GetItem, METH_VARARGS, doc_wxTreeListEvent_GetItem},
    {sipName_GetOldCheckedState, meth_wxTreeListEvent_GetOldCheckedState, METH_VARARGS, doc_wxTreeListEvent_GetOldCheckedState}
};

sipVariableDef variables_wxTreeListEvent[] = {
    {PropertyVariable, sipName_OldCheckedState, &methods_wxTreeListEvent[3], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Item, &methods_wxTreeListEvent[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Column, &methods_wxTreeListEvent[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxTreeListEvent, "TreeListEvent() -> None\n"
"\n"
"Event generated by wxTreeListCtrl.");


sipClassTypeDef sipTypeDef__dataview_wxTreeListEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxTreeListEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_TreeListEvent,
        {0, 0, 1},
        4, methods_wxTreeListEvent,
        0, SIP_NULLPTR,
        3, variables_wxTreeListEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxTreeListEvent,
    -1,
    -1,
    supers_wxTreeListEvent,
    SIP_NULLPTR,
    init_type_wxTreeListEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxTreeListEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxTreeListEvent,
    cast_wxTreeListEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxTreeListEvent),
};
