Containments themselves are plugins; in fact, they are a specialization of Plasma::Applet and come with all the same flexibility plus a little bit extra. (I suppose that means that in theory you could have a superkaramba theme or a Mac Dashboard widget as your desktop or panel ... it would require some minor patching in corona.cpp around line 400 to work in practice, however.)
Right now there are four Containments that I'm aware of available for the Plasma workspace: DefaultDesktop, Panel, Null and AnalogClock (of course ;). I believe the Amarok guys have also written a Containment specifically for Amarok's needs. To give you an idea of the complexity involved, Panel is 329 lines of code (including the header) and DefaultDesktop is 2,213 lines (though that also currently includes wallpaper Package support, threaded wallpaper rendering and all the legacy Desktop directory loading code). With scripting, you could do this without C++ even (though right now we lack some useful/necessary bindings to the Containment class to make this practical ... not a huge amount of work though).
The runtime definition for a Containment (such as your desktop area on a given physical screen) is stored in the configuration file looking something like this:
[Containments][1]
formfactor=0
geometry=0,0,1280,800
location=0
locked=false
plugin=desktop
screen=0
The Containment plugin that is loaded is defined by the
plugin= entry. Change that entry and you change the containment. The widgets inside stay the same, only the Containment changes ... (to protect the innocent?)Changing the
screen= entry alters which physical screen, if any, a containment is associated with. This is where this feature overlaps with the zooming: zooming out is how one gets an overview of all available containments (modulo panels) to switch between them or just interact with widgets that on other Containments (including moving them between Containments). This has all been there since 4.0.(By the by, if you have been looking for a longer explanation of the zooming concept, here's a blog from last July where I wrote such a thing.)
Plasma has been designed with this idea of switching Containments as a very basic and rather central concept. Those following closely will have noticed that I've mentioned this idea more than once in various screencasts and blogs in the last year or two.
However, it seems that the full implications of this particular feature set is being missed, because when, in passing, I noted what this means in relation to something like the toolbox (remember, that's the containment's job) on panel-devel people were ... surprised. I was surprised they were surprised. I thought I was stating the bleeding obvious, but apparently I wasn't. So, lots of surprised people all around. To join in the party of surprised people, here it is:
If you want a different feature set, select a different Containment.
So if you want no toolbox, a completely different neat/crazy background concept, something that incorporates a different widget layout schema, or $WHATEVER ... you just need to find a containment that provides that. This is similar to how instead of having one clock applet with a bazillion configuration options and widgets, we instead have clock visualizations that share most of their code with each other and you select between the different clock faces when choosing a clock to stare at.
The inspiration for this approach was watching the various Kicker PanelExtension classes and feeling the pain of just how limited they were in what they were allowed to do. Because of that, people creating things like the Mac dock would fork bits of kicker, write their own panel system from scratch, do it in Superkaramba, etc. That seemed really unfortunate. People want radically different ways of dealing with panels, and I figured they'd want the same with their desktops, media centers and mobile devices. So why not make that part of the interface a plugin that's as flexible as any desktop widget itself is?
Now let's reflect on the idea that I'm not keen on making the desktop toolbox configurable: maybe it starts to make sense to you that it's an unnecessary complication because the whole Containment is a plugin. The toolbox has a point and purpose, it's improving nicely as we go and, yes, I personally think it will become something rather compelling .. but at the end of the day it's just part of another plugin loaded at runtime. The only hardcoded bit is that it's the default plugin to load in lieu of other configuration directives.
(If you're wondering if other Containments can take advantage of the toolbox if they wish, yes they can. The Containment class provides access to it for any Containment plugin that so wishes to use it.)
Currently, Containment switching and creation is "hidden" in the appletsrc config file. We will be making UI for it, hopefully for 4.1. It's been pending completion of the DefaultDesktop config dialog which we will then genericize into a general Containment config. To the user this will appear pretty much like any other wallpaper setting dialog, only with a hell of a lot more punch as it will give access to more than just wallpaper changes when you hit that "Ok" button.

13 comments:
So the desktop is a... plugin? Neat. :-)
/Gunde
maybe not an appropriate place for this question, but...
i'm not a Qt/KDE developer, but a java one.
if my unpretending is correct
plasma and kde provide a framework for:
loading modules
module dependency
different context to execute plasmoids
resource management(load)
....
the question:
how thas this functionality compare with OSGi(osgi.org) specification?
OSGi implementations http://www.osgi.org/Markets/HomePage
example:
eclipse, plugins state their dependence.
they are lazily loaded. resource access is through the framework, which manages optimal access and disposal...
a big long i know.
thank you for your time and great work on kde.
That's pretty rocking. Lots of potential there for customized interfaces. The EeePC would do well with something like that.
So are the containment plugins loaded from the same place as plasmoids, as described in the techbase tutorial? http://techbase.kde.org/index.php?title=Development/Tutorials/Plasma/GettingStarted#Testing_the_Applet
I saw this comment on the Dot a couple of months back, which seems to echo what you say in this blog:
http://dot.kde.org/1197522021/1197543708/1197546904/
It sounds pretty inspirational, but I'm wondering how accurate the poster was with the assertions they made, especially the comparisons with Firefox?
@Jernej
loading modules, module dependency, execution context and resource management do exist as long as modern computer exist. But nice to see OSGi did realized it as well and seems to sell old things with new buzzwords still works ;)
What's the [1] in the configuration for?
/ Aron
Idea of Containments is wicked, but I think the ZUI is somehow..ehmm..weird.. ;) It really reminds the desktop grid function of KWin and users may be confused..
And what do you think about associating Containment with virtual desktop/viewport, not only with physical desktop? Because many people have each virtual destop/viewport for work, IM, webbrowsing, etc.. So it would be nice to see that on webbrowsing virtual desktop/viewport I have Containment with e.g. no panel, plasmoid which shows some RSS feeds, etc. ..
Hi Aareon,
thanks for this interesting post. IMHO a very clever architecture.
I know we are just humans and all that, but I think the "excitement" about the desktop toolbox would have been much less, if you would have come out with this information earlier. Like: "no this patch isn't the right way. Please create a custom containment to solve your problem".
I'm sure it would have saved you a lot of typing on panel-devel.
Thx, Christian
I actually knew about the whole different containments for different features thing. What I didn't know was that the toolbox is a feature of the desktop containment.
Also, plasma is already rockin' on the EeePC, but I've got some nifty ideas for it.
PS. being able to tie containments with virtual screens as well would be great for my desktop.
Containments <-> virtual Desktops <-> multiple screens ... I wonder how users will cope with all these overlaying concepts of spacial organization. For instance back in the old days when I tried Enlightnment ... IIRC (it has faded a bit;) ... it had virtual desktops which were vertically stacked, and additionally you could have a several "screens" wide area which you could scroll horizontally, but which were no separate virtual desktops... IIRC I found that to be quite confusing :)
@Jernej: "how thas this functionality compare with OSGi(osgi.org) specification"
well, it's a lot less 'rigorous' in terms of formalized specs than OSGi (from what i understand abou the OSGi process; i'm not a Java expert though =), but yes, we provide a large number of highly interoperable components that are easily queried and integrated at a very high level.
@leo_s: "The EeePC would do well with something like that."
that's one of the reasons for the Containment approach: same underlying code base but different bits of sugar on top depending on the device.
imagine a containment like the Wii entry screen (totally doable), or a containment like the hilden desktop (also totally doable) ... the desktop we ship with 4.0 is just one possibility.
but even if you create another containment, even if it's radically different or written in javascript or whatever, you still get to use all the code that we are testing and torturing on laptops and desktops, meaning less work and more guarantee of quality. which is, to me, pretty intriguing.
"So are the containment plugins loaded from the same place as plasmoids, as described in the techbase tutorial?"
yes. biggest difference is that they subclass Containment and that their SerciveTypes entry in the .desktop file looks something like Plasma/Applet,Plasma/Containment.
in fact, if you remove the "Hidden=true" entry from the desktop and panel containments ... they show up in the Add Wdgets dialog (!)
@anonymous: "I'm wondering how accurate the poster was with the assertions they made,"
democratizing, or rather in a less buzzwordy way: opening up the desktop infrastructure for broad participation (and sharing of the results) is part of the Plasma way, yes.
we're getting closer to that dream step by step ... right now we're finally setting up our DXS/GHNS repository and there's likely to be a SoC for Plasmagik which will close the loop full circle from create to share.
@elvi: "What's the [1] in the configuration for"
it's a unique identifier. every containment and widget gets a numerical identifier so that we can refer to them internally in a content-netural way. this way switching from plugin=desktop to plugin=myAwesomeness doesn't affect anything else.
think of it like the primary key in an SQL table.
@Milan: "I think the ZUI is somehow..ehmm..weird"
yeah, it's different. but it's actually been tested in the Real World(tm) and shown that it can work very very well.
once people get to play with it and we refine our implementation of it, it will become more evident what the possibilities are.
@Anonymous: "if you would have come out with this information earlier."
there's really two things that got in the way of this:
i've been eating and breathing plasma for a while now, so some things seem very obvious to me ... though evidently they aren't. it's sometimes hard to see over my own assumptions; that's a human trait, and one i'm as succeptable to as anyone else.
the other thing is that i actually have communicated this point in the past. some of this information has appeared on my blog, but some is also in our wiki. after a while it gets really tiring to just repeat myself over and over and over. nor do i particularly feel that it's my duty to ensure that absolutely everyone understands the inner workings of plasma; that's an unrealistic burden for me to carry, but people hound me until that's accomplished. personally, i think it's amazingly selfish of those people to not step back and think about the amount of my time and energy they are actually requesting.
one of the biggest annoyances for me with taking an approach that is so ... different from everyone else's is that there is a lack of a common language and knowledge base. so people who otherwise know lots of stuff about software and desktops and laptops and linux and open source and kde and ... end up being pretty innocent about man of the concepts we're aiming for.
some of the ideas are just plain new, but a lot of them are actually taken from the last decade of (often academic) usability research and development, modern non-desktopy interfaces (the Wii and iPhone are two well known examples in this area), etc.. unfortunately, there's very little cross talk between us in the traditional desktop world and these other fields, so there's been very little knowledge sharing.
and at some point i eventually just want to write code and work with those who are equally enveloped in the concepts rather than continue to educate the Nth group of people in a bug report.
it's a shift in how to think about primary user interfaces, and to really explore the full set of ideas we're working towards is a multi-hour discussion to just get to "start". we had a full day of this at dev days in Munich last year where ~15 of us sat in a meeting room for 6-7 hours as we walked through these ideas and discussed the implications for application development.
i mean, we haven't even gotten to "what does this mean for kmail?" just questions yet. we're still talking "what is a Containment?"
so many of these conversations (like the toolbox one) i really just want to defer until we're further along with development.
i ask people for that latitude ("trust me, this isn't right; you'll understand more as we go") and the response to that is not pretty. tbh, it's really disappointing.
i do understand very clearly now, though, why so little actually interesting interface design work happens in open source: it's an amazingly hostile environment for it.
@Soap: "What I didn't know was that the toolbox is a feature of the desktop containment."
interesting. so .. when you would zoom out and the toolbox went with it ... what did you perceive was happening?
@anonymous: "I wonder how users will cope with all these overlaying concepts of spacial organization. "
i really want to make Containments a pretty neutral idea to the user. we'll probably end up calling them "Activities" or "Activity Groups" in the user interface and let the user switch between them based on that.
hopefully this will provide a different-enough context that there isn't the tendency at all to equate them with virtual desktops.
@aaron: "interesting. so .. when you would zoom out and the toolbox went with it ... what did you perceive was happening?"
good point. I guess I thought it was some weird layouting issue.
So I guess I'm coming to the discussion late but: if it's the toolbox itself is not embedded in the design of all containments, then why not pinch it out for a while (say moving the functionality to a context-menu on the desktop) ?
Make that new thing the default containment, while working on the current one in the background?
This way you get to keep your idea of containment, to be released when it is in a more complete form. I think once more time has passed and more work gone into it, people may be more open to the completed idea, rather than the semi-functional idea-in-progress.
Also, people will stop complaining about this confusingly elaborate "add a widget" button. Which I think is a valid criticism. For the person looking to get some work done, they don't need a super-fancy way to add widgets. It's likely an infrequent activity, and doesn't need it's own doohicky(tm) persistently on the desktop.
Would that be a reasonable solution?
Post a Comment