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

#include "sipAPI_core.h"

        #include <wx/event.h>

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


class sipwxSetCursorEvent : public  ::wxSetCursorEvent
{
public:
    sipwxSetCursorEvent( ::wxCoord, ::wxCoord);
    sipwxSetCursorEvent(const  ::wxSetCursorEvent&);
    virtual ~sipwxSetCursorEvent();

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

    char sipPyMethods[2];
};

sipwxSetCursorEvent::sipwxSetCursorEvent( ::wxCoord x, ::wxCoord y):  ::wxSetCursorEvent(x,y), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

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

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

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

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

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

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

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

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

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

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


PyDoc_STRVAR(doc_wxSetCursorEvent_GetCursor, "GetCursor() -> Cursor\n"
"\n"
"Returns a reference to the cursor specified by this event.");

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

    {
        const  ::wxSetCursorEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxCursor(sipCpp->GetCursor());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_SetCursorEvent, sipName_GetCursor, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxSetCursorEvent_GetX, "GetX() -> Coord\n"
"\n"
"Returns the X coordinate of the mouse in client coordinates.");

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

    {
        const  ::wxSetCursorEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxSetCursorEvent, &sipCpp))
        {
             ::wxCoord sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetX();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return SIPLong_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_SetCursorEvent, sipName_GetX, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxSetCursorEvent_GetY, "GetY() -> Coord\n"
"\n"
"Returns the Y coordinate of the mouse in client coordinates.");

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

    {
        const  ::wxSetCursorEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxSetCursorEvent, &sipCpp))
        {
             ::wxCoord sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetY();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return SIPLong_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_SetCursorEvent, sipName_GetY, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxSetCursorEvent_HasCursor, "HasCursor() -> bool\n"
"\n"
"Returns true if the cursor specified by this event is a valid cursor.");

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

    {
        const  ::wxSetCursorEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->HasCursor();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_SetCursorEvent, sipName_HasCursor, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxSetCursorEvent_SetCursor, "SetCursor(cursor)\n"
"\n"
"Sets the cursor associated with this event.");

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

    {
        const  ::wxCursor* cursor;
         ::wxSetCursorEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxSetCursorEvent, &sipCpp, sipType_wxCursor, &cursor))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetCursor(*cursor);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_SetCursorEvent, sipName_SetCursor, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const  ::wxSetCursorEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_SetCursorEvent, sipName_Clone, doc_wxSetCursorEvent_Clone);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_wxSetCursorEvent(void *, const sipTypeDef *);}
static void *cast_wxSetCursorEvent(void *sipCppV, const sipTypeDef *targetType)
{
     ::wxSetCursorEvent *sipCpp = reinterpret_cast< ::wxSetCursorEvent *>(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_wxSetCursorEvent(void *, int);}
static void release_wxSetCursorEvent(void *sipCppV, int sipState)
{
    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxSetCursorEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxSetCursorEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
         ::wxCoord x = 0;
         ::wxCoord y = 0;

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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxSetCursorEvent(x,y);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxSetCursorEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxSetCursorEvent[] = {
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxSetCursorEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxSetCursorEvent_Clone)},
    {SIP_MLNAME_CAST(sipName_GetCursor), meth_wxSetCursorEvent_GetCursor, METH_VARARGS, SIP_MLDOC_CAST(doc_wxSetCursorEvent_GetCursor)},
    {SIP_MLNAME_CAST(sipName_GetX), meth_wxSetCursorEvent_GetX, METH_VARARGS, SIP_MLDOC_CAST(doc_wxSetCursorEvent_GetX)},
    {SIP_MLNAME_CAST(sipName_GetY), meth_wxSetCursorEvent_GetY, METH_VARARGS, SIP_MLDOC_CAST(doc_wxSetCursorEvent_GetY)},
    {SIP_MLNAME_CAST(sipName_HasCursor), meth_wxSetCursorEvent_HasCursor, METH_VARARGS, SIP_MLDOC_CAST(doc_wxSetCursorEvent_HasCursor)},
    {SIP_MLNAME_CAST(sipName_SetCursor), SIP_MLMETH_CAST(meth_wxSetCursorEvent_SetCursor), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxSetCursorEvent_SetCursor)}
};

sipVariableDef variables_wxSetCursorEvent[] = {
    {PropertyVariable, sipName_Y, &methods_wxSetCursorEvent[3], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_X, &methods_wxSetCursorEvent[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Cursor, &methods_wxSetCursorEvent[1], &methods_wxSetCursorEvent[5], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxSetCursorEvent, "SetCursorEvent(x=0, y=0)\n"
"\n"
"A wxSetCursorEvent is generated from wxWindow when the mouse cursor is\n"
"about to be set as a result of mouse motion.");


sipClassTypeDef sipTypeDef__core_wxSetCursorEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxSetCursorEvent,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_SetCursorEvent,
        {0, 0, 1},
        6, methods_wxSetCursorEvent,
        0, SIP_NULLPTR,
        3, variables_wxSetCursorEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxSetCursorEvent,
    -1,
    -1,
    supers_wxSetCursorEvent,
    SIP_NULLPTR,
    init_type_wxSetCursorEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxSetCursorEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxSetCursorEvent,
    cast_wxSetCursorEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
