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


class sipwxIdleEvent : public ::wxIdleEvent
{
public:
    sipwxIdleEvent();
    sipwxIdleEvent(const ::wxIdleEvent&);
    virtual ~sipwxIdleEvent();

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

    char sipPyMethods[2];
};

sipwxIdleEvent::sipwxIdleEvent(): ::wxIdleEvent(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxEvent* sipwxIdleEvent::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 ::wxIdleEvent::Clone();

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

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

::wxEventCategory sipwxIdleEvent::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 ::wxIdleEvent::GetEventCategory();

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

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


PyDoc_STRVAR(doc_wxIdleEvent_MoreRequested, "MoreRequested() -> bool\n"
"\n"
"Returns true if the OnIdle function processing this event requested\n"
"more processing time.");

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

    {
        const ::wxIdleEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->MoreRequested();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_IdleEvent, sipName_MoreRequested, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxIdleEvent_RequestMore, "RequestMore(needMore=True) -> None\n"
"\n"
"Tells wxWidgets that more processing is required.");

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

    {
        bool needMore = 1;
        ::wxIdleEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|b", &sipSelf, sipType_wxIdleEvent, &sipCpp, &needMore))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->RequestMore(needMore);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_IdleEvent, sipName_RequestMore, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxIdleEvent_GetMode, "GetMode() -> IdleMode\n"
"\n"
"Static function returning a value specifying how wxWidgets will send\n"
"idle events: to all windows, or only to those which specify that they\n"
"will process the events.");

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

    {
        if (sipParseArgs(&sipParseErr, sipArgs, ""))
        {
            ::wxIdleMode sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxIdleEvent::GetMode();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_wxIdleMode);
        }
    }

    sipNoMethod(sipParseErr, sipName_IdleEvent, sipName_GetMode, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxIdleEvent_SetMode, "SetMode(mode) -> None\n"
"\n"
"Static function for specifying how wxWidgets will send idle events: to\n"
"all windows, or only to those which specify that they will process the\n"
"events.");

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

    {
        ::wxIdleMode mode;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "E", sipType_wxIdleMode, &mode))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            ::wxIdleEvent::SetMode(mode);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_IdleEvent, sipName_SetMode, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const ::wxIdleEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_IdleEvent, sipName_Clone, doc_wxIdleEvent_Clone);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxIdleEvent)
        return sipCppV;

    sipCppV = ((const sipClassTypeDef *)sipType_wxEvent)->ctd_cast(static_cast< ::wxEvent *>(sipCpp), targetType);
    if (sipCppV)
        return sipCppV;

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_wxIdleEvent(void *, int);}
static void release_wxIdleEvent(void *sipCppV, int sipState)
{
    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxIdleEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxIdleEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxIdleEvent();
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxIdleEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxIdleEvent[] = {
    {sipName_Clone, meth_wxIdleEvent_Clone, METH_VARARGS, doc_wxIdleEvent_Clone},
    {sipName_GetMode, meth_wxIdleEvent_GetMode, METH_VARARGS, doc_wxIdleEvent_GetMode},
    {sipName_MoreRequested, meth_wxIdleEvent_MoreRequested, METH_VARARGS, doc_wxIdleEvent_MoreRequested},
    {sipName_RequestMore, SIP_MLMETH_CAST(meth_wxIdleEvent_RequestMore), METH_VARARGS|METH_KEYWORDS, doc_wxIdleEvent_RequestMore},
    {sipName_SetMode, SIP_MLMETH_CAST(meth_wxIdleEvent_SetMode), METH_VARARGS|METH_KEYWORDS, doc_wxIdleEvent_SetMode}
};

PyDoc_STRVAR(doc_wxIdleEvent, "IdleEvent() -> None\n"
"\n"
"This class is used for idle events, which are generated when the\n"
"system becomes idle.");


sipClassTypeDef sipTypeDef__core_wxIdleEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxIdleEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_IdleEvent,
        {0, 0, 1},
        5, methods_wxIdleEvent,
        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_wxIdleEvent,
    -1,
    -1,
    supers_wxIdleEvent,
    SIP_NULLPTR,
    init_type_wxIdleEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxIdleEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxIdleEvent,
    cast_wxIdleEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxIdleEvent),
};
