aboutsummaryrefslogtreecommitdiffstats
path: root/shibokengenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* Added method fullPythonFunctionName(func) to ShibokenGenerator.Marcelo Lira2010-06-171-0/+1
| | | | | | It accepts an AbstractMetaFunction and returns the full name in Python, including the module namespace. E.g.: "sample.SimpleFile.exists"
* Added method to guess scope of function argument default values.Marcelo Lira2010-06-151-0/+3
| | | | | | | The default values for arguments are simple strings, sometimes during binding code generation scope information is needed. The method ShibokenGenerator::guessScopeForDefaultValue tries to guess scope information for default values.
* Added Converter<T>::checkType.Hugo Parente Lima2010-06-091-5/+7
| | | | | | This method is needed because you can not call Converter<T>::isConvertible inside a Converter<Y>::isConvertible implementation, otherwise it'll create a 2-step implicit conversion.
* ShibokenGenerator::filterFunctions method becomes static.sb-0.3.2Marcelo Lira2010-06-031-1/+1
| | | | | | | | It doesn't use instance information and can now be called by other static methods. Reviewed by Renato Araújo <renato.filho@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Added support for protected fields when not using the "protected hack".Marcelo Lira2010-06-031-0/+2
| | | | Tests were also added.
* Generator improved to handle protected enums without the protected hack.Marcelo Lira2010-06-021-0/+2
|
* Cosmetic changes.Hugo Parente Lima2010-05-211-3/+3
| | | | | | | | | - Don't use stream operator on macros. - Avoid use of INDENT << INDENT. - Rename some variables on generated code to follow our coding style. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Renato Araújo <renato.filho@openbossa.org>
* 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.