Monday, October 19, 2009

Some work on GNUstep theme support...

Quentin came to visit london this weekend, and he thus forced^H^H^H^H^H^Hconvainced me to work again on gnustep, on the theming support. GNUstep had the possibility to use themes using my theme bundle, Camaelon. But this had some technical issues (though we do use it in Étoilé), mostly that it's easy for Camaelon to be out of sync with the current GNUstep implementation. Richard Frith-Macdonald has thus started to implement some theme support directly into GNUstep, and even wrote a theming application to help creating themes. But the support is still limited -- you can change images, colors, and the drawing of some widgets but not all.

Anyway, what I did this weekend was quite a bit of refactoring in the theming code dealing with pixmaps -- things should be much clearer now. I also added an implementation for Nine Patch pixmaps, which basically makes creating custom themes a lot more simple. For example, the following content in a theme's Info-gnustep.plist will be enough -- no need to have multiple files as with Camaelon, no need to measure things...


GSThemeTiles = {
NSButton = {
NinePatch = YES;
FileName = NSButton.tiff
};
};


With a button made in five minutes of Gimp work (as can be seen!):




An example of the result:


Monday, July 06, 2009

New website

I finally took the time to redo my website properly :)

Obviously, I had to use Seaside, and as I did play with Pier some time ago, this looked like a good fit.

For those who do not know, Seaside is the best web application server I know of -- it really is something when you want to quickly write extremely complex sites or webapps. Pier is a CMS developped on top of Seaside, which provides a wiki system amongst other things.

The new theme is also frankly much better than my previous one -- it's actually nearly exactly the same as the default Pier theme, but hey, I really like it, and it _is_ cleaner :)

The site also automatically pull the last posts from this blog as well as my last commits and some recent twitter posts, and display all this as the main page.

Finally, one thing that wasn't great on the previous site was the pictures section; I resumed some earlier work I did on a Pier component (Pier Gallery) and cleaned it up to get what's shown now... more on that in a next post.

Monday, June 29, 2009

Automating DxO FilmPack (OSX)

DxO FilmPack is an awesome set of filters for your pictures, rendering them using classic films -- not just the colors, but the grain as well. It is available either as a standalone application or as a Photoshop plugin.

As an example of what FilmPack can do, here's one picture I took, first the original, then two filtered:

Original:






Fuji Superia 200:





Ilford Pan F Plus 50:





But even though it's really, really cool... it has a rather annoying limitation in its standalone version: you cannot apply a filter to a set of images, you have to apply it image by image. Of course, this might be all you need; but for my part, I would love selecting a type of filter I like and apply it on an entire set of pictures, as if I did shoot them using a film camera.

Hack it



Here is how you can do it, using a mixture of bash and AppleScript. Honestly, this is a hack -- it would be great for it to be integrated in FilmPack directly! but in the meantime, this can be useful...

As expected, the programmers did not bother to provide a scripting interface, so you seemingly cannot script it (it would have been useful for such a program with potential repetitive action, don't you think?).

Or can you ? It turns out that OSX has a rather nifty feature that allow near-global scripting: you can have access to all the GUI objects shown on screen, query their states, etc. It is not active by default -- you need to go (in the System Preferences) to "Universal Access" and click on "Enable access for assistive devices".

So, we starts with a bash script (we can call it "convert.sh"):


#!/bin/bash
for i in `ls *.JPG`;
do /Applications/DxO\ FilmPack\ 2.app/Contents/MacOS/DxO\ FilmPack\ 2 $i & osascript ./filmpack.script; done


This will, for each jpeg files in the current directory, open the binary executable of FilmPack and passing it the current jpeg as a parameter ($i). Doing this has for effect to start FilmPack and automatically load the image passed. Finally, as soon as FilmPack is started, we execute the filmpack.script.

This filmpack.script is a simple AppleScript:


tell application "System Events"
tell process "DxO FilmPack 2"
get enabled of menu item "Save As..." of menu 1 of menu bar item "File" of menu bar 1
set frontmost to true
click menu item "Save As..." of menu 1 of menu bar item "File" of menu bar 1
click button "Save" of sheet 1 of window "DxO FilmPack 2"
click menu item "Quit DxO FilmPack 2" of menu 1 of menu bar item "DxO FilmPack 2" of menu bar 1
end tell
end tell


This script asks the FilmPack application to save the current opened image, and to quit the application.

The only notable trick here is the "get enabled" line -- by asking AppleScript if the "Save As..." menu item is enabled, AppleScript will actually block until it can read the value, which makes the whole operation as fast as can be (no need for a sleep somewhere to wait until FilmPack is fully loaded and/or has applied the filter to the image).

Use it



Now, how to use it? well, let's say you have a directory Pictures containing your pictures. You can copy in that directory both convert.sh and filmpack.script (or alternatively put those files in some default path). Then the last thing you have to do is to "configure" FilmPack once -- it will then remember the settings for the next time it is used. The easiest way to do this is thus to start FilmPack, open one of your picture, choose what kind of filtering you want to do, then save where you want all the pictures to be saved. Then quit FilmPack, and run convert.sh!

Friday, February 06, 2009

Interview Étoilé



Me and Quentin were interviewed a few weeks ago by a french linux magazine (Linux Pratique Essentiel), about Étoilé. The magazine is out this month, and the magazine preview shows the article, starting page 24 to page 28...

(note: the title can be translated as "Étoilé, an innovative desktop environment")

Tuesday, February 03, 2009

Atari

Great stories about the creation of the Atari ST: part 1 and part 2. I still remember fondly the ST, TT030 and Falcons... (The TT030 my dad had still works, afaik). I also remember the huge Megafile 30 on top of the MegaST -- an incredible thirty megabytes of disk space ! Why is it that I am now always short on space :)

Sunday, February 01, 2009

...and snow in london

After the south of France, it's now London's turn...

It apparently did not snow as much in 18 years -- London is very quiet today!










update:










update2, going to work:























Wednesday, January 07, 2009

Snow in Provence

A friend just sent me this picture:







...taken from her window, near Marseilles, south of France. Impressive isn't it ? highway closed, etc.

Usually happens every ten years or so :)

edit: another friend took the following pics:













edit 2: check that video...



Monday, January 05, 2009

A Modern Objective-C Runtime

David just got his paper describing his new Objective-C runtime for etoile published in the Journal of Object Technology. Congrats :)