[Kde-bindings] I need help with SMOKE (trying to write bindings for SPL)

Clifford Wolf clifford at clifford.at
Sun Oct 9 15:23:22 UTC 2005


Hi,

I'm trying to write Qt+KDE bindings for SPL (http://www.clifford.at/spl/)
using SMOKE. My idea was to first write a little C program which only
implemnts those parst of the iterface required for a little "Hello World"
program, than make it an SPL module and finally add the missing code for
the bindings to be complete.

As far as I can see in the sources of PerlQT and qtruby, most of the code
is for type conversion, so a little SMOKE "Hello World" should be
possible..

Unfortunately it seams like there is no documentation for the SMOKE API and
the PerlQT and qtruby bindings aren't easy to understand if one doesn't
have any idea of Perl and/or Ruby internals.

I understood that one first needs to call init_qt_Smoke() and can then
access the global qt_Smoke instance of the Some class. And I think it also
is clear to me how to lookup method names and how to pass arguments, but:

	Q: The Smoke::ClassFn method expects an object pointer as 2nd
	argument. I have no idea how objects can be instanciated and this
	pointers be created.

	Q: I also found no hint how the return values of the called methods
	are passed back to the caller.

I think with this two informations I should be able to write a small app
which does the following with the SMOKE wrapper library:

	#include <qt3/qapplication.h>
	#include <qt3/qlabel.h>

	int main(int argc, char **argv)
	{
		QApplication *a = new QApplication(argc, argv);
		QWidget *l = new QLabel("Hello World!", NULL);
		a->setMainWidget(l);
		l->show();
		a->exec();
		return 0;
	}

And from there on it should only be a matter of lines of code (but not of
missing information) to write the bindings for SPL.

I also think that such a simple "SMOKE Hello World" would be pretty usefull
for others when they want to write Qt/KDE bindings for other languages..

Thanks in advance for your help.

yours,
 - clifford

-- 
SSSS PPPP L     The SPL Programming Language
S    P  P L     http://www.clifford.at/spl/
SSSS PPPP L     ----------------------------------------------------
   S P    L     An object oriented, stateful, simple, small, c-like,
SSSS P    LLLL  embeddable, feature rich, dynamic scripting language
 
Once you have something that grows faster than education grows, you're
always going to get a pop culture. -- Alan Kay
 



More information about the Kde-bindings mailing list