[Kde-bindings] GSoc Project: Kross improvements

Ben Boeckel MathStuf at gmail.com
Tue Mar 24 09:53:52 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I am interested in improving Kross. I am creating a strategy/RPG game 
engine which relies heavily upon Kross for its scripting capabilities and 
there are some issues that I have found that I would like to work on 
fixing:

- - I have seen inconsistencies between the different languages which 
have bridges in their use of connect and disconnect. QtScript is 
different because it does them differently anyways, but the rest should 
have all the common uses for connect and disconnect available. I have 
a patch attached which implements all of the overloads (listed below) 
for the connect() function. It also does not currently work completely 
due to the way objects are published and used in the script (another 
point later). Overloads of connect (similar for disconnect, but 
disconnecting against 0 for all should also be supported):

qobj.connect(signal, localslot[, type])
qobj.connect(sender, signal, receiver, slot[, type])
qobj.connect(sender, signal, receiver, signal[, type])
qobj.connect(senderreceiver, signal, slot[, type])
qobj.connect(senderreceiver, signal, signal[, type])
sender.connect(signal, localslot[, type])
sender.connect(signal, receiver, slot[, type])
sender.connect(signal, receiver, signal[, type])
senderreceiver.connect(signal, slot[, type])
senderreceiver.connect(signal, signal[, type])

I also fixed up the connection to differentiate between signals and 
slots as well by using (a different) nasty hack which figures out if the 
object has a methods of the name that is a signal or a slot.

- - Publishing of objects to the script currently differs between the 
languages supported. JavaScript, QtScript, and Falcon can just use 
published objects while Python and Ruby need to import and require 
the objects, respectively. I'm not completely familiar with the API of the 
languages, but I think it should be possible to support setting up global 
variables with the names rather than intercepting import or require 
calls (as my last overview of the code led me to believe).

- - Rework Kross::ActionCollection to also inherit from 
Kross::ChildrenInterface. K::AC should also support having QObjects 
published through them. In order to publish objects to a branch of 
objects, an object mush be published at every leaf or available to all 
through the Kross::Manager. Personally, I find this hard to work with in 
Sigen since many scripts may need a class and publishing it for every 
script is prone to errors with missing objects and such.

This breaks the current API/ABI, but providing it in parallel could be 
workable until KDE5 I think (though since I think Kross-enhanced 
projects are few outside of KDE, just port them to it, but I understand if 
this is an unworkable solution)

- - Forwarding headers. An easy fix, but currently not provided.

Any feedback would be greatly appreciated.

- --Ben Boeckel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAknIrbAACgkQiPi+MRHG3qSPlgCeIvS+m8fYz1pWK2NY8J0LyA8h
dQgAn38uSHNy10Ib40nEtBlocz9t249x
=bq42
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: krossfalcon-connect.patch
Type: text/x-patch
Size: 10546 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20090324/e5182ed2/attachment.patch>


More information about the Kde-bindings mailing list