/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.16
 *
 *     Copyright: (c) 2018 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]),sipPySelf,SIP_NULLPTR,sipName_Clone);

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

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

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

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

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

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

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

    return sipVH__dataview_57(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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_TreeListEvent, sipName_GetItem, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeListEvent_GetOldCheckedState, "GetOldCheckedState() -> 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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_TreeListEvent, sipName_GetOldCheckedState, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeListEvent_GetColumn, "GetColumn() -> unsigned\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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_TreeListEvent, sipName_GetColumn, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    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_wxNotifyEvent)
        return static_cast< ::wxNotifyEvent *>(sipCpp);

    if (targetType == sipType_wxCommandEvent)
        return static_cast< ::wxCommandEvent *>(sipCpp);

    if (targetType == sipType_wxEvent)
        return static_cast< ::wxEvent *>(sipCpp);

    if (targetType == sipType_wxObject)
        return static_cast< ::wxObject *>(sipCpp);

    return sipCppV;
}


/* 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[] = {{23, 0, 1}};


static PyMethodDef methods_wxTreeListEvent[] = {
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxTreeListEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTreeListEvent_Clone)},
    {SIP_MLNAME_CAST(sipName_GetColumn), meth_wxTreeListEvent_GetColumn, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTreeListEvent_GetColumn)},
    {SIP_MLNAME_CAST(sipName_GetItem), meth_wxTreeListEvent_GetItem, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTreeListEvent_GetItem)},
    {SIP_MLNAME_CAST(sipName_GetOldCheckedState), meth_wxTreeListEvent_GetOldCheckedState, METH_VARARGS, SIP_MLDOC_CAST(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()\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,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxTreeListEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxTreeListEvent,
    cast_wxTreeListEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
