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

#include "sipAPI_core.h"

        #include <wx/sizer.h>

        #include <wx/statbox.h>
        #include <wx/window.h>
        #include <wx/gdicmn.h>
        #include <wx/sizer.h>
        #include <wx/sizer.h>
        #include <wx/gdicmn.h>
        #include <wx/sizer.h>
        
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxStaticBoxSizer : public  ::wxStaticBoxSizer
{
public:
    sipwxStaticBoxSizer( ::wxStaticBox*,int);
    sipwxStaticBoxSizer(int, ::wxWindow*,const  ::wxString&);
    virtual ~sipwxStaticBoxSizer();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    void RecalcSizes() SIP_OVERRIDE;
     ::wxSize CalcMin() SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxStaticBoxSizer(const sipwxStaticBoxSizer &);
    sipwxStaticBoxSizer &operator = (const sipwxStaticBoxSizer &);

    char sipPyMethods[2];
};

sipwxStaticBoxSizer::sipwxStaticBoxSizer( ::wxStaticBox*box,int orient):  ::wxStaticBoxSizer(box,orient), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxStaticBoxSizer::sipwxStaticBoxSizer(int orient, ::wxWindow*parent,const  ::wxString& label):  ::wxStaticBoxSizer(orient,parent,label), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

void sipwxStaticBoxSizer::RecalcSizes()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,SIP_NULLPTR,sipName_RecalcSizes);

    if (!sipMeth)
    {
         ::wxStaticBoxSizer::RecalcSizes();
        return;
    }

    extern void sipVH__core_45(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    sipVH__core_45(sipGILState, 0, sipPySelf, sipMeth);
}

 ::wxSize sipwxStaticBoxSizer::CalcMin()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,SIP_NULLPTR,sipName_CalcMin);

    if (!sipMeth)
        return  ::wxStaticBoxSizer::CalcMin();

    extern  ::wxSize sipVH__core_93(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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


PyDoc_STRVAR(doc_wxStaticBoxSizer_GetStaticBox, "GetStaticBox() -> StaticBox\n"
"\n"
"Returns the static box associated with the sizer.");

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

    {
        const  ::wxStaticBoxSizer *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetStaticBox();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromType(sipRes,sipType_wxStaticBox,SIP_NULLPTR);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxStaticBoxSizer_CalcMin, "CalcMin() -> Size\n"
"\n"
"Implements the calculation of a box sizer's minimal.");

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

    {
         ::wxStaticBoxSizer *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxSize((sipSelfWasArg ? sipCpp-> ::wxStaticBoxSizer::CalcMin() : sipCpp->CalcMin()));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxStaticBoxSizer_RecalcSizes, "RecalcSizes()\n"
"\n"
"Implements the calculation of a box sizer's dimensions and then sets\n"
"the size of its children (calling wxWindow::SetSize if the child is a\n"
"window).");

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

    {
         ::wxStaticBoxSizer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxStaticBoxSizer, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp-> ::wxStaticBoxSizer::RecalcSizes() : sipCpp->RecalcSizes());
            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_StaticBoxSizer, sipName_RecalcSizes, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxBoxSizer)
        return static_cast< ::wxBoxSizer *>(sipCpp);

    if (targetType == sipType_wxSizer)
        return static_cast< ::wxSizer *>(sipCpp);

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

    return sipCppV;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxStaticBoxSizer *>(sipCppV);
    else
        delete reinterpret_cast< ::wxStaticBoxSizer *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
         ::wxStaticBox* box;
        int orient = wxHORIZONTAL;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J8|i", sipType_wxStaticBox, &box, &orient))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxStaticBoxSizer(box,orient);
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        int orient;
         ::wxWindow* parent;
        const  ::wxString& labeldef = wxEmptyString;
        const  ::wxString* label = &labeldef;
        int labelState = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "iJ8|J1", &orient, sipType_wxWindow, &parent, sipType_wxString,&label, &labelState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxStaticBoxSizer(orient,parent,*label);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(label),sipType_wxString,labelState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxStaticBoxSizer[] = {
    {SIP_MLNAME_CAST(sipName_CalcMin), meth_wxStaticBoxSizer_CalcMin, METH_VARARGS, SIP_MLDOC_CAST(doc_wxStaticBoxSizer_CalcMin)},
    {SIP_MLNAME_CAST(sipName_GetStaticBox), meth_wxStaticBoxSizer_GetStaticBox, METH_VARARGS, SIP_MLDOC_CAST(doc_wxStaticBoxSizer_GetStaticBox)},
    {SIP_MLNAME_CAST(sipName_RecalcSizes), meth_wxStaticBoxSizer_RecalcSizes, METH_VARARGS, SIP_MLDOC_CAST(doc_wxStaticBoxSizer_RecalcSizes)}
};

sipVariableDef variables_wxStaticBoxSizer[] = {
    {PropertyVariable, sipName_StaticBox, &methods_wxStaticBoxSizer[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxStaticBoxSizer, "StaticBoxSizer(box, orient=HORIZONTAL)\n"
"StaticBoxSizer(orient, parent, label=EmptyString)\n"
"\n"
"wxStaticBoxSizer is a sizer derived from wxBoxSizer but adds a static\n"
"box around the sizer.");


sipClassTypeDef sipTypeDef__core_wxStaticBoxSizer = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxStaticBoxSizer,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_StaticBoxSizer,
        {0, 0, 1},
        3, methods_wxStaticBoxSizer,
        0, SIP_NULLPTR,
        1, variables_wxStaticBoxSizer,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxStaticBoxSizer,
    -1,
    -1,
    supers_wxStaticBoxSizer,
    SIP_NULLPTR,
    init_type_wxStaticBoxSizer,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxStaticBoxSizer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxStaticBoxSizer,
    cast_wxStaticBoxSizer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
