Koto: Weekly Report Two

Iain Dooley idoo4002 at mail.usyd.edu.au
Thu Jul 21 19:26:34 CEST 2005


Hello KDE'ers!

Well, for my project, (http://www.iaindooley.com/koto) i have basically 
been doing a LOT of reading. first read Qt and Ruby manuals, then 
started learning C++ (as I've never worked with it before). I'm very 
familiar with C and Java, so it has not been hard to adapt my knowledge, 
and I've written some sample applications from tutorials etc. ("Hello 
world" and that kind of thing) and made my first use of Qt Designer to 
create a GUI.

I have also been looking at methods of using Ruby to script control of a 
GUI in a distributed environment. It was unsuitable to use Qt/Ruby 
bindings for two reasons:

    1) The user would have access to the entire Qt/KDE library including 
unrestricted File I/O etc.
    2) The system would depend on the Ruby interpreter on their machine 
being up to date/configured properly

Because I want the distributed applications to be 'browsed' in the same 
way as web pages (the original name of the project when I submitted it 
was Distributed Application Markup Language, but one of my mentors 
Cornelius Schumacher informed me that something called DAML already 
exists so I changed the name :-) I want the browser/runner application 
to be self contained so that it can be easily ported to platforms that 
may not necessarily have Ruby installed by default. Also, it would be a 
security risk to have a Ruby script that downloaded and automatically 
executed on the user's machine.

Those of you familiar with Ruby will know that its quite easy to extend 
using C. It is also just as easy to embed a Ruby interpreter into your C 
application, and the method of making variables, methods and structures 
available to Ruby as classes is quite well documented for C. The same is 
not true for C++, however, and I spent some time looking at how to 
combine C code with C++ code. I eventually found this tutorial 
(apparently the only one of it's kind, and still incomplete!!):

http://metaeditor.sourceforge.net/embed/#id2840200

Which I have read. I am now ready to combine my newfound knowledge of 
C++, Ruby and Qt! My first step is to implemented a Ruby class that will 
control the interpreter (sample code is provided with that tutorial), 
and construct a base class from which I can inherit to automatically 
make C++ classes available to Ruby scripts. That's my goal by the end of 
next week (July 31).

With that goal realised the next step is to dynamically load GUI apps 
from Qt Designer XML documents, and implement the framework for binding 
Ruby scripts as 'control scripts' for the Widgets specified in the XML 
document.

I'm back at University next week (some of us are not so lucky to be 
doing this over our holidays!!) so my time is a little restricted, but I 
will still be able to put in 20+ hours to this project for the month of 
August (uni work will just have to suffer a little :-).

Cheers,

Iain
http://www.iaindooley.com


More information about the Kde-soc mailing list