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

#include "sipAPI_grid.h"
        #include <wx/grid.h>



PyDoc_STRVAR(doc_wxGridSizesInfo_GetSize, "GetSize(pos) -> int\n"
"\n"
"Get the element size.");

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

    {
        uint pos;
        const ::wxGridSizesInfo *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bu", &sipSelf, sipType_wxGridSizesInfo, &sipCpp, &pos))
        {
            int sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetSize(pos);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_GridSizesInfo, sipName_GetSize, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    delete reinterpret_cast< ::wxGridSizesInfo *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void *array_wxGridSizesInfo(Py_ssize_t);}
static void *array_wxGridSizesInfo(Py_ssize_t sipNrElem)
{
    return new ::wxGridSizesInfo[sipNrElem];
}


extern "C" {static void array_delete_wxGridSizesInfo(void *);}
static void array_delete_wxGridSizesInfo(void *sipCpp)
{
    delete[] reinterpret_cast< ::wxGridSizesInfo *>(sipCpp);
}


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


extern "C" {static void *copy_wxGridSizesInfo(const void *, Py_ssize_t);}
static void *copy_wxGridSizesInfo(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new ::wxGridSizesInfo(reinterpret_cast<const ::wxGridSizesInfo *>(sipSrc)[sipSrcIdx]);
}


extern "C" {static void dealloc_wxGridSizesInfo(sipSimpleWrapper *);}
static void dealloc_wxGridSizesInfo(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_wxGridSizesInfo(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_wxGridSizesInfo(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_wxGridSizesInfo(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    ::wxGridSizesInfo *sipCpp = SIP_NULLPTR;

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxGridSizesInfo();
            Py_END_ALLOW_THREADS

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

            return sipCpp;
        }
    }

    {
        int defSize;
        const ::wxArrayInt* allSizes;
        int allSizesState = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "iJ1", &defSize, sipType_wxArrayInt, &allSizes, &allSizesState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new ::wxGridSizesInfo(defSize, *allSizes);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxArrayInt *>(allSizes), sipType_wxArrayInt, allSizesState);

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

            return sipCpp;
        }
    }

    {
        const ::wxGridSizesInfo* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxGridSizesInfo[] = {
    {sipName_GetSize, SIP_MLMETH_CAST(meth_wxGridSizesInfo_GetSize), METH_VARARGS|METH_KEYWORDS, doc_wxGridSizesInfo_GetSize}
};


extern "C" {static PyObject *varget_wxGridSizesInfo_m_sizeDefault(void *, PyObject *, PyObject *);}
static PyObject *varget_wxGridSizesInfo_m_sizeDefault(void *sipSelf, PyObject *, PyObject *)
{
    int sipVal;
    ::wxGridSizesInfo *sipCpp = reinterpret_cast< ::wxGridSizesInfo *>(sipSelf);

    sipVal = sipCpp->m_sizeDefault;

    return PyLong_FromLong(sipVal);
}


extern "C" {static int varset_wxGridSizesInfo_m_sizeDefault(void *, PyObject *, PyObject *);}
static int varset_wxGridSizesInfo_m_sizeDefault(void *sipSelf, PyObject *sipPy, PyObject *)
{
    int sipVal;
    ::wxGridSizesInfo *sipCpp = reinterpret_cast< ::wxGridSizesInfo *>(sipSelf);

    sipVal = sipLong_AsInt(sipPy);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->m_sizeDefault = sipVal;

    return 0;
}

sipVariableDef variables_wxGridSizesInfo[] = {
    {InstanceVariable, sipName_m_sizeDefault, (PyMethodDef *)varget_wxGridSizesInfo_m_sizeDefault, (PyMethodDef *)varset_wxGridSizesInfo_m_sizeDefault, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxGridSizesInfo, "GridSizesInfo() -> None\n"
"GridSizesInfo(defSize, allSizes) -> None\n"
"\n"
"wxGridSizesInfo stores information about sizes of all wxGrid rows or\n"
"columns.");


sipClassTypeDef sipTypeDef__grid_wxGridSizesInfo = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxGridSizesInfo,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_GridSizesInfo,
        {0, 0, 1},
        1, methods_wxGridSizesInfo,
        0, SIP_NULLPTR,
        1, variables_wxGridSizesInfo,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxGridSizesInfo,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxGridSizesInfo,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGridSizesInfo,
    assign_wxGridSizesInfo,
    array_wxGridSizesInfo,
    copy_wxGridSizesInfo,
    release_wxGridSizesInfo,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxGridSizesInfo,
    sizeof (::wxGridSizesInfo),
};
