/*
 * 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/textctrl.h>

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


class sipwxTextUrlEvent : public  ::wxTextUrlEvent
{
public:
    sipwxTextUrlEvent(int,const  ::wxMouseEvent&,long,long);
    sipwxTextUrlEvent(const  ::wxTextUrlEvent&);
    virtual ~sipwxTextUrlEvent();

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

    char sipPyMethods[2];
};

sipwxTextUrlEvent::sipwxTextUrlEvent(int winid,const  ::wxMouseEvent& evtMouse,long start,long end):  ::wxTextUrlEvent(winid,evtMouse,start,end), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxTextUrlEvent::sipwxTextUrlEvent(const  ::wxTextUrlEvent& event):  ::wxTextUrlEvent(event), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

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

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

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

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

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

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

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

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

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


PyDoc_STRVAR(doc_wxTextUrlEvent_GetMouseEvent, "GetMouseEvent() -> MouseEvent");

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

    {
        const  ::wxTextUrlEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxMouseEvent(sipCpp->GetMouseEvent());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTextUrlEvent_GetURLStart, "GetURLStart() -> long");

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

    {
        const  ::wxTextUrlEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTextUrlEvent, &sipCpp))
        {
            long sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetURLStart();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTextUrlEvent_GetURLEnd, "GetURLEnd() -> long");

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

    {
        const  ::wxTextUrlEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxTextUrlEvent, &sipCpp))
        {
            long sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetURLEnd();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxTextUrlEvent_Clone, "Clone() -> Event\n"
"\n"
"Returns a copy of the event.");

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

    {
        const  ::wxTextUrlEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxTextUrlEvent::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_TextUrlEvent, sipName_Clone, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxCommandEvent)
        return static_cast< ::wxCommandEvent *>(sipCpp);

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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxTextUrlEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxTextUrlEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        int winid;
        const  ::wxMouseEvent* evtMouse;
        long start;
        long end;

        static const char *sipKwdList[] = {
            sipName_winid,
            sipName_evtMouse,
            sipName_start,
            sipName_end,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "iJ9ll", &winid, sipType_wxMouseEvent, &evtMouse, &start, &end))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxTextUrlEvent(winid,*evtMouse,start,end);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxTextUrlEvent* event;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J9", sipType_wxTextUrlEvent, &event))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxTextUrlEvent(*event);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxTextUrlEvent[] = {
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxTextUrlEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTextUrlEvent_Clone)},
    {SIP_MLNAME_CAST(sipName_GetMouseEvent), meth_wxTextUrlEvent_GetMouseEvent, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTextUrlEvent_GetMouseEvent)},
    {SIP_MLNAME_CAST(sipName_GetURLEnd), meth_wxTextUrlEvent_GetURLEnd, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTextUrlEvent_GetURLEnd)},
    {SIP_MLNAME_CAST(sipName_GetURLStart), meth_wxTextUrlEvent_GetURLStart, METH_VARARGS, SIP_MLDOC_CAST(doc_wxTextUrlEvent_GetURLStart)}
};

sipVariableDef variables_wxTextUrlEvent[] = {
    {PropertyVariable, sipName_URLStart, &methods_wxTextUrlEvent[3], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_URLEnd, &methods_wxTextUrlEvent[2], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_MouseEvent, &methods_wxTextUrlEvent[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxTextUrlEvent, "TextUrlEvent(winid, evtMouse, start, end)\n"
"TextUrlEvent(event)");


sipClassTypeDef sipTypeDef__core_wxTextUrlEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxTextUrlEvent,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_TextUrlEvent,
        {0, 0, 1},
        4, methods_wxTextUrlEvent,
        0, SIP_NULLPTR,
        3, variables_wxTextUrlEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxTextUrlEvent,
    -1,
    -1,
    supers_wxTextUrlEvent,
    SIP_NULLPTR,
    init_type_wxTextUrlEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxTextUrlEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxTextUrlEvent,
    cast_wxTextUrlEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
