At UDS I had a meeting with David Barth and Florian Boucault about a project 
to automatically wrap Gnome GObject based libraries for use with Qt C++/QML 
projects. It could then be used to wrap a common library that could be used by 
both the Unity-3D and Unity-2D shells.

I made a start at UDS and got the project checked out of the KDE playground 
SVN and built it against the latest version of GObject Introspection. Since, 
UDS I've been working on it fulltime and it is beginning to be *almost* 
useful. I've implemented function calling and argument marshalling so that 
function, constructor and method calls now work. 

There is still a fair bit of work to do on the marshalling. I am using the 
'Everything' library that is part of the G-I tests as the basis of a QtTest 
based unit test to cover all the functionality in the libeverything. So it is 
a matter of getting each function call working in turn like this:

    // const char * const * test_strv_out_c (void);
    QVector<QByteArray> strvOutCResult;
    invoked = QMetaObject::invokeMethod(everythingNamespace, "testStrvOutC", 
Q_RETURN_ARG(QVector<QByteArray>, strvOutCResult));
    QCOMPARE(invoked, true);
    QVector<QByteArray> strvOutCExpected;
    strvOutCExpected << "thanks";
    strvOutCExpected << "for";
    strvOutCExpected << "all";
    strvOutCExpected << "the";
    strvOutCExpected << "fish";
    QCOMPARE(strvOutCResult, strvOutCExpected);

Once I have the function call coverage for libeverything reasonably complete, 
the next stage will be to add getting and setting GObject properties as Qt 
properties, and forwarding GObject signals to Qt signals. Then the dynamic 
runtime will be fairly complete.

After that, an option will be added to generate the code C++ QObject based 
classes, that can be compiled against. At first the code generated will use 
QMetaObject::invokeMethod(), but I think there is scope for tuning and 
possibly called the target C functions directly. We will need to do some 
performance tests to see if that will be necessary.

I've just created a Launchpad project at https://launchpad.net/smoke-gobject/ 
and people are welcome to check out the code and try it out. I probably need 
to add some build instructions about which ubuntu dev packages need to be 
installed though.

When I started on the project I wrote these blogs:

http://www.kdedevelopers.org/node/3878
http://www.kdedevelopers.org/node/3894
http://www.kdedevelopers.org/node/3899
I'll try and write another blog soon to describe the recent progress in more 
detail than I've done in this mail.

-- Richard

_______________________________________________
Mailing list: https://launchpad.net/~ayatana-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~ayatana-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to