Ticket #36801: sipQtGuiQList0100QGlyphRun.cpp

File sipQtGuiQList0100QGlyphRun.cpp, 6.5 KB (added by berg-michael (Michael Berg), 12 years ago)

file from /work/PyQt-mac- gpl-4.9.4/QtGui/sipQtGuiQList0100QGlyphRun.cpp

Line 
1/*
2 * Interface wrapper code.
3 *
4 * Generated by SIP 4.13.3 on Sat Nov 10 11:02:46 2012
5 *
6 * Copyright (c) 2012 Riverbank Computing Limited <info@riverbankcomputing.com>
7 *
8 * This file is part of PyQt.
9 *
10 * This file may be used under the terms of the GNU General Public
11 * License versions 2.0 or 3.0 as published by the Free Software
12 * Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
13 * included in the packaging of this file.  Alternatively you may (at
14 * your option) use any later version of the GNU General Public
15 * License if such license has been publicly approved by Riverbank
16 * Computing Limited (or its successors, if any) and the KDE Free Qt
17 * Foundation. In addition, as a special exception, Riverbank gives you
18 * certain additional rights. These rights are described in the Riverbank
19 * GPL Exception version 1.1, which can be found in the file
20 * GPL_EXCEPTION.txt in this package.
21 *
22 * If you are unsure which license is appropriate for your use, please
23 * contact the sales department at sales@riverbankcomputing.com.
24 *
25 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27 */
28
29#include "sipAPIQtGui.h"
30
31#line 33 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-pyqt4/py27-pyqt4/work/PyQt-mac-gpl-4.9.4/sip/QtCore/qlist.sip"
32#include <qlist.h>
33#line 34 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-pyqt4/py27-pyqt4/work/PyQt-mac-gpl-4.9.4/QtGui/sipQtGuiQList0100QGlyphRun.cpp"
34
35#line 33 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-pyqt4/py27-pyqt4/work/PyQt-mac-gpl-4.9.4/sip/QtGui/qglyphrun.sip"
36#include <qglyphrun.h>
37#line 38 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-pyqt4/py27-pyqt4/work/PyQt-mac-gpl-4.9.4/QtGui/sipQtGuiQList0100QGlyphRun.cpp"
38
39
40extern "C" {static void assign_QList_0100QGlyphRun(void *, SIP_SSIZE_T, const void *);}
41static void assign_QList_0100QGlyphRun(void *sipDst, SIP_SSIZE_T sipDstIdx, const void *sipSrc)
42{
43    reinterpret_cast<QList<QGlyphRun> *>(sipDst)[sipDstIdx] = *reinterpret_cast<const QList<QGlyphRun> *>(sipSrc);
44}
45
46
47extern "C" {static void *array_QList_0100QGlyphRun(SIP_SSIZE_T);}
48static void *array_QList_0100QGlyphRun(SIP_SSIZE_T sipNrElem)
49{
50    return new QList<QGlyphRun>[sipNrElem];
51}
52
53
54extern "C" {static void *copy_QList_0100QGlyphRun(const void *, SIP_SSIZE_T);}
55static void *copy_QList_0100QGlyphRun(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
56{
57    return new QList<QGlyphRun>(reinterpret_cast<const QList<QGlyphRun> *>(sipSrc)[sipSrcIdx]);
58}
59
60
61/* Call the mapped type's destructor. */
62extern "C" {static void release_QList_0100QGlyphRun(void *, int);}
63static void release_QList_0100QGlyphRun(void *ptr, int)
64{
65    Py_BEGIN_ALLOW_THREADS
66    delete reinterpret_cast<QList<QGlyphRun> *>(ptr);
67    Py_END_ALLOW_THREADS
68}
69
70
71
72extern "C" {static int convertTo_QList_0100QGlyphRun(PyObject *, void **, int *, PyObject *);}
73static int convertTo_QList_0100QGlyphRun(PyObject *sipPy,void **sipCppPtrV,int *sipIsErr,PyObject *sipTransferObj)
74{
75    QList<QGlyphRun> **sipCppPtr = reinterpret_cast<QList<QGlyphRun> **>(sipCppPtrV);
76
77#line 64 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-pyqt4/py27-pyqt4/work/PyQt-mac-gpl-4.9.4/sip/QtCore/qlist.sip"
78    SIP_SSIZE_T len;
79
80    // Check the type if that is all that is required.
81    if (sipIsErr == NULL)
82    {
83        if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0)
84            return 0;
85
86        for (SIP_SSIZE_T i = 0; i < len; ++i)
87        {
88            PyObject *itm = PySequence_ITEM(sipPy, i);
89            bool ok = (itm && sipCanConvertToType(itm, sipType_QGlyphRun, SIP_NOT_NONE));
90
91            Py_XDECREF(itm);
92
93            if (!ok)
94                return 0;
95        }
96
97        return 1;
98    }
99
100    QList<QGlyphRun> *ql = new QList<QGlyphRun>;
101    len = PySequence_Size(sipPy);
102 
103    for (SIP_SSIZE_T i = 0; i < len; ++i)
104    {
105        PyObject *itm = PySequence_ITEM(sipPy, i);
106        int state;
107        QGlyphRun *t = reinterpret_cast<QGlyphRun *>(sipConvertToType(itm, sipType_QGlyphRun, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
108
109        Py_DECREF(itm);
110 
111        if (*sipIsErr)
112        {
113            sipReleaseType(t, sipType_QGlyphRun, state);
114
115            delete ql;
116            return 0;
117        }
118
119        ql->append(*t);
120
121        sipReleaseType(t, sipType_QGlyphRun, state);
122    }
123 
124    *sipCppPtr = ql;
125 
126    return sipGetState(sipTransferObj);
127#line 128 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-pyqt4/py27-pyqt4/work/PyQt-mac-gpl-4.9.4/QtGui/sipQtGuiQList0100QGlyphRun.cpp"
128}
129
130
131extern "C" {static PyObject *convertFrom_QList_0100QGlyphRun(void *, PyObject *);}
132static PyObject *convertFrom_QList_0100QGlyphRun(void *sipCppV,PyObject *sipTransferObj)
133{
134   QList<QGlyphRun> *sipCpp = reinterpret_cast<QList<QGlyphRun> *>(sipCppV);
135
136#line 37 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-pyqt4/py27-pyqt4/work/PyQt-mac-gpl-4.9.4/sip/QtCore/qlist.sip"
137    // Create the list.
138    PyObject *l;
139
140    if ((l = PyList_New(sipCpp->size())) == NULL)
141        return NULL;
142
143    // Set the list elements.
144    for (int i = 0; i < sipCpp->size(); ++i)
145    {
146        QGlyphRun *t = new QGlyphRun(sipCpp->at(i));
147        PyObject *tobj;
148
149        if ((tobj = sipConvertFromNewType(t, sipType_QGlyphRun, sipTransferObj)) == NULL)
150        {
151            Py_DECREF(l);
152            delete t;
153
154            return NULL;
155        }
156
157        PyList_SET_ITEM(l, i, tobj);
158    }
159
160    return l;
161#line 162 "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-pyqt4/py27-pyqt4/work/PyQt-mac-gpl-4.9.4/QtGui/sipQtGuiQList0100QGlyphRun.cpp"
162}
163
164
165sipMappedTypeDef sipTypeDef_QtGui_QList_0100QGlyphRun = {
166    {
167        -1,
168        0,
169        0,
170        SIP_TYPE_MAPPED,
171        sipNameNr_44297,
172        {0}
173    },
174    {
175        -1,
176        {0, 0, 1},
177        0, 0,
178        0, 0,
179        0, 0,
180        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
181    },
182    assign_QList_0100QGlyphRun,
183    array_QList_0100QGlyphRun,
184    copy_QList_0100QGlyphRun,
185    release_QList_0100QGlyphRun,
186    convertTo_QList_0100QGlyphRun,
187    convertFrom_QList_0100QGlyphRun
188};