/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.8.5
 *
 *     Copyright: (c) 2020 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);
        }
    }

    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);
        }
    }

    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);
        }
    }

    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_wxLayoutAlgorithm)
        return sipCppV;

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

    return SIP_NULLPTR;
}


/* 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 *array_wxLayoutAlgorithm(Py_ssize_t);}
static void *array_wxLayoutAlgorithm(Py_ssize_t sipNrElem)
{
    return new ::wxLayoutAlgorithm[sipNrElem];
}


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


extern "C" {static void *copy_wxLayoutAlgorithm(const void *, Py_ssize_t);}
static void *copy_wxLayoutAlgorithm(const void *sipSrc, Py_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[] = {{40, 0, 1}};


static PyMethodDef methods_wxLayoutAlgorithm[] = {
    {sipName_LayoutFrame, SIP_MLMETH_CAST(meth_wxLayoutAlgorithm_LayoutFrame), METH_VARARGS|METH_KEYWORDS, doc_wxLayoutAlgorithm_LayoutFrame},
    {sipName_LayoutMDIFrame, SIP_MLMETH_CAST(meth_wxLayoutAlgorithm_LayoutMDIFrame), METH_VARARGS|METH_KEYWORDS, doc_wxLayoutAlgorithm_LayoutMDIFrame},
    {sipName_LayoutWindow, SIP_MLMETH_CAST(meth_wxLayoutAlgorithm_LayoutWindow), METH_VARARGS|METH_KEYWORDS, 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,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxLayoutAlgorithm,
    assign_wxLayoutAlgorithm,
    array_wxLayoutAlgorithm,
    copy_wxLayoutAlgorithm,
    release_wxLayoutAlgorithm,
    cast_wxLayoutAlgorithm,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
