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

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


class sipwxRibbonGalleryEvent : public ::wxRibbonGalleryEvent
{
public:
    sipwxRibbonGalleryEvent(::wxEventType, int, ::wxRibbonGallery*, ::wxRibbonGalleryItem*);
    sipwxRibbonGalleryEvent(const ::wxRibbonGalleryEvent&);
    virtual ~sipwxRibbonGalleryEvent();

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

    char sipPyMethods[2];
};

sipwxRibbonGalleryEvent::sipwxRibbonGalleryEvent(::wxEventType command_type, int win_id, ::wxRibbonGallery*gallery, ::wxRibbonGalleryItem*item): ::wxRibbonGalleryEvent(command_type, win_id, gallery, item), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxEventCategory sipwxRibbonGalleryEvent::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 ::wxRibbonGalleryEvent::GetEventCategory();

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

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

::wxEvent* sipwxRibbonGalleryEvent::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 ::wxRibbonGalleryEvent::Clone();

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

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


PyDoc_STRVAR(doc_wxRibbonGalleryEvent_GetGallery, "GetGallery() -> RibbonGallery\n"
"\n"
"Returns the gallery which the event relates to.");

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

    {
        ::wxRibbonGalleryEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetGallery();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_RibbonGalleryEvent, sipName_GetGallery, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRibbonGalleryEvent_GetGalleryItem, "GetGalleryItem() -> RibbonGalleryItem\n"
"\n"
"Returns the gallery item which the event relates to, or NULL if it\n"
"does not relate to an item.");

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

    {
        ::wxRibbonGalleryEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetGalleryItem();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_RibbonGalleryEvent, sipName_GetGalleryItem, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRibbonGalleryEvent_SetGallery, "SetGallery(gallery)\n"
"\n"
"Sets the gallery relating to this event.");

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

    {
        ::wxRibbonGallery* gallery;
        ::wxRibbonGalleryEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxRibbonGalleryEvent, &sipCpp, sipType_wxRibbonGallery, &gallery))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetGallery(gallery);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_RibbonGalleryEvent, sipName_SetGallery, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRibbonGalleryEvent_SetGalleryItem, "SetGalleryItem(item)\n"
"\n"
"Sets the gallery item relating to this event.");

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

    {
        ::wxRibbonGalleryItem* item;
        ::wxRibbonGalleryEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxRibbonGalleryEvent, &sipCpp, sipType_wxRibbonGalleryItem, &item))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetGalleryItem(item);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_RibbonGalleryEvent, sipName_SetGalleryItem, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRibbonGalleryEvent_Clone, "Clone(self) -> Optional[Event]");

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

    {
        const ::wxRibbonGalleryEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_RibbonGalleryEvent, sipName_Clone, doc_wxRibbonGalleryEvent_Clone);

    return SIP_NULLPTR;
}


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

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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxRibbonGalleryEvent *>(sipCppV);
    else
        delete reinterpret_cast<::wxRibbonGalleryEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        ::wxEventType command_type = wxEVT_NULL;
        int win_id = 0;
        ::wxRibbonGallery* gallery = 0;
        ::wxRibbonGalleryItem* item = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|iiJ8J8", &command_type, &win_id, sipType_wxRibbonGallery, &gallery, sipType_wxRibbonGalleryItem, &item))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxRibbonGalleryEvent(command_type, win_id, gallery, item);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxRibbonGalleryEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxRibbonGalleryEvent[] = {
    {sipName_Clone, meth_wxRibbonGalleryEvent_Clone, METH_VARARGS, doc_wxRibbonGalleryEvent_Clone},
    {sipName_GetGallery, meth_wxRibbonGalleryEvent_GetGallery, METH_VARARGS, doc_wxRibbonGalleryEvent_GetGallery},
    {sipName_GetGalleryItem, meth_wxRibbonGalleryEvent_GetGalleryItem, METH_VARARGS, doc_wxRibbonGalleryEvent_GetGalleryItem},
    {sipName_SetGallery, SIP_MLMETH_CAST(meth_wxRibbonGalleryEvent_SetGallery), METH_VARARGS|METH_KEYWORDS, doc_wxRibbonGalleryEvent_SetGallery},
    {sipName_SetGalleryItem, SIP_MLMETH_CAST(meth_wxRibbonGalleryEvent_SetGalleryItem), METH_VARARGS|METH_KEYWORDS, doc_wxRibbonGalleryEvent_SetGalleryItem}
};

sipVariableDef variables_wxRibbonGalleryEvent[] = {
    {PropertyVariable, sipName_GalleryItem, &methods_wxRibbonGalleryEvent[2], &methods_wxRibbonGalleryEvent[4], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Gallery, &methods_wxRibbonGalleryEvent[1], &methods_wxRibbonGalleryEvent[3], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxRibbonGalleryEvent, "RibbonGalleryEvent(command_type=wx.wxEVT_NULL, win_id=0, gallery=None, item=None)");


sipClassTypeDef sipTypeDef__ribbon_wxRibbonGalleryEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxRibbonGalleryEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_RibbonGalleryEvent,
        {0, 0, 1},
        5, methods_wxRibbonGalleryEvent,
        0, SIP_NULLPTR,
        2, variables_wxRibbonGalleryEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxRibbonGalleryEvent,
    -1,
    -1,
    supers_wxRibbonGalleryEvent,
    SIP_NULLPTR,
    init_type_wxRibbonGalleryEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxRibbonGalleryEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxRibbonGalleryEvent,
    cast_wxRibbonGalleryEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
