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

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

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

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

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

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

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

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

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


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

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

    /* Raise an exception if the arguments couldn't be parsed. */
    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 SIPLong_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    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);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeEvent_GetLabel, "GetLabel() -> String\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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    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_ITEM_CHANGING and\n"
"EVT_TREE_ITEM_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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    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);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTreeEvent_SetToolTip, "SetToolTip(tooltip)\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;
        }
    }

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

    return SIP_NULLPTR;
}


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

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

    /* Raise an exception if the arguments couldn't be parsed. */
    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_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_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[] = {{356, 255, 1}};


static PyMethodDef methods_wxTreeEvent[] = {
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxTreeEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTreeEvent_Clone)},
    {SIP_MLNAME_CAST(sipName_GetItem), meth_wxTreeEvent_GetItem, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTreeEvent_GetItem)},
    {SIP_MLNAME_CAST(sipName_GetKeyCode), meth_wxTreeEvent_GetKeyCode, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTreeEvent_GetKeyCode)},
    {SIP_MLNAME_CAST(sipName_GetKeyEvent), meth_wxTreeEvent_GetKeyEvent, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTreeEvent_GetKeyEvent)},
    {SIP_MLNAME_CAST(sipName_GetLabel), meth_wxTreeEvent_GetLabel, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTreeEvent_GetLabel)},
    {SIP_MLNAME_CAST(sipName_GetOldItem), meth_wxTreeEvent_GetOldItem, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTreeEvent_GetOldItem)},
    {SIP_MLNAME_CAST(sipName_GetPoint), meth_wxTreeEvent_GetPoint, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTreeEvent_GetPoint)},
    {SIP_MLNAME_CAST(sipName_IsEditCancelled), meth_wxTreeEvent_IsEditCancelled, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTreeEvent_IsEditCancelled)},
    {SIP_MLNAME_CAST(sipName_SetToolTip), SIP_MLMETH_CAST(meth_wxTreeEvent_SetToolTip), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(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())\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,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxTreeEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxTreeEvent,
    cast_wxTreeEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
