/*
 * 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/window.h>
        #include <wx/mdi.h>
        #include <wx/gdicmn.h>
        #include <wx/frame.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxLayoutAlgorithm : public  ::wxLayoutAlgorithm
{
public:
    sipwxLayoutAlgorithm();
    sipwxLayoutAlgorithm(const  ::wxLayoutAlgorithm&);
    ~sipwxLayoutAlgorithm();

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxLayoutAlgorithm(const sipwxLayoutAlgorithm &);
    sipwxLayoutAlgorithm &operator = (const sipwxLayoutAlgorithm &);
};

sipwxLayoutAlgorithm::sipwxLayoutAlgorithm():  ::wxLayoutAlgorithm(), sipPySelf(SIP_NULLPTR)
{
}

sipwxLayoutAlgorithm::sipwxLayoutAlgorithm(const  ::wxLayoutAlgorithm& a0):  ::wxLayoutAlgorithm(a0), sipPySelf(SIP_NULLPTR)
{
}

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


PyDoc_STRVAR(doc_wxLayoutAlgorithm_LayoutFrame, "LayoutFrame(frame, mainWindow=None) -> bool\n"
"\n"
"Lays out the children of a normal frame.");

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

    {
         ::wxFrame* frame;
         ::wxWindow* mainWindow = 0;
         ::wxLayoutAlgorithm *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8|J8", &sipSelf, sipType_wxLayoutAlgorithm, &sipCpp, sipType_wxFrame, &frame, sipType_wxWindow, &mainWindow))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->LayoutFrame(frame,mainWindow);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxLayoutAlgorithm_LayoutMDIFrame, "LayoutMDIFrame(frame, rect=None) -> bool\n"
"\n"
"Lays out the children of an MDI parent frame.");

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

    {
         ::wxMDIParentFrame* frame;
         ::wxRect* rect = 0;
        int rectState = 0;
         ::wxLayoutAlgorithm *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8|J0", &sipSelf, sipType_wxLayoutAlgorithm, &sipCpp, sipType_wxMDIParentFrame, &frame, sipType_wxRect, &rect, &rectState))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->LayoutMDIFrame(frame,rect);
            Py_END_ALLOW_THREADS
            sipReleaseType(rect,sipType_wxRect,rectState);

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxLayoutAlgorithm_LayoutWindow, "LayoutWindow(parent, mainWindow=None) -> bool\n"
"\n"
"Lays out the children of a normal frame or other window.");

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

    {
         ::wxWindow* parent;
         ::wxWindow* mainWindow = 0;
         ::wxLayoutAlgorithm *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8|J8", &sipSelf, sipType_wxLayoutAlgorithm, &sipCpp, sipType_wxWindow, &parent, sipType_wxWindow, &mainWindow))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->LayoutWindow(parent,mainWindow);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

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

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxObject)
        return static_cast< ::wxObject *>(sipCpp);

    return sipCppV;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxLayoutAlgorithm *>(sipCppV);
    else
        delete reinterpret_cast< ::wxLayoutAlgorithm *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void assign_wxLayoutAlgorithm(void *, SIP_SSIZE_T, void *);}
static void assign_wxLayoutAlgorithm(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxLayoutAlgorithm *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxLayoutAlgorithm *>(sipSrc);
}


extern "C" {static void *array_wxLayoutAlgorithm(SIP_SSIZE_T);}
static void *array_wxLayoutAlgorithm(SIP_SSIZE_T sipNrElem)
{
    return new  ::wxLayoutAlgorithm[sipNrElem];
}


extern "C" {static void *copy_wxLayoutAlgorithm(const void *, SIP_SSIZE_T);}
static void *copy_wxLayoutAlgorithm(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new  ::wxLayoutAlgorithm(reinterpret_cast<const  ::wxLayoutAlgorithm *>(sipSrc)[sipSrcIdx]);
}


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

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


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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxLayoutAlgorithm();
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxLayoutAlgorithm* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxLayoutAlgorithm[] = {
    {SIP_MLNAME_CAST(sipName_LayoutFrame), SIP_MLMETH_CAST(meth_wxLayoutAlgorithm_LayoutFrame), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLayoutAlgorithm_LayoutFrame)},
    {SIP_MLNAME_CAST(sipName_LayoutMDIFrame), SIP_MLMETH_CAST(meth_wxLayoutAlgorithm_LayoutMDIFrame), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLayoutAlgorithm_LayoutMDIFrame)},
    {SIP_MLNAME_CAST(sipName_LayoutWindow), SIP_MLMETH_CAST(meth_wxLayoutAlgorithm_LayoutWindow), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxLayoutAlgorithm_LayoutWindow)}
};

PyDoc_STRVAR(doc_wxLayoutAlgorithm, "LayoutAlgorithm()\n"
"\n"
"wxLayoutAlgorithm implements layout of subwindows in MDI or SDI\n"
"frames.");


sipClassTypeDef sipTypeDef__adv_wxLayoutAlgorithm = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxLayoutAlgorithm,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_LayoutAlgorithm,
        {0, 0, 1},
        3, methods_wxLayoutAlgorithm,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxLayoutAlgorithm,
    -1,
    -1,
    supers_wxLayoutAlgorithm,
    SIP_NULLPTR,
    init_type_wxLayoutAlgorithm,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxLayoutAlgorithm,
    assign_wxLayoutAlgorithm,
    array_wxLayoutAlgorithm,
    copy_wxLayoutAlgorithm,
    release_wxLayoutAlgorithm,
    cast_wxLayoutAlgorithm,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
