aboutsummaryrefslogtreecommitdiffstats
path: root/shibokengenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Added support for reverse operators.Hugo Lima2009-11-101-14/+0
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* added boolean parameter checkExact to ShibokenGenerator::cpythonCheckFunctionMarcelo Lira2009-11-051-8/+8
| | | | | | forcing it to use the _CheckExact macro instead of the more permissive _Check; one use of this is to check if a parameter is of exact type enum if a C++ method that receives an enum
* ShibokenGenerator::cpythonBaseName updated to deal with flag typesMarcelo Lira2009-11-051-2/+2
|
* Merge remote branch 'setanta/master'Hugo Lima2009-11-041-2/+7
|\ | | | | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org>
| * updated toPython conversions to deal with C++ methods that returnMarcelo Lira2009-11-041-2/+7
| | | | | | | | | | references to object-type (which are supposed to be moved around as pointers)
* | Do not generate code for operator[] (sequence protocol must be used) or ↵Hugo Lima2009-11-041-2/+0
|/ | | | | | operator->, the last one does not makes sense into python world.
* modified ShibokenGenerator::cpythonIsConvertibleFunction argumentMarcelo Lira2009-11-041-2/+2
| | | | | to TypeEntry* and added a convenience method that receives an AbstractMetaType* and calls the new version of the method
* Skip generation of unecessary wrapper classes.renato araujo oliveira2009-11-031-5/+10
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Add initial support for python sequence protocol.Hugo Lima2009-11-031-1/+1
|
* fixed ShibokenGenerator::translateTypeForWrapperMethod to append theMarcelo Lira2009-11-031-1/+1
| | | | | pointer character to value-type pointer strings, this fixes a problem on the generation of toPython conversions
* improved and organized the workings of conversion templates: addedMarcelo Lira2009-11-031-7/+10
| | | | | | | | | | | | | | | | | | | | | ConverterBase from which the generic Converter<T> and the specific Converters inherit; two methods were added: * createWrapper: returns a new PyObject wrapper with the Python type information produced by the HeaderGenerator; this method is called by toPython when a not yet wrapped C++ object needs to be converted. * copyCppObject: copies a instance of a C++ class, usually created by a implicit conversion that needs to be passed to a C++ methods; could be more than one method with variants of the converted type (value, reference, pointer) that makes no difference to the Python wrapped class. The C++ arguments converted from Python arguments by the Python method wrapper are dealt with as pointers if they are object or value types. Abstract classes and object-types, whose copy constructor and operator= should be private, are declared as Converter<T*> instead of Converter<T> and inherit from ConverterBase<T*>, this avoids impossible tries to copy such objects.
* added the method ShibokenGenerator::shouldDereferenceArgumentPointer,Marcelo Lira2009-11-031-0/+7
| | | | | which checks if an argument type should be dereferenced by the Python method wrapper before calling the C++ method
* created a simpler version of ShibokenGenerator::writeBaseConversionMarcelo Lira2009-11-011-2/+12
| | | | | | | that receives a TypeEntry* and uses only the basic type, ignoring const, pointer or reference information; ShibokenGenerator::cpythonIsConvertibleFunction now calls this new version of writeBaseConversion
* changed ShibokenGenerator::writeBaseConversion return type fromMarcelo Lira2009-11-011-10/+7
| | | | QString to void since no one is using it anymore
* moved method ShibokenGenerator::implicitConversions to baseMarcelo Lira2009-10-301-16/+0
| | | | | | Generator class on (GeneratorRunner) Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* removed method ShibokenGenerator::sortContructor, already implementedMarcelo Lira2009-10-301-21/+1
| | | | | on Generator (from GeneratorRunner); also corrected the type in the method name (also corrected on the base Generator class)
* modified overload method decisor to create an instance of a value-typeMarcelo Lira2009-10-301-1/+4
| | | | | | | | when a method that expects a reference for the value-type receives another type convertible to said value-type; the instance created is given to a std::auto_ptr object to be deleted at the end of the scope Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
* added convenience methods to call ShibokenGenerator::cpythonWrapperCPtr;Marcelo Lira2009-10-301-1/+13
| | | | | | the base method now uses TypeEntry* instead of AbstractMetaClass* and checks if the TypeEntry represents a Value Type or an Object Type, if not it returns an empty QString
* modified ShibokenGenerator::writeBaseConversion to write only the functionMarcelo Lira2009-10-301-2/+4
| | | | name if the argumentName parameter is not supplied
* modified Converter<T>::isConvertible(PyObject*) to check only if the givenMarcelo Lira2009-10-301-14/+9
| | | | | Python object is convertible to the C++ type T, and not if it is of the same type as T (this is done by the standard PyTYPENAME_Check macros)
* the Python check macros are generated once again since it is aMarcelo Lira2009-10-301-8/+22
| | | | | | | | | | convention for every type to have the said macros; also, there are some situations where one needs to now if a type is of this or that kind, and not if it is convertible to other types; the two ShibokenGenerator::cpythonCheckFunction reverted to the previous behavior and the new stuff was moved to the methods ShibokenGenerator::cpythonIsConvertibleFunction, and the places from where they are called were changed accordingly
* Revert "changed the way value-type references are converted: instead of"Marcelo Lira2009-10-301-4/+1
| | | | This reverts commit 9835de882d806a809b96cdce98597156915fbb48.
* changed the way value-type references are converted: instead ofMarcelo Lira2009-10-281-1/+4
| | | | | | creating a new wrapper for the new value-type passed by value it reuses an existing wrapper as is expected for a referenced value; also fixed the collector_test.py
* arguments whose types pointers to value-types are now converted as theyMarcelo Lira2009-10-271-8/+3
| | | | | | were common value-types, the pointer is extracted only at the time of the method call; this behavior is desired when an overloaded method has both cases to decide upon, and it is natural to convert for the common case
* reverted changes on the associations of C++ primitive types to PythonMarcelo Lira2009-10-271-18/+18
| | | | | primitive types for they are used to decide equivalencies on the ShibokenGenerator::isPyInt method
* Added Converter<T>::isConvertible to replace the T_Check functions.Hugo Lima2009-10-271-35/+43
| | | | | | This allow the user to full custommize the type conversion. Note: This change added a known regression on test_derived
* changed the way that added special methods ("__str__", "__repr__") areMarcelo Lira2009-10-231-0/+10
| | | | dealt with to allow future expansions ("__call__", "__getattr__", etc)
* renamed template variable %SELF to %PYSELF and %CPPOBJ to %CPPSELFMarcelo Lira2009-10-231-5/+5
| | | | | to improve code readability; also fixed usage of template variables on type system for the test bindings
* Added better support for functions with inject code.Hugo Lima2009-10-231-0/+2
|
* added the convenience method implicitConversions(const AbstractMetaType*)Marcelo Lira2009-10-231-0/+11
| | | | | to ShibokenGenerator to retrieve a list of implicit constructors for the given type
* Revert "modified the generator do deal with all value type conversions in"Marcelo Lira2009-10-231-24/+9
| | | | This reverts commit 4213b0176ae9af91221dbe38e1dead10638ff054.
* Revert "The implicit conversions of value types generate a new instance"Marcelo Lira2009-10-231-11/+0
| | | | This reverts commit 0953187f7b13b8ca410c8db8fa856154cc6729a8.
* added two new variables for the type system template system:Marcelo Lira2009-10-211-0/+12
| | | | | | | | | | | | | | * %SELF, replaced by the variable name for the Python instance of a class method * %CPPOBJ, replaced by the pointer to the C++ object for the Python instance associated with the method where it appears the 'cpythonWrapperCPtr(const AbstractMetaClass*, QString)' method was moved from CppGenerator to ShibokenGenerator to be available for the type system variable replacement method; the test bindings for the libsample's SimpleFile class was updated to use the new type system variables
* The implicit conversions of value types generate a new instanceMarcelo Lira2009-10-021-0/+11
| | | | of the type, and this instance must be freed after use.
* modified the generator do deal with all value type conversions inMarcelo Lira2009-10-011-9/+24
| | | | | | the same manner as it does with object types, in other words using pointers instead of copies when converting the Python wrappers to C++
* Fix QTextCodec and QTextCodec::ConverterState generation:Luciano Wolf2009-09-221-9/+10
| | | | | | - Fix function names containing "::" (such as QTextCodec); - Fix wrong method naming while generating CPython code; - Fix inner classes code generation.
* Shiboken now fixes the conversions and calls passing Object Types by valueMarcelo Lira2009-09-181-1/+1
|
* ShibokenGenerator::translateTypeForWrapperMethod stoped mixingMarcelo Lira2009-09-171-1/+2
| | | | references with references to containers
* argument conversion now deals with pointers to Value TypesMarcelo Lira2009-09-161-1/+12
|
* modified ShibokenGenerator::getFormatUnitString signature to receiveMarcelo Lira2009-09-161-4/+5
| | | | a pointer to AbstractMetaFunction instead of a AbstractMetaArgumentList
* generated converters uses 'const' for all Object-Type parametersMarcelo Lira2009-09-161-0/+8
|
* added suport to flag-like enums (aka QFlags)Marcelo Lira2009-09-161-3/+12
|
* Removed useless ValueHolder template.Hugo Lima2009-09-151-2/+2
|
* Fix more compiler errors on generated code.Hugo Lima2009-09-111-1/+3
|
* - Implementation of some functions moved to .cppHugo Lima2009-09-081-0/+24
| | | | | - Added a warning when no python operators can be found to a C++ operator. - Added mapping from C++ operator[] to Python __getitem__
* fixed some typos on license platesBruno dos Santos de Araujo2009-09-021-1/+1
|
* - CppGenerator and HeaderGenerator modified to take classes withMarcelo Lira2009-09-021-5/+0
| | | | | | | private destructors into account - Removed ShibokenGenerator::canCreateWrapperFor(...) method - Minor improvements to ShibokenGenerator documentation - Expanded PrivateDtor case and added related unit test
* method ShibokenGenerator::writeToPythonConversion now checks forMarcelo Lira2009-09-011-0/+2
| | | | validity of 'type' and 'argumentName' arguments
* Correctly handle uints and ushorts, because APIExtractor does not knowns theHugo Lima2009-08-281-0/+2
| | | | that uint is equals to unsigned int.
* Removed all warningsHugo Lima2009-08-281-1/+2
|