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

#include "sipAPI_core.h"
        #include <wx/event.h>
        #include <wx/event.h>
        #include <wx/window.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxPaletteChangedEvent : public ::wxPaletteChangedEvent
{
public:
    sipwxPaletteChangedEvent(::wxWindowID);
    sipwxPaletteChangedEvent(const ::wxPaletteChangedEvent&);
    virtual ~sipwxPaletteChangedEvent();

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

    char sipPyMethods[2];
};

sipwxPaletteChangedEvent::sipwxPaletteChangedEvent(::wxWindowID winid): ::wxPaletteChangedEvent(winid), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxEvent* sipwxPaletteChangedEvent::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 ::wxPaletteChangedEvent::Clone();

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

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

::wxEventCategory sipwxPaletteChangedEvent::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 ::wxPaletteChangedEvent::GetEventCategory();

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

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


PyDoc_STRVAR(doc_wxPaletteChangedEvent_SetChangedWindow, "SetChangedWindow(win) -> None");

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

    {
        ::wxWindow* win;
        ::wxPaletteChangedEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxPaletteChangedEvent, &sipCpp, sipType_wxWindow, &win))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetChangedWindow(win);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_PaletteChangedEvent, sipName_SetChangedWindow, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxPaletteChangedEvent_GetChangedWindow, "GetChangedWindow() -> Window");

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

    {
        const ::wxPaletteChangedEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetChangedWindow();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_PaletteChangedEvent, sipName_GetChangedWindow, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const ::wxPaletteChangedEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_PaletteChangedEvent, sipName_Clone, doc_wxPaletteChangedEvent_Clone);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxPaletteChangedEvent)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxPaletteChangedEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxPaletteChangedEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        ::wxWindowID winid = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|i", &winid))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxPaletteChangedEvent(winid);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxPaletteChangedEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxPaletteChangedEvent[] = {
    {sipName_Clone, meth_wxPaletteChangedEvent_Clone, METH_VARARGS, doc_wxPaletteChangedEvent_Clone},
    {sipName_GetChangedWindow, meth_wxPaletteChangedEvent_GetChangedWindow, METH_VARARGS, doc_wxPaletteChangedEvent_GetChangedWindow},
    {sipName_SetChangedWindow, SIP_MLMETH_CAST(meth_wxPaletteChangedEvent_SetChangedWindow), METH_VARARGS|METH_KEYWORDS, doc_wxPaletteChangedEvent_SetChangedWindow}
};

sipVariableDef variables_wxPaletteChangedEvent[] = {
    {PropertyVariable, sipName_ChangedWindow, &methods_wxPaletteChangedEvent[1], &methods_wxPaletteChangedEvent[2], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxPaletteChangedEvent, "PaletteChangedEvent(winid=0) -> None");


sipClassTypeDef sipTypeDef__core_wxPaletteChangedEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxPaletteChangedEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_PaletteChangedEvent,
        {0, 0, 1},
        3, methods_wxPaletteChangedEvent,
        0, SIP_NULLPTR,
        1, variables_wxPaletteChangedEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxPaletteChangedEvent,
    -1,
    -1,
    supers_wxPaletteChangedEvent,
    SIP_NULLPTR,
    init_type_wxPaletteChangedEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxPaletteChangedEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxPaletteChangedEvent,
    cast_wxPaletteChangedEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxPaletteChangedEvent),
};
