| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
cppgenerator.cpp
libshiboken/basewrapper.cpp
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
Reviewed by Lauro Moura <lauro.neto@openbossa.org>
|
| |\
| | |
| | |
| | |
| | | |
Conflicts:
libshiboken/conversions.h
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
on initShiboken function.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Reviewer: Lauro Moura <lauro.neto@openbossa.org>
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|/ /
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
conventions.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
|
|
|
|
|
|
| |
to implement this function (inlining it when needed).
This safe amazings 8KiB from QtGui :-)
|
|
|
|
| |
field in SbkBaseWrapper_Type.
|
| |
|
|
|
|
| |
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
expressions.
|
|
|
|
| |
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
|
|
|
|
|
| |
The conversion of '[const] char*' to C++ now accepts an None object
and gives back a NULL pointer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
|
| |
|
|
|
|
| |
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
|
|
|
|
| |
instanciations.
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
function.
Reviewed by Lauro Moura <lauro.neto@openbossa.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The same initializations are made in SbkBaseWrapper_TpNew
which is called by SbkBaseWrapper_New.
|
| |
|
|
|
|
| |
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
|
|
|
|
|
|
|
| |
- Flag for types with private destructor
- Cleaning weakrefs in normal destructor
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
|
|
|
|
|
|
| |
For 4 and 5-item tuples
Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
|
|
|
|
| |
Reviewer: Renato Filho <renato.filho@openbossa.org>
|
|
|
|
| |
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
|
|
|
|
|
|
| |
Only if not specified signed/unsigned
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
|
|
|
|
| |
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
|
|
|
|
|
|
|
|
|
| |
A new converter specialization was added to deal with 'void*'
conversions. In the case of C++ generating a unknown void pointer
a BaseWrapper is used to hold the said pointer.
There is a new test for this situation.
Reviewed by Renato Araújo <renato.filho@openbossa.org>
|
|
|
|
|
|
|
|
|
|
| |
It was renamed to PySequenceToArgcArgv and a new argument was added, besides some documentation.
If the sequence is empty and defaultAppName (the new argument) was provided, argc will be 1 and
argv will have a copy of defaultAppName because some libraries, like Qt, need at least one element
in argv (the application name), otherwise it'll crash somewhere inside Qt.
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The simplest definition of duck punching for our purposes is
the ability to change the definition of a method in an instance of
a class.
To allow this behaviour the SbkBaseWrapper structure had to be
extended with a 'ob_dict' which is a PyObject pointer to the instance
dictionary. It is originally set to NULL until the user tries to access
it. This dictionary could be accessed through the '__dict__' instance
property. For now it is read-only.
The generator was updated to handle the instance dictionary, and an
extensive duck punching test was also added.
Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
|
|
|
|
|
|
| |
A type is convertible to char if it is a number or a 1-sized char.
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
|
|
|
|
|
| |
- Converter<PyInt>::isConvertible should return bool instead of int and
- Converter<PyInt>::toPython must receive "const PyInt&" instead of just "PyInt".
|
|
|
|
|
|
|
| |
ThreadStateSaver class just wraps the Python Thread save and restore
operations. Its destructor also ensures the restoration of saved
thread state if the method ends abruptly, e.g. when the wrapped
C++ library throws an exception.
|
|
|
|
|
|
| |
GilState class puts some sugar over the Python GIL usage and also
adds the safety of a final GIL release when the GilState destructor
is called when get out of scope.
|
| |
|
|
|
|
| |
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem:
- There are two class, A and B, B inherits from A.
- You are inside a virtual method reimplemented in python with just one parameter of type A*.
- But the object referenced by a variable of type A* is an instance of B and it was created by C++,
not Python!
- Shiboken needs to create a PyObject of type B, not A! This does not makes sense for C++, but does
for Python, because python variables does not store type information, just values.
To achieve this we use RTTI to get the real type name of a variable, then we create the PyObject using
the TypeResolver infrastructure initially developed to help with signal slot problems. In other words,
the TypeResolver class has been moved from libpyside to libshiboken.
|
|
|
|
| |
basewrapper.cpp
|
|
|
|
| |
Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
|