[Kde-bindings] ruby bindings

Richard Dale Richard_Dale at tipitina.demon.co.uk
Fri Jul 18 23:50:00 UTC 2003


On Friday 18 July 2003 19:22, Germain Garand wrote:
> Le Jeudi 03 Juillet 2003 14:05, Richard Dale a écrit :
> > I adapted the Qt Designer cppeditor plugin for java as 'javaeditor' to
> > see what could be customised via a Designer plugin. Unfortunately I found
> > it isn't possible to customise the lists of signal/slot types displayed
> > to show java,
>
> Ah, interesting... I faced the same issues with the perleditor.
> Now, if there are more and more people interested in having Designer
> plugins, things could change fast.
> I've forwarded most important issues/wishlist items upstream ( bug in the
> DesignerFormWindow::addFunction() interface, isCpp() locks all over the
> place, need for a language agnostic function/slot dialog, and more
> generally better access to the MetaDataBase) and so far had good feedback
> (though *very* slowly).
> The only stumbling block left in 3.2 is a one and only isCpp() lock, that
> was most unfortunately forgotten by Marius B. Monsen when he removed the
> others (so that's another roundtrip through qt-bugs@ :-(( )
Yes I can confirm the isCpp() problem with java too :( - I've attached my 
currentt javaeditor plugin. 

This was the method that I found to be a bit of a 'let down' too - i expected 
to be able to 'javatize' the C++ type signatures:

QStrList LanguageInterfaceImpl::signalNames( QObject *obj ) const
{
    QStrList sigs;
    QStrList javasigs;
    sigs = obj->metaObject()->signalNames( TRUE );
    sigs.remove( "destroyed()" );
    
	for ( QPtrListIterator<char> sit( sigs ); sit.current(); ++sit ) {
	QString f( sit.current() );
	
	// It looks as though the purpose of this method is to allow the C++
	// types in the signals to be changed to another language like java
	// by editing the strings as below. However, unfortunately it doesn't 
	// have any effect :-(
	f.replace("unsigned char", "byte");
	f.replace("bool", "boolean");
	f.replace("QString", "String");
	f.replace("QTime", "Date");
	f.replace("::", ".");
	f.remove("*");
	f.remove("&");
	f.remove("const ");
	f.remove("signed ");
	f.remove("unsigned ");
	javasigs.append(strdup((const char *) f));
    }
 
    return javasigs;
}

How signal/slot type signatures should appear in non C++ languages is a tricky 
problem.

Marco Ladermann has written an XSLT based java juic tool - I could either 
adapt that for ruby, or hack the C++ in puic.
> Could I send a reminder mentionning your work as well (and maybe the
> ongoing work on ruby?) ?
I've worked out the syntax for declaring slots/signals in ruby, and the 
interface to the ruby equivalent of the PerlQt runtime, so I'm not far off 
producing something useful, but not quite yet..
> Anyway, for what concerns the signal/slot dialog, I found out that it was
> possible to turnaround by using the classbrowser interface, with quite some
> sore hacks, to mimic the "Members" tab behaviour (a tab that is disabled
> when your plugin isn't Cpp)...
Hmm - these isCpp() only problems sounds familar - 'CALLING NORWAY... CALLING 
NORWAY...' your most excellent unguaranteed Qt Designer plugin interface is 
*nearly* there :) But we need the odd tweak..
> From there, you can produce custom signal/slot registering dialogs, and
> register the input in the MetaDataBase by using
> DesignerFormWindow::addFunction(), which is now fixed.
>
> It doesn't fix the global function/slot dialog problem, but it does add an
> alternate, target language friendly way of inputing functions/slots...
OK I'll have a look - I was just trying to only change code in the javaeditor 
plugin, not is the body of QtDesigner. And certainly lets get rid of 'windows 
within windows' MDI in QtDesigner for scripting language plugins - horrid!!

-- Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: javaeditor_0.2.tar.gz
Type: application/x-tgz
Size: 25823 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20030719/f079cf71/attachment.bin>


More information about the Kde-bindings mailing list