Saturday, May 31, 2008

Text plugin for jasper

Well, I haven't had much time to work on jasper the past few weeks, but now there is a few new features.

Firstly, there is a new build script, thanks to some-guy. This is very useful to me, as it makes it less work for me to add new plugins. It also adds "make like" output, which can be useful if something is failing (if you pass quiet it will only display errors). Also, passing clean ("./build.sh clean") will clean up all files generated by building, which is also a very nice feature.

The only other visual change was the addition of the "text plugin", which is used to display the title of a window. Some things which I still have do do for this plugin is make it update when the title changes, and also properly handle the case when the title is too long (at the moment it will just keep on writing, potentially over-top of other buttons). The font and font-size is the only part which is currently editable by the theme, though I do hope to add some other options (such as colour, style, etc)

The updated theme now looks quite a bit more bulky, but I'm only updating the theme to show (and test) new features, so I'm not concerned with usability yet.

Saturday, May 17, 2008

Well svg loading now works. Although, it isn't displaying the svg's, it is using the shape of the svg and then drawing colour (it is used in cairo as a mask). At the moment the colour is specified by the theme, but I hope to add the ability to get the colour from gtk. Also, it should be relatively simple to use gradients rather than plain colours, or use an (svg) image instead.

I added (well... copied from compiz) a timeout system, which basically allows plugins to get functions called as often as they want (they specify a time, and when it is done, the function gets called). I used that to allow 'animated' themes. By animated I mean the colour slowly shifts between two colours (although alot more is possible)

For those who are trying it out, and want to disable the animation (I will in the 'default' theme soon), just remove the target and dif tags (within cairoanimation). Also, one thing to notice is that you can use the different methods at the same time, one button could be a png image, while another could be a colour fading svg image.

Next is work on the state handling (of windows and buttons), this will allow things like changing decorations when maximized or shaded.
Maybe add gradient support.
Add a dbus plugin and a plugin that allows buttons such as shelf and maximumize.
Moveable tabs.
Proper theme loading / settings loading (parse the themes when you start decorator rather than when you open a window)
And many more things :)

EDIT: seems that it doesn't like xml tags in there...

Wednesday, May 7, 2008

I've added some more things, and fixed some bugs:

Use pkgconfig in the build script - this means no need to change the build script if you have things installed to nonstandard locations

'Handle' some "toolkit actions" - this is the main menu / run dialog when pressing alt+F1/F2 respectively - this will only work if you have a gnome panel (as all it does it relay the messages to that)

The two worst bugs should be fixed. New windows should now get decorations (thanks to maniac103's suggestion to use mapNotify instead of createNotify to add windows), and it shouldn't crash when closing, then opening another window (as I wasn't properly removing the windows, which was causing it to crash when opening another)



TODO (short-term and in no particular order):
Fix crashes under certain circumstances (opening the advanced search in ccsm)

Add better button support (if you press mouse than move it off button, it shouldn't trigger button when you release it)

More drawing plugins (svg's, animated borders, etc)

Make new windows position account for the decorations straight away (rather than appearing in one spot and then jumping to another)

Fix the appearance of the decorations when the window is transformed


EDIT: I thought buttons acted differently than they do... fixed

Tuesday, May 6, 2008


I have seen a couple posts on the forums regarding the new decorator, codenamed: jasper, so I thought I would post a little information on it.

Rather than basing the decorator off emerald or g-w-d, I decided to base it off comipz. It is similar to compiz in that it uses a plugin system very similar to compiz (in fact, the code that does this is copied from compiz and only slightly modified).

Something I hope to accomplish with this, is to allow for excessive customization through the use of plugins. I decided to make it after trying to add customizable buttons to emerald/g-w-d. I think that doing customizable buttons cleanly requires plugins, so that is why I use plugins. Another benifit is that if you want to draw something differently, all you need to do is use a different plugin. One theme could use an image plugin to draw a buttons, while using another plugin to draw a pulsating border using cairo.

Per window themes is also another thing which I want to add (so different windows get different decorations), or a decoration based on which user is running the process that the window is associated with (so, for instance, if you are running an application as root, it could receive a different border). So much is possible (at least, I can't yet see why any of the afore mentioned things would prove problematic - however, that often changes when actually coding it :D)

As DarknessssenkraD said in his post (at least according to google translations), the state is "ultra mega alpha" - and I think that is a good indication of its state, it 'works' (sometimes), but there is a lot of work to do (both in stability and features).

For those who want to try it out (also from DarknessssenkraD's post):

git-clone git://anongit.compiz-fusion.org/users/b0le/jasper
cd jasper
./build.sh
./jasper --replace
(only need the second one if it doesn't work first time)
./jasper --replace

It would be good to note that my build script isn't very good (feel free to volunteer to fix it). One problem is that if compiz is not installed to /usr/local, you may need to run 'CPATH="$PREFIX/include/compiz" ./build.sh'
So if you have, say, a normal ubuntu package, you would run 'CPATH="/usr/include/compiz" ./build.sh'

Currently the only dependencies are X, cairo, libxml2 and libdecoration (so to compile it you will need the appropriate files)