KDE Development

Java in Plasma

I had encountered a blog on Troll’s website (can not recall where exactly it was, and who posted it… if you find it, please notify me) about creating Java objects from C++. More precisely, creating Qt Jambi widgets and using them in a C++ program.

It gave me an idea. How about a Java-based Plasmoid? We have Python, JavaScript (ECMAScript) and what not, but no Java.

There still are no Java bindings for Plasma, but that doesn’t mean that there can not be Java Plasmoids. If you think that I’m talking gibberish, just look at the following screenshot. As you can see, there are a couple of plasmoids that say Java (to be exact, there are 4 of them).

Java in Plasma

No, they are not C++ plasmoids that just write ‘Java’ to fool you, those are applets written in Java. You have the code in Plasma’s playground (/trunk/playground/base/plasma/applets/java).

The main problem is setting up the environment.

  1. First you have to install Java SDK (tested with SUN’s, it should also work with IcedTea),
  2. then, you have to install (or compile) Qt Jambi which is a bit pain in the neck if you have Qt with debug symbols included.
  3. And, once it is all installed, you need to set the environment variables both for compiling the applet, and running it in Plasma afterwards. You can use the environment.sh that is included with the source, and modify it to your needs. You also need to change the Jambi’s path in CMakeLists.txt.

Well, that should be all. When I find the time to try to generate Plasma bindings for Java, you will be notified :) (To be honest, I hope that someone will beat me to it)

Cheerio!

Theme Contest and New Features

Plasma now supports different looks for panels depending on the screen edge where the panel is located. You can find more details about how to make this kind of themes at KDE’s Techbase. Basically if you want to create a custom look for a left panel, just create all background elements for it and add prefix ‘west-’ to the name of every element. (east for right, north for top and south for bottom panel).

If you don’t want to name all the elements yourself, you could always use the Slim Glow theme as a base template since it uses this new feature of Plasma.

Reminder: Start making the Plasma themes, there is a contest going on!

Plasma Themes Contest

This is a post from the Dot, I’m just copying the announcement here as well. So, if you would like to comment, just do it there please.

The KDE Plasma team is inviting everyone to participate in a contest to create Plasma themes from which a select few will be chosen to be included as a part of the upcoming KDE 4.1 release. This is a great opportunity to contribute to a very visible component of the KDE project, the Plasma desktop.

A great feature of Plasma is the ability to theme components of the desktop using Scalable Vector Graphics (SVGs). This means there is no need for you to know C++ or any other programming language to create a great looking theme.

You only need to know how to use one of many graphics tools (e.g. Krita, Inkscape, The GIMP, Karbon, etc.) and that is all. Depending on your prowess with such tools, you can create great looking plasma themes in as little as an hour.

You can find a quick guide to creating Plasma themes in the Creating a Plasma Theme in 7 Easy Steps Techbase article.

Rules:

  1. Submit your work in the Plasma Themes section of KDE-Look.org website. Put a notice ‘(for theme contest)’ in the title of the theme.
  2. Submissions will be accepted as a tar.gz file of the theme folder.
  3. Submission deadline is 9th April, 2008 18:00 UTC. Themes submitted after the deadline will not be considered for this release.
  4. Winners will be announced by 18th April, 2008.
  5. All artwork must be original or otherwise meet the requirements for distribution as part of a GPL licensed project. Preferred license is LGPL.

Guidelines:

  1. Consistency. All theme parts should fit nicely with each other.
  2. Completeness. Although Plasma automatically loads required images from the default theme when they are not present in the active theme, it is suggested that you include SVGs for all theme elements.
  3. Uniqueness. The unique always stand out in the crowd; so should your theme.

Have fun! The Plasma Team.

This is a post from the Dot, I’m just copying the announcement here as well. So, if you would like to comment, just do it there please.

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…

Another theme for Plasma

There’s a new theme walking down the streets of Plasmawille. It’s called Slim Glow. For more info, go to the kde-look.org

Theme Preview

Concerning the last theme you have seen on the blog some time ago, it vanished in a ‘rm -fR’ accident and is scheduled for reconstruction.

Plasma Applet Browser Evolves

Thanks to Chani Armitage P.A.B. now has a remove applet button.

Well, nothing more for this post - head to Chani’s blog for more info…

NodeLayout : Example sheet

NodeLayout : Example sheet

Since it appears that the last explanation (which I recommend you to read before opening the example sheet) of NodeLayout was not as good as it should be, here you are - drawn explanation with a few examples in .png format (33K).

Unfortunately WordPress doesn’t allow me to upload the svgz file… hope you’ll be able to read the small text in the picture.

NodeLayout for Plasma

Yes, it’s that time of year again - the time for backporting layouts from Lancelot to Plasma.

NodeLayout is one of the most powerful layouts in general, in a sense of that it’s expressiveness for positioning static content is greater than any current layout in Plasma.

The idea behind it is to help developers avoid creating multiple different layout objects mixed and nested in each other when creating complex UIs. It’s a bit trickier to get the hang of it - the nodes definition, but once you get to know it, it will become your natural way of thinking. :) (yes, I know I’m sounding like a shampoo commercial)

Every item’s geometry is defined by two nodes - one for the top-left corner, and the other one for the bottom-right corner.

Each node is defined by a pair of relative (xr, yr) and a pair of absolute (xa, ya) coordinates. The calculated node coordinates depend
on the size and position of the NodeLayout object in the following manner (layout is the geometry of the NodeLayout):

  • x = layout.left() + (xr * layout.width()) + xa
  • y = layout.top() + (yr * layout.height()) + ya

Alternatively, the item’s position can be defined by using one node and one pair of relative coordinates (xr, yr). In that case, the item is sized following the sizeHint(). The relative coordinates (this time they are relative to the item’s geometry, not the layout’s) specify what point of the item will be bound to the defined node.

Note: The horizontal and vertical values are completely independent so you can, for example, have automatic (sizeHint defined) sizing for width, and fixed sizing for height.

Lancelot icon

Lancelot icons


Bridgekeeper: WHAT… is your name?
Lancelot: Sir Lancelot of Camelot.
Bridgekeeper: WHAT…is your quest?
Lancelot: To seek the Holy Grail.
Bridgekeeper: WHAT…is your favorite color?
Lancelot: Blue.
Bridgekeeper: Right, off you go.
Lancelot: Oh! Well, thank you. Thank you very much.

I got bored while waiting for the green light for committing the NodeLayout (later about that) to libPlasma, so I decided to make a nice icon for Lancelot. I had a couple of ideas - shield, knight, helmet and a grail.

Shield was not a great solution since people would think that it has something to do with computer protection, and knight and helmet (IMHO) are suited more for a game like Wesnoth then for an application launcher. So i have made a grail.

Applet Browser in libplasma

Plasma Applet Browser

The Plasma Applet Browser is now integrated into the libplasma and it will be available in the next Beta that is going to be published on Wednesday.

I’ve replaced the old drag-and-drop with a bit fancier stuff - now (as you can see in the screenshot) when you drag the plasmoids, you will be shown only the icons (possibly will be replaced by screenshots of plasmoids) not the whole “blue bars” you saw last time.

At the moment, you can add only one applet at a time by dragging, but that will be changed soon. If you use Oxygen style, you’ll encounter a nasty bug concerning the drag-and-drop-icons - there will be no icons, only nice shades of gray… but that’s not my fault.

Next Page »
Powered by WordPress
Copyright by Ivan Čukić, Foment Group