aboutsummaryrefslogtreecommitdiffstats
path: root/shibokengenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use translateTypeForWrapperMethod for all types.Hugo Parente Lima2010-04-291-9/+2
| | | | | Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Reviewer: Renato Araújo <renato.araujo@openbossa.org>
* Known what flag to use on PyBuildValue when a container is used.Hugo Parente Lima2010-04-291-0/+1
|
* Fixed refcount leak on virtual functions args.Renato Filho2010-04-291-4/+5
| | | | | Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>, Luciano Wolf <luciano.wolf@openbossa.org>
* Add include headers of global enums.Hugo Parente Lima2010-04-221-0/+1
|
* Add extra options for ShibokenGenerator::writeBaseConversion.Hugo Parente Lima2010-04-051-4/+5
|
* Updated ShibokenGenerator::injectedCodeHasReturnValueAttribution.Marcelo Lira2010-03-221-5/+11
| | | | | The method now checks native code injections instead of only target language code.
* Adds ShibokenGenerator::buildAbstractMetaTypeFromString.Marcelo Lira2010-03-191-3/+44
| | | | | | | This method tries to build an AbstractMetaType from a string, it is used by guessCPythonCheckFunction to better handle type replacements identifying types already known by the type database for the currently generated, instead of treating said replacements as mere blobs.
* Allow hash-function tag to be definied in object-types (Fix bug #186).Hugo Lima2010-03-191-1/+4
|
* Changed the semantic of Converter<T>::isConvertible method.Hugo Lima2010-03-181-2/+12
| | | | | | | | | The new semantic is: Returns true when the type can be converted to T OR the type is T. The old semantic was: Returns true when the type can be converted to T and false if the type is T, however int and float converters did not follow this rule, because they used PyNumber_Check on their isConvertible implementation.
* Object-types are not copyable at all.Hugo Lima2010-03-181-1/+1
|
* Adds convenience methods to return the name of extended conversion functions.Marcelo Lira2010-03-021-0/+10
| | | | | | | | ShibokenGenerator got the methods: * QString extendedIsConvertibleFunctionName(TypeEntry*) Returns the name of an extended "isConvertible" function. * QString extendedToCppFunctionName(TypeEntry*) Returns the name of an extended "toCpp" function.
* Adds ShibokenGenerator::getExtendedConverters() method.Marcelo Lira2010-03-021-0/+21
| | | | | | It returns all types from a previous module that could be generated by a conversion operator defined in the current module, as well as all the possible arguments for the conversion.
* Shiboken generator now supports references to pointers as arguments.Marcelo Lira2010-02-261-1/+3
| | | | | | | Two methods with references to object type and value type pointers were added to BlackBox test class just to check the compilation. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* The C++ pointer for a Python wrapper is now acquired using a Converter.Marcelo Lira2010-02-241-1/+2
| | | | | | | The macros for casting a wrapper C++ void pointer to a specific C++ pointer are no longer generated, converters are used instead. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Adds method ShibokenGenerator::getAllAncestors(metaClass)Marcelo Lira2010-02-241-0/+11
| | | | The new method returns a flat list of all the given class' ancestors.
* Add writeToCppConversion overload with AbstractMetaClass instead of ↵Hugo Lima2010-02-231-0/+7
| | | | | | AbstractMetaType. This is needed by hash function writer.
* Pass QStrings by const references instead of by value.Hugo Lima2010-02-231-8/+7
|
* Add support for "signed short" type (needed in QtCore.QTextStream)Luciano Wolf2010-02-231-0/+1
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* - Fix method writeTypeCheck, so it finally correct decides when to use ↵Hugo Lima2010-02-231-2/+3
| | | | | | | | PyNumber_Check or a more specific type check function. - Promote bool type as a specialization of int, as we do with float. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Adds the convenience method 'isPairContainer' to ShibokenGenerator.Marcelo Lira2010-02-201-0/+6
| | | | | | | It checks if an AbstractMetaType represents a C++ pair container. Also updated code to make use of the new method. Reviewed by Lauro Moura <lauro.neto@openbossa.org>
* Adds the convenience method 'isCString' to ShibokenGenerator.Marcelo Lira2010-02-201-2/+7
| | | | | It checks if an AbstractMetaType represents a C string. Also updated code to make use of the new method.
* Write a verbose error messages when the function arguments don't match.Hugo Lima2010-02-181-0/+9
| | | | | | | This will increase the binding size, so there's an option to disable verbose error messages. "--disable-verbose-error-messages" Reviewed by Renato Araújo <renato.filho@openbossa.org> and Marcelo Lira <marcelo.lira@openbossa.org>
* Do not export Sbk*Type variables.Hugo Lima2010-02-121-0/+24
| | | | | | To access Sbk*Type variables from other modules, you need to use the array provided via CObjects. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* The method needsReferenceCountControl checks also in the class' ancestry.Marcelo Lira2010-02-121-2/+6
| | | | | | ShibokenGenerator::needsReferenceCountControl checks the object and all its ancestry for the need to support reference counting control of other objects pointed by the present class.
* Adds 2 convenience methods to ShibokenGenerator to check for refcount mods.Marcelo Lira2010-02-101-0/+20
| | | | | | The new expressively named methods hasMethodsWithReferenceCountModifications and needsReferenceCountControl returns boolean values to help generation of code for reference counting support.
* Adds some name generator methods to ShibokenGenerator.Marcelo Lira2010-02-101-0/+15
| | | | | | | Added the following self evident methods to ShibokenGenerator: * QString cpythonGettersSettersDefinitionName(const AbstractMetaClass*); * QString cpythonGetterFunctionName(const AbstractMetaField*); * QString cpythonSetterFunctionName(const AbstractMetaField*);
* Implement support to conversion rule.Renato Filho2010-02-091-4/+13
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Fixes generation of binding reimplementation of modified virtual methods.Marcelo Lira2010-02-091-2/+3
| | | | | Argument removal and type modification no longer affects the generation of virtual method signatures in the binding code.
* Implement ShibokenGenerator::isCopyable based on BoostPythonGeneratorAnderson Lizardo2010-02-041-0/+13
| | | | Reviewed by Renato Araújo <renato.filho@openbossa.org>
* When used inside a static function, %CPPSELF will be replaced by theHugo Lima2010-02-041-3/+8
| | | | | | class type, and %CPPSELF. by "<Class Type>::" Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Fix indentation problems on code injections.Hugo Lima2010-02-031-2/+0
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org> and Renato Araújo <renato.filho@openbossa.org>
* - Write return value policy on reimplementations of virtual functions.Hugo Lima2010-02-021-1/+2
| | | | | | | - Decref references returned by the python implemantation. - Print error, if it happen on python code of an virtual function called from C++. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Do not add an extra indentation on code injections.Hugo Lima2010-02-021-2/+5
| | | | Write an comment on start and ending of code injections.
* Remove warning about ugly conditions on if clause.Hugo Lima2010-02-021-2/+2
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Fixes ShibokenGenerator::injectedCodeCallsCppFunction.Marcelo Lira2010-02-021-2/+4
| | | | | | | The function now recognises uses like "... new %TYPE(..." on code injections as calls to the C++ function. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Implement return value heuristic.Hugo Lima2010-02-021-0/+8
| | | | | | | If the method returns a pointer and there are no policies for the return type, the returned value is considered child of the current object (self). Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Fix crash when a virtual function with enum in they arguments is called from ↵Hugo Lima2010-02-011-1/+5
| | | | | | C++ and have an implementation in Python.
* Small refactor on filterFunction function.Hugo Lima2010-02-011-70/+8
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Write the enum name based on enum module, not the current module being ↵Hugo Lima2010-01-261-2/+2
| | | | generated.
* Add special conversion rules to the char type.Hugo Lima2010-01-201-3/+3
| | | | | | A type is convertible to char if it is a number or a 1-sized char. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* When verifying for the aliased type of a primitive type, go to the last ↵Hugo Lima2010-01-201-1/+1
| | | | aliased type instead of just the first one.
* Adds helper methods to ShibokenGenerator.Marcelo Lira2010-01-191-0/+56
| | | | | | | | | | | | | | | | | | | | These are the methods added to ShibokenGenerator: * classNeedsGetattroFunction(metaClass) Returns true if a tp_getattro function should be generated for the given class. At the moment the only criteria is that the class has an overload with both static and non-static versions of a method. * getMethodsWithBothStaticAndNonStaticMethods(metaClass) Returns a list of methods of the given class where each one is part of a different overload with both static and non-static method. * cpythonMethodDefinitionName(metaFunc) Returns the name of a method definition (a single method, i.e. a PyMethodDef struct) for a given method. * cpythonGetattroFunctionName(metaClass) Returns the name of a 'tp_getattro' method for a given class.
* Common variable names are stored as #defines instead of C++ static methods.Marcelo Lira2010-01-181-3/+3
| | | | Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
* Updated type system variable replacement for '%0' (aka C++ return value).Marcelo Lira2010-01-151-3/+2
| | | | | Now the variable is replaced by a C++ return variable instead of getting the value directly from the PyObject.
* Added ShibokenGenerator::shouldDereferenceAbstractMetaTypePointer method.Marcelo Lira2010-01-151-3/+7
| | | | | | | It checks if a meta type should be dereferenced by the Python method wrapper passing it to C++. ShibokenGenerator::shouldDereferenceArgumentPointer now calls the new method.
* Values returned from C++ are now stored in a C++ variable.Marcelo Lira2010-01-151-2/+2
| | | | | | | | | | | The previous behaviour was to pass the result, if any, straight to the to-Python-converter method. Separating the C++ from the Python part allows us to release the thread lock when calling C++ and taking it back before calling the converter filled with Python calls. Also renamed "retvalVariableName()" to the more meaninful name "pythonReturnVariableName()" and added "cppReturnVariableName()". Also updated the type system variable replacement to recognize "%0" as "cppReturnVariableName()".
* Remove warning about using a uninitialized variableHugo Lima2010-01-151-2/+2
|
* Changed prefix of local generated C functions to avoid name clash with ↵Hugo Lima2010-01-141-7/+9
| | | | | | bindinded method names. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Added a convenience overload for cpythonBaseName, with AbstractMetaClass as ↵Hugo Lima2010-01-141-0/+5
| | | | parameter.
* Fix object initialization.Hugo Lima2010-01-131-1/+1
| | | | | | | The C++ object instanciation was made in tp_init function instead of tp_new function. Now tp_new just create a useless python object which will be filled in the tp_init function. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>