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

#include "sipAPI_ribbon.h"

        #include <wx/ribbon/toolbar.h>

        #include <wx/ribbon/toolbar.h>
        #include <wx/event.h>
        #include <wx/menu.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxRibbonToolBarEvent : public  ::wxRibbonToolBarEvent
{
public:
    sipwxRibbonToolBarEvent( ::wxEventType,int, ::wxRibbonToolBar*);
    sipwxRibbonToolBarEvent(const  ::wxRibbonToolBarEvent&);
    virtual ~sipwxRibbonToolBarEvent();

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

    char sipPyMethods[2];
};

sipwxRibbonToolBarEvent::sipwxRibbonToolBarEvent( ::wxEventType command_type,int win_id, ::wxRibbonToolBar*bar):  ::wxRibbonToolBarEvent(command_type,win_id,bar), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

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

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

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

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

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

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

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

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

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

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


PyDoc_STRVAR(doc_wxRibbonToolBarEvent_GetBar, "GetBar() -> RibbonToolBar");

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

    {
         ::wxRibbonToolBarEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetBar();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRibbonToolBarEvent_SetBar, "SetBar(bar)");

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

    {
         ::wxRibbonToolBar* bar;
         ::wxRibbonToolBarEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxRibbonToolBarEvent, &sipCpp, sipType_wxRibbonToolBar, &bar))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetBar(bar);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRibbonToolBarEvent_PopupMenu, "PopupMenu(menu) -> bool");

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

    {
         ::wxMenu* menu;
         ::wxRibbonToolBarEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxRibbonToolBarEvent, &sipCpp, sipType_wxMenu, &menu))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->PopupMenu(menu);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

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

    return SIP_NULLPTR;
}


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

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

    {
        const  ::wxRibbonToolBarEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxRibbonToolBarEvent::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_RibbonToolBarEvent, sipName_Clone, doc_wxRibbonToolBarEvent_Clone);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxRibbonToolBarEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxRibbonToolBarEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
         ::wxEventType command_type = wxEVT_NULL;
        int win_id = 0;
         ::wxRibbonToolBar* bar = 0;

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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxRibbonToolBarEvent(command_type,win_id,bar);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxRibbonToolBarEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxRibbonToolBarEvent[] = {
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxRibbonToolBarEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxRibbonToolBarEvent_Clone)},
    {SIP_MLNAME_CAST(sipName_GetBar), meth_wxRibbonToolBarEvent_GetBar, METH_VARARGS, SIP_MLDOC_CAST(doc_wxRibbonToolBarEvent_GetBar)},
    {SIP_MLNAME_CAST(sipName_PopupMenu), SIP_MLMETH_CAST(meth_wxRibbonToolBarEvent_PopupMenu), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxRibbonToolBarEvent_PopupMenu)},
    {SIP_MLNAME_CAST(sipName_SetBar), SIP_MLMETH_CAST(meth_wxRibbonToolBarEvent_SetBar), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxRibbonToolBarEvent_SetBar)}
};

sipVariableDef variables_wxRibbonToolBarEvent[] = {
    {PropertyVariable, sipName_Bar, &methods_wxRibbonToolBarEvent[1], &methods_wxRibbonToolBarEvent[3], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxRibbonToolBarEvent, "RibbonToolBarEvent(command_type=wx.wxEVT_NULL, win_id=0, bar=None)");


sipClassTypeDef sipTypeDef__ribbon_wxRibbonToolBarEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxRibbonToolBarEvent,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_RibbonToolBarEvent,
        {0, 0, 1},
        4, methods_wxRibbonToolBarEvent,
        0, SIP_NULLPTR,
        1, variables_wxRibbonToolBarEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxRibbonToolBarEvent,
    -1,
    -1,
    supers_wxRibbonToolBarEvent,
    SIP_NULLPTR,
    init_type_wxRibbonToolBarEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxRibbonToolBarEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxRibbonToolBarEvent,
    cast_wxRibbonToolBarEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
