aboutsummaryrefslogtreecommitdiffstats
path: root/headergenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Added Converter<T>::checkType.Hugo Parente Lima2010-06-091-0/+1
| | | | | | 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.
* Added support for protected fields when not using the "protected hack".Marcelo Lira2010-06-031-0/+21
| | | | Tests were also added.
* Fixes code generation for classes with private destructors.Marcelo Lira2010-06-021-3/+21
| | | | | | This fix is specific for the cases when the "protected hack" is turned off. Also added some tests.
* Generator improved to handle protected enums without the protected hack.Marcelo Lira2010-06-021-7/+36
|
* API fixes.Renato Filho2010-05-181-2/+6
| | | | | | | | | * Export enums without macro * Declare virtual destructor on all classes with virtual functions * Fix extern "C" declaration scope Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>, Marcelo Lira <marcelo.lira@openbossa.org>
* Add namespaces to the array of type indexes.Hugo Parente Lima2010-04-221-2/+1
|
* Write converters for classes inside namespaces.Hugo Parente Lima2010-04-221-20/+8
|
* Minor tweaks in global header generation.Hugo Parente Lima2010-04-221-92/+83
| | | | Also uses FileOut class to write the file, so the file is only written if needed.
* Add include headers of global enums.Hugo Parente Lima2010-04-221-29/+14
|
* Added ObjectTypeReferenceConverter, so object-types can be used as references.Hugo Lima2010-03-181-0/+7
|
* Changed the semantic of Converter<T>::isConvertible method.Hugo Lima2010-03-181-12/+29
| | | | | | | | | 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.
* Generator now writes code to support extended conversions.Marcelo Lira2010-03-021-1/+25
| | | | Removed "new_ctor_operator" test from black list.
* Refactored and documented base Converters.Marcelo Lira2010-03-021-3/+5
| | | | | | | | | | | | To improve legibility and understanding ConverterBase<T> was renamed to ValueTypeConverter<T>, and ConverterBase<T*> specialization is now an independent base converter ObjectTypeConverter<T>. Converter_CppEnum was renamed to EnumConverter. The HeaderGenerator and custom converters for the test bindings were updated accordingly. Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Lauro Moura <lauro.neto@openbossa.org>
* Removed unnecessary code from HeaderGenerator::writeTypeConverterImpl.Marcelo Lira2010-03-011-55/+51
|
* Generator noew handles implicit conversions that are conversion operators.Marcelo Lira2010-03-011-7/+20
| | | | | | Previously all implicit conversions were constructors, now they could be conversion operators, with no explicit arguments except for the owner class where they where defined.
* Fix bug #142 by eliminating the CppCopier::copy function and adding it to a ↵Hugo Lima2010-02-261-3/+2
| | | | field in SbkBaseWrapper_Type.
* The C++ pointer for a Python wrapper is now acquired using a Converter.Marcelo Lira2010-02-241-4/+0
| | | | | | | 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>
* User definied converters are written outside Shiboken namespace.Hugo Lima2010-02-181-2/+1
|
* Add some comments on the generated global header.Hugo Lima2010-02-181-0/+2
|
* Write all converters on global header to avoid the module from exporting any ↵Hugo Lima2010-02-181-6/+82
| | | | symbols.
* Do not export Sbk*Type variables.Hugo Lima2010-02-121-13/+49
| | | | | | 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>
* Do not declare and export *_New functions on global header.Hugo Lima2010-02-121-4/+0
|
* Fixes generation of binding reimplementation of modified virtual methods.Marcelo Lira2010-02-091-2/+5
| | | | | Argument removal and type modification no longer affects the generation of virtual method signatures in the binding code.
* Do not try to call constructors created on typesystem by add-function tag.Hugo Lima2010-02-081-1/+6
| | | | Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Implement ShibokenGenerator::isCopyable based on BoostPythonGeneratorAnderson Lizardo2010-02-041-1/+1
| | | | Reviewed by Renato Araújo <renato.filho@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>
* Fixed declaration of inline function on header without implementation.Renato Filho2010-02-021-1/+1
| | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Fixed added constructor generation.Renato Filho2010-02-011-0/+3
| | | | Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
* Export converters when needed.Hugo Lima2010-01-261-2/+7
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Write cptr macro for inner classes.Hugo Lima2010-01-261-2/+4
|
* Add protected hack to global header.Hugo Lima2010-01-261-0/+4
|
* Write CopyCppObject function for inner classes.Hugo Lima2010-01-261-0/+1
|
* Fixing includesLauro Neto2010-01-261-1/+1
| | | | Reviewed by Hugo Parent <hugo.lima@openbossa.org>
* Implemented support for classname on MetaObject.renato2009-12-301-2/+1
| | | | Reviewer: Hugo Lima <hugo.lima@openbossa.org>
* Generated module headers now include headers of required modules.Marcelo Lira2009-12-291-0/+8
| | | | | | | | Example: "other" module depends on "sample" module, so the generated module header for "other" (i.e. "other_python.h") will include "sample_python.h". Of course the required module include path must be set by the build system.
* Wrapper classes of QObjects store a pointer to their own meta object, a ↵Hugo Lima2009-12-281-3/+12
| | | | | | dynamic one. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Replaces SbkCopyCppObject template function with the CppObjectCopier ↵Marcelo Lira2009-12-221-3/+8
| | | | | | | | | | | | | | | template struct In addition to the mere use of SbkCopyCppObject to copy C++ objects, it is needed to know if a C++ type has a C++ wrapped produced by the generator. To solve this SbkCopyCppObject was transformed in the template struct CppObjectCopier with the methods copy and the constant member isCppWrapper. The Converter[Base]<>::createWrapper methods were replaced by template function SbkCreateWrapper. Also some refactoring was made on the Converters code to improve legibility. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Add metaObject() method to every class derived from QObject whenHugo Lima2009-12-161-0/+3
| | | | the flag enable-pyside-extensions is on.
* Write SbkType<T> function implementation for inner classes.Hugo Lima2009-12-161-0/+1
|
* All wrapped classes now inherit from the SbkBaseWrapper of the metatype ↵Marcelo Lira2009-12-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | SbkBaseWrapperType. The wrapped classes are described with a SbkBaseWrapperType structure which extends the PyTypeObject with information about multiple inheritance and parenting ownership. This works well for the classes produced by the generator but inheriting classes written in Python continues using the PyTypeObject to describe themselves. To fix this the SbkBaseWrapperType is now a metatype for all the wrapped classes and anyone inheriting from them. In addition all the wrapped classes now inherit from SbkBaseWrapper, since Python's PyType_Ready method need that multiple inheriting classes have a common base class with the same size of the classes involved in the multiple inheritance, which disqualifies Python's base "object" class. The metatype and the base wrapper type are initialized by calling the new Shiboken::init_shiboken() function. This is done by all the imported binding modules, but it is really run only in the first call. Another noteworthy change is the replacement of PyTypeObject as a basis for SbkBaseWrapperType by the PyHeapTypeObject, since the latter is the proper choice for types created on the heap, e.g. user defined classes extending the generated wrapper classes. Reviewed by Hugo Lima <hugo.lima@openbossa.org>
* Renamed ShiboTypeObject to SbkBaseWrapperType to clearify its relationship ↵Marcelo Lira2009-12-111-1/+1
| | | | with SbkBaseWrapper.
* Converter<T>::copyCppObject method was replaced by a template function.Marcelo Lira2009-12-101-22/+21
| | | | | | | | | | | | | | | | | Added the template function T* SbkCopyCppObject(const T& cppobj); whose task is simply to copy a C++ object. If the binding has a C++ class wrapper for it, the function is specialized to use the copy constructor of the C++ wrapper class. This replaces the Converter<T>::copyCppObject method. Also moved implementation of Converter<T>::toPython from the generator to ConverterBase<T> in the conversions header, for it makes use of the SbkCopyCppObject. Reviewed by Lauro Neto <lauro.neto@openbossa.org>
* Added convenience method to get the file name for a module's global header.Marcelo Lira2009-12-081-4/+4
| | | | Reviewed by Hugo Lima <hugo.lima@openbossa.org>
* Module header now uses the visibility macro on the Python type structure ↵Marcelo Lira2009-12-081-3/+3
| | | | declaration.
* Renamed a lot of Shiboken things with "Py" prefix to use "Sbk" prefix.Marcelo Lira2009-12-081-5/+5
| | | | | | | | | | | | | | To avoid confusion of Python stuff with Shiboken generated stuff. For example: a C++ class called "String" would have the PyString_Type wrapper generated for it, mixing with the proper Python PyString_Type; now the generate code will have things like SbkString_Type, SbkString_New, SbkString_someMethod, and so on. PyBaseWrapper and its variants were renamed to SbkBaseWrapper. PyType<T>() is now SbkType<T>() PyEnumObject was renamed to SbkEnumObject.
* Do not generate the method Converter<T>::createWrapper, it'll beHugo Lima2009-12-071-10/+23
| | | | | | | auto generated by the compiler using the function PyType<T> to get PyTypeObject of a type T. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Multiple inheritance works as desired for 99.9% of all known use cases!Hugo Lima2009-12-051-0/+7
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Remove Qt specific and useless code from header generator.Hugo Lima2009-12-021-3/+0
| | | | Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Dont write "::" in include guards.Hugo Lima2009-12-021-3/+4
|
* Merged with multipleinheritance branchMarcelo Lira2009-11-251-3/+8
|\