aboutsummaryrefslogtreecommitdiffstats
path: root/cppgenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Enum's __invert__ method must use 'self' argument.Marcelo Lira2010-03-231-1/+1
| | | | | Reviewed by Anderson Lizardo <anderson.lizardo@openbossa.org> Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* The __not__ method is not generated any more since it is not being used.Marcelo Lira2010-03-231-1/+0
|
* Fixes virtual method writer to handle modification to return type.Marcelo Lira2010-03-221-5/+11
| | | | | | No code is generated for return value conversion on virtual method callers if code is provided to handle said conversion via code injection or custom conversion rule.
* Fixed virtual method callers to consider modifications to return type.Marcelo Lira2010-03-221-1/+6
| | | | | Type modifications done to the value expected to be returned by a Python override of a virtual method are now handled properly.
* Merge branch 'operator'Lauro Neto2010-03-221-0/+32
|\
| * Make sure reverse shift operators are calledLauro Neto2010-03-221-0/+32
| | | | | | | | | | | | | | Solves #119 Reviewer: Bruno Araujo <bruno.araujo@openbossa.org> Reviewer: Anderson Lizardo <anderson.lizardo@openbossa.org>
* | Fix CppGenerator::writeMinimalConstructorCallArguments when the class has ↵Hugo Lima2010-03-221-3/+5
|/ | | | | | | | | non-primitive types with default values. Reviewer: Bruno Araújo <bruno.araujo@openbossa.org> Reviewer: Anderson Lizardo <anderson.lizardo@openbossa.org>
* Fix error message for containers, replacing QList by list, QHash by dict, etc.Hugo Lima2010-03-221-0/+12
| | | | | Reviewer: Bruno Araújo <bruno.araujo@openbossa.org> Reviewer: Anderson Lizardo <anderson.lizardo@openbossa.org>
* Better handling of replaced types and custom conversions in the overload ↵Marcelo Lira2010-03-191-12/+24
| | | | decisor.
* Minimal grammar fixesMatti Airas2010-03-191-3/+3
| | | | | Reviewer: Hugo Parente <hugo.limra@openbossa.org> Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
* Move the checks to verify if an object is invalid to ↵Hugo Lima2010-03-181-24/+3
| | | | Shiboken::cppObjectIsInvalid function.
* Changed the semantic of Converter<T>::isConvertible method.Hugo Lima2010-03-181-12/+0
| | | | | | | | | 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.
* added support for pure virtual methods returning void ptrsMatti Airas2010-03-171-2/+3
| | | | | | | the return statements now have correct values for pure virtual methods returning void pointers. also added a dummy test for this (can't really test it properly until the semantics of casting the python return value into a void pointer is properly defined -- if ever).
* bugfix: always write the return statementMatti Airas2010-03-171-2/+3
| | | | | | the return statement within the error block was only written if there was something to return. now an empty statement is written if no return value is expected.
* Merge branch 'master' into extensibleconversionsMarcelo Lira2010-03-041-16/+62
|\ | | | | | | | | | | | | | | | | Conflicts: cppgenerator.cpp libshiboken/basewrapper.cpp Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Lauro Moura <lauro.neto@openbossa.org>
| * Remove the "(destructor)" cast to avoid wrong code to be silently compiled.Hugo Lima2010-03-021-2/+2
| |
| * Use polymorphic-id-expression to discover the correct type of a C++ object.Hugo Lima2010-03-021-14/+60
| |
* | Adds support for extensible converters for value type classes.Marcelo Lira2010-03-021-3/+1
| | | | | | | | | | | | | | | | | | | | 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.
* | Generator now writes code to support extended conversions.Marcelo Lira2010-03-021-0/+20
| | | | | | | | Removed "new_ctor_operator" test from black list.
* | Adds extended conversions writer functions.Marcelo Lira2010-03-021-0/+50
| | | | | | | | | | Adds the functions responsible for writing code for functions that supports extensible conversions.
* | Wrapper meta type can now point to converter extensions.Marcelo Lira2010-03-021-1/+3
|/ | | | | | | 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.
* Generator noew handles implicit conversions that are conversion operators.Marcelo Lira2010-03-011-3/+10
| | | | | | 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-17/+18
| | | | field in SbkBaseWrapper_Type.
* Rename init_shiboken to InitShiboken, to follow our naming convention.Hugo Lima2010-02-261-2/+2
|
* Fix bug#142.Hugo Lima2010-02-241-5/+8
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org> and Luciano Wolf <luciano.wolf@openbossa.org>
* Fixed QMetaObject.className return value.Renato Filho2010-02-241-2/+4
| | | | Reviewed by Lauro Moura <lauro.neto@openbossa.org>
* The special cast function can now cast a pointer to all ancestor classes.Marcelo Lira2010-02-241-4/+3
| | | | | | It also stopped using specific "cptr" cast macros, for these are to be abandoned since they're considered harmful to multiple inheritance casting.
* Fixed support for innerclass.Renato Filho2010-02-241-4/+30
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Remove inplace operators of flagsLauro Neto2010-02-231-25/+3
| | | | | | | | | | | | | | | | Enums and flags are now treated as immutable types, so using a inplace operator will create a new flag object and attribute it to the name which the operator is called. flags = Qt.Window flags |= Qt.Dialog # This will create a new object and attribute # to flags This was done in order to prevent changing the original objects as the the inplace operator in line2 would modify the object pointed by Qt.Window. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Adding default value for enum/flag constructorLauro Neto2010-02-231-4/+4
|
* Fixing Enum '~' invert operatorLauro Neto2010-02-231-3/+3
| | | | Was being registered as __neg__ instead of __invert__
* Write hash function for types with hash function specified in typesystem.Hugo Lima2010-02-231-1/+17
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* - Fix method writeTypeCheck, so it finally correct decides when to use ↵Hugo Lima2010-02-231-16/+9
| | | | | | | | PyNumber_Check or a more specific type check function. - Promote bool type as a specialization of int, as we do with float. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* The C++-like enum values are now registered inside the related enums.Marcelo Lira2010-02-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Originally the values of an enum were registered in the scope that enclosed the enum declaration, just like C++ does, now in addition to this the values are registered inside the enum type. To exemplify, the following C++ enum: Scope { enum Foo { Value }; }; can be accessed in Python as this: Scope.Value as well as this: Scope.Foo.Value The enum unit tests were expanded to check for this new behaviour. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Adds the convenience method 'isPairContainer' to ShibokenGenerator.Marcelo Lira2010-02-201-9/+5
| | | | | | | 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-7/+7
| | | | | It checks if an AbstractMetaType represents a C string. Also updated code to make use of the new method.
* Message for signature errors treats C++ null pointer as Python None.Marcelo Lira2010-02-201-2/+7
| | | | | C++ '0' (or 'NULL') default value is translated as Python 'None' in error message for wrong method calls.
* All enums are now extensible to match the C++ casting behaviour.Marcelo Lira2010-02-201-1/+31
| | | | | | | | | | | | | | | 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>
* Fix bug on overload resolution when the generator needs to decide ifHugo Lima2010-02-191-7/+17
| | | | | | | it can expect the argument to be any number type or an explicty type, e.g. float. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Write all converters on global header to avoid the module from exporting any ↵Hugo Lima2010-02-181-76/+0
| | | | symbols.
* Fixes method call error messages for constructors.Marcelo Lira2010-02-181-2/+5
| | | | Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Write a verbose error messages when the function arguments don't match.Hugo Lima2010-02-181-2/+37
| | | | | | | 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>
* The generator takes "default ownership" modifications into account.Marcelo Lira2010-02-171-0/+5
| | | | | | | The default ownership does nothing. This is useful to avoid automatic heuristically based generation of code defining parenting. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Do not export Sbk*Type variables.Hugo Lima2010-02-121-21/+39
| | | | | | 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>
* Fixes the type checking for class' fields of primitive numeric types.Marcelo Lira2010-02-121-1/+1
|
* Updates the code written to support reference keeping.Marcelo Lira2010-02-121-42/+9
| | | | | | The classes that kept references to other objects now make use of the new SbkBaseWrapper_keepReference helper function from libshiboken.
* Register enums within type resolverLauro Neto2010-02-121-0/+8
| | | | Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Fixed error handling on Python object constructor.Renato Filho2010-02-111-3/+4
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Fixes problem with CppGenerator::writeTypeCheck due to a bad rebasing.Marcelo Lira2010-02-111-15/+11
| | | | Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Adds support to arguments marked as keep reference in the type system.Marcelo Lira2010-02-101-0/+38
| | | | | | | Every method marked to increment the reference count of any argument must decrement the reference count of previously held objects. A dictionary is used to associate the method overload and Python wrapper instance with the previously set object.