/*
 * 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 sipwxMouseCaptureLostEvent : public  ::wxMouseCaptureLostEvent
{
public:
    sipwxMouseCaptureLostEvent( ::wxWindowID);
    sipwxMouseCaptureLostEvent(const  ::wxMouseCaptureLostEvent&);
    virtual ~sipwxMouseCaptureLostEvent();

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

    char sipPyMethods[2];
};

sipwxMouseCaptureLostEvent::sipwxMouseCaptureLostEvent( ::wxWindowID windowId):  ::wxMouseCaptureLostEvent(windowId), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

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

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

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

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

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

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

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

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

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

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


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

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

    {
        const  ::wxMouseCaptureLostEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_MouseCaptureLostEvent, sipName_Clone, doc_wxMouseCaptureLostEvent_Clone);

    return SIP_NULLPTR;
}


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

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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxMouseCaptureLostEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxMouseCaptureLostEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
         ::wxWindowID windowId = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|i", &windowId))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxMouseCaptureLostEvent(windowId);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxMouseCaptureLostEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxMouseCaptureLostEvent[] = {
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxMouseCaptureLostEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxMouseCaptureLostEvent_Clone)}
};

PyDoc_STRVAR(doc_wxMouseCaptureLostEvent, "MouseCaptureLostEvent(windowId=0)\n"
"\n"
"A mouse capture lost event is sent to a window that had obtained mouse\n"
"capture, which was subsequently lost due to an \"external\" event (for\n"
"example, when a dialog box is shown or if another application captures\n"
"the mouse).");


sipClassTypeDef sipTypeDef__core_wxMouseCaptureLostEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxMouseCaptureLostEvent,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_MouseCaptureLostEvent,
        {0, 0, 1},
        1, methods_wxMouseCaptureLostEvent,
        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_wxMouseCaptureLostEvent,
    -1,
    -1,
    supers_wxMouseCaptureLostEvent,
    SIP_NULLPTR,
    init_type_wxMouseCaptureLostEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxMouseCaptureLostEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxMouseCaptureLostEvent,
    cast_wxMouseCaptureLostEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
