aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken
Commit message (Collapse)AuthorAgeFilesLines
* Shiboken generator and libshiboken now share the same version number.sb-0.2.0Hugo Lima2010-03-231-3/+3
| | | | | | | Version bumped to 0.2.0. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Reviewer: Lauro Moura <lauro.neto@openbossa.org>
* Remove duplicated definition of libshiboken_VERSION.Hugo Lima2010-03-231-1/+0
| | | | | Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Reviewer: Lauro Moura <lauro.neto@openbossa.org>
* Fixes Converter<void*>::toPython method.Marcelo Lira2010-03-231-0/+2
| | | | | | | | The void* converter transforms a C++ NULL pointer in a Python None. An unit test for this case was added as well. Reviewed by Anderson Lizardo <anderson.lizardo@openbossa.org> Reviewed by Bruno Araújo <bruno.araujo@openbossa.org>
* Converter<T*>::toCpp specialization now converts None to NULL pointer first.Marcelo Lira2010-03-221-1/+3
| | | | | | With the recent changes to Converter's behaviour, in particular to isConvertible method, Converter<T*>::toCpp must deal with Py_None values first.
* Merge branch 'operator'Lauro Neto2010-03-221-1/+1
|\
| * Fix SbkBaseWrapper_Check castLauro Neto2010-03-221-1/+1
| |
* | Fix pkgconfig libdir variable with lib64/ or lib32/ directories.Hugo Lima2010-03-221-2/+2
|/ | | | | Reviewer: Bruno Araújo <bruno.araujo@openbossa.org> Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
* Speed up conversions of lists from python to c++ if the list classHugo Lima2010-03-181-0/+3
| | | | is binded by Shiboken (like QStringList).
* Added ObjectTypeReferenceConverter, so object-types can be used as references.Hugo Lima2010-03-181-0/+13
|
* Sequence conversion are made ONLY for python sequences.Hugo Lima2010-03-181-3/+7
| | | | | | Not for binded types implementing sequence protocol, otherwise this will cause a mess like QBitArray being accepted by someone expecting a QStringList.
* Added Shiboken::isShibokenType function to check is a object have a typeHugo Lima2010-03-181-0/+7
| | | | generated by Shiboken generator.
* Just try to reduce a bit the noise in source code caused by the use of ↵Hugo Lima2010-03-181-4/+2
| | | | templates.
* Add a default implementation for SbkType, so not binded types will return a ↵Hugo Lima2010-03-181-1/+4
| | | | | | | null pointer. Pro: Will be possible to write template functions to handle sequence conversions. Cons: We will not have an unresolved symbol when an error occur on generator.
* Move the checks to verify if an object is invalid to ↵Hugo Lima2010-03-181-2/+5
| | | | Shiboken::cppObjectIsInvalid function.
* Renamed templates used for conversions of containers.Hugo Lima2010-03-181-5/+5
|
* Changed the semantic of Converter<T>::isConvertible method.Hugo Lima2010-03-181-21/+70
| | | | | | | | | 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.
* Do not incref and decref the python dict reference on python to c++ conversions.Hugo Lima2010-03-181-5/+0
|
* Fix reference leak in StdPair converter.Hugo Lima2010-03-181-2/+2
|
* Merge branch 'master' into extensibleconversionsMarcelo Lira2010-03-043-23/+36
|\ | | | | | | | | | | | | | | | | Conflicts: cppgenerator.cpp libshiboken/basewrapper.cpp Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Lauro Moura <lauro.neto@openbossa.org>
| * Merge remote branch 'hugopl/typediscovery2'Hugo Lima2010-03-033-23/+36
| |\ | | | | | | | | | | | | Conflicts: libshiboken/conversions.h
| | * Init tb_base of SbkBaseWrapperType_Type on struct declaration instead ofHugo Lima2010-03-031-3/+1
| | | | | | | | | | | | | | | | | | | | | on initShiboken function. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Reviewer: Lauro Moura <lauro.neto@openbossa.org>
| | * Use polymorphic-id-expression to discover the correct type of a C++ object.Hugo Lima2010-03-023-20/+35
| | |
* | | Adds support for extensible converters for value type classes.Marcelo Lira2010-03-021-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Value type classes without implicit conversions use the default implementation provided by ValueTypeConverter. This commit updates ValueTypeConverter to check for extended conversions, since even a class without implicit conversions in one module could get some conversion operators in another. CppGenerator now writes 'isConvertible' calls to all object and value types checks leaving the door open to extended conversions.
* | | Wrapper meta type can now point to converter extensions.Marcelo Lira2010-03-022-1/+12
|/ / | | | | | | | | | | | | The SbkBaseWrapperType structure now stores pointers to functions that extend the type Converter methods 'isConvertible' and 'toCpp'. This is used when a module is extended by another module that defines a conversion operator for a class in the first module.
* / Refactored and documented base Converters.Marcelo Lira2010-03-021-59/+68
|/ | | | | | | | | | | | 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>
* Rename SbkCreateWrapper to createWrapper, to follow our fuction naming ↵Hugo Lima2010-02-261-4/+4
| | | | | | conventions. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Do not get the pointer of SbkType<T> function, so the compiler doesn't needHugo Lima2010-02-262-7/+7
| | | | | | to implement this function (inlining it when needed). This safe amazings 8KiB from QtGui :-)
* Fix bug #142 by eliminating the CppCopier::copy function and adding it to a ↵Hugo Lima2010-02-262-7/+30
| | | | field in SbkBaseWrapper_Type.
* Rename init_shiboken to InitShiboken, to follow our naming convention.Hugo Lima2010-02-262-10/+8
|
* Fix Config.cmake library pathLauro Neto2010-02-251-1/+1
| | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Adds a 'new' function to the SbkBaseWrapperType meta type.Marcelo Lira2010-02-241-1/+21
| | | | | | | | | | | | When a Python programmer extends a wrapped C++ class the newly created type must inherit its parent class' special information (e.g. multiple inheritance casting). The 'new' function for the wrapper meta type copies the parent information for the extended type. As it is now the meta type new works properly only with a Python class inheriting from a single wrapped C++ type. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Remove FindShiboken.cmake file in favor of ShibokenConfig and Version .cmake ↵Hugo Lima2010-02-244-21/+31
| | | | | | | | | | | files. This is the right way to go, according to: - http://www.cmake.org/pipermail/cmake/2009-April/028504.html - http://www.cmake.org/Wiki/CMake_2.6_Notes#Packages Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Remove warnings related to comparison between signed and unsigned integer ↵Hugo Lima2010-02-221-21/+41
| | | | expressions.
* Fix memory corruption due to missing parenthesis in ternary operatorAnderson Lizardo2010-02-221-1/+1
| | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* The C string converter now transforms a Python None in a C null pointer.Marcelo Lira2010-02-201-1/+5
| | | | | The conversion of '[const] char*' to C++ now accepts an None object and gives back a NULL pointer.
* All enums are now extensible to match the C++ casting behaviour.Marcelo Lira2010-02-202-9/+0
| | | | | | | | | | | | | | | Now the user can build new values of a particular enum type passing an integer to its constructor. Thus, the following C++ code: MyEnum val = (MyEnum) 1; is the equivalent of this Python code: val = MyEnum(1) The enum unit tests were also updated. Reviewed by Lauro Moura <lauro.neto@openbossa.org>
* Fixing array deallocation in exampleLauro Neto2010-02-191-1/+1
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Adding sequenceToIntArray helper functionLauro Neto2010-02-192-0/+45
|
* Some optimizations and code cleanup on conversion code for std containers.Hugo Lima2010-02-181-11/+7
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Converter<T> doesn't inherits ConverterBase, to avoid uneeded template ↵Hugo Lima2010-02-181-1/+1
| | | | instanciations.
* Write a verbose error messages when the function arguments don't match.Hugo Lima2010-02-182-1/+39
| | | | | | | 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-122-0/+18
| | | | | | 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>
* Deallocator for classes with private destructor now calls reference clearing ↵Marcelo Lira2010-02-121-0/+1
| | | | | | function. Reviewed by Lauro Moura <lauro.neto@openbossa.org>
* Adds support for managing objects referred by a Python wrapper.Marcelo Lira2010-02-122-1/+56
| | | | | | | | | | | | | | | | | | | | | A mapping to referred objects has been added to the SbkBaseWrapper structure to keep track of objects used by a given Python wrapper. This differs from ownership or parenting, since the referee is not responsible for destroying the referred object. It is more akin to a model/view relationship when many views refers to one model but don't own it, and the model must be kept alive as long it is referred. Two methods were added to assist the reference keeping: * SbkBaseWrapper_keepReference Causes a referred object reference counter to be increased and any previous used object refcount is decreased. SbkBaseWrapper_clearReferences Decrements the reference counter of all referred objects. It is called when the Python wrapper referee is destroyed.
* Removed some member initializations from SbkBaseWrapper_New.Marcelo Lira2010-02-121-4/+0
| | | | | The same initializations are made in SbkBaseWrapper_TpNew which is called by SbkBaseWrapper_New.
* Adding typeresolver.h to shiboken.hLauro Neto2010-02-111-0/+1
|
* Shiboken::setParent also accepts list of children.Renato Filho2010-02-051-1/+7
| | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Fix Weakreference supportLauro Neto2010-02-041-0/+3
| | | | | | | - Flag for types with private destructor - Cleaning weakrefs in normal destructor Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Fixing tuple construction and adding more makeTupleLauro Neto2010-02-041-9/+23
| | | | | | For 4 and 5-item tuples Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
* Adding support for weakreferenceLauro Neto2010-02-032-1/+9
| | | | Reviewer: Renato Filho <renato.filho@openbossa.org>