diff options
-rw-r--r-- | generator/cppgenerator.cpp | 50 | ||||
-rw-r--r-- | generator/headergenerator.cpp | 2 | ||||
-rw-r--r-- | libshiboken/basewrapper.cpp | 20 | ||||
-rw-r--r-- | libshiboken/basewrapper.h | 10 | ||||
-rw-r--r-- | libshiboken/basewrapper_p.h | 4 | ||||
-rw-r--r-- | libshiboken/bindingmanager.cpp | 2 | ||||
-rw-r--r-- | libshiboken/conversions.h | 16 | ||||
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 6 |
8 files changed, 55 insertions, 55 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index fe90843f..aaa6d679 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -469,7 +469,7 @@ void CppGenerator::writeDestructorNative(QTextStream &s, const AbstractMetaClass Indentation indentation(INDENT); s << wrapperName(metaClass) << "::~" << wrapperName(metaClass) << "()" << endl << '{' << endl; s << INDENT << "SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this);" << endl; - s << INDENT << "Shiboken::Wrapper::destroy(wrapper);" << endl; + s << INDENT << "Shiboken::Object::destroy(wrapper);" << endl; s << '}' << endl; } @@ -738,7 +738,7 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu if (invalidateReturn) { s << INDENT << "if (invalidadeArg0)" << endl; Indentation indentation(INDENT); - s << INDENT << "Shiboken::Wrapper::invalidate(" << PYTHON_RETURN_VAR ".object());" << endl; + s << INDENT << "Shiboken::Object::invalidate(" << PYTHON_RETURN_VAR ".object());" << endl; } foreach (FunctionModification funcMod, func->modifications()) { @@ -746,7 +746,7 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu if (argMod.resetAfterUse) { s << INDENT << "if (invalidadeArg" << argMod.index << ")" << endl; Indentation indentation(INDENT); - s << INDENT << "Shiboken::Wrapper::invalidate(PyTuple_GET_ITEM(pyargs, "; + s << INDENT << "Shiboken::Object::invalidate(PyTuple_GET_ITEM(pyargs, "; s << (argMod.index - 1) << "));" << endl; } } @@ -786,7 +786,7 @@ void CppGenerator::writeMetaObjectMethod(QTextStream& s, const AbstractMetaClass { Indentation indentation(INDENT); s << INDENT << "SbkObject* pySelf = Shiboken::BindingManager::instance().retrieveWrapper(this);\n" - << INDENT << "void* typeData = Shiboken::Wrapper::getTypeUserData(pySelf);" << endl + << INDENT << "void* typeData = Shiboken::Object::getTypeUserData(pySelf);" << endl << INDENT << "if (!typeData) {" << endl; { Indentation indentation2(INDENT); @@ -828,7 +828,7 @@ void CppGenerator::writeConstructorWrapper(QTextStream& s, const AbstractMetaFun // Check if the right constructor was called. if (!metaClass->hasPrivateDestructor()) { - s << INDENT << "if (Shiboken::Wrapper::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType<" << metaClass->qualifiedCppName() << " >()))" << endl; + s << INDENT << "if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType<" << metaClass->qualifiedCppName() << " >()))" << endl; Indentation indent(INDENT); s << INDENT << "return " << m_currentErrorCode << ';' << endl << endl; } @@ -920,7 +920,7 @@ void CppGenerator::writeConstructorWrapper(QTextStream& s, const AbstractMetaFun if (hasPythonConvertion) s << INDENT << "}" << endl; - s << INDENT << "if (PyErr_Occurred() || !Shiboken::Wrapper::setCppPointer(sbkSelf, Shiboken::SbkType<" << metaClass->qualifiedCppName() << " >(), cptr)) {" << endl; + s << INDENT << "if (PyErr_Occurred() || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType<" << metaClass->qualifiedCppName() << " >(), cptr)) {" << endl; { Indentation indent(INDENT); s << INDENT << "delete cptr;" << endl; @@ -932,13 +932,13 @@ void CppGenerator::writeConstructorWrapper(QTextStream& s, const AbstractMetaFun s << endl; } - s << INDENT << "Shiboken::Wrapper::setValidCpp(sbkSelf, true);" << endl; + s << INDENT << "Shiboken::Object::setValidCpp(sbkSelf, true);" << endl; // If the created C++ object has a C++ wrapper the ownership is assigned to Python // (first "1") and the flag indicating that the Python wrapper holds an C++ wrapper // is marked as true (the second "1"). Otherwise the default values apply: // Python owns it and C++ wrapper is false. if (shouldGenerateCppWrapper(overloads.first()->ownerClass())) - s << INDENT << "Shiboken::Wrapper::setHasCppWrapper(sbkSelf, true);" << endl; + s << INDENT << "Shiboken::Object::setHasCppWrapper(sbkSelf, true);" << endl; s << INDENT << "Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);" << endl; // Create metaObject and register signal/slot @@ -1171,7 +1171,7 @@ void CppGenerator::writeMethodWrapper(QTextStream& s, const AbstractMetaFunction s << INDENT << "if (!isReverse" << endl; { Indentation indent(INDENT); - s << INDENT << "&& Shiboken::Wrapper::checkType(arg)" << endl; + s << INDENT << "&& Shiboken::Object::checkType(arg)" << endl; s << INDENT << "&& !PyObject_TypeCheck(arg, self->ob_type)" << endl; s << INDENT << "&& PyObject_HasAttrString(arg, const_cast<char*>(\"" << revOpName << "\"))) {" << endl; // This PyObject_CallMethod call will emit lots of warnings like @@ -1425,7 +1425,7 @@ void CppGenerator::writeErrorSection(QTextStream& s, OverloadData& overloadData) void CppGenerator::writeInvalidCppObjectCheck(QTextStream& s, QString pyArgName, const TypeEntry* type) { - s << INDENT << "if (!Shiboken::Wrapper::isValid(" << pyArgName << "))" << endl; + s << INDENT << "if (!Shiboken::Object::isValid(" << pyArgName << "))" << endl; Indentation indent(INDENT); s << INDENT << "return " << m_currentErrorCode << ';' << endl; } @@ -1848,7 +1848,7 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f } if (func->isAbstract()) { - s << INDENT << "if (Shiboken::Wrapper::hasCppWrapper(reinterpret_cast<SbkObject*>(self))) {\n"; + s << INDENT << "if (Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject*>(self))) {\n"; { Indentation indent(INDENT); s << INDENT << "PyErr_SetString(PyExc_NotImplementedError, \"pure virtual method '"; @@ -2042,7 +2042,7 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f virtualCall = virtualCall.replace("%CLASS_NAME", func->ownerClass()->qualifiedCppName()); normalCall = normalCall.replace("::%CLASS_NAME::", ""); methodCall = ""; - mc << "(Shiboken::Wrapper::isUserType(self) ? " << virtualCall << ":" << normalCall << ")"; + mc << "(Shiboken::Object::isUserType(self) ? " << virtualCall << ":" << normalCall << ")"; } } } @@ -2126,15 +2126,15 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f s << INDENT; if (arg_mod.ownerships[TypeSystem::TargetLangCode] == TypeSystem::TargetLangOwnership) { - s << "Shiboken::Wrapper::getOwnership(" << pyArgName << ");"; + s << "Shiboken::Object::getOwnership(" << pyArgName << ");"; } else if (wrappedClass->hasVirtualDestructor()) { if (arg_mod.index == 0) { - s << "Shiboken::Wrapper::releaseOwnership(" PYTHON_RETURN_VAR ");"; + s << "Shiboken::Object::releaseOwnership(" PYTHON_RETURN_VAR ");"; } else { - s << "Shiboken::Wrapper::releaseOwnership(" << pyArgName << ");"; + s << "Shiboken::Object::releaseOwnership(" << pyArgName << ");"; } } else { - s << "Shiboken::Wrapper::invalidate(" << pyArgName << ");"; + s << "Shiboken::Object::invalidate(" << pyArgName << ");"; } s << endl; } @@ -2150,7 +2150,7 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f break; } - s << INDENT << "Shiboken::Wrapper::keepReference(reinterpret_cast<SbkObject*>(self), \""; + s << INDENT << "Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(self), \""; QString varName = arg_mod.referenceCounts.first().varName; if (varName.isEmpty()) varName = func->minimalSignature() + QString().number(arg_mod.index); @@ -2628,7 +2628,7 @@ void CppGenerator::writeCopyFunction(QTextStream& s, const AbstractMetaClass *me s << "static PyObject *" << className << "___copy__(PyObject *self)" << endl; s << "{" << endl; s << INDENT << metaClass->qualifiedCppName() << "* " CPP_SELF_VAR " = 0;" << endl; - s << INDENT << "if (!Shiboken::Wrapper::isValid(self))" << endl; + s << INDENT << "if (!Shiboken::Object::isValid(self))" << endl; { Indentation indent(INDENT); s << INDENT << "return 0;" << endl; @@ -2642,7 +2642,7 @@ void CppGenerator::writeCopyFunction(QTextStream& s, const AbstractMetaClass *me s << INDENT << PYTHON_RETURN_VAR " = Shiboken::Converter<" << metaClass->qualifiedCppName(); s << "*>::toPython(copy);" << endl; - s << INDENT << "Shiboken::Wrapper::getOwnership(" PYTHON_RETURN_VAR ");" << endl; + s << INDENT << "Shiboken::Object::getOwnership(" PYTHON_RETURN_VAR ");" << endl; s << endl; @@ -2724,7 +2724,7 @@ void CppGenerator::writeSetterFunction(QTextStream& s, const AbstractMetaField* bool pythonWrapperRefCounting = metaField->type()->typeEntry()->isObject() || metaField->type()->isValuePointer(); if (pythonWrapperRefCounting) { - s << INDENT << "Shiboken::Wrapper::keepReference(reinterpret_cast<SbkObject*>(self), \""; + s << INDENT << "Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(self), \""; s << metaField->name() << "\", value);" << endl; //s << INDENT << "Py_XDECREF(oldvalue);" << endl; s << endl; @@ -3805,7 +3805,7 @@ bool CppGenerator::writeParentChildManagement(QTextStream& s, const AbstractMeta else childVariable = usePyArgs ? "pyargs["+QString::number(childIndex-1)+"]" : "arg"; - s << INDENT << "Shiboken::Wrapper::setParent(" << parentVariable << ", " << childVariable << ");\n"; + s << INDENT << "Shiboken::Object::setParent(" << parentVariable << ", " << childVariable << ");\n"; return true; } @@ -3839,7 +3839,7 @@ void CppGenerator::writeReturnValueHeuristics(QTextStream& s, const AbstractMeta } if (type->isQObject() || type->isObject() || type->isValuePointer()) - s << INDENT << "Shiboken::Wrapper::setParent(" << self << ", " PYTHON_RETURN_VAR ");" << endl; + s << INDENT << "Shiboken::Object::setParent(" << self << ", " PYTHON_RETURN_VAR ");" << endl; } void CppGenerator::writeHashFunction(QTextStream& s, const AbstractMetaClass* metaClass) @@ -3867,7 +3867,7 @@ void CppGenerator::writeStdListWrapperMethods(QTextStream& s, const AbstractMeta { //len s << "Py_ssize_t " << cpythonBaseName(metaClass->typeEntry()) << "__len__" << "(PyObject* self)" << endl << '{' << endl; - s << INDENT << "if (!Shiboken::Wrapper::isValid(self))" << endl; + s << INDENT << "if (!Shiboken::Object::isValid(self))" << endl; s << INDENT << INDENT << "return 0;" << endl << endl; s << INDENT << metaClass->qualifiedCppName() << " &cppSelf = Shiboken::Converter<" << metaClass->qualifiedCppName() <<"& >::toCpp(self);" << endl; s << INDENT << "return cppSelf.size();" << endl; @@ -3875,7 +3875,7 @@ void CppGenerator::writeStdListWrapperMethods(QTextStream& s, const AbstractMeta //getitem s << "PyObject* " << cpythonBaseName(metaClass->typeEntry()) << "__getitem__" << "(PyObject* self, Py_ssize_t _i)" << endl << '{' << endl; - s << INDENT << "if (!Shiboken::Wrapper::isValid(self))" << endl; + s << INDENT << "if (!Shiboken::Object::isValid(self))" << endl; s << INDENT << INDENT << "return 0;" << endl << endl; s << INDENT << metaClass->qualifiedCppName() << " &cppSelf = Shiboken::Converter<" << metaClass->qualifiedCppName() <<"& >::toCpp(self);" << endl; s << INDENT << "if (_i < 0 || _i >= (Py_ssize_t) cppSelf.size()) {" << endl; @@ -3888,7 +3888,7 @@ void CppGenerator::writeStdListWrapperMethods(QTextStream& s, const AbstractMeta //setitem s << "int " << cpythonBaseName(metaClass->typeEntry()) << "__setitem__" << "(PyObject* self, Py_ssize_t _i, PyObject* _value)" << endl << '{' << endl; - s << INDENT << "if (!Shiboken::Wrapper::isValid(self))" << endl; + s << INDENT << "if (!Shiboken::Object::isValid(self))" << endl; s << INDENT << INDENT << "return -1;" << endl; s << INDENT << metaClass->qualifiedCppName() << " &cppSelf = Shiboken::Converter<" << metaClass->qualifiedCppName() <<"& >::toCpp(self);" << endl; s << INDENT << "if (_i < 0 || _i >= (Py_ssize_t) cppSelf.size()) {" << endl; diff --git a/generator/headergenerator.cpp b/generator/headergenerator.cpp index 3f14712b..4775331c 100644 --- a/generator/headergenerator.cpp +++ b/generator/headergenerator.cpp @@ -434,7 +434,7 @@ void HeaderGenerator::finishGeneration() s << INDENT << metaClass->qualifiedCppName() << "* value = const_cast<" << metaClass->qualifiedCppName() << "* >(cppobj);" << endl; s << INDENT << "if (!isExactType)" << endl; s << INDENT << INDENT << "typeName = typeid(*value).name();" << endl; - s << INDENT << "PyObject* pyObj = Shiboken::Wrapper::newObject(reinterpret_cast<SbkObjectType*>(SbkType< ::" << metaClass->qualifiedCppName() << " >())," + s << INDENT << "PyObject* pyObj = Shiboken::Object::newObject(reinterpret_cast<SbkObjectType*>(SbkType< ::" << metaClass->qualifiedCppName() << " >())," << "value, hasOwnership, isExactType, typeName);" << endl; s << INDENT << "PySide::Signal::updateSourceObject(pyObj);" << endl; s << INDENT << "return pyObj;" << endl; diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp index 948a24e3..a19d569c 100644 --- a/libshiboken/basewrapper.cpp +++ b/libshiboken/basewrapper.cpp @@ -170,7 +170,7 @@ void SbkDeallocWrapper(PyObject* pyObj) } } - Shiboken::Wrapper::deallocData(sbkObj); + Shiboken::Object::deallocData(sbkObj); } void SbkDeallocWrapperWithPrivateDtor(PyObject* self) @@ -180,7 +180,7 @@ void SbkDeallocWrapperWithPrivateDtor(PyObject* self) PyObject_ClearWeakRefs(self); Shiboken::BindingManager::instance().releaseWrapper(sbkObj); - Shiboken::Wrapper::deallocData(sbkObj); + Shiboken::Object::deallocData(sbkObj); } void SbkBaseTypeDealloc(PyObject* pyObj) @@ -407,7 +407,7 @@ std::list<SbkObject*> splitPyObject(PyObject* pyObj) if (!lst.isNull()) { for(int i = 0, i_max = PySequence_Fast_GET_SIZE(lst.object()); i < i_max; i++) { PyObject* item = PySequence_Fast_GET_ITEM(lst.object(), i); - if (Wrapper::checkType(item)) + if (Object::checkType(item)) result.push_back(reinterpret_cast<SbkObject*>(item)); } } @@ -503,7 +503,7 @@ bool hasCast(SbkObjectType* self) void* cast(SbkObjectType* self, SbkObject* obj, PyTypeObject *target) { - return self->d->mi_specialcast(Wrapper::cppPointer(obj, target), reinterpret_cast<SbkObjectType*>(target)); + return self->d->mi_specialcast(Object::cppPointer(obj, target), reinterpret_cast<SbkObjectType*>(target)); } void setCastFunction(SbkObjectType* self, SpecialCastFunction func) @@ -563,7 +563,7 @@ void initPrivateData(SbkObjectType* self) } // namespace ObjectType -namespace Wrapper +namespace Object { bool checkType(PyObject* pyObj) @@ -587,7 +587,7 @@ static void setSequenceOwnership(PyObject* pyObj, bool owner) else releaseOwnership(*it); } - } else if (Wrapper::checkType(pyObj)) { + } else if (Object::checkType(pyObj)) { if (owner) getOwnership(reinterpret_cast<SbkObject*>(pyObj)); else @@ -603,7 +603,7 @@ static void _destroyParentInfo(SbkObject* obj, bool keepReference) while(!pInfo->children.empty()) { SbkObject* first = pInfo->children.front(); // Mark child as invalid - Shiboken::Wrapper::invalidate(first); + Shiboken::Object::invalidate(first); removeParent(first, false, keepReference); } removeParent(obj, false); @@ -877,7 +877,7 @@ void setParent(PyObject* parent, PyObject* child) * so if you pass this class to someone that takes the ownership, we CAN'T enter in this if, but hey! QString * follows the sequence protocol. */ - if (PySequence_Check(child) && !Wrapper::checkType(child)) { + if (PySequence_Check(child) && !Object::checkType(child)) { Shiboken::AutoDecRef seq(PySequence_Fast(child, 0)); for (int i = 0, max = PySequence_Size(seq); i < max; ++i) setParent(parent, PySequence_Fast_GET_ITEM(seq.object(), i)); @@ -949,14 +949,14 @@ void deallocData(SbkObject* self) Py_TYPE(self)->tp_free(self); } -void setTypeUserData(SbkObject* wrapper, void *user_data, DeleteUserDataFunc d_func) +void setTypeUserData(SbkObject* wrapper, void* userData, DeleteUserDataFunc d_func) { SbkObjectType* ob_type = reinterpret_cast<SbkObjectType*>(wrapper->ob_type); if (ob_type->d->user_data) ob_type->d->d_func(ob_type->d->user_data); ob_type->d->d_func = d_func; - ob_type->d->user_data = user_data; + ob_type->d->user_data = userData; } void* getTypeUserData(SbkObject* wrapper) diff --git a/libshiboken/basewrapper.h b/libshiboken/basewrapper.h index 7ae5502f..cdc5f484 100644 --- a/libshiboken/basewrapper.h +++ b/libshiboken/basewrapper.h @@ -129,7 +129,7 @@ LIBSHIBOKEN_API bool canCallConstructor(PyTypeObject* myType, PyTypeObjec /** * Call copy function for the object type **/ -LIBSHIBOKEN_API void* copy(SbkObjectType* self, const void *obj); +LIBSHIBOKEN_API void* copy(SbkObjectType* self, const void* obj); LIBSHIBOKEN_API void setCopyFunction(SbkObjectType* self, ObjectCopierFunction func); LIBSHIBOKEN_API void setExternalCppConversionFunction(SbkObjectType* self, ExtendedToCppFunc func); @@ -157,7 +157,7 @@ LIBSHIBOKEN_API void setDestructorFunction(SbkObjectType* self, ObjectDes LIBSHIBOKEN_API void initPrivateData(SbkObjectType* self); } -namespace Wrapper { +namespace Object { /** * Returns true if the object is an instance of a type created by the Shiboken generator. @@ -242,7 +242,7 @@ LIBSHIBOKEN_API void destroy(SbkObject* self); /** * Get/Set Userdata in type class */ -LIBSHIBOKEN_API void setTypeUserData(SbkObject* wrapper, void* user_data, DeleteUserDataFunc d_func); +LIBSHIBOKEN_API void setTypeUserData(SbkObject* wrapper, void* userData, DeleteUserDataFunc d_func); LIBSHIBOKEN_API void* getTypeUserData(SbkObject* wrapper); /** @@ -257,9 +257,9 @@ LIBSHIBOKEN_API void* getTypeUserData(SbkObject* wrapper); * \param key a key that identifies the C++ method signature and argument where the referredObject came from. * \parem referredObject the object whose reference is used by the self object. */ -LIBSHIBOKEN_API void keepReference(SbkObject* self, const char* key, PyObject* referredObject, bool append=false); +LIBSHIBOKEN_API void keepReference(SbkObject* self, const char* key, PyObject* referredObject, bool append = false); -} // namespace Wrapper +} // namespace Object } // namespace Shiboken diff --git a/libshiboken/basewrapper_p.h b/libshiboken/basewrapper_p.h index ebf50d44..45fdb876 100644 --- a/libshiboken/basewrapper_p.h +++ b/libshiboken/basewrapper_p.h @@ -218,7 +218,7 @@ inline std::list<SbkObjectType*> getCppBaseClasses(PyTypeObject* baseType) return visitor.bases(); } -namespace Wrapper +namespace Object { /** * Decrements the reference counters of every object referred by self. @@ -230,7 +230,7 @@ void clearReferences(SbkObject* self); * Destroy internal data **/ void deallocData(SbkObject* self); -} // namespace Wrapper +} // namespace Object } // namespace Shiboken diff --git a/libshiboken/bindingmanager.cpp b/libshiboken/bindingmanager.cpp index dd9fb5d1..f0797042 100644 --- a/libshiboken/bindingmanager.cpp +++ b/libshiboken/bindingmanager.cpp @@ -148,7 +148,7 @@ BindingManager::~BindingManager() * the BindingManager is being destroyed the interpreter is alredy * shutting down. */ while (!m_d->wrapperMapper.empty()) { - Wrapper::destroy(m_d->wrapperMapper.begin()->second); + Object::destroy(m_d->wrapperMapper.begin()->second); } assert(m_d->wrapperMapper.size() == 0); delete m_d; diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h index 5d0048fe..a49ec34d 100644 --- a/libshiboken/conversions.h +++ b/libshiboken/conversions.h @@ -113,7 +113,7 @@ inline PyObject* createWrapper(const T* cppobj, bool hasOwnership = false, bool const char* typeName = 0; if (!isExactType) typeName = typeid(*const_cast<T*>(cppobj)).name(); - return Wrapper::newObject(reinterpret_cast<SbkObjectType*>(SbkType<T>()), + return Object::newObject(reinterpret_cast<SbkObjectType*>(SbkType<T>()), const_cast<T*>(cppobj), hasOwnership, isExactType, typeName); } @@ -150,7 +150,7 @@ struct Converter<T*> static T* toCpp(PyObject* pyobj) { if (PyObject_TypeCheck(pyobj, SbkType<T>())) - return (T*) Wrapper::cppPointer(reinterpret_cast<SbkObject*>(pyobj), SbkType<T>()); + return (T*) Object::cppPointer(reinterpret_cast<SbkObject*>(pyobj), SbkType<T>()); else if (Converter<T>::isConvertible(pyobj)) return CppObjectCopier<T>::copy(Converter<T>::toCpp(pyobj)); else if (pyobj == Py_None) @@ -239,7 +239,7 @@ struct ValueTypeConverter } assert(false); } - return *reinterpret_cast<T*>(Wrapper::cppPointer(reinterpret_cast<SbkObject*>(pyobj), SbkType<T>())); + return *reinterpret_cast<T*>(Object::cppPointer(reinterpret_cast<SbkObject*>(pyobj), SbkType<T>())); } }; @@ -274,7 +274,7 @@ struct ObjectTypeConverter SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(pyobj->ob_type); if (ObjectType::hasCast(shiboType)) return reinterpret_cast<T*>(ObjectType::cast(shiboType, reinterpret_cast<SbkObject*>(pyobj), SbkType<T>())); - return (T*) Wrapper::cppPointer(reinterpret_cast<SbkObject*>(pyobj), SbkType<T>()); + return (T*) Object::cppPointer(reinterpret_cast<SbkObject*>(pyobj), SbkType<T>()); } }; @@ -560,7 +560,7 @@ struct StdListConverter // binded types implementing sequence protocol, otherwise this will // cause a mess like QBitArray being accepted by someone expecting a // QStringList. - if ((SbkType<StdList>() && Wrapper::checkType(pyObj)) || !PySequence_Check(pyObj)) + if ((SbkType<StdList>() && Object::checkType(pyObj)) || !PySequence_Check(pyObj)) return false; for (int i = 0, max = PySequence_Length(pyObj); i < max; ++i) { AutoDecRef item(PySequence_GetItem(pyObj, i)); @@ -583,7 +583,7 @@ struct StdListConverter static StdList toCpp(PyObject* pyobj) { if (PyObject_TypeCheck(pyobj, SbkType<StdList>())) - return *reinterpret_cast<StdList*>(Wrapper::cppPointer(reinterpret_cast<SbkObject*>(pyobj), SbkType<StdList>())); + return *reinterpret_cast<StdList*>(Object::cppPointer(reinterpret_cast<SbkObject*>(pyobj), SbkType<StdList>())); StdList result; for (int i = 0; i < PySequence_Size(pyobj); i++) { @@ -606,7 +606,7 @@ struct StdPairConverter { if (PyObject_TypeCheck(pyObj, SbkType<StdPair>())) return true; - if ((SbkType<StdPair>() && Wrapper::checkType(pyObj)) || !PySequence_Check(pyObj) || PySequence_Length(pyObj) != 2) + if ((SbkType<StdPair>() && Object::checkType(pyObj)) || !PySequence_Check(pyObj) || PySequence_Length(pyObj) != 2) return false; AutoDecRef item1(PySequence_GetItem(pyObj, 0)); @@ -651,7 +651,7 @@ struct StdMapConverter { if (PyObject_TypeCheck(pyObj, SbkType<StdMap>())) return true; - if ((SbkType<StdMap>() && Wrapper::checkType(pyObj)) || !PyDict_Check(pyObj)) + if ((SbkType<StdMap>() && Object::checkType(pyObj)) || !PyDict_Check(pyObj)) return false; PyObject* key; diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index fb46eb2f..c54da989 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -178,9 +178,9 @@ if ((*it)->isLayoutType()) { ObjectTypeLayout* l = reinterpret_cast<ObjectTypeLayout*>(*it); reparent_layout_items(parent, %CONVERTTOPYTHON[ObjectTypeLayout*](l)); - Shiboken::Wrapper::setParent(layout, %CONVERTTOPYTHON[ObjectTypeLayout*](l)); + Shiboken::Object::setParent(layout, %CONVERTTOPYTHON[ObjectTypeLayout*](l)); } else { - Shiboken::Wrapper::setParent(parent, %CONVERTTOPYTHON[ObjectType*](*it)); + Shiboken::Object::setParent(parent, %CONVERTTOPYTHON[ObjectType*](*it)); } } } @@ -1176,7 +1176,7 @@ </modify-argument> <inject-code class="target" position="end"> %RETURN_TYPE %0 = %TYPE::%FUNCTION_NAME(); - %PYARG_0 = Shiboken::Wrapper::newObject(&SbkObject_Type, %0, false, false); + %PYARG_0 = Shiboken::Object::newObject(&SbkObject_Type, %0, false, false); </inject-code> </modify-function> </value-type> |