Want to become famous for a small amount of work? Want to have people thanking you for saving their project? Well then step right up and write a tutorial about Introspection. Ok, perhaps you won’t become famous and I might be the only person to thank you but here is a challenge for those who like to get their hands dirty in some of the more esoteric abilities of a piece of code.
As of now we have mostly been talking about introspection as a way to hook up existing GObject libraries to scripting languages but one of the most powerful features of Introspection is the ability to write your own C libraries inside your scripting project. You may wish to do this for speed, or perhaps there is a feature that is not yet directly bindable via introspection. While it is trivial to write one of these small libraries the devil is in the details and having a tutorial around would help people to dive in and play around. What I am looking for:
- Setup – show how to setup a makefile or even a setup.py file to compile a simple library, gir and typelib files. Make sure the build env installs all the files to the correct locations and even has a way to test changes without installing
- The C example 1 – show how to implement a simple function that takes simple input and returns output
- The C example 2 – show how to implement different types of functions including multiple output functions and memory managed types
- The C example 3 – show how to implement a gobject class with properties and other gobject features
- The Vala examples – show how to do the above in Vala
- Advanced topics could include callbacks
I’m pretty sure there may already be some Vala examples running around but the point of these tutorials would be to teach a scripter who is somewhat familiar with compiled languages how they could add lower level functionality to their project with out too much pain. Are you up for the challenge? Feel free to add a subpage to the PyGObject wiki.
[read this post in: ar de es fr it ja ko pt ru zh-CN ]