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

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


class sipwxColourPickerEvent : public ::wxColourPickerEvent
{
public:
    sipwxColourPickerEvent();
    sipwxColourPickerEvent(::wxObject*, int, const ::wxColour&);
    sipwxColourPickerEvent(const ::wxColourPickerEvent&);
    virtual ~sipwxColourPickerEvent();

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

    char sipPyMethods[2];
};

sipwxColourPickerEvent::sipwxColourPickerEvent(): ::wxColourPickerEvent(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxColourPickerEvent::sipwxColourPickerEvent(::wxObject*generator, int id, const ::wxColour& colour): ::wxColourPickerEvent(generator, id, colour), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxEventCategory sipwxColourPickerEvent::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 ::wxColourPickerEvent::GetEventCategory();

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

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

::wxEvent* sipwxColourPickerEvent::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 ::wxColourPickerEvent::Clone();

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

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


PyDoc_STRVAR(doc_wxColourPickerEvent_GetColour, "GetColour() -> Colour\n"
"\n"
"Retrieve the colour the user has just selected.");

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

    {
        const ::wxColourPickerEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxColour(sipCpp->GetColour());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_ColourPickerEvent, sipName_GetColour, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxColourPickerEvent_SetColour, "SetColour(pos)\n"
"\n"
"Set the colour associated with the event.");

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

    {
        const ::wxColour* pos;
        int posState = 0;
        ::wxColourPickerEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxColourPickerEvent, &sipCpp, sipType_wxColour, &pos, &posState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetColour(*pos);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<::wxColour *>(pos), sipType_wxColour, posState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_ColourPickerEvent, sipName_SetColour, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const ::wxColourPickerEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_ColourPickerEvent, sipName_Clone, doc_wxColourPickerEvent_Clone);

    return SIP_NULLPTR;
}


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

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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxColourPickerEvent *>(sipCppV);
    else
        delete reinterpret_cast<::wxColourPickerEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxColourPickerEvent();
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        ::wxObject* generator;
        int id;
        const ::wxColour* colour;
        int colourState = 0;

        static const char *sipKwdList[] = {
            sipName_generator,
            sipName_id,
            sipName_colour,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8iJ1", sipType_wxObject, &generator, &id, sipType_wxColour, &colour, &colourState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxColourPickerEvent(generator, id, *colour);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<::wxColour *>(colour), sipType_wxColour, colourState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxColourPickerEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxColourPickerEvent[] = {
    {sipName_Clone, meth_wxColourPickerEvent_Clone, METH_VARARGS, doc_wxColourPickerEvent_Clone},
    {sipName_GetColour, meth_wxColourPickerEvent_GetColour, METH_VARARGS, doc_wxColourPickerEvent_GetColour},
    {sipName_SetColour, SIP_MLMETH_CAST(meth_wxColourPickerEvent_SetColour), METH_VARARGS|METH_KEYWORDS, doc_wxColourPickerEvent_SetColour}
};

sipVariableDef variables_wxColourPickerEvent[] = {
    {PropertyVariable, sipName_Colour, &methods_wxColourPickerEvent[1], &methods_wxColourPickerEvent[2], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxColourPickerEvent, "ColourPickerEvent()\n"
"ColourPickerEvent(generator, id, colour)\n"
"\n"
"This event class is used for the events generated by\n"
"wxColourPickerCtrl.");


sipClassTypeDef sipTypeDef__core_wxColourPickerEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxColourPickerEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_ColourPickerEvent,
        {0, 0, 1},
        3, methods_wxColourPickerEvent,
        0, SIP_NULLPTR,
        1, variables_wxColourPickerEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxColourPickerEvent,
    -1,
    -1,
    supers_wxColourPickerEvent,
    SIP_NULLPTR,
    init_type_wxColourPickerEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxColourPickerEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxColourPickerEvent,
    cast_wxColourPickerEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
