Hello folks, our latest work on Shiboken (yes, the very same that produced a preliminary version of QtCore with 1.5M [1]) was to clarify how the type system's "inject-code" should be used.
The code injection feature is a very interesting one, it gives the binding developer power to change specific things where and as he pleases, instead of relying on the repetitive generated code. The complete explanation of the "inject-code" tag can be found in the updated Shiboken documentation[2], but summarizing here the main issue was to define what the positioning options provided by the API Extractor would mean for the generated CPython code. Where is "native/beginning"? Or "target/end"? Where is this for a modified method, for a class, and for the global module? As a side effect, we improved the type system variables. And what are those? Type system variables are used to avoid writing specific coded too tied to the binding generator implementation. There are generic variables, but each generator can introduce their own, as Shiboken does. For example: <inject-code class="target" position="beginning"> %CPPSELF.%FUNCTION_NAME(true); </inject-code> In the above code injection the type system variable "%CPPSELF" will be replaced by the wrapped C++ object and "%FUNCTION_NAME" by the wrapped C++ method (Python wrapped, as indicated by class="target") where that piece of custom code was meant to be inserted. Once again, refer to the Shiboken documentation[3] to know all the type system variables introduced. And just to remind you, the build sequence is: API Extractor, Generator Runner and Shiboken. Everything from the gitorious master branch. [4] [1] http://lists.openbossa.org/pipermail/pyside/2009-November/000302.html [2] http://www.pyside.org/docs/shiboken [3] http://www.pyside.org/docs/shiboken/typesystemvariables.html [4] http://qt.gitorious.org/pyside Cheers, -- Marcelo Lira dos Santos INdT - Instituto Nokia de Tecnologia _______________________________________________ PySide mailing list [email protected] http://lists.openbossa.org/listinfo/pyside
