summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-11-10 20:01:04 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-11-10 20:17:24 -0200
commit23c1b92073a25e23e2c3bdb2e1a758cfbb64fe79 (patch)
treeadaee02820f58a600e178c9fa0fb7fa1a2618271
parent92dcb7ae3a92416b4129d549625eba0512e02426 (diff)
downloadpyside-23c1b92073a25e23e2c3bdb2e1a758cfbb64fe79.tar.gz
pyside-23c1b92073a25e23e2c3bdb2e1a758cfbb64fe79.tar.xz
pyside-23c1b92073a25e23e2c3bdb2e1a758cfbb64fe79.zip
Changes needed to compile PySide with libshiboken v1.0
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
-rw-r--r--PySide/QtGui/glue/qapplication_init.cpp20
-rw-r--r--PySide/QtGui/glue/qlayout_help_functions.h22
-rw-r--r--PySide/QtGui/glue/qmenu_glue.h7
-rw-r--r--PySide/QtGui/glue/qwidget_glue.h8
-rw-r--r--PySide/QtGui/qpixmap_conversion.h4
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml10
-rw-r--r--PySide/QtWebKit/typesystem_webkit.xml4
-rw-r--r--PySide/phonon/typesystem_phonon.xml4
-rw-r--r--PySide/typesystem_templates.xml4
9 files changed, 40 insertions, 43 deletions
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index fcacc02..51ed3ff 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -5,9 +5,9 @@ static int QApplicationArgCount;
static char** QApplicationArgValues;
static const char QAPP_MACRO[] = "qApp";
-int SbkQApplication_Init(PyObject* self, PyObject* args, PyObject*)
+int Sbk_QApplication_Init(PyObject* self, PyObject* args, PyObject*)
{
- if (Shiboken::isUserType(self) && !Shiboken::canCallConstructor(self->ob_type, Shiboken::SbkType<QApplication >()))
+ if (Shiboken::isUserType(self) && !Shiboken::canCallConstructor(self->ob_type, Shiboken::SbkType<QApplication>()))
return -1;
if (QApplication::instance()) {
@@ -21,19 +21,19 @@ int SbkQApplication_Init(PyObject* self, PyObject* args, PyObject*)
return -1;
}
- if (!PySequenceToArgcArgv(PyTuple_GET_ITEM(args, 0), &QApplicationArgCount, &QApplicationArgValues, "PySideApp")) {
+ if (!Shiboken::sequenceToArgcArgv(PyTuple_GET_ITEM(args, 0), &QApplicationArgCount, &QApplicationArgValues, "PySideApp")) {
PyErr_BadArgument();
return -1;
}
+ SbkObject* sbkSelf = reinterpret_cast<SbkObject*>(self);
QApplicationWrapper* cptr = new QApplicationWrapper(QApplicationArgCount, QApplicationArgValues);
- Shiboken::setCppPointer(reinterpret_cast<SbkBaseWrapper*>(self),
- Shiboken::SbkType<QApplication>(),
- cptr);
- SbkBaseWrapper_setValidCppObject(self, 1);
- SbkBaseWrapper *sbkSelf = reinterpret_cast<SbkBaseWrapper*>(self);
- sbkSelf->containsCppWrapper = 1;
- sbkSelf->hasOwnership = 0;
+ Shiboken::Wrapper::setCppPointer(sbkSelf,
+ Shiboken::SbkType<QApplication>(),
+ cptr);
+ Shiboken::Wrapper::setValidCpp(sbkSelf, true);
+ Shiboken::Wrapper::setHasCppWrapper(sbkSelf, true);
+ Shiboken::Wrapper::releaseOwnership(sbkSelf);
Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);
PySide::Signal::updateSourceObject(self);
cptr->metaObject();
diff --git a/PySide/QtGui/glue/qlayout_help_functions.h b/PySide/QtGui/glue/qlayout_help_functions.h
index e62077a..0a6dd0e 100644
--- a/PySide/QtGui/glue/qlayout_help_functions.h
+++ b/PySide/QtGui/glue/qlayout_help_functions.h
@@ -1,24 +1,24 @@
#ifndef QLAYOUT_HELP_FUNCTIONS
#define QLAYOUT_HELP_FUNCTIONS
-void addLayoutOwnership(QLayout *layout, QLayoutItem *item);
+void addLayoutOwnership(QLayout* layout, QLayoutItem* item);
-inline QByteArray retrieveObjectName(PyObject *obj)
+inline QByteArray retrieveObjectName(PyObject* obj)
{
Shiboken::AutoDecRef objName(PyObject_Str(obj));
return PyString_AsString(objName);
}
-inline void addLayoutOwnership(QLayout *layout, QWidget *widget)
+inline void addLayoutOwnership(QLayout* layout, QWidget* widget)
{
//transfer ownership to parent widget
- QWidget *parent = layout->parentWidget();
+ QWidget* parent = layout->parentWidget();
if (!parent) {
//keep the reference while the layout is orphan
Shiboken::AutoDecRef pyParent(Shiboken::Converter<QWidget*>::toPython(layout));
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QWidget*>::toPython(widget));
- Shiboken::keepReference(reinterpret_cast<Shiboken::SbkBaseWrapper*>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true);
+ Shiboken::keepReference(reinterpret_cast<SbkObject*>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true);
} else {
Shiboken::AutoDecRef pyParent(Shiboken::Converter<QWidget*>::toPython(parent));
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QWidget*>::toPython(widget));
@@ -26,15 +26,15 @@ inline void addLayoutOwnership(QLayout *layout, QWidget *widget)
}
}
-inline void addLayoutOwnership(QLayout *layout, QLayout *other)
+inline void addLayoutOwnership(QLayout* layout, QLayout* other)
{
//transfer all children widgetes from other to layout parent widget
- QWidget *parent = layout->parentWidget();
+ QWidget* parent = layout->parentWidget();
if (!parent) {
//keep the reference while the layout is orphan
Shiboken::AutoDecRef pyParent(Shiboken::Converter<QLayout*>::toPython(layout));
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QLayout*>::toPython(other));
- Shiboken::keepReference(reinterpret_cast<Shiboken::SbkBaseWrapper*>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true);
+ Shiboken::keepReference(reinterpret_cast<SbkObject*>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true);
return;
}
@@ -48,13 +48,13 @@ inline void addLayoutOwnership(QLayout *layout, QLayout *other)
}
-inline void addLayoutOwnership(QLayout *layout, QLayoutItem *item)
+inline void addLayoutOwnership(QLayout* layout, QLayoutItem* item)
{
- QWidget *w = item->widget();
+ QWidget* w = item->widget();
if (w)
addLayoutOwnership(layout, w);
else {
- QLayout *l = item->layout();
+ QLayout* l = item->layout();
if (l)
addLayoutOwnership(layout, l);
}
diff --git a/PySide/QtGui/glue/qmenu_glue.h b/PySide/QtGui/glue/qmenu_glue.h
index 1a6cb19..94eab15 100644
--- a/PySide/QtGui/glue/qmenu_glue.h
+++ b/PySide/QtGui/glue/qmenu_glue.h
@@ -1,8 +1,7 @@
-inline PyObject*
-addActionWithPyObject(QMenu *self, const QIcon& icon, const QString& text, PyObject *callback, const QKeySequence &shortcut)
+inline PyObject* addActionWithPyObject(QMenu* self, const QIcon& icon, const QString& text, PyObject* callback, const QKeySequence& shortcut)
{
- QAction *act = new QAction(text, self);
+ QAction* act = new QAction(text, self);
if (!icon.isNull())
act->setIcon(icon);
@@ -12,7 +11,7 @@ addActionWithPyObject(QMenu *self, const QIcon& icon, const QString& text, PyObj
self->addAction(act);
- PyObject *pyAct = Shiboken::Converter<QAction*>::toPython(act);
+ PyObject* pyAct = Shiboken::Converter<QAction*>::toPython(act);
Shiboken::AutoDecRef result(PyObject_CallMethod(pyAct, "connect", "OsO", pyAct, SIGNAL(triggered()), callback));
if (result.isNull()) {
Py_DECREF(pyAct);
diff --git a/PySide/QtGui/glue/qwidget_glue.h b/PySide/QtGui/glue/qwidget_glue.h
index 6be6518..0339e89 100644
--- a/PySide/QtGui/glue/qwidget_glue.h
+++ b/PySide/QtGui/glue/qwidget_glue.h
@@ -8,8 +8,7 @@ static QString retrieveObjectName(PyObject *obj)
/**
* Tranfer objects ownership from layout to widget
**/
-static inline void
-qwidgetReparentLayout(QWidget *parent, QLayout *layout)
+static inline void qwidgetReparentLayout(QWidget *parent, QLayout *layout)
{
Shiboken::AutoDecRef pyParent(Shiboken::Converter<QWidget*>::toPython(parent));
@@ -36,11 +35,10 @@ qwidgetReparentLayout(QWidget *parent, QLayout *layout)
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QLayout*>::toPython(layout));
Shiboken::setParent(pyParent, pyChild);
//remove previous references
- Shiboken::keepReference(reinterpret_cast<Shiboken::SbkBaseWrapper*>(pyChild.object()), qPrintable(retrieveObjectName(pyChild)), Py_None);
+ Shiboken::keepReference(reinterpret_cast<SbkObject*>(pyChild.object()), qPrintable(retrieveObjectName(pyChild)), Py_None);
}
-static inline void
-qwidgetSetLayout(QWidget *self, QLayout *layout)
+static inline void qwidgetSetLayout(QWidget *self, QLayout *layout)
{
if (!layout || self->layout())
return;
diff --git a/PySide/QtGui/qpixmap_conversion.h b/PySide/QtGui/qpixmap_conversion.h
index 1423959..ba21e08 100644
--- a/PySide/QtGui/qpixmap_conversion.h
+++ b/PySide/QtGui/qpixmap_conversion.h
@@ -8,7 +8,7 @@ inline bool Converter<QPixmap>::isConvertible(PyObject* pyobj)
{
if (ValueTypeConverter<QPixmap>::isConvertible(pyobj))
return true;
- SbkBaseWrapperType* shiboType = reinterpret_cast<SbkBaseWrapperType*>(SbkType<QPixmap>());
+ SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType<QPixmap>());
bool isVariant = Converter<QVariant>::checkType(pyobj);
if (isVariant) {
QVariant var(Converter<QVariant>::toCpp(pyobj));
@@ -24,7 +24,7 @@ inline bool Converter<QPixmap>::isConvertible(PyObject* pyobj)
inline QPixmap Converter<QPixmap>::toCpp(PyObject* pyobj)
{
- SbkBaseWrapperType* shiboType = reinterpret_cast<SbkBaseWrapperType*>(SbkType<QPixmap>());
+ SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType<QPixmap>());
bool isVariant = Converter<QVariant>::checkType(pyobj);
if (isVariant) {
QVariant var(Converter<QVariant>::toCpp(pyobj));
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index b54dfb6..7dd9aae 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -526,7 +526,7 @@
<add-function signature="value()" return-type="QTreeWidgetItem*">
<inject-code>
%PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItem*](%CPPSELF.operator*());
- SbkBaseWrapper_setOwnership(%PYARG_0, false);
+ Shiboken::Wrapper::releaseOwnership(%PYARG_0);
</inject-code>
</add-function>
<enum-type name="IteratorFlag" flags="QTreeWidgetItemIterator::IteratorFlags"/>
@@ -1140,7 +1140,7 @@
<enum-type name="PanelModality"/>
<inject-code class="target" position="end">
PyObject* userTypeConstant = PyInt_FromLong(QGraphicsItem::UserType);
- PyDict_SetItemString(SbkQGraphicsItem_Type.super.ht_type.tp_dict, "UserType", userTypeConstant);
+ PyDict_SetItemString(Sbk_QGraphicsItem_Type.super.ht_type.tp_dict, "UserType", userTypeConstant);
</inject-code>
<modify-function signature="setParentItem(QGraphicsItem *)">
<modify-argument index="this">
@@ -3300,7 +3300,7 @@
<modify-function signature="setStyle(QStyle*)">
<inject-code class="target" position="end">
- Shiboken::keepReference(reinterpret_cast&lt;Shiboken::SbkBaseWrapper*&gt;(%PYSELF), "__style__", %PYARG_1);
+ Shiboken::keepReference(reinterpret_cast&lt;SbkObject*&gt;(%PYSELF), "__style__", %PYARG_1);
</inject-code>
</modify-function>
<modify-function signature="style()const">
@@ -3312,9 +3312,9 @@
if (appStyle == myStyle) {
Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp));
Shiboken::setParent(pyApp, %PYARG_0);
- SbkBaseWrapper_setOwnership(%PYARG_0, false);
+ Shiboken::Wrapper::releaseOwnership(%PYARG_0);
} else {
- Shiboken::keepReference(reinterpret_cast&lt;Shiboken::SbkBaseWrapper*&gt;(%PYSELF), "__style__", %PYARG_0);
+ Shiboken::keepReference(reinterpret_cast&lt;SbkObject*&gt;(%PYSELF), "__style__", %PYARG_0);
}
}
</inject-code>
diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml
index 1eebe4a..b56a909 100644
--- a/PySide/QtWebKit/typesystem_webkit.xml
+++ b/PySide/QtWebKit/typesystem_webkit.xml
@@ -39,8 +39,8 @@
<define-ownership class="target" owner="default"/>
</modify-argument>
<inject-code position="end">
- Shiboken::SbkBaseWrapper* _pyReturn = reinterpret_cast&lt;Shiboken::SbkBaseWrapper*&gt;(%PYARG_0);
- if (!_pyReturn->parentInfo)
+ SbkObject* _pyReturn = reinterpret_cast&lt;SbkObject*&gt;(%PYARG_0);
+ if (!Shiboken::Wrapper::hasParentInfo(_pyReturn))
Shiboken::setParent(%PYSELF, %PYARG_0);
</inject-code>
</modify-function>
diff --git a/PySide/phonon/typesystem_phonon.xml b/PySide/phonon/typesystem_phonon.xml
index 310ae90..16dd72c 100644
--- a/PySide/phonon/typesystem_phonon.xml
+++ b/PySide/phonon/typesystem_phonon.xml
@@ -86,11 +86,11 @@
PySideSignal* signal_item;
signal_item = PySide::Signal::newObject("capabilitiesChanged", "void", NULL);
- PyDict_SetItemString(SbkPhonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, "capabilitiesChanged", (PyObject*)signal_item);
+ PyDict_SetItemString(Sbk_Phonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, "capabilitiesChanged", (PyObject*)signal_item);
Py_DECREF(signal_item);
signal_item = PySide::Signal::newObject("availableAudioOutputDevicesChanged", "void", NULL);
- PyDict_SetItemString( SbkPhonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, "availableAudioOutputDevicesChanged", (PyObject*)signal_item);
+ PyDict_SetItemString( Sbk_Phonon_BackendCapabilities_NotifierWrapper_Type.super.ht_type.tp_dict, "availableAudioOutputDevicesChanged", (PyObject*)signal_item);
Py_DECREF(signal_item);
</inject-code>
</object-type>
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index 5763434..968195f 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -182,8 +182,8 @@
%PYARG_0 = Shiboken::makeTuple(retval_, %4);
</template>
<template name="set_qapp_parent_for_orphan">
- Shiboken::SbkBaseWrapper* _pySelf = reinterpret_cast&lt;Shiboken::SbkBaseWrapper*&gt;(%PYARG_0);
- if (!_pySelf->parentInfo)
+ SbkObject* _pySelf = reinterpret_cast&lt;SbkObject*&gt;(%PYARG_0);
+ if (!Shiboken::Wrapper::hasParentInfo(_pySelf))
Shiboken::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0);
</template>
<!-- templates for __reduce__ -->