KDE Development

Plasma UI Compiler

Well, as always, when I get bored, something good comes out of it.

This time I was annoyed with the fact that if I wanted to change the layout of Lancelot, I would have to dig in the code and switch layouts, parents, children etc. Without doubt, Lancelot is currently the most complicated (UI-wise) application based on libPlasma. (I’m not taking into consideration Amarok2 since it has only one part of its UI based on plasma - just the center piece - which is trivial ATM)

So I decided it was the time to switch to a XML-based definition of the UI. The problem, of course, was that there is no such feature in Plasma yet - there is a Designer and UIC for QWidgets, but not for Plasma and QGraphicsView

So, what could I do? The answer was simple - write PUIC - Plasma UI Compiler - which takes a XML formated file and generates C++ code from it. The tool is under heavy development meaning that most of current Plasma widgets are not yet supported (read: none of the Plasma’s widgets are supported :) ). Currently, it supports a couple of layouts (Border, Node and Flip) and Lancelot’s widgets.

Since PUIC is the integral part of Lancelot (for the time being), or to be more precise, the integral part of Lancelot’s build system (basic CMake support for PUIC is done also), the first thing on my TODO list is to complete the transition to XML-based UI, thus completing the support for all Lancelot’s widgets. After that, PUIC will be separated to grow on its own, and other layouts will be added with all Plasma’s widgets.

p.s. I have removed Lancelot from extragear’s build until this is finished.

p.p.s. Sorry for extremely long sentences.

p.p.p.s. No screenshots this time… be patient…

10 Comments »

  1. Perhaps this is obvious, I just want to be sure: The XML has to be written by hand?

    Comment by Carsten Niehaus — February 12, 2008 @ 1:27 pm

  2. @Carsten
    For the time being. But it shouldn’t be hard to make a designer later on.

    Comment by admin — February 12, 2008 @ 1:31 pm

  3. Out of curiosity, what kind of XML definition will you use? Is there in KDE a standard XML-based GUI specification language?

    Otherwise, instead of creating an ad-hoc language for this, you may consider using an already defined language, like the standard UIML (http://en.wikipedia.org/wiki/UIML) or one of the available open-source projects (http://en.wikipedia.org/wiki/User_interface_markup_language)

    Comment by TuringTest — February 12, 2008 @ 2:09 pm

  4. You do know that “puic” already has a Qt/KDE meaning, right? ;)

    http://perlqt.sourceforge.net/dist/current/doc/en/index.html#rad_prototyping_with_qt_designer_and_puic

    Comment by Benjamin Reed — February 12, 2008 @ 2:40 pm

  5. @TuringTest
    The problem with existing UI markup languages is that they are not made for Plasma (obviously) and that they are too general. For example, Plasma has no message dialogs etc.

    The format that is input to PUIC is very close to the Plasma’s code to keep the compiler simple. The second aim is to ease the development of the Designer (sometime in future)

    @Benjamin Reed
    Damn, so I’ll have to invent some new crazy name that will be a classic free software joke like Plasma and Oxygen… >:[

    Comment by admin — February 12, 2008 @ 2:43 pm

  6. I may be completely mistaken here; but I was totally assuming that Qt designer and normal dialogs/widgets would be good enough for Plasma, as soon as it depends on WoC (Widgets on Canvas (aka graphicsview)).

    Did I miss something?

    Comment by Thomas Zander — February 12, 2008 @ 5:51 pm

  7. @Thomas
    Well, since there is no Widgets on QGV yet (in the stable version of Qt anyway), I can not answer this with certainty.

    I suppose it will be available in one or another way, but I don’t think that QWidgets will completely replace Plasma’s widgets for one reason - they just don’t fit in. Just look at the calendar that pops out when you click the clock widget.

    It is another thing to have a QLineEdit on QGV, but having whole dialogs, panels etc. is (IMHO) plain ugly.

    If future proves me wrong, Plasma UI compiler will remain only a tool for Lancelot… since it is not based on QWidgets.

    Comment by admin — February 12, 2008 @ 6:08 pm

  8. You should call it “Puck” ;)

    Also, you should write an update (including screenshots!) for the Commit-Digest ;)

    Danny

    Comment by Danny Allen — February 13, 2008 @ 12:15 am

  9. Do you can publish a Lancelot RPM package for openSuSE?

    Comment by kwpolska — February 24, 2008 @ 12:28 pm

  10. @kwpolska
    I think it is in KDE4 extragear package of openSUSE.

    But is is not yet ready to be used (especially the version that could be in that package).

    As far as the packages are concerned, I’m not sure that I’ll be making them at all. They should be provided by the distribution (since Lancelot IS a part of KDE).

    Comment by admin — February 24, 2008 @ 12:37 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress
Copyright by Ivan Čukić, Foment Group