/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.15.3
 *
 * Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt6-DataVisualization.
 * 
 * This file may be used under the terms of the GNU General Public License
 * version 3.0 as published by the Free Software Foundation and appearing in
 * the file LICENSE included in the packaging of this file.  Please review the
 * following information to ensure the GNU General Public License version 3.0
 * requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 * 
 * If you do not wish to use this file under the terms of the GPL version 3.0
 * then you may purchase a commercial license.  For more information contact
 * info@riverbankcomputing.com.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "sipAPIQtDataVisualization.h"

#line 135 "/usr/lib/python3.14/site-packages/PyQt6/bindings/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 29 "/build/pyqt6-datavisualization/src/pyqt6_datavisualization-6.11.0/build/QtDataVisualization/sipQtDataVisualizationQList0101QSurface3DSeries.cpp"

#line 26 "/build/pyqt6-datavisualization/src/pyqt6_datavisualization-6.11.0/sip/QtDataVisualization/qsurface3dseries.sip"
#include <qsurface3dseries.h>
#line 33 "/build/pyqt6-datavisualization/src/pyqt6_datavisualization-6.11.0/build/QtDataVisualization/sipQtDataVisualizationQList0101QSurface3DSeries.cpp"


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


extern "C" {static void *array_QList_0101QSurface3DSeries(Py_ssize_t);}
static void *array_QList_0101QSurface3DSeries(Py_ssize_t sipNrElem)
{
    return new QList< ::QSurface3DSeries*>[sipNrElem];
}


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


/* Call the mapped type's destructor. */
extern "C" {static void release_QList_0101QSurface3DSeries(void *, int, void *);}
static void release_QList_0101QSurface3DSeries(void *sipCppV, int, void *)
{
    QList< ::QSurface3DSeries*> *sipCpp = reinterpret_cast<QList< ::QSurface3DSeries*> *>(sipCppV);
    delete sipCpp;
}



extern "C" {static int convertTo_QList_0101QSurface3DSeries(PyObject *, void **, int *, PyObject *, void **);}
static int convertTo_QList_0101QSurface3DSeries(PyObject *sipPy, void **sipCppPtrV, int *sipIsErr, PyObject *sipTransferObj, void **)
{
    QList< ::QSurface3DSeries*> **sipCppPtr = reinterpret_cast<QList< ::QSurface3DSeries*> **>(sipCppPtrV);

#line 170 "/usr/lib/python3.14/site-packages/PyQt6/bindings/QtCore/qpycore_qlist.sip"
    PyObject *iter = PyObject_GetIter(sipPy);

    if (!sipIsErr)
    {
        PyErr_Clear();
        Py_XDECREF(iter);

        return (iter && !PyBytes_Check(sipPy) && !PyUnicode_Check(sipPy));
    }

    if (!iter)
    {
        *sipIsErr = 1;

        return 0;
    }

    QList<QSurface3DSeries *> *ql = new QList<QSurface3DSeries *>;
 
    for (Py_ssize_t i = 0; ; ++i)
    {
        PyErr_Clear();
        PyObject *itm = PyIter_Next(iter);

        if (!itm)
        {
            if (PyErr_Occurred())
            {
                delete ql;
                Py_DECREF(iter);
                *sipIsErr = 1;

                return 0;
            }

            break;
        }

        QSurface3DSeries *t = reinterpret_cast<QSurface3DSeries *>(
                sipForceConvertToType(itm, sipType_QSurface3DSeries, sipTransferObj, 0,
                        0, sipIsErr));
 
        if (*sipIsErr)
        {
            PyErr_Format(PyExc_TypeError,
                    "index %zd has type '%s' but 'QSurface3DSeries' is expected", i,
                    sipPyTypeName(Py_TYPE(itm)));

            Py_DECREF(itm);
            delete ql;
            Py_DECREF(iter);

            return 0;
        }

        ql->append(t);

        Py_DECREF(itm);
    }

    Py_DECREF(iter);
 
    *sipCppPtr = ql;
 
    return sipGetState(sipTransferObj);
#line 138 "/build/pyqt6-datavisualization/src/pyqt6_datavisualization-6.11.0/build/QtDataVisualization/sipQtDataVisualizationQList0101QSurface3DSeries.cpp"
}


extern "C" {static PyObject *convertFrom_QList_0101QSurface3DSeries(void *, PyObject *);}
static PyObject *convertFrom_QList_0101QSurface3DSeries(void *sipCppV, PyObject *sipTransferObj)
{
    QList< ::QSurface3DSeries*> *sipCpp = reinterpret_cast<QList< ::QSurface3DSeries*> *>(sipCppV);

#line 139 "/usr/lib/python3.14/site-packages/PyQt6/bindings/QtCore/qpycore_qlist.sip"
    int gc_enabled = sipEnableGC(0);
    PyObject *l = PyList_New(sipCpp->size());

    if (l)
    {
        for (int i = 0; i < sipCpp->size(); ++i)
        {
            QSurface3DSeries *t = sipCpp->at(i);

            // The explicit (void *) cast allows QSurface3DSeries to be const.
            PyObject *tobj = sipConvertFromType((void *)t, sipType_QSurface3DSeries,
                    sipTransferObj);

            if (!tobj)
            {
                Py_DECREF(l);
                l = 0;

                break;
            }

            PyList_SetItem(l, i, tobj);
        }
    }

    sipEnableGC(gc_enabled);

    return l;
#line 176 "/build/pyqt6-datavisualization/src/pyqt6_datavisualization-6.11.0/build/QtDataVisualization/sipQtDataVisualizationQList0101QSurface3DSeries.cpp"
}


sipMappedTypeDef sipTypeDef_QtDataVisualization_QList_0101QSurface3DSeries = {
    {
        SIP_NULLPTR,
        SIP_TYPE_MAPPED,
        sipNameNr_2071,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        -1,
        {0, 0, 1},
        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}
    },
    assign_QList_0101QSurface3DSeries,
    array_QList_0101QSurface3DSeries,
    copy_QList_0101QSurface3DSeries,
    release_QList_0101QSurface3DSeries,
    convertTo_QList_0101QSurface3DSeries,
    convertFrom_QList_0101QSurface3DSeries
};
