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

#include "sipAPI_adv.h"

        #include <wx/wizard.h>

        #include <wx/wizard.h>
        #include <wx/event.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxWizardEvent : public  ::wxWizardEvent
{
public:
    sipwxWizardEvent( ::wxEventType,int,bool, ::wxWizardPage*);
    sipwxWizardEvent(const  ::wxWizardEvent&);
    virtual ~sipwxWizardEvent();

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

    char sipPyMethods[2];
};

sipwxWizardEvent::sipwxWizardEvent( ::wxEventType type,int id,bool direction, ::wxWizardPage*page):  ::wxWizardEvent(type,id,direction,page), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

 ::wxEvent* sipwxWizardEvent::Clone() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

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

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

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

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

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

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

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

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


PyDoc_STRVAR(doc_wxWizardEvent_GetDirection, "GetDirection() -> bool\n"
"\n"
"Return the direction in which the page is changing: for\n"
"EVT_WIZARD_PAGE_CHANGING, return true if we're going forward or false\n"
"otherwise and for EVT_WIZARD_PAGE_CHANGED return true if we came from\n"
"the previous page and false if we returned from the next one.");

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

    {
        const  ::wxWizardEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetDirection();
            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_WizardEvent, sipName_GetDirection, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxWizardEvent_GetPage, "GetPage() -> WizardPage\n"
"\n"
"Returns the wxWizardPage which was active when this event was\n"
"generated.");

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

    {
        const  ::wxWizardEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetPage();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromType(sipRes,sipType_wxWizardPage,SIP_NULLPTR);
        }
    }

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

    return SIP_NULLPTR;
}


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

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

    {
        const  ::wxWizardEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxWizardEvent::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_WizardEvent, sipName_Clone, doc_wxWizardEvent_Clone);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_wxWizardEvent(void *, const sipTypeDef *);}
static void *cast_wxWizardEvent(void *sipCppV, const sipTypeDef *targetType)
{
     ::wxWizardEvent *sipCpp = reinterpret_cast< ::wxWizardEvent *>(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_wxWizardEvent(void *, int);}
static void release_wxWizardEvent(void *sipCppV, int sipState)
{
    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxWizardEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxWizardEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
         ::wxEventType type = wxEVT_NULL;
        int id = wxID_ANY;
        bool direction = 1;
         ::wxWizardPage* page = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|iibJ8", &type, &id, &direction, sipType_wxWizardPage, &page))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxWizardEvent(type,id,direction,page);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxWizardEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxWizardEvent[] = {
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxWizardEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWizardEvent_Clone)},
    {SIP_MLNAME_CAST(sipName_GetDirection), meth_wxWizardEvent_GetDirection, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWizardEvent_GetDirection)},
    {SIP_MLNAME_CAST(sipName_GetPage), meth_wxWizardEvent_GetPage, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWizardEvent_GetPage)}
};

sipVariableDef variables_wxWizardEvent[] = {
    {PropertyVariable, sipName_Page, &methods_wxWizardEvent[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Direction, &methods_wxWizardEvent[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxWizardEvent, "WizardEvent(type=wx.wxEVT_NULL, id=wx.ID_ANY, direction=True, page=0)\n"
"\n"
"wxWizardEvent class represents an event generated by the wxWizard:\n"
"this event is first sent to the page itself and, if not processed\n"
"there, goes up the window hierarchy as usual.");


sipClassTypeDef sipTypeDef__adv_wxWizardEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxWizardEvent,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_WizardEvent,
        {0, 0, 1},
        3, methods_wxWizardEvent,
        0, SIP_NULLPTR,
        2, variables_wxWizardEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxWizardEvent,
    -1,
    -1,
    supers_wxWizardEvent,
    SIP_NULLPTR,
    init_type_wxWizardEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxWizardEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxWizardEvent,
    cast_wxWizardEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
