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

#include "sipAPI_core.h"
        #include <wx/treectrl.h>
        #include <wx/treectrl.h>
        #include <wx/treebase.h>
        #include <wx/event.h>
        #include <wx/gdicmn.h>
        #include <wx/event.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxTreeEvent : public ::wxTreeEvent
{
public:
    sipwxTreeEvent(::wxEventType, ::wxTreeCtrl*, const ::wxTreeItemId&);
    sipwxTreeEvent(const ::wxTreeEvent&);
    virtual ~sipwxTreeEvent();

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

    char sipPyMethods[2];
};

sipwxTreeEvent::sipwxTreeEvent(::wxEventType commandType, ::wxTreeCtrl*tree, const ::wxTreeItemId& item): ::wxTreeEvent(commandType, tree, item), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxEvent* sipwxTreeEvent::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 ::wxTreeEvent::Clone();

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

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

::wxEventCategory sipwxTreeEvent::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 ::wxTreeEvent::GetEventCategory();

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

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


PyDoc_STRVAR(doc_wxTreeEvent_GetItem, "GetItem() -> TreeItemId\n"
"\n"
"Returns the item.");

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

    {
        const ::wxTreeEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_TreeEvent, sipName_GetItem, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeEvent_GetKeyCode, "GetKeyCode() -> int\n"
"\n"
"Returns the key code if the event is a key event.");

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

    {
        const ::wxTreeEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetKeyCode();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_TreeEvent, sipName_GetKeyCode, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeEvent_GetKeyEvent, "GetKeyEvent() -> KeyEvent\n"
"\n"
"Returns the key event for EVT_TREE_KEY_DOWN events.");

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

    {
        const ::wxTreeEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxKeyEvent(sipCpp->GetKeyEvent());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_TreeEvent, sipName_GetKeyEvent, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeEvent_GetLabel, "GetLabel() -> str\n"
"\n"
"Returns the label if the event is a begin or end edit label event.");

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

    {
        const ::wxTreeEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxString(sipCpp->GetLabel());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_TreeEvent, sipName_GetLabel, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeEvent_GetOldItem, "GetOldItem() -> TreeItemId\n"
"\n"
"Returns the old item index (valid for EVT_TREE_SEL_CHANGING and\n"
"EVT_TREE_SEL_CHANGED events).");

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

    {
        const ::wxTreeEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxTreeItemId(sipCpp->GetOldItem());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_TreeEvent, sipName_GetOldItem, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeEvent_GetPoint, "GetPoint() -> Point\n"
"\n"
"Returns the position of the mouse pointer if the event is a drag or\n"
"menu-context event.");

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

    {
        const ::wxTreeEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_TreeEvent, sipName_GetPoint, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeEvent_IsEditCancelled, "IsEditCancelled() -> bool\n"
"\n"
"Returns true if the label edit was cancelled.");

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

    {
        const ::wxTreeEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->IsEditCancelled();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_TreeEvent, sipName_IsEditCancelled, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeEvent_SetToolTip, "SetToolTip(tooltip) -> None\n"
"\n"
"Set the tooltip for the item (valid for EVT_TREE_ITEM_GETTOOLTIP\n"
"events).");

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

    {
        const ::wxString* tooltip;
        int tooltipState = 0;
        ::wxTreeEvent *sipCpp;

        static const char *sipKwdList[] = {
            sipName_tooltip,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxTreeEvent, &sipCpp, sipType_wxString, &tooltip, &tooltipState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetToolTip(*tooltip);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(tooltip), sipType_wxString, tooltipState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_TreeEvent, sipName_SetToolTip, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const ::wxTreeEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_TreeEvent, sipName_Clone, doc_wxTreeEvent_Clone);

    return SIP_NULLPTR;
}


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

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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxTreeEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxTreeEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        ::wxEventType commandType;
        ::wxTreeCtrl* tree;
        const ::wxTreeItemId& itemdef = wxTreeItemId();
        const ::wxTreeItemId* item = &itemdef;

        static const char *sipKwdList[] = {
            sipName_commandType,
            sipName_tree,
            sipName_item,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "iJ8|J9", &commandType, sipType_wxTreeCtrl, &tree, sipType_wxTreeItemId, &item))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxTreeEvent(commandType, tree, *item);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxTreeEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxTreeEvent[] = {
    {sipName_Clone, meth_wxTreeEvent_Clone, METH_VARARGS, doc_wxTreeEvent_Clone},
    {sipName_GetItem, meth_wxTreeEvent_GetItem, METH_VARARGS, doc_wxTreeEvent_GetItem},
    {sipName_GetKeyCode, meth_wxTreeEvent_GetKeyCode, METH_VARARGS, doc_wxTreeEvent_GetKeyCode},
    {sipName_GetKeyEvent, meth_wxTreeEvent_GetKeyEvent, METH_VARARGS, doc_wxTreeEvent_GetKeyEvent},
    {sipName_GetLabel, meth_wxTreeEvent_GetLabel, METH_VARARGS, doc_wxTreeEvent_GetLabel},
    {sipName_GetOldItem, meth_wxTreeEvent_GetOldItem, METH_VARARGS, doc_wxTreeEvent_GetOldItem},
    {sipName_GetPoint, meth_wxTreeEvent_GetPoint, METH_VARARGS, doc_wxTreeEvent_GetPoint},
    {sipName_IsEditCancelled, meth_wxTreeEvent_IsEditCancelled, METH_VARARGS, doc_wxTreeEvent_IsEditCancelled},
    {sipName_SetToolTip, SIP_MLMETH_CAST(meth_wxTreeEvent_SetToolTip), METH_VARARGS|METH_KEYWORDS, doc_wxTreeEvent_SetToolTip}
};

sipVariableDef variables_wxTreeEvent[] = {
    {PropertyVariable, sipName_Point, &methods_wxTreeEvent[6], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_OldItem, &methods_wxTreeEvent[5], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Label, &methods_wxTreeEvent[4], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_KeyEvent, &methods_wxTreeEvent[3], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_KeyCode, &methods_wxTreeEvent[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Item, &methods_wxTreeEvent[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxTreeEvent, "TreeEvent(commandType, tree, item=TreeItemId()) -> None\n"
"\n"
"A tree event holds information about events associated with wxTreeCtrl\n"
"objects.");


sipClassTypeDef sipTypeDef__core_wxTreeEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxTreeEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_TreeEvent,
        {0, 0, 1},
        9, methods_wxTreeEvent,
        0, SIP_NULLPTR,
        6, variables_wxTreeEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxTreeEvent,
    -1,
    -1,
    supers_wxTreeEvent,
    SIP_NULLPTR,
    init_type_wxTreeEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxTreeEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxTreeEvent,
    cast_wxTreeEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxTreeEvent),
};
