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

#include "sipAPI_adv.h"

        #include <wx/laywin.h>

        #include <wx/event.h>
        #include <wx/gdicmn.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxCalculateLayoutEvent : public  ::wxCalculateLayoutEvent
{
public:
    sipwxCalculateLayoutEvent( ::wxWindowID);
    sipwxCalculateLayoutEvent(const  ::wxCalculateLayoutEvent&);
    virtual ~sipwxCalculateLayoutEvent();

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

    char sipPyMethods[2];
};

sipwxCalculateLayoutEvent::sipwxCalculateLayoutEvent( ::wxWindowID id):  ::wxCalculateLayoutEvent(id), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

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

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

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

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

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

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

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

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

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

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


PyDoc_STRVAR(doc_wxCalculateLayoutEvent_GetFlags, "GetFlags() -> int\n"
"\n"
"Returns the flags associated with this event.");

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

    {
        const  ::wxCalculateLayoutEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxCalculateLayoutEvent, &sipCpp))
        {
            int sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetFlags();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return SIPLong_FromLong(sipRes);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxCalculateLayoutEvent_GetRect, "GetRect() -> wx.Rect\n"
"\n"
"Before the event handler is entered, returns the remaining parent\n"
"client area that the window could occupy.");

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

    {
        const  ::wxCalculateLayoutEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxRect(sipCpp->GetRect());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxCalculateLayoutEvent_SetFlags, "SetFlags(flags)\n"
"\n"
"Sets the flags associated with this event.");

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

    {
        int flags;
         ::wxCalculateLayoutEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxCalculateLayoutEvent, &sipCpp, &flags))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetFlags(flags);
            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_CalculateLayoutEvent, sipName_SetFlags, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxCalculateLayoutEvent_SetRect, "SetRect(rect)\n"
"\n"
"Call this to specify the new remaining parent client area, after the\n"
"space occupied by the window has been subtracted.");

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

    {
        const  ::wxRect* rect;
        int rectState = 0;
         ::wxCalculateLayoutEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxCalculateLayoutEvent, &sipCpp, sipType_wxRect, &rect, &rectState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetRect(*rect);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxRect *>(rect),sipType_wxRect,rectState);

            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_CalculateLayoutEvent, sipName_SetRect, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

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

    {
        const  ::wxCalculateLayoutEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxCalculateLayoutEvent::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_CalculateLayoutEvent, sipName_Clone, doc_wxCalculateLayoutEvent_Clone);

    return SIP_NULLPTR;
}


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

    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_wxCalculateLayoutEvent(void *, int);}
static void release_wxCalculateLayoutEvent(void *sipCppV, int sipState)
{
    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxCalculateLayoutEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxCalculateLayoutEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
         ::wxWindowID id = 0;

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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxCalculateLayoutEvent(id);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxCalculateLayoutEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxCalculateLayoutEvent[] = {
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxCalculateLayoutEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxCalculateLayoutEvent_Clone)},
    {SIP_MLNAME_CAST(sipName_GetFlags), meth_wxCalculateLayoutEvent_GetFlags, METH_VARARGS, SIP_MLDOC_CAST(doc_wxCalculateLayoutEvent_GetFlags)},
    {SIP_MLNAME_CAST(sipName_GetRect), meth_wxCalculateLayoutEvent_GetRect, METH_VARARGS, SIP_MLDOC_CAST(doc_wxCalculateLayoutEvent_GetRect)},
    {SIP_MLNAME_CAST(sipName_SetFlags), SIP_MLMETH_CAST(meth_wxCalculateLayoutEvent_SetFlags), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxCalculateLayoutEvent_SetFlags)},
    {SIP_MLNAME_CAST(sipName_SetRect), SIP_MLMETH_CAST(meth_wxCalculateLayoutEvent_SetRect), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxCalculateLayoutEvent_SetRect)}
};

sipVariableDef variables_wxCalculateLayoutEvent[] = {
    {PropertyVariable, sipName_Rect, &methods_wxCalculateLayoutEvent[2], &methods_wxCalculateLayoutEvent[4], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Flags, &methods_wxCalculateLayoutEvent[1], &methods_wxCalculateLayoutEvent[3], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxCalculateLayoutEvent, "CalculateLayoutEvent(id=0)\n"
"\n"
"This event is sent by wxLayoutAlgorithm to calculate the amount of the\n"
"remaining client area that the window should occupy.");


sipClassTypeDef sipTypeDef__adv_wxCalculateLayoutEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxCalculateLayoutEvent,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_CalculateLayoutEvent,
        {0, 0, 1},
        5, methods_wxCalculateLayoutEvent,
        0, SIP_NULLPTR,
        2, variables_wxCalculateLayoutEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxCalculateLayoutEvent,
    -1,
    -1,
    supers_wxCalculateLayoutEvent,
    SIP_NULLPTR,
    init_type_wxCalculateLayoutEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxCalculateLayoutEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxCalculateLayoutEvent,
    cast_wxCalculateLayoutEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
