KWin Adds Support for QML Decorations
As part of a KDE-wide effort to prepare for Qt 5/QtQuick2, and a push to improve the window manager, KWin now sports QML decoration support. Currently, the C++ API for decorators is "...not very Qt like and requires a strong understanding of how the window decoration in KWin works ... [and] seems to be too difficult to be used." This complexity increases maintenance burden: "In 4.9 we ship four window decorations: the Aurorae theme engine, Oxygen, Plastik, b2 and Laptop. Together they are 10 kSLOC of C++ code and 1 kSLOC QML code (Aurorae). Before Aurorae got ported to QML the size of the decorations was 13 kSLOC. Overall that is about 10 per cent of the KWin source base, which is rather large." Basing his work on the QML version of the Aurorae engine, Martin Gräßlin set out to port Plastik to QML (the C++ version has already bitrotted, and was slated for removal): "After one and a half days of work I’m proud to say that writing decorations in QML is possible. ... In the current state the decoration consists of 370 lines of QML code and I expect to need an additional 100 lines to finish the buttons (they are already functional, that is the close button closes the window) and add some of the configuration options. The same API in C++ consists of 1500 lines of code. So we do not only get fewer lines of code but also a more readable and easier to maintain codebase. For something like a window decoration a declarative approach is much better suited than the imperative C++ way of painting elements."
is gnome dying? staring into the abyss — Swfblag http://goo.gl/6EZra
I'm not up on to speed on QML, does anyone know if there will be a change in performance with the move from C++? I think having smaller, more readable code is great and I'm wondering if we might also see a performance boost? Or perhaps a slight performance drop? Or will it all work out to be about the same when it's compiled?
Get through the summary? Or have a general idea why we should read TFA?
The Daddy casts sleep on the Baby. The Baby resists!
What a retarded idea. *golf clap*
Javascript is used AS A DESCRIPTION LANGUAGE to DESCRIBE THE INTERFACE
Have you EVER used a CONFIGURATION FILE???
Have you ever WRITTEN A PARSER for a configuration file???
Did you even stop to consider that perhaps Javascript is an EXCELLENT description language
Can you PLEASE DESCRIBE how using a Javascript as a description language is SLOWER IN ANY WAY than writing a description language parser from scratch???
There is PLENTY about this subject on the web.
This is happening in Qt, look at their developer blog
In a nutshell:
Have you ever laid out a user interface using a GUI tool? Typically it writes an XML file or some such that describes the interface.
The problem with XML is that it's not too good for representing algorithms and relationships. Modern GUIs have complex controls that change dynamically and interact with each other and that XML file is not rich enough to represent all the things you want to do.
Enter Javascript. It's rich enough to describe all these relationships and dynamic behaviors.
So instead of reading the UI from an XML file, it reads from a javascript file instead.
Where people are SADLY MISTAKEN is they think that using Javascript in this manner imposes some sort of performance penalty. It should be plain from my description that there is NO performance penalty for doing it this way.
They can call the language... wait for it... K++.
Thank you, thank you, I'll be here all week.
Slashdot's favorite troll.