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

#include "sipAPI_core.h"

        #include <wx/event.h>

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


class sipwxNotifyEvent : public  ::wxNotifyEvent
{
public:
    sipwxNotifyEvent( ::wxEventType,int);
    sipwxNotifyEvent(const  ::wxNotifyEvent&);
    virtual ~sipwxNotifyEvent();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
     ::wxEventCategory GetEventCategory() const SIP_OVERRIDE;
     ::wxEvent* Clone() const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxNotifyEvent(const sipwxNotifyEvent &);
    sipwxNotifyEvent &operator = (const sipwxNotifyEvent &);

    char sipPyMethods[2];
};

sipwxNotifyEvent::sipwxNotifyEvent( ::wxEventType eventType,int id):  ::wxNotifyEvent(eventType,id), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

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

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

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

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

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

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

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

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

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

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


PyDoc_STRVAR(doc_wxNotifyEvent_Allow, "Allow()\n"
"\n"
"This is the opposite of Veto(): it explicitly allows the event to be\n"
"processed.");

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

    {
         ::wxNotifyEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxNotifyEvent, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Allow();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_NotifyEvent, sipName_Allow, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxNotifyEvent_IsAllowed, "IsAllowed() -> bool\n"
"\n"
"Returns true if the change is allowed (Veto() hasn't been called) or\n"
"false otherwise (if it was).");

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

    {
        const  ::wxNotifyEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->IsAllowed();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_NotifyEvent, sipName_IsAllowed, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxNotifyEvent_Veto, "Veto()\n"
"\n"
"Prevents the change announced by this event from happening.");

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

    {
         ::wxNotifyEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxNotifyEvent, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Veto();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_NotifyEvent, sipName_Veto, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const  ::wxNotifyEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_NotifyEvent, sipName_Clone, doc_wxNotifyEvent_Clone);

    return SIP_NULLPTR;
}


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

    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_wxNotifyEvent(void *, int);}
static void release_wxNotifyEvent(void *sipCppV, int sipState)
{
    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxNotifyEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxNotifyEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
         ::wxEventType eventType = wxEVT_NULL;
        int id = 0;

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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxNotifyEvent(eventType,id);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxNotifyEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxNotifyEvent[] = {
    {SIP_MLNAME_CAST(sipName_Allow), meth_wxNotifyEvent_Allow, METH_VARARGS, SIP_MLDOC_CAST(doc_wxNotifyEvent_Allow)},
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxNotifyEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxNotifyEvent_Clone)},
    {SIP_MLNAME_CAST(sipName_IsAllowed), meth_wxNotifyEvent_IsAllowed, METH_VARARGS, SIP_MLDOC_CAST(doc_wxNotifyEvent_IsAllowed)},
    {SIP_MLNAME_CAST(sipName_Veto), meth_wxNotifyEvent_Veto, METH_VARARGS, SIP_MLDOC_CAST(doc_wxNotifyEvent_Veto)}
};

PyDoc_STRVAR(doc_wxNotifyEvent, "NotifyEvent(eventType=wxEVT_NULL, id=0)\n"
"\n"
"This class is not used by the event handlers by itself, but is a base\n"
"class for other event classes (such as wxBookCtrlEvent).");


sipClassTypeDef sipTypeDef__core_wxNotifyEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxNotifyEvent,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_NotifyEvent,
        {0, 0, 1},
        4, methods_wxNotifyEvent,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxNotifyEvent,
    -1,
    -1,
    supers_wxNotifyEvent,
    SIP_NULLPTR,
    init_type_wxNotifyEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxNotifyEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxNotifyEvent,
    cast_wxNotifyEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
