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

#include "sipAPI_ribbon.h"
        #include <wx/ribbon/bar.h>
        #include <wx/ribbon/page.h>
        #include <wx/event.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxRibbonBarEvent : public ::wxRibbonBarEvent
{
public:
    sipwxRibbonBarEvent(::wxEventType, int, ::wxRibbonPage*);
    sipwxRibbonBarEvent(const ::wxRibbonBarEvent&);
    virtual ~sipwxRibbonBarEvent();

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

    char sipPyMethods[2];
};

sipwxRibbonBarEvent::sipwxRibbonBarEvent(::wxEventType command_type, int win_id, ::wxRibbonPage*page): ::wxRibbonBarEvent(command_type, win_id, page), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

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

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

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

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

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

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

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

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

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

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


PyDoc_STRVAR(doc_wxRibbonBarEvent_GetPage, "GetPage() -> RibbonPage\n"
"\n"
"Returns the page being changed to, or being clicked on.");

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

    {
        ::wxRibbonBarEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetPage();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromType(sipRes, sipType_wxRibbonPage, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_RibbonBarEvent, sipName_GetPage, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRibbonBarEvent_SetPage, "SetPage(page) -> None\n"
"\n"
"Sets the page relating to this event.");

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

    {
        ::wxRibbonPage* page;
        ::wxRibbonBarEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxRibbonBarEvent, &sipCpp, sipType_wxRibbonPage, &page))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetPage(page);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_RibbonBarEvent, sipName_SetPage, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const ::wxRibbonBarEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_RibbonBarEvent, sipName_Clone, doc_wxRibbonBarEvent_Clone);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxRibbonBarEvent)
        return sipCppV;

    sipCppV = ((const sipClassTypeDef *)sipType_wxNotifyEvent)->ctd_cast(static_cast< ::wxNotifyEvent *>(sipCpp), targetType);
    if (sipCppV)
        return sipCppV;

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_wxRibbonBarEvent(void *, int);}
static void release_wxRibbonBarEvent(void *sipCppV, int sipState)
{
    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxRibbonBarEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxRibbonBarEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        ::wxEventType command_type = wxEVT_NULL;
        int win_id = 0;
        ::wxRibbonPage* page = 0;

        static const char *sipKwdList[] = {
            sipName_command_type,
            sipName_win_id,
            sipName_page,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|iiJ8", &command_type, &win_id, sipType_wxRibbonPage, &page))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxRibbonBarEvent(command_type, win_id, page);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxRibbonBarEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_wxRibbonBarEvent[] = {{13, 0, 1}};


static PyMethodDef methods_wxRibbonBarEvent[] = {
    {sipName_Clone, meth_wxRibbonBarEvent_Clone, METH_VARARGS, doc_wxRibbonBarEvent_Clone},
    {sipName_GetPage, meth_wxRibbonBarEvent_GetPage, METH_VARARGS, doc_wxRibbonBarEvent_GetPage},
    {sipName_SetPage, SIP_MLMETH_CAST(meth_wxRibbonBarEvent_SetPage), METH_VARARGS|METH_KEYWORDS, doc_wxRibbonBarEvent_SetPage}
};

sipVariableDef variables_wxRibbonBarEvent[] = {
    {PropertyVariable, sipName_Page, &methods_wxRibbonBarEvent[1], &methods_wxRibbonBarEvent[2], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxRibbonBarEvent, "RibbonBarEvent(command_type=wx.wxEVT_NULL, win_id=0, page=None) -> None\n"
"\n"
"Event used to indicate various actions relating to a wxRibbonBar.");


sipClassTypeDef sipTypeDef__ribbon_wxRibbonBarEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxRibbonBarEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_RibbonBarEvent,
        {0, 0, 1},
        3, methods_wxRibbonBarEvent,
        0, SIP_NULLPTR,
        1, variables_wxRibbonBarEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxRibbonBarEvent,
    -1,
    -1,
    supers_wxRibbonBarEvent,
    SIP_NULLPTR,
    init_type_wxRibbonBarEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxRibbonBarEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxRibbonBarEvent,
    cast_wxRibbonBarEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxRibbonBarEvent),
};
