aboutsummaryrefslogtreecommitdiffstats
path: root/shibokengenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* Fixed refcount leak on virtual functions args.Renato Filho2010-04-291-1/+1
| | | | | Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>, Luciano Wolf <luciano.wolf@openbossa.org>
* Add extra options for ShibokenGenerator::writeBaseConversion.Hugo Parente Lima2010-04-051-2/+2
|
* Updated ShibokenGenerator::injectedCodeHasReturnValueAttribution.Marcelo Lira2010-03-221-4/+5
| | | | | The method now checks native code injections instead of only target language code.
* Adds ShibokenGenerator::buildAbstractMetaTypeFromString.Marcelo Lira2010-03-191-0/+8
| | | | | | | 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.
* Adds convenience methods to return the name of extended conversion functions.Marcelo Lira2010-03-021-0/+3
| | | | | | | | 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/+6
| | | | | | 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.
* Adds method ShibokenGenerator::getAllAncestors(metaClass)Marcelo Lira2010-02-241-1/+4
| | | | 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/+1
| | | | | | AbstractMetaType. This is needed by hash function writer.
* Pass QStrings by const references instead of by value.Hugo Lima2010-02-231-5/+4
|
* Adds the convenience method 'isPairContainer' to ShibokenGenerator.Marcelo Lira2010-02-201-0/+1
| | | | | | | 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-0/+2
| | | | | 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/+4
| | | | | | | 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/+3
| | | | | | 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>
* Adds 2 convenience methods to ShibokenGenerator to check for refcount mods.Marcelo Lira2010-02-101-0/+6
| | | | | | 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/+3
| | | | | | | Added the following self evident methods to ShibokenGenerator: * QString cpythonGettersSettersDefinitionName(const AbstractMetaClass*); * QString cpythonGetterFunctionName(const AbstractMetaField*); * QString cpythonSetterFunctionName(const AbstractMetaField*);
* Implement ShibokenGenerator::isCopyable based on BoostPythonGeneratorAnderson Lizardo2010-02-041-0/+2
| | | | Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Fix indentation problems on code injections.Hugo Lima2010-02-031-0/+2
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org> and Renato Araújo <renato.filho@openbossa.org>
* Implement return value heuristic.Hugo Lima2010-02-021-0/+3
| | | | | | | 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>
* Small refactor on filterFunction function.Hugo Lima2010-02-011-2/+0
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Fixing includesLauro Neto2010-01-261-1/+1
| | | | Reviewed by Hugo Parent <hugo.lima@openbossa.org>
* Adds helper methods to ShibokenGenerator.Marcelo Lira2010-01-191-0/+8
| | | | | | | | | | | | | | | | | | | | 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-5/+5
| | | | Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
* Generator now makes use of the GilState and ThreadStateSaver classes.Marcelo Lira2010-01-181-1/+1
| | | | | Generated code now makes use of the new convenience classes instead of directly using the Python provided PyGILState_STATE and PyThreadState.
* Adds CppGenerator::writeCppSelfDefinition method.Marcelo Lira2010-01-151-0/+1
| | | | | | | | | | The code to write the definition of cppSelf was in two places and contained an #ifdef clause, now it is a writer method. Also added the ShibokenGenerator::cppSelfVariableName() method to be used instead of directly writing the "cppSelf" string. Updated custom code on test binding to remove warning. Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
* Added ShibokenGenerator::shouldDereferenceAbstractMetaTypePointer method.Marcelo Lira2010-01-151-2/+3
| | | | | | | 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.
* Adds ShibokenGenerator::threadStateVariableName() method.Marcelo Lira2010-01-151-0/+1
|
* Values returned from C++ are now stored in a C++ variable.Marcelo Lira2010-01-151-1/+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()".
* Added a convenience overload for cpythonBaseName, with AbstractMetaClass as ↵Hugo Lima2010-01-141-0/+1
| | | | parameter.
* Modifies ShibokenGenerator::writeCodeSnips semantics.Marcelo Lira2009-12-281-1/+3
| | | | | | | A NULL pointer in the "lastArg" parameter of writeCodeSnips means that the function being processed will be called without arguments. The behavior prior to this change was that a NULL lastArg indicates that all arguments are to be used.
* Added the option --enable-pyside-extensions to enable PySide extensions.Hugo Lima2009-12-161-0/+3
| | | | | | | | | | You need to enable these extensions if you are generating a binding for a Qt-based library and need to pass some types through the signal slots mechanism. If you turn this flag on, you also need to link the generated bindings with the libpyside, besides add libpyside include path to your project. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Removes unused method ShibokenGenerator::hasInjectedCodeOrSignatureModification.Marcelo Lira2009-12-151-2/+0
|
* Updates generator to use improvements in API Extractor regarding function ↵Marcelo Lira2009-12-151-8/+0
| | | | modifications.
* Added convenience method to get the file name for a module's global header.Marcelo Lira2009-12-081-0/+4
| | | | Reviewed by Hugo Lima <hugo.lima@openbossa.org>
* Multiple inheritance works as desired for 99.9% of all known use cases!Hugo Lima2009-12-051-0/+2
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Try to guess the check function for custom types.Hugo Lima2009-12-011-0/+1
|
* Added a new signature of cpythonIsConvertibleFunction to ShibokenGenerator.Marcelo Lira2009-12-011-2/+3
| | | | | | Added cpythonIsConvertibleFunction(const AbstractMetaType*) to ShibokenGenerator to generate "isConvertible" checks that adds the pointer sign '*' to value pointers and object types.
* Add the generator flag "enable-parent-ctor-heuristic".Hugo Lima2009-11-301-1/+7
| | | | | When enabled, this heuristic will check every constructor for an argument named "parent", if the argument is a pointer, then it'll be the parent of this object.
* Merged with multipleinheritance branchMarcelo Lira2009-11-251-1/+8
|\
| * Added the method ShibokenGenerator::hasMultipleInheritanceInAncestry(metaClass)Marcelo Lira2009-11-181-0/+3
| | | | | | | | | | which returns a boolean indicating if there are cases of multiple inheritance in any of its ancestors.
| * modified the unused method ShibokenGenerator::getBaseClasses toMarcelo Lira2009-11-181-1/+3
| | | | | | | | | | return an AbstractMetaClassList (AbstractMetaClass does not provide such a method)
| * Classes that have multiple inheritance in some point of its ancestryMarcelo Lira2009-11-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | now receive the multiple inheritance information, the initialization function will be that of the first ancestor that have multiple inheritance. Example: class MDerived : public Base1, public Base2 clas SonOfMDerived : public MDerived MDerived defines the function PyMDerived_mi_init to register the multiple inheritance information, and SonOfMDerived just uses the ancestor function.
* | Added ShibokenGenerator::shouldGenerateCppWrapper(metaClass) method.Marcelo Lira2009-11-241-0/+4
| |
* | Removed unused method ShibokenGenerator::signatureForDefaultVirtualMethod.Marcelo Lira2009-11-231-6/+0
| | | | | | | | | | Used only by boostpythongenerator and remained untouched after the Shiboken fork.
* | Added the method injectedCodeCallsPythonOverride(func) toMarcelo Lira2009-11-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ShibokenGenerator, it returns true if a code injection on a virtual method override (a "native" inject-code) does a call to the Python override. Added the %PYTHON_METHOD_OVERRIDE type system variable, it is replaced by the name of the pointer to a Python method that represents an override to a C++ virtual method. A code injection in the "native/end" position for a method modification is now put before the dereferencing of the variables used in the Python call (the method object and the Python argument tuple). If a call to the Python override method is detected on code injections of the "native" class from method modifications, the generator doesn't write the same call again. All documentation was updated with the changes.
* | Added method ShibokenGenerator::injectedCodeUsesPySelf to checkMarcelo Lira2009-11-231-3/+11
| | | | | | | | | | | | | | if the user injected code uses the "%PYSELF" type system variable. This is useful to provide the Python wrapper pointer to native method code injections. Also updated the documentation comment for injectedCodeUsesCppSelf.
* | Added the method ShibokenGenerator::injectedCodeHasReturnValueAttributionMarcelo Lira2009-11-201-0/+8
| | | | | | | | | | | | that checks if a function returning 'void' needs to have the Python method wrapper return value set to Py_None. This happens when any of the other overloads for the function return type is different from 'void'.
* | Modified ShibokenGenerator::writeCodeSnips to receive also anMarcelo Lira2009-11-191-0/+2
|/ | | | | | | | | AbstractMetaArgument indicating the last C++ argument available (i.e. converted from Python arguments to C++) to be used in the type system variable replacement. If a variable in the user's custom code is not ready, it is replaced by the argument default value. Also updated the documentation.
* Added the %PYTHONTYPEOBJECT type system variable, which is replacedMarcelo Lira2009-11-171-2/+4
| | | | | | | | | by the proper Python type object depending on the context: method or class modification. Also added an AbstractMetaClass argument to ShibokenGenerator::writeCodeSnips to pass the needed context information. Reviewd by Luciano Wolf <luciano.wolf@openbossa.org>
* Add variables CONVERTTOPYTHO[###] and PYARG_# to code snips.Hugo Lima2009-11-161-0/+17
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* added two convenience methods to ShibokenGenerator that receiveMarcelo Lira2009-11-131-0/+17
| | | | | | AbstractMetaFunction; one tells if the function uses the %CPPSELF type system variable on its code snippets (if any), and the other says if there is a call to the wrapped C++ function in the code snippets