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


class sipwxCollapsiblePaneEvent : public ::wxCollapsiblePaneEvent
{
public:
    sipwxCollapsiblePaneEvent(::wxObject*, int, bool);
    sipwxCollapsiblePaneEvent(const ::wxCollapsiblePaneEvent&);
    virtual ~sipwxCollapsiblePaneEvent();

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

    char sipPyMethods[2];
};

sipwxCollapsiblePaneEvent::sipwxCollapsiblePaneEvent(::wxObject*generator, int id, bool collapsed): ::wxCollapsiblePaneEvent(generator, id, collapsed), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::wxEventCategory sipwxCollapsiblePaneEvent::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 ::wxCollapsiblePaneEvent::GetEventCategory();

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

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

::wxEvent* sipwxCollapsiblePaneEvent::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 ::wxCollapsiblePaneEvent::Clone();

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

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


PyDoc_STRVAR(doc_wxCollapsiblePaneEvent_GetCollapsed, "GetCollapsed() -> bool\n"
"\n"
"Returns true if the pane has been collapsed.");

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

    {
        const ::wxCollapsiblePaneEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxCollapsiblePaneEvent, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetCollapsed();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_CollapsiblePaneEvent, sipName_GetCollapsed, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxCollapsiblePaneEvent_SetCollapsed, "SetCollapsed(collapsed) -> None\n"
"\n"
"Sets this as a collapsed pane event (if collapsed is true) or as an\n"
"expanded pane event (if collapsed is false).");

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

    {
        bool collapsed;
        ::wxCollapsiblePaneEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bb", &sipSelf, sipType_wxCollapsiblePaneEvent, &sipCpp, &collapsed))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetCollapsed(collapsed);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_CollapsiblePaneEvent, sipName_SetCollapsed, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxCollapsiblePaneEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxCollapsiblePaneEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        ::wxObject* generator;
        int id;
        bool collapsed;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8ib", sipType_wxObject, &generator, &id, &collapsed))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxCollapsiblePaneEvent(generator, id, collapsed);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxCollapsiblePaneEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxCollapsiblePaneEvent[] = {
    {sipName_GetCollapsed, meth_wxCollapsiblePaneEvent_GetCollapsed, METH_VARARGS, doc_wxCollapsiblePaneEvent_GetCollapsed},
    {sipName_SetCollapsed, SIP_MLMETH_CAST(meth_wxCollapsiblePaneEvent_SetCollapsed), METH_VARARGS|METH_KEYWORDS, doc_wxCollapsiblePaneEvent_SetCollapsed}
};

sipVariableDef variables_wxCollapsiblePaneEvent[] = {
    {PropertyVariable, sipName_Collapsed, &methods_wxCollapsiblePaneEvent[0], &methods_wxCollapsiblePaneEvent[1], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxCollapsiblePaneEvent, "CollapsiblePaneEvent(generator, id, collapsed) -> None\n"
"\n"
"This event class is used for the events generated by\n"
"wxCollapsiblePane.");


sipClassTypeDef sipTypeDef__core_wxCollapsiblePaneEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxCollapsiblePaneEvent,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_CollapsiblePaneEvent,
        {0, 0, 1},
        2, methods_wxCollapsiblePaneEvent,
        0, SIP_NULLPTR,
        1, variables_wxCollapsiblePaneEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxCollapsiblePaneEvent,
    -1,
    -1,
    supers_wxCollapsiblePaneEvent,
    SIP_NULLPTR,
    init_type_wxCollapsiblePaneEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxCollapsiblePaneEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxCollapsiblePaneEvent,
    cast_wxCollapsiblePaneEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxCollapsiblePaneEvent),
};
