aboutsummaryrefslogtreecommitdiffstats
path: root/generator/cppgenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CppGenerator's writeCopyFunction method now uses ↵Marcelo Lira2012-03-081-8/+4
| | | | | | | | | cpythonToPythonConversionFunction. The new overload of cpythonToPythonConversionFunction, that is. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
* CppGenerator's method writeReprFunction now uses writeCppSelfDefinition.Marcelo Lira2012-03-081-10/+7
|
* Functions marked as deprecated will raises a python warning.Renato Filho2012-03-081-0/+7
| | | | Fixes bug #873.
* Improved the generation of argument conversion in modified functions.Marcelo Lira2012-03-081-45/+32
| | | | | | | | Added the SBK_UNUSED macro to libshiboken to prevent compilation warnings. An unit test was added. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* CppGenerator's writeHashFunction now uses writeCppSelfDefinition.Marcelo Lira2012-03-081-4/+3
|
* Method buildAbstractMetaTypeFromString now uses a cache for the types it builds.Marcelo Lira2012-03-081-24/+7
|
* Added tests for a class that its only constructor is the copy one.Marcelo Lira2012-03-081-1/+1
| | | | | | | | This simulates a situation found in QtWebKit's QWebDatabase and QWebSecurityOrigin classes. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
* The type checking now pays attention to the <no-null-pointer/> tag.Marcelo Lira2012-03-081-5/+11
| | | | An unit test was also added for it.
* The result of rich comparisons are stored in a return variable before ↵Marcelo Lira2012-03-081-8/+9
| | | | converting them to Python.
* Improved guessCPythonCheckFunction method to produce an AbstractMetaType for ↵Marcelo Lira2012-03-081-5/+14
| | | | | | | | | | known types. This is in opposition of simply returning a string with a custom type check. The details are in the docstring in ShibokenGenerator header. Also added a new modification test and refactored here and there in the sample binding type system.
* Check if the directory exists before writing C++ module definition file.Hugo Parente Lima2012-03-081-0/+1
|
* Removed huge if block to ease the code readbility.Hugo Parente Lima2012-03-081-187/+190
|
* Fixed type system variable replacement for arguments removed with conversion ↵Marcelo Lira2012-03-081-13/+7
| | | | | | | | | | rule. Also added an array argument modification test, and moved AutoArrayPointer from libpyside to libshiboken. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Disassembled ShibokenGenerator's writeCodeSnips method.Marcelo Lira2012-03-081-56/+47
| | | | | | | | Also added writeConversionRule methods to CppGenerator. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Removed unnecessary indentation from generated overload selector switch.Marcelo Lira2012-03-081-19/+13
| | | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Improved and fixed the setter and getter writer functions.Marcelo Lira2012-03-081-46/+38
| | | | Also added an unit test to a protected container property.
* Moved many variables names used in generated code to macros.Marcelo Lira2012-03-081-123/+113
| | | | | | | | | | | Also fixed ShibokenGenerator::pythonFunctionWrapperUsesListOfArguments() method to consider call operators. Fixed code snippet variable replacement for when there's only one Python argument in the function. And CppGenerator::writeArgumentsInitializer() was sanitized, with never used code erased. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Revamped the virtual method writer.Marcelo Lira2012-03-081-75/+71
| | | | | It's way less messy now, and uses writeTypeCheck() as it should have been doing from the beginning.
* The rich comparison function writer now makes use of the C++ self variable ↵Marcelo Lira2012-03-081-19/+26
| | | | | | writer. That was the last one.
* Added functions to provide a cleaner enum and flags initialization.Marcelo Lira2012-03-081-65/+62
| | | | | | | | | | | The functions are: Shiboken::Enum::createGlobalEnum() Shiboken::Enum::createScopedEnum() Shiboken::Enum::createGlobalEnumItem() Shiboken::Enum::createScopedEnumItem() Also updated the generator to make use of them.
* Added the ErrorCode helper class to handle the current error code value.Marcelo Lira2012-03-081-27/+14
| | | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Moved the generation of Python result error checking to a single function.Marcelo Lira2012-03-081-27/+15
|
* Sanitized CppGenerator's writeToPythonFunction() method.Marcelo Lira2012-03-081-9/+16
|
* Modified the generation of 'nb_bool' functions to use standard functions.Marcelo Lira2012-03-081-5/+7
| | | | Instead of writing everything on its own.
* Improved coding style in the terrible writeStdListWrapperMethods method.Marcelo Lira2012-03-081-34/+36
|
* Added a method to retrieve a function's argument typeMarcelo Lira2012-03-081-33/+50
| | | | | | | | The method in question is CppGenerator::getArgumentType(), and it resolves any type modification made in the type system. Also remove an unused convenience method for writeArgumentConversion, and unused variable on rich comparison writer function.
* Improved the code of two code generation functions for better readability.Marcelo Lira2012-03-081-30/+36
| | | | | | | | | The functions are CppGenerator::writeRichCompareFunction() CppGenerator::writeOverloadedFunctionDecisorEngine() In the case of the last one, the generated code was also improved.
* Centralized the generation of global and class enums in one method.Marcelo Lira2012-03-081-20/+15
|
* Created a method to generate method wrapper variable initialization code.Marcelo Lira2012-03-081-70/+71
| | | | | | | | The contents of the new CppGenerator::writeMethodWrapperPreamble() method were moved from the writers of constructor and method wrappers. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* All Python to C++ conversions were moved to ↵Marcelo Lira2012-03-081-42/+48
| | | | CppGenerator::writePythonToCppTypeConversion().
* More readable code on CppGenerator::writeVirtualMethodNative() method.Marcelo Lira2012-03-081-16/+12
|
* Improved writeInvalidPyObjectCheck() method and updated generator to make ↵Marcelo Lira2012-03-081-31/+34
| | | | use of it.
* Improved readability of CppGenerator::writeCopyFunction() method.Marcelo Lira2012-03-081-32/+18
| | | | The indentation, and everything else about it, was terrible.
* Improved CppGenerator::writeCppSelfDefinition() method and its use.Marcelo Lira2012-03-081-51/+48
| | | | Now anyone wanting to get a cppSelf object must go through this method.
* Removed unused parameter from writeInvalidCppObjectCheck().Marcelo Lira2012-03-081-7/+7
| | | | Also removed the default value for a more explicit use of the method.
* Added a function to initialize a new wrapper type and add it to a module or ↵Marcelo Lira2012-03-081-72/+77
| | | | | | | | | | enclosing class. The class register writer was updated to use the new ObjectType::introduceWrapperType(). Types are now created and registered via the introduceWrapperType() function. I also did a little refactoring on CppGenerator::writeClassRegister.
* Introduces new API to create and import Python modules.Marcelo Lira2012-03-081-12/+23
| | | | | | | | | | | | | The Shiboken::Module namespace also provides management of module types, including the communication of types among dependent modules. Module::create() will call Shiboken::init(), so this can be removed from the generated module's source code. This deprecates the old Shiboken::importModule() function. The generation of module initialization code was updated to use the new Shiboken::Module functions.
* Moved writeMinimalConstructorCallArguments() functionality to Generator Runner.Marcelo Lira2012-03-081-72/+3
| | | | | Updated tests' type systems to reflect the behaviour of Generator::minimalConstructor().
* Moved the methods isObjectType() and isPointer() from ShibokenGenerator to ↵Marcelo Lira2012-03-081-11/+11
| | | | | | Generator Runner. They were needed by other methods in the Generator class.
* std::auto_ptr is safer than relying in an if clause at the end of the code ↵Marcelo Lira2012-03-081-6/+7
| | | | block.
* Fix bug 941 - "Signals with QtCore.Qt types as arguments has invalid signatures"Hugo Parente Lima2012-03-081-81/+12
| | | | | Reviewer: Renato Araújo <renato.filho@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Used SignalManager function to retrieve MetaObjectRenato Filho2012-03-081-1/+1
| | | | | Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Neto <lauro.neto@openbossa.org>
* Check if need to use placement new for types that inherits QObject due to ↵Hugo Parente Lima2012-03-081-5/+12
| | | | | | | QML (qmlRegisterType) function. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
* More convenience functions added. More refactoring. Code more readable.Marcelo Lira2012-03-081-14/+10
| | | | | | | | ShibokenGenerator::isPointer() ShibokenGenerator::isWrapperType() Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Added convenience functions to improve code readability.Marcelo Lira2012-03-081-10/+8
| | | | | | | | | | | | | | | | Checking if a type is an Object Type is a very common task, followed by asking if a type is a pointer to a type that has a Python wrapper. These functions solve the problem: ShibokenGenerator::isObjectType(type) ShibokenGenerator::isPointerToWrapperType(type) I refactored the generator code to make use of those functions. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Lauro Moura <lauro.neto@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Fixed typo in generated code.Marcelo Lira2012-03-081-4/+4
|
* Improved code readability in CppGenerator::writeVirtualMethodNative.Marcelo Lira2012-03-081-4/+4
|
* Replaced trailing space by a period in documentation comment.Marcelo Lira2012-03-081-1/+1
| | | | | Also removed other trailing space elsewhere and fixed some typos in the comments.
* Fix enum qMetaType register.Renato Filho2012-03-081-5/+6
| | | | | | | fix bug #886. Reviewer: Hugo Parente <hugo.lima@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Make sure register QMetaObject before QObject.Renato Filho2012-03-081-2/+36
| | | | | | | Remove all staticMetaObject form know types. Reviewer: Hugo Parente <hugo.lima@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>