Moved AutoArrayPointer from libpyside to libshiboken.
Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
d129ca02f6
commit
fae2dfd9b1
5 changed files with 4 additions and 66 deletions
|
|
@ -3257,10 +3257,6 @@
|
||||||
|
|
||||||
<!-- TODO: Support conversions on virtual function -->
|
<!-- TODO: Support conversions on virtual function -->
|
||||||
<modify-function signature="drawItems(QPainter*, int, QGraphicsItem**, const QStyleOptionGraphicsItem*)">
|
<modify-function signature="drawItems(QPainter*, int, QGraphicsItem**, const QStyleOptionGraphicsItem*)">
|
||||||
<extra-includes>
|
|
||||||
<include file-name="autoarraypointer.h" location="global"/>
|
|
||||||
</extra-includes>
|
|
||||||
|
|
||||||
<modify-argument index="2">
|
<modify-argument index="2">
|
||||||
<remove-argument/>
|
<remove-argument/>
|
||||||
<conversion-rule class="native">
|
<conversion-rule class="native">
|
||||||
|
|
@ -3272,7 +3268,7 @@
|
||||||
<replace-type modified-type="PySequence"/>
|
<replace-type modified-type="PySequence"/>
|
||||||
<conversion-rule class="native">
|
<conversion-rule class="native">
|
||||||
int numItems = PySequence_Size(%PYARG_1);
|
int numItems = PySequence_Size(%PYARG_1);
|
||||||
PySide::AutoArrayPointer<QGraphicsItem*> %out(numItems);
|
Shiboken::AutoArrayPointer<QGraphicsItem*> %out(numItems);
|
||||||
for (int i=0; i < numItems; i++) {
|
for (int i=0; i < numItems; i++) {
|
||||||
%out[i] = %CONVERTTOCPP[QGraphicsItem*](PySequence_Fast_GET_ITEM(%PYARG_1, i));
|
%out[i] = %CONVERTTOCPP[QGraphicsItem*](PySequence_Fast_GET_ITEM(%PYARG_1, i));
|
||||||
}
|
}
|
||||||
|
|
@ -3299,7 +3295,7 @@
|
||||||
|
|
||||||
<conversion-rule class="native">
|
<conversion-rule class="native">
|
||||||
int numOptions = PySequence_Size(%PYARG_2);
|
int numOptions = PySequence_Size(%PYARG_2);
|
||||||
PySide::AutoArrayPointer<QStyleOptionGraphicsItem> %out(numOptions);
|
Shiboken::AutoArrayPointer<QStyleOptionGraphicsItem> %out(numOptions);
|
||||||
for (int i=0; i < numOptions; i++) {
|
for (int i=0; i < numOptions; i++) {
|
||||||
%out[i] = %CONVERTTOCPP[QStyleOptionGraphicsItem](PySequence_Fast_GET_ITEM(%PYARG_1, i));
|
%out[i] = %CONVERTTOCPP[QStyleOptionGraphicsItem](PySequence_Fast_GET_ITEM(%PYARG_1, i));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
PySide::AutoArrayPointer<char> data(%ARGUMENT_NAMES);
|
Shiboken::AutoArrayPointer<char> data(%ARGUMENT_NAMES);
|
||||||
QHostAddress ha;
|
QHostAddress ha;
|
||||||
quint16 port;
|
quint16 port;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,10 +53,6 @@
|
||||||
<enum-type name="State"/>
|
<enum-type name="State"/>
|
||||||
<enum-type name="TransferMode"/>
|
<enum-type name="TransferMode"/>
|
||||||
<enum-type name="TransferType"/>
|
<enum-type name="TransferType"/>
|
||||||
<extra-includes>
|
|
||||||
<include file-name="autoarraypointer.h" location="global"/>
|
|
||||||
</extra-includes>
|
|
||||||
|
|
||||||
<modify-function signature="connectToHost(const QString&, quint16)" allow-thread="yes" />
|
<modify-function signature="connectToHost(const QString&, quint16)" allow-thread="yes" />
|
||||||
<modify-function signature="login(const QString&, const QString&)" allow-thread="yes" />
|
<modify-function signature="login(const QString&, const QString&)" allow-thread="yes" />
|
||||||
<modify-function signature="close()" allow-thread="yes" />
|
<modify-function signature="close()" allow-thread="yes" />
|
||||||
|
|
@ -88,10 +84,6 @@
|
||||||
<enum-type name="ConnectionMode"/>
|
<enum-type name="ConnectionMode"/>
|
||||||
<enum-type name="Error"/>
|
<enum-type name="Error"/>
|
||||||
<enum-type name="State"/>
|
<enum-type name="State"/>
|
||||||
<extra-includes>
|
|
||||||
<include file-name="autoarraypointer.h" location="global"/>
|
|
||||||
</extra-includes>
|
|
||||||
|
|
||||||
<modify-function signature="readAll()" allow-thread="yes"/>
|
<modify-function signature="readAll()" allow-thread="yes"/>
|
||||||
<modify-function signature="read(char*, qint64)" allow-thread="yes">
|
<modify-function signature="read(char*, qint64)" allow-thread="yes">
|
||||||
<modify-argument index="return">
|
<modify-argument index="return">
|
||||||
|
|
@ -129,10 +121,6 @@
|
||||||
<object-type name="QTcpSocket"/>
|
<object-type name="QTcpSocket"/>
|
||||||
<object-type name="QUdpSocket">
|
<object-type name="QUdpSocket">
|
||||||
<enum-type name="BindFlag" flags="BindMode"/>
|
<enum-type name="BindFlag" flags="BindMode"/>
|
||||||
<extra-includes>
|
|
||||||
<include file-name="autoarraypointer.h" location="global"/>
|
|
||||||
</extra-includes>
|
|
||||||
|
|
||||||
<modify-function signature="readDatagram(char*, qint64, QHostAddress*, quint16*)" allow-thread="yes">
|
<modify-function signature="readDatagram(char*, qint64, QHostAddress*, quint16*)" allow-thread="yes">
|
||||||
<modify-argument index="1">
|
<modify-argument index="1">
|
||||||
<remove-argument/>
|
<remove-argument/>
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@
|
||||||
%PYARG_0 = Shiboken::makeTuple(a, b, c, d, e);
|
%PYARG_0 = Shiboken::makeTuple(a, b, c, d, e);
|
||||||
</template>
|
</template>
|
||||||
<template name="read_wrapper">
|
<template name="read_wrapper">
|
||||||
PySide::AutoArrayPointer<char> _data(%2);
|
Shiboken::AutoArrayPointer<char> _data(%2);
|
||||||
qint64 _size = %CPPSELF.%FUNCTION_NAME(_data, %2);
|
qint64 _size = %CPPSELF.%FUNCTION_NAME(_data, %2);
|
||||||
if (_size > 0)
|
if (_size > 0)
|
||||||
%PYARG_0 = %CONVERTTOPYTHON[QByteArray](QByteArray(_data, _size));
|
%PYARG_0 = %CONVERTTOPYTHON[QByteArray](QByteArray(_data, _size));
|
||||||
|
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
/*
|
|
||||||
* This file is part of the PySide project.
|
|
||||||
*
|
|
||||||
* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
*
|
|
||||||
* Contact: PySide team <contact@pyside.org>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef AUTOARRAYPOINTER_H
|
|
||||||
#define AUTOARRAYPOINTER_H
|
|
||||||
|
|
||||||
|
|
||||||
namespace PySide
|
|
||||||
{
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
class AutoArrayPointer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
AutoArrayPointer(int size) { data = new T[size]; }
|
|
||||||
T& operator[](int pos) { return data[pos]; }
|
|
||||||
operator T*() const { return data; }
|
|
||||||
~AutoArrayPointer() { delete[] data; }
|
|
||||||
private:
|
|
||||||
T* data;
|
|
||||||
};
|
|
||||||
|
|
||||||
} //namespace PySide
|
|
||||||
|
|
||||||
|
|
||||||
#endif // AUTOARRAYPOINTER_H
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue