/*
 * 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 sipwxScrollEvent : public  ::wxScrollEvent
{
public:
    sipwxScrollEvent( ::wxEventType,int,int,int);
    sipwxScrollEvent(const  ::wxScrollEvent&);
    virtual ~sipwxScrollEvent();

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

    char sipPyMethods[2];
};

sipwxScrollEvent::sipwxScrollEvent( ::wxEventType commandType,int id,int pos,int orientation):  ::wxScrollEvent(commandType,id,pos,orientation), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

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

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

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

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

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

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

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

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

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

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


PyDoc_STRVAR(doc_wxScrollEvent_GetOrientation, "GetOrientation() -> int\n"
"\n"
"Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of\n"
"the scrollbar.");

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

    {
        const  ::wxScrollEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetOrientation();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return SIPLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_ScrollEvent, sipName_GetOrientation, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxScrollEvent_GetPosition, "GetPosition() -> int\n"
"\n"
"Returns the position of the scrollbar.");

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

    {
        const  ::wxScrollEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetPosition();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return SIPLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_ScrollEvent, sipName_GetPosition, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxScrollEvent_SetOrientation, "SetOrientation(orient)");

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

    {
        int orient;
         ::wxScrollEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxScrollEvent, &sipCpp, &orient))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetOrientation(orient);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_ScrollEvent, sipName_SetOrientation, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxScrollEvent_SetPosition, "SetPosition(pos)");

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

    {
        int pos;
         ::wxScrollEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxScrollEvent, &sipCpp, &pos))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetPosition(pos);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_ScrollEvent, sipName_SetPosition, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const  ::wxScrollEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_ScrollEvent, sipName_Clone, doc_wxScrollEvent_Clone);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxScrollEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxScrollEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

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

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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxScrollEvent(commandType,id,pos,orientation);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxScrollEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxScrollEvent[] = {
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxScrollEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxScrollEvent_Clone)},
    {SIP_MLNAME_CAST(sipName_GetOrientation), meth_wxScrollEvent_GetOrientation, METH_VARARGS, SIP_MLDOC_CAST(doc_wxScrollEvent_GetOrientation)},
    {SIP_MLNAME_CAST(sipName_GetPosition), meth_wxScrollEvent_GetPosition, METH_VARARGS, SIP_MLDOC_CAST(doc_wxScrollEvent_GetPosition)},
    {SIP_MLNAME_CAST(sipName_SetOrientation), SIP_MLMETH_CAST(meth_wxScrollEvent_SetOrientation), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxScrollEvent_SetOrientation)},
    {SIP_MLNAME_CAST(sipName_SetPosition), SIP_MLMETH_CAST(meth_wxScrollEvent_SetPosition), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxScrollEvent_SetPosition)}
};

sipVariableDef variables_wxScrollEvent[] = {
    {PropertyVariable, sipName_Position, &methods_wxScrollEvent[2], &methods_wxScrollEvent[4], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Orientation, &methods_wxScrollEvent[1], &methods_wxScrollEvent[3], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxScrollEvent, "ScrollEvent(commandType=wxEVT_NULL, id=0, pos=0, orientation=0)\n"
"\n"
"A scroll event holds information about events sent from stand-alone\n"
"scrollbars (see wxScrollBar) and sliders (see wxSlider).");


sipClassTypeDef sipTypeDef__core_wxScrollEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxScrollEvent,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_ScrollEvent,
        {0, 0, 1},
        5, methods_wxScrollEvent,
        0, SIP_NULLPTR,
        2, variables_wxScrollEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxScrollEvent,
    -1,
    -1,
    supers_wxScrollEvent,
    SIP_NULLPTR,
    init_type_wxScrollEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxScrollEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxScrollEvent,
    cast_wxScrollEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
