summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix location of tr1's hash functions and namespace on msvc.Hugo Lima2009-11-241-8/+15
| | | | Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* Added visibility rules to libsample.Hugo Lima2009-11-2328-72/+168
|
* Remove -lutil from target_link_libraries. This library *must* be provided by ↵Hugo Lima2009-11-231-2/+1
| | | | | | | | | cmake. If any distro doesn't provide this by default, this is a distro bug, not a shiboken one. The other problem is that an unix/linux/gcc specific flag can't be placed here, because it doesn't makes sense on windows.
* - Add msvc compiler flags.Hugo Lima2009-11-231-6/+9
| | | | | - Add boost include directories to include path. - Work when the generatorrunnerplugin_dir variable have white spaces.
* Use "unsigned int" instead of "uint".Hugo Lima2009-11-232-6/+5
|
* Fix dllimport/dllexport macros.Hugo Lima2009-11-231-2/+2
|
* Uses __FUNCTION__ instead of __PRETTY_FUNCTION__, which is a GCC extension.Hugo Lima2009-11-236-28/+3
|
* Removed the use of fileno from the SimpleFile test, since it is Linux specific.Marcelo Lira2009-11-232-9/+0
|
* removed boostpythongenerator legacy commentMarcelo Lira2009-11-231-14/+0
|
* Removed unused method ShibokenGenerator::signatureForDefaultVirtualMethod.Marcelo Lira2009-11-232-24/+0
| | | | | Used only by boostpythongenerator and remained untouched after the Shiboken fork.
* Added a great deal of tests to virtual method modification cases.Marcelo Lira2009-11-235-2/+300
|
* Added the method injectedCodeCallsPythonOverride(func) toMarcelo Lira2009-11-235-22/+62
| | | | | | | | | | | | | | | | | | | | | | ShibokenGenerator, it returns true if a code injection on a virtual method override (a "native" inject-code) does a call to the Python override. Added the %PYTHON_METHOD_OVERRIDE type system variable, it is replaced by the name of the pointer to a Python method that represents an override to a C++ virtual method. A code injection in the "native/end" position for a method modification is now put before the dereferencing of the variables used in the Python call (the method object and the Python argument tuple). If a call to the Python override method is detected on code injections of the "native" class from method modifications, the generator doesn't write the same call again. All documentation was updated with the changes.
* Added the type system %PYTHON_ARGUMENTS variable. It is used inMarcelo Lira2009-11-232-38/+117
| | | | | | | | | | | | | | | | | | | | | | | "native" code injections to get the Python tuple of objects converted from C++ arguments received from a virtual method call. The tuple is the one to be passed to a Python override of the wrapped C++ virtual method. Other type system variables were improved to have a smarter replacement depending if they are part of a code injection of the "native" or "target" classes. * %PYARG_# In the context of a native code injection it represents one item in the Python argument tuple, acquired with PyTuple_GET_ITEM. If the binding developer attributes some value to the variable the code snippet writer tries to be smart and sets the tuple item with PyTuple_SET_ITEM. See the updated documentation for more details. * %CPPSELF Replaced by "this" in native code injections. The documentation was updated with the new information.
* The code injections in the native/beginning position come after theMarcelo Lira2009-11-233-80/+97
| | | | | | C++ arguments conversion to a Python argument tuple. The documentation was updated with this information. The virtual method writer was also fixed to not convert removed arguments.
* Added method ShibokenGenerator::injectedCodeUsesPySelf to checkMarcelo Lira2009-11-232-3/+21
| | | | | | | if the user injected code uses the "%PYSELF" type system variable. This is useful to provide the Python wrapper pointer to native method code injections. Also updated the documentation comment for injectedCodeUsesCppSelf.
* Added a great deal of test cases for argument removal and modification.Marcelo Lira2009-11-233-0/+255
|
* Renamed OverloadData::hasDefaultValue to ↵Marcelo Lira2009-11-233-9/+14
| | | | | | | | | OverloadData::getFunctionWithDefaultValue and modified it to return a pointer to the actual AbstractMetaFunction with the default value (or NULL if it doesn't has the value), instead of just returning a boolean. The overload decisor writer makes use of this new behavior to get the correct function for a method call with default values.
* Added test case for method overloads with different return types.Marcelo Lira2009-11-202-0/+13
| | | | Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Added the writeNoneReturn method to CppGenerator to attribute Py_NoneMarcelo Lira2009-11-202-3/+30
| | | | | | | to the Python method wrapper return variable, after a call to a C++ function that returns void, but only when any of its other overloads has a return type different from void. Also documented the CppGenerator::writeOverloadedMethodDecisor method.
* Added methods to OverloadData:Marcelo Lira2009-11-202-0/+31
| | | | | | | | | | * OverloadData* headOverloadData() const; Return the root OverloadData object for the current OverloadData. * QStringList returnTypes() const; Returns a list of the possible return types for the current OverloadData. * bool hasNonVoidReturnType() const; Returns true if any of the overloads for the current OverloadData has a return type different from void.
* Added the method ShibokenGenerator::injectedCodeHasReturnValueAttributionMarcelo Lira2009-11-202-0/+19
| | | | | | that checks if a function returning 'void' needs to have the Python method wrapper return value set to Py_None. This happens when any of the other overloads for the function return type is different from 'void'.
* Updated the type system description of the sample binding to use theMarcelo Lira2009-11-191-6/+5
| | | | | | proper type system variables instead of calling Shiboken directly. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Some refactoring and cleaning on CppGenerator::writeMethodWrapper.Marcelo Lira2009-11-191-7/+28
| | | | | | | CppGenerator::writeMethodCall now passes to the injected code writer the last argument to be used in a call, if it is not the last one, so the code writer can make smarter decisions when replacing type system variables in user written code.
* Modified ShibokenGenerator::writeCodeSnips to receive also anMarcelo Lira2009-11-194-12/+28
| | | | | | | | | AbstractMetaArgument indicating the last C++ argument available (i.e. converted from Python arguments to C++) to be used in the type system variable replacement. If a variable in the user's custom code is not ready, it is replaced by the argument default value. Also updated the documentation.
* Added the type system variable "%ARG#_TYPE" which returns the C++ typeMarcelo Lira2009-11-192-2/+71
| | | | | | | | for the argument indicated by the numeric index '#'; wrong indexes will issue a generator warning. The documentation was updated as well. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
* When the user adds a function with an argument unknown for the typesystem,Hugo Lima2009-11-191-0/+4
| | | | | | | the generator writes type checks as TYPENAME_Check, so this macro allows users to add PyObject arguments to their added functions. Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Major refactor on the methods writeOverloadedMethodDecisor andMarcelo Lira2009-11-191-94/+84
| | | | | | | writeMethodCall from CppGenerator. The code is shorter and more clear. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Fixed type system variable replacement for %# and %ARGUMENT_NAMESMarcelo Lira2009-11-192-9/+69
| | | | | | to handle correctly removed arguments and also consider variable values with default values. The documentation was updated with the new information.
* Fixed OverloadData::isFinalOccurrence method to consider removed arguments.Marcelo Lira2009-11-191-2/+7
|
* Use google dense hash table instead of std::map in BindingManager.Hugo Lima2009-11-1810-3/+1973
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* Fixed ownership modification writer: the argument index for the selfMarcelo Lira2009-11-181-1/+1
| | | | | | object is -1 not 0. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Moved the validity check for wrapped C++ objects to a CppGeneratorMarcelo Lira2009-11-182-19/+21
| | | | | method, since it is used in more than one place. Also clearified the error message.
* Conversion for function/method arguments with modified types willMarcelo Lira2009-11-181-0/+2
| | | | | | | not be generated anymore. The user must provide its own conversions for those cases. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Commented unused static function 'dumpFunction'.Marcelo Lira2009-11-181-1/+3
|
* Fixed C string toPython converter to return Py_None when a NULL pointerMarcelo Lira2009-11-184-11/+44
| | | | | is received. Fixed and improved the test for functions returning NULL pointer values.
* Added features to manage basic ownership transference between C++Marcelo Lira2009-11-186-49/+132
| | | | | and Python. Updated the KinderGarten example with two methods that steal and retrieve Python ownership, and added the proper unit tests.
* Fixed Converter<>::toPython(cppobj) method to return Py_None when cppobj is ↵Marcelo Lira2009-11-181-0/+4
| | | | NULL.
* When calling a function whose next argument has a default valueMarcelo Lira2009-11-181-1/+6
| | | | | the overload decisor tries to find the exact function for the call instead of passing the reference function.
* Added support for the type system "invalidate-after-use" argument modification.Marcelo Lira2009-11-186-4/+63
| | | | | | | | The Python wrapper object produced for an argument received from C++ on a virtual method call is marked as invalid after the call to the Python override. If the Python script keeps the wrapper and try to use it afterwards a RuntimeError exception is raised. Test cases were added using the ObjectType::event method and the new Event class.
* Value-type Python wrappers now check if they hold invalid C++ object pointers.Marcelo Lira2009-11-181-6/+6
|
* Wrappers with invalid C++ object pointers should raise RuntimeErrorMarcelo Lira2009-11-181-2/+2
| | | | instead of NotImplementedError.
* Adapt to changes in Generator interface.Hugo Lima2009-11-182-9/+3
| | | | Reviewed by Renato Araújo <renato.filho@openbossa.org>
* Fixed virtual method writer and Py_BuildValue format string generatorMarcelo Lira2009-11-172-0/+2
| | | | | | to take pointers to value types into account. Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* Added the %PYTHONTYPEOBJECT type system variable, which is replacedMarcelo Lira2009-11-175-8/+33
| | | | | | | | | by the proper Python type object depending on the context: method or class modification. Also added an AbstractMetaClass argument to ShibokenGenerator::writeCodeSnips to pass the needed context information. Reviewd by Luciano Wolf <luciano.wolf@openbossa.org>
* Shiboken documentation updated with type system variables informationMarcelo Lira2009-11-164-4/+111
| | | | Reviewed by Hugo Lima <hugo.lima@openbossa.org>
* Add variables CONVERTTOPYTHO[###] and PYARG_# to code snips.Hugo Lima2009-11-164-30/+106
| | | | Reviewed by Marcelo Lira <marcelo.lira@openbossa.org>
* OverloadData does not ignore arguments which modify types.Hugo Lima2009-11-163-5/+35
|
* Added tests for various inject-code use cases.Hugo Lima2009-11-164-19/+218
|
* removed unused CppGenerator::writeNonVirtualModifiedFunctionNativeMarcelo Lira2009-11-162-39/+0
| | | | | | | method; it was used only by the boostpythongenerator from where Shiboken code forked Reviewed by Hugo Parente <hugo.lima@openbossa.org>
* improved the generator detection of user's custom code calling theMarcelo Lira2009-11-162-21/+31
| | | | | | | | | wrapped C++ methods (including constructors) to avoid making duplicate calls; also fixed the writing of native/end code injection on wrapper class level Reviewed by Hugo Parente <hugo.lima@openbossa.org>