aboutsummaryrefslogtreecommitdiffstats
path: root/generator/shibokengenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CppGenerator's writeCopyFunction method now uses ↵Marcelo Lira2012-03-081-1/+16
| | | | | | | | | 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>
* Improved the generation of argument conversion in modified functions.Marcelo Lira2012-03-081-6/+40
| | | | | | | | 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>
* Improved type system converter variable usage in the sample test binding.Marcelo Lira2012-03-081-2/+1
| | | | ShibokenGenerator uses qDeleteAll for the cached meta types.
* The type system converter variable replacement was moved to a single method.Marcelo Lira2012-03-081-23/+47
| | | | | | | | | Such a method is safer than the previous that used only a regular expression, because now it tries to build a meta type for the type found in the user's custom code. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Moved functionality from a couple of write function to ones that return strings.Marcelo Lira2012-03-081-31/+38
| | | | | The methods writeToCppConversion and writeToPythonConversion now use the services of cpythonToCppConversionFunction and cpythonToPythonConversionFunction.
* Method buildAbstractMetaTypeFromString now uses a cache for the types it builds.Marcelo Lira2012-03-081-18/+22
|
* Improved the generation of type indexes written to the generated module header.Marcelo Lira2012-03-081-8/+42
| | | | | | Now classes that are typedefs to template class instantiations are written twice with the same index: one with the aliased name, and other with the name composed of template and template arguments.
* The type checking now pays attention to the <no-null-pointer/> tag.Marcelo Lira2012-03-081-0/+19
| | | | An unit test was also added for it.
* Improved guessCPythonCheckFunction method to produce an AbstractMetaType for ↵Marcelo Lira2012-03-081-11/+40
| | | | | | | | | | 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.
* Included tests for added function signatures very similar to already ↵Marcelo Lira2012-03-081-10/+22
| | | | | | | | | | | | | | | existing ones. Specifically this causes the situation when there is in C++ a function with an argument that is a reference to a Value Type, and the user adds a very similar function with the same type, but passed as value. Example: C++ : function(const TYPE& a, int b) Added: function(TYPE) The return type of ShibokenGenerator::getArgumentReplacement() method was modified, because the argument object is more useful than its index.
* Fixed type system variable replacement for arguments removed with conversion ↵Marcelo Lira2012-03-081-5/+16
| | | | | | | | | | 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>
* Small visual improvements on writeArgumentNames().Marcelo Lira2012-03-081-10/+7
|
* Disassembled ShibokenGenerator's writeCodeSnips method.Marcelo Lira2012-03-081-223/+227
| | | | | | | | 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>
* Moved many variables names used in generated code to macros.Marcelo Lira2012-03-081-21/+21
| | | | | | | | | | | 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-1/+1
| | | | | It's way less messy now, and uses writeTypeCheck() as it should have been doing from the beginning.
* I rewrote generator functions of type checking strings in ShibokenGenerator.Marcelo Lira2012-03-081-60/+55
| | | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Added a method to retrieve a function's argument typeMarcelo Lira2012-03-081-1/+14
| | | | | | | | 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.
* AbstractMetaType builder now calls the metatype's own 'decideUsagePattern' ↵Marcelo Lira2012-03-081-2/+1
| | | | method.
* Renamed argument of ShibokenGenerator's getTypeIndexVariableName() method.Marcelo Lira2012-03-081-5/+3
|
* Fixed writeBaseConversion method to handle references to C++ primitives.Marcelo Lira2012-03-081-3/+9
| | | | Added test for a reference to integer as a function argument.
* Moved the methods isObjectType() and isPointer() from ShibokenGenerator to ↵Marcelo Lira2012-03-081-32/+7
| | | | | | Generator Runner. They were needed by other methods in the Generator class.
* Fixes ShibokenGenerator::isCString(type).Marcelo Lira2012-03-081-1/+3
|
* Moved some type system variable replacement to their own methods.Marcelo Lira2012-03-081-16/+36
| | | | | | | | | | | | | The new methods replace the contents of the following type system variables: %CONVERTTOPYTHON %CONVERTTOCPP %ISCONVERTIBLE %CHECKTYPE The replacements were part of the ShibokenGenerator::writeCodeSnips() method.
* More convenience functions added. More refactoring. Code more readable.Marcelo Lira2012-03-081-10/+36
| | | | | | | | 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-1/+19
| | | | | | | | | | | | | | | | 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>
* Propagate default args modification during the overload data descisor.Renato Filho2012-03-081-2/+18
| | | | | | | Fix bug #919. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
* Added two new type system variables: %ISCONVERTIBLE and %CHECKTYPE.Marcelo Lira2012-03-081-2/+10
| | | | | | | | | | | | | | Currently the variables are replaced as follows: * %ISCONVERTIBLE[CPPTYPE] -> Shiboken::Converter<CPPTYPE>::isConvertible * %CHECKTYPE[CPPTYPE] -> Shiboken::Converter<CPPTYPE>::checkType Future improvements may change that, so having these variables is a good thing. The documentation was updated. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Araujo <renato.filho@openbossa.org>
* Fixed substitution of method calls from user custom code for Qt's ↵Marcelo Lira2012-03-081-4/+13
| | | | | | | metaObject() method. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Fixed injected code processing to avoid infinite recursion in virtual method ↵Marcelo Lira2012-03-081-0/+38
| | | | | | calls. Unit tests were also added.
* Fix bug 501 - "Shiboken generator doesn't use full qualified name (with :: ↵Hugo Parente Lima2012-03-081-5/+1
| | | | | | | prefix) on all places." Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
* Added Shiboken buffer interface.Hugo Parente Lima2012-03-081-0/+2
| | | | | | | | | | | | | This interface is just a wrapper to the differents API's provided by Python to deal with memory buffers in various versions of Python, so is recommended to use this API to deal with Python memory buffers instead of the CPython API. If you want to have a Python buffer as argument of any function just change the argument type to "PyBuffer" and the generator will handle it right regarding to type checking. Reviewer: Renato Araújo <renato.filho@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Don't segfault when running with Qt4.5.Hugo Parente Lima2012-03-081-9/+14
| | | | | Reviewer: Lauro Moura <lauro.neto@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
* Fix bug 823 - "Shiboken doesn't support function call overloads"Hugo Parente Lima2012-03-081-0/+3
|
* Remove GCC 4.6 warning on basewrapper.cpp and shibokengenerator.cppHugo Parente Lima2012-03-081-2/+0
| | | | | libshiboken/basewrapper.cpp:212:57: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] generator/shibokengenerator.cpp:1118:9: warning: variable ‘numArgs’ set but not used [-Wunused-but-set-variable]
* Implement support to operator++;Renato Filho2012-03-081-0/+2
| | | | | | | Fixes bug #688. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
* Added the type system variables %BEGIN_ALLOW_THREADS and %END_ALLOW_THREADS.Marcelo Lira2012-03-081-0/+9
| | | | | | | | | | Also moved the save and restore thread state lines to a macro in ShibokenGenerator header file. The type system variables documentation was updated accordingly. Reviewed by Lauro Moura <lauro.neto@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* The option "avoid protected hack" is now set via command line.sb-1.0.0-rc1Marcelo Lira2012-03-081-66/+63
| | | | | | | | Instead of the old ugly way of compiling the behaviour forever using "#define". Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Overloaded call decision now consider inheritance: inheritor is checked ↵Marcelo Lira2012-03-081-2/+2
| | | | | | | | | | before ancestor. A couple of ShibokenGenerator methods were made "const" to allow them to be called from OverloadDecisor. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Implemented support to iterator function generation.Renato Araujo Oliveira Filho2012-03-081-0/+2
| | | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
* Added the "%CPPTYPE" type system variable.Marcelo Lira2012-03-081-0/+4
| | | | | | | | | | %CPPTYPE will be converted to the original C++ name of a class, without any "Wrapper" suffix or namespace prefix. Documentation for the new variable was added as well. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Type system %TYPE variable is now available for class wide custom code.Marcelo Lira2012-03-081-0/+1
| | | | %TYPE documentation was updated.
* Fix bug#633 - "bool of null QDate (possibly other empty QString/null QObj ↵Hugo Parente Lima2012-03-081-0/+8
| | | | | | | types?) returns True for empty instance; probably should be False" Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Renato Araújo <renato.filho@openbossa.org>
* Add support for operator overload injection.Hugo Parente Lima2012-03-081-0/+5
| | | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
* Added support for promoting enums from removed namespaces to upper scope.Marcelo Lira2012-03-081-0/+32
| | | | | | | | | | Classes in namespaces marked not to be generated are always moved to upper scopes, the current modification add this same behaviour to enums. Tests were also added. Reviewed by Lauro Moura <lauro.neto@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Fix bug#484 - "Error compiling QtContacts 1.1 (problems with const ↵Hugo Parente Lima2012-03-081-4/+6
| | | | | | | QList<QVariant>)" Reviewer: Renato Araújo <renato.filho@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
* Generator now writes the proper variable name on C++ constructor calls.Marcelo Lira2012-03-081-1/+2
| | | | | | When a conversion rule is provided for a constructor argument the C++ constructor, for which the conversion rule doesn't apply, is generated with wrong argument names. This commit solves this.
* Do not use const and ref when writing converters for object-types, qflags, ↵Hugo Parente Lima2012-03-081-5/+5
| | | | const ref. value types and enums.
* namespace Shiboken::BaseType renamed to Shiboken::ObjectType.Hugo Parente Lima2012-03-081-3/+7
|
* Variable SbkBaseWrapperType_Type renamed to SbkObjectType_TypeHugo Parente Lima2012-03-081-1/+1
|
* Remove unused variables.Hugo Parente Lima2012-03-081-2/+0
|