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


class sipwxRibbonPanelEvent : public ::wxRibbonPanelEvent
{
public:
    sipwxRibbonPanelEvent(::wxEventType, int, ::wxRibbonPanel*);
    sipwxRibbonPanelEvent(const ::wxRibbonPanelEvent&);
    virtual ~sipwxRibbonPanelEvent();

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

    char sipPyMethods[2];
};

sipwxRibbonPanelEvent::sipwxRibbonPanelEvent(::wxEventType command_type, int win_id, ::wxRibbonPanel*panel): ::wxRibbonPanelEvent(command_type, win_id, panel), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxEventCategory sipwxRibbonPanelEvent::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 ::wxRibbonPanelEvent::GetEventCategory();

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

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

::wxEvent* sipwxRibbonPanelEvent::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 ::wxRibbonPanelEvent::Clone();

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

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


PyDoc_STRVAR(doc_wxRibbonPanelEvent_GetPanel, "GetPanel() -> RibbonPanel\n"
"\n"
"Returns the panel relating to this event.");

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

    {
        ::wxRibbonPanelEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetPanel();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_RibbonPanelEvent, sipName_GetPanel, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        ::wxRibbonPanel* page;
        ::wxRibbonPanelEvent *sipCpp;

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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetPanel(page);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_RibbonPanelEvent, sipName_SetPanel, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const ::wxRibbonPanelEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_RibbonPanelEvent, sipName_Clone, doc_wxRibbonPanelEvent_Clone);

    return SIP_NULLPTR;
}


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

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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxRibbonPanelEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxRibbonPanelEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        ::wxEventType command_type = wxEVT_NULL;
        int win_id = 0;
        ::wxRibbonPanel* panel = 0;

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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxRibbonPanelEvent(command_type, win_id, panel);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxRibbonPanelEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxRibbonPanelEvent[] = {
    {sipName_Clone, meth_wxRibbonPanelEvent_Clone, METH_VARARGS, doc_wxRibbonPanelEvent_Clone},
    {sipName_GetPanel, meth_wxRibbonPanelEvent_GetPanel, METH_VARARGS, doc_wxRibbonPanelEvent_GetPanel},
    {sipName_SetPanel, SIP_MLMETH_CAST(meth_wxRibbonPanelEvent_SetPanel), METH_VARARGS|METH_KEYWORDS, doc_wxRibbonPanelEvent_SetPanel}
};

sipVariableDef variables_wxRibbonPanelEvent[] = {
    {PropertyVariable, sipName_Panel, &methods_wxRibbonPanelEvent[1], &methods_wxRibbonPanelEvent[2], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxRibbonPanelEvent, "RibbonPanelEvent(command_type=wx.wxEVT_NULL, win_id=0, panel=None) -> None\n"
"\n"
"Event used to indicate various actions relating to a wxRibbonPanel.");


sipClassTypeDef sipTypeDef__ribbon_wxRibbonPanelEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxRibbonPanelEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_RibbonPanelEvent,
        {0, 0, 1},
        3, methods_wxRibbonPanelEvent,
        0, SIP_NULLPTR,
        1, variables_wxRibbonPanelEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxRibbonPanelEvent,
    -1,
    -1,
    supers_wxRibbonPanelEvent,
    SIP_NULLPTR,
    init_type_wxRibbonPanelEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxRibbonPanelEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxRibbonPanelEvent,
    cast_wxRibbonPanelEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxRibbonPanelEvent),
};
