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


class sipwxBookCtrlEvent : public ::wxBookCtrlEvent
{
public:
    sipwxBookCtrlEvent(::wxEventType, int, int, int);
    sipwxBookCtrlEvent(const ::wxBookCtrlEvent&);
    virtual ~sipwxBookCtrlEvent();

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

    char sipPyMethods[2];
};

sipwxBookCtrlEvent::sipwxBookCtrlEvent(::wxEventType eventType, int id, int sel, int oldSel): ::wxBookCtrlEvent(eventType, id, sel, oldSel), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxEvent* sipwxBookCtrlEvent::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 ::wxBookCtrlEvent::Clone();

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

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

::wxEventCategory sipwxBookCtrlEvent::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 ::wxBookCtrlEvent::GetEventCategory();

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

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


PyDoc_STRVAR(doc_wxBookCtrlEvent_GetOldSelection, "GetOldSelection() -> int\n"
"\n"
"Returns the page that was selected before the change, wxNOT_FOUND if\n"
"none was selected.");

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

    {
        const ::wxBookCtrlEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetOldSelection();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_BookCtrlEvent, sipName_GetOldSelection, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxBookCtrlEvent_GetSelection, "GetSelection() -> int\n"
"\n"
"Returns the currently selected page, or wxNOT_FOUND if none was\n"
"selected.");

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

    {
        const ::wxBookCtrlEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetSelection();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_BookCtrlEvent, sipName_GetSelection, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxBookCtrlEvent_SetOldSelection, "SetOldSelection(page) -> None\n"
"\n"
"Sets the id of the page selected before the change.");

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

    {
        int page;
        ::wxBookCtrlEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxBookCtrlEvent, &sipCpp, &page))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetOldSelection(page);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_BookCtrlEvent, sipName_SetOldSelection, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxBookCtrlEvent_SetSelection, "SetSelection(page) -> None\n"
"\n"
"Sets the selection member variable.");

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

    {
        int page;
        ::wxBookCtrlEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxBookCtrlEvent, &sipCpp, &page))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetSelection(page);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_BookCtrlEvent, sipName_SetSelection, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxBookCtrlEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxBookCtrlEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        ::wxEventType eventType = wxEVT_NULL;
        int id = 0;
        int sel = wxNOT_FOUND;
        int oldSel = wxNOT_FOUND;

        static const char *sipKwdList[] = {
            sipName_eventType,
            sipName_id,
            sipName_sel,
            sipName_oldSel,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|iiii", &eventType, &id, &sel, &oldSel))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxBookCtrlEvent(eventType, id, sel, oldSel);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxBookCtrlEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxBookCtrlEvent[] = {
    {sipName_GetOldSelection, meth_wxBookCtrlEvent_GetOldSelection, METH_VARARGS, doc_wxBookCtrlEvent_GetOldSelection},
    {sipName_GetSelection, meth_wxBookCtrlEvent_GetSelection, METH_VARARGS, doc_wxBookCtrlEvent_GetSelection},
    {sipName_SetOldSelection, SIP_MLMETH_CAST(meth_wxBookCtrlEvent_SetOldSelection), METH_VARARGS|METH_KEYWORDS, doc_wxBookCtrlEvent_SetOldSelection},
    {sipName_SetSelection, SIP_MLMETH_CAST(meth_wxBookCtrlEvent_SetSelection), METH_VARARGS|METH_KEYWORDS, doc_wxBookCtrlEvent_SetSelection}
};

sipVariableDef variables_wxBookCtrlEvent[] = {
    {PropertyVariable, sipName_Selection, &methods_wxBookCtrlEvent[1], &methods_wxBookCtrlEvent[3], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_OldSelection, &methods_wxBookCtrlEvent[0], &methods_wxBookCtrlEvent[2], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxBookCtrlEvent, "BookCtrlEvent(eventType=wxEVT_NULL, id=0, sel=NOT_FOUND, oldSel=NOT_FOUND) -> None\n"
"\n"
"This class represents the events generated by book controls\n"
"(wxNotebook, wxListbook, wxChoicebook, wxTreebook, wxAuiNotebook).");


sipClassTypeDef sipTypeDef__core_wxBookCtrlEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxBookCtrlEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_BookCtrlEvent,
        {0, 0, 1},
        4, methods_wxBookCtrlEvent,
        0, SIP_NULLPTR,
        2, variables_wxBookCtrlEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxBookCtrlEvent,
    -1,
    -1,
    supers_wxBookCtrlEvent,
    SIP_NULLPTR,
    init_type_wxBookCtrlEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxBookCtrlEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxBookCtrlEvent,
    cast_wxBookCtrlEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxBookCtrlEvent),
};
