/*
 * 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 sipwxActivateEvent : public ::wxActivateEvent
{
public:
    sipwxActivateEvent(::wxEventType, bool, int, ::wxActivateEvent::Reason);
    sipwxActivateEvent(const ::wxActivateEvent&);
    virtual ~sipwxActivateEvent();

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

    char sipPyMethods[2];
};

sipwxActivateEvent::sipwxActivateEvent(::wxEventType eventType, bool active, int id, ::wxActivateEvent::Reason ActivationReason): ::wxActivateEvent(eventType, active, id, ActivationReason), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxEvent* sipwxActivateEvent::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 ::wxActivateEvent::Clone();

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

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

::wxEventCategory sipwxActivateEvent::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 ::wxActivateEvent::GetEventCategory();

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

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


PyDoc_STRVAR(doc_wxActivateEvent_GetActive, "GetActive() -> bool\n"
"\n"
"Returns true if the application or window is being activated, false\n"
"otherwise.");

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

    {
        const ::wxActivateEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetActive();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_ActivateEvent, sipName_GetActive, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxActivateEvent_GetActivationReason, "GetActivationReason() -> Reason\n"
"\n"
"Allows checking if the window was activated by clicking it with the\n"
"mouse or in some other way.");

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

    {
        const ::wxActivateEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxActivateEvent, &sipCpp))
        {
            ::wxActivateEvent::Reason sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetActivationReason();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_ActivateEvent, sipName_GetActivationReason, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const ::wxActivateEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_ActivateEvent, sipName_Clone, doc_wxActivateEvent_Clone);

    return SIP_NULLPTR;
}


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

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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxActivateEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxActivateEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        ::wxEventType eventType = wxEVT_NULL;
        bool active = 1;
        int id = 0;
        ::wxActivateEvent::Reason ActivationReason = ::wxActivateEvent::Reason_Unknown;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|ibiE", &eventType, &active, &id, sipType_wxActivateEvent_Reason, &ActivationReason))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxActivateEvent(eventType, active, id, ActivationReason);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxActivateEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxActivateEvent[] = {
    {sipName_Clone, meth_wxActivateEvent_Clone, METH_VARARGS, doc_wxActivateEvent_Clone},
    {sipName_GetActivationReason, meth_wxActivateEvent_GetActivationReason, METH_VARARGS, doc_wxActivateEvent_GetActivationReason},
    {sipName_GetActive, meth_wxActivateEvent_GetActive, METH_VARARGS, doc_wxActivateEvent_GetActive}
};

static sipEnumMemberDef enummembers_wxActivateEvent[] = {
    {sipName_Reason_Mouse, static_cast<int>(::wxActivateEvent::Reason_Mouse), 10},
    {sipName_Reason_Unknown, static_cast<int>(::wxActivateEvent::Reason_Unknown), 10},
};

sipVariableDef variables_wxActivateEvent[] = {
    {PropertyVariable, sipName_Active, &methods_wxActivateEvent[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxActivateEvent, "ActivateEvent(eventType=wxEVT_NULL, active=True, id=0, ActivationReason=Reason_Unknown) -> None\n"
"\n"
"An activate event is sent when a window or application is being\n"
"activated or deactivated.");


sipClassTypeDef sipTypeDef__core_wxActivateEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxActivateEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_ActivateEvent,
        {0, 0, 1},
        3, methods_wxActivateEvent,
        2, enummembers_wxActivateEvent,
        1, variables_wxActivateEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxActivateEvent,
    -1,
    -1,
    supers_wxActivateEvent,
    SIP_NULLPTR,
    init_type_wxActivateEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxActivateEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxActivateEvent,
    cast_wxActivateEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxActivateEvent),
};
