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


class sipwxHelpEvent : public ::wxHelpEvent
{
public:
    sipwxHelpEvent(::wxEventType, ::wxWindowID, const ::wxPoint&, ::wxHelpEvent::Origin);
    sipwxHelpEvent(const ::wxHelpEvent&);
    virtual ~sipwxHelpEvent();

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

    char sipPyMethods[2];
};

sipwxHelpEvent::sipwxHelpEvent(::wxEventType type, ::wxWindowID winid, const ::wxPoint& pt, ::wxHelpEvent::Origin origin): ::wxHelpEvent(type, winid, pt, origin), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxEventCategory sipwxHelpEvent::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 ::wxHelpEvent::GetEventCategory();

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

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

::wxEvent* sipwxHelpEvent::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 ::wxHelpEvent::Clone();

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

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


PyDoc_STRVAR(doc_wxHelpEvent_GetOrigin, "GetOrigin() -> HelpEvent.Origin\n"
"\n"
"Returns the origin of the help event which is one of the\n"
"wxHelpEvent::Origin values.");

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

    {
        const ::wxHelpEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxHelpEvent, &sipCpp))
        {
            ::wxHelpEvent::Origin sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetOrigin();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_HelpEvent, sipName_GetOrigin, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxHelpEvent_GetPosition, "GetPosition() -> Point\n"
"\n"
"Returns the left-click position of the mouse, in screen coordinates.");

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

    {
        const ::wxHelpEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxPoint(sipCpp->GetPosition());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_HelpEvent, sipName_GetPosition, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxHelpEvent_SetOrigin, "SetOrigin(origin) -> None\n"
"\n"
"Set the help event origin, only used internally by wxWidgets normally.");

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

    {
        ::wxHelpEvent::Origin origin;
        ::wxHelpEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BE", &sipSelf, sipType_wxHelpEvent, &sipCpp, sipType_wxHelpEvent_Origin, &origin))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetOrigin(origin);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_HelpEvent, sipName_SetOrigin, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxHelpEvent_SetPosition, "SetPosition(pt) -> None\n"
"\n"
"Sets the left-click position of the mouse, in screen coordinates.");

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

    {
        const ::wxPoint* pt;
        int ptState = 0;
        ::wxHelpEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxHelpEvent, &sipCpp, sipType_wxPoint, &pt, &ptState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetPosition(*pt);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxPoint *>(pt), sipType_wxPoint, ptState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_HelpEvent, sipName_SetPosition, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const ::wxHelpEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_HelpEvent, sipName_Clone, doc_wxHelpEvent_Clone);

    return SIP_NULLPTR;
}


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

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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxHelpEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxHelpEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        ::wxEventType type = wxEVT_NULL;
        ::wxWindowID winid = 0;
        const ::wxPoint& ptdef = wxDefaultPosition;
        const ::wxPoint* pt = &ptdef;
        int ptState = 0;
        ::wxHelpEvent::Origin origin = ::wxHelpEvent::Origin_Unknown;

        static const char *sipKwdList[] = {
            sipName_type,
            sipName_winid,
            sipName_pt,
            sipName_origin,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|iiJ1E", &type, &winid, sipType_wxPoint, &pt, &ptState, sipType_wxHelpEvent_Origin, &origin))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxHelpEvent(type, winid, *pt, origin);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxPoint *>(pt), sipType_wxPoint, ptState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxHelpEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxHelpEvent[] = {
    {sipName_Clone, meth_wxHelpEvent_Clone, METH_VARARGS, doc_wxHelpEvent_Clone},
    {sipName_GetOrigin, meth_wxHelpEvent_GetOrigin, METH_VARARGS, doc_wxHelpEvent_GetOrigin},
    {sipName_GetPosition, meth_wxHelpEvent_GetPosition, METH_VARARGS, doc_wxHelpEvent_GetPosition},
    {sipName_SetOrigin, SIP_MLMETH_CAST(meth_wxHelpEvent_SetOrigin), METH_VARARGS|METH_KEYWORDS, doc_wxHelpEvent_SetOrigin},
    {sipName_SetPosition, SIP_MLMETH_CAST(meth_wxHelpEvent_SetPosition), METH_VARARGS|METH_KEYWORDS, doc_wxHelpEvent_SetPosition}
};

static sipEnumMemberDef enummembers_wxHelpEvent[] = {
    {sipName_Origin_HelpButton, static_cast<int>(::wxHelpEvent::Origin_HelpButton), 266},
    {sipName_Origin_Keyboard, static_cast<int>(::wxHelpEvent::Origin_Keyboard), 266},
    {sipName_Origin_Unknown, static_cast<int>(::wxHelpEvent::Origin_Unknown), 266},
};

sipVariableDef variables_wxHelpEvent[] = {
    {PropertyVariable, sipName_Position, &methods_wxHelpEvent[2], &methods_wxHelpEvent[4], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxHelpEvent, "HelpEvent(type=wxEVT_NULL, winid=0, pt=DefaultPosition, origin=Origin_Unknown) -> None\n"
"\n"
"A help event is sent when the user has requested context-sensitive\n"
"help.");


sipClassTypeDef sipTypeDef__core_wxHelpEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxHelpEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_HelpEvent,
        {0, 0, 1},
        5, methods_wxHelpEvent,
        3, enummembers_wxHelpEvent,
        1, variables_wxHelpEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxHelpEvent,
    -1,
    -1,
    supers_wxHelpEvent,
    SIP_NULLPTR,
    init_type_wxHelpEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxHelpEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxHelpEvent,
    cast_wxHelpEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxHelpEvent),
};
