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


class sipwxWindowModalDialogEvent : public ::wxWindowModalDialogEvent
{
public:
    sipwxWindowModalDialogEvent(::wxEventType, int);
    sipwxWindowModalDialogEvent(const ::wxWindowModalDialogEvent&);
    virtual ~sipwxWindowModalDialogEvent();

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

    char sipPyMethods[2];
};

sipwxWindowModalDialogEvent::sipwxWindowModalDialogEvent(::wxEventType commandType, int id): ::wxWindowModalDialogEvent(commandType, id), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

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

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

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

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

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

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

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

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

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

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


PyDoc_STRVAR(doc_wxWindowModalDialogEvent_GetDialog, "GetDialog() -> Dialog\n"
"\n"
"Return the corresponding dialog.");

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

    {
        const ::wxWindowModalDialogEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetDialog();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_WindowModalDialogEvent, sipName_GetDialog, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxWindowModalDialogEvent_GetReturnCode, "GetReturnCode() -> int\n"
"\n"
"Return the dialog's return code.");

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

    {
        const ::wxWindowModalDialogEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetReturnCode();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_WindowModalDialogEvent, sipName_GetReturnCode, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxWindowModalDialogEvent_Clone, "Clone() -> Event\n"
"\n"
"Clone the event.");

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

    {
        const ::wxWindowModalDialogEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_WindowModalDialogEvent, sipName_Clone, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxWindowModalDialogEvent)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxWindowModalDialogEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxWindowModalDialogEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

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

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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxWindowModalDialogEvent(commandType, id);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxWindowModalDialogEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxWindowModalDialogEvent[] = {
    {sipName_Clone, meth_wxWindowModalDialogEvent_Clone, METH_VARARGS, doc_wxWindowModalDialogEvent_Clone},
    {sipName_GetDialog, meth_wxWindowModalDialogEvent_GetDialog, METH_VARARGS, doc_wxWindowModalDialogEvent_GetDialog},
    {sipName_GetReturnCode, meth_wxWindowModalDialogEvent_GetReturnCode, METH_VARARGS, doc_wxWindowModalDialogEvent_GetReturnCode}
};

sipVariableDef variables_wxWindowModalDialogEvent[] = {
    {PropertyVariable, sipName_ReturnCode, &methods_wxWindowModalDialogEvent[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Dialog, &methods_wxWindowModalDialogEvent[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxWindowModalDialogEvent, "WindowModalDialogEvent(commandType=wxEVT_NULL, id=0) -> None\n"
"\n"
"Event sent by wxDialog::ShowWindowModal() when the dialog closes.");


sipClassTypeDef sipTypeDef__core_wxWindowModalDialogEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxWindowModalDialogEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_WindowModalDialogEvent,
        {0, 0, 1},
        3, methods_wxWindowModalDialogEvent,
        0, SIP_NULLPTR,
        2, variables_wxWindowModalDialogEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxWindowModalDialogEvent,
    -1,
    -1,
    supers_wxWindowModalDialogEvent,
    SIP_NULLPTR,
    init_type_wxWindowModalDialogEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxWindowModalDialogEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxWindowModalDialogEvent,
    cast_wxWindowModalDialogEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxWindowModalDialogEvent),
};
