Building the accessible web

Published 16 January, 2012 in User Science - 0 Comments

As a web developer for a relatively large company that provide basic societal services with a wide ranged target group, accessibility has always interested me. I’ve been to a few workshops regarding web accessibility and I try to, at least to a lesser degree, make our web sites accessible to visitors using various types of accessibility tools like screen readers and so on.

Creating accessible web sites isn’t that hard as long as they are static. But the web isn’t static any more! As the web technology evolves we tend to make more dynamic web sites that are becoming more and more state full than the old and boring state less web. We do this with the help of JavaScript and AJAX to update a part or section of the page if the user clicks this or that button or what ever. And this makes it way harder to create accessible web sites for visitors not using a mouse to navigate or who can’t see the actual page.

But as the “regular” web technology evolves with HTML5 and such, so does the accessibility part of the web as well. I just stumbled upon this great talk from Google IO 2011, and I think this is something that every web developer who likes to call her or him self a web developer should see. At least I know what I will do the next couple of weeks! With some really small efforts we can make the web much more accessible for people with various impairities.

And I encourage every web developer to follow the Google Developer Channel at Youtube. There’s a lot of good stuff there!

Roxen Application Launcher 1.2.1

Published 22 November, 2011 in Applications , Linux , Programming , Roxen - 0 Comments

Roxen Application Launcher 1.2.1

There’s a new release of Roxen Application Launcher (come again?) for Linux.

Although the previous release, using GTK3, came quite recently this release has some new things.

GSettings

I dumped the “keyfile” solution for the application settings in favour to GSettings. So the settings is no longer stored in a file in the application directory but rather in the system’s application settings backend. GSettings is part of GIO – the GNOME networking library – and since RAL depends on GIO no new dependency is needed. The upside is that I could put a file of source code in the bin! Plus, it’s fun learning new stuff!

Editors and content types

Previously I have kept an editor – name and command line – for every content type. Anders at Roxen thought it’d be better if editors and content types were separated. I’ve thought about that before but never bothered to do anything about it.

But now, along with GTK3, there’s a new (I think) AppInfo class and the new AppChooserButton and AppChooserDialog widgets so I thought it’d be cool to use those. So selecting an editor for a new content type is way more simple now, and it also looks nicer. Plus we get the icon for the editor in the content type list under the “Applications” tab ;)

Simple logging

I also implemented some simple logging which can be viewed under the new “Logging” tab. This will be worked upon and at the moment not very useful information is written to the log, but at least it’s a start.

Default icons

The icons in the notification popup – which only are three to the number – is now fetched from the user’s default icon theme. They we’re bundled before.

SOUP all the way

Previously I have used a little hack for saving downloaded files to disk. The problem was that the Vapi bindings for libsoup casted the data to a string which totally scrambled binary content like images and such. My solution was to write a simple C-function which took a SoupMessageBody struct as argument and then wrote that to diskt always keeping the uint8[] type of the content.

I bug reported this way back and it’s now fixed in Vala so I dumped my solution and am now using Vala all the way. Gone is one C and one Vapi file.

While at it I changed from using blocking functions in libsoup to the async ones. You never really noticed blocking calls was used before, but right is right. Right?

And that’s that for this time I think!

Roxen Application Launcher 1.2.1

Sources is available at the Roxen Application Launcher Github repository

GTK TreeViewColumn with icon and text

Published 21 November, 2011 in Linux , Programming - 0 Comments

TreeViewColumn with icon and text

The other day I wanted to put both an icon and text in the same GTK+ TreeViewColumn, and I had absolutely no idea how to do that. So I Google’d and Google’d but had trouble finding any examples. I even downloaded the source code of the Gnome System Monitor – where exactly what I wanted exist – but that was mostly written in C++ which I know very little of.

But I’m stubborn, and after a while I found and example in Python which I managed to interpret. Even though I know very little Python it’s not that hard to follow, and the example was short.

In short what’s needed is packing two CellRenderers in the same TreeViewColumn. Quite logical when you know about it. The example below is in Vala:

15 lines of Vala
  1. var tree_view = new TreeView ();
  2. var col = new TreeViewColumn ();
  3. col.title = title;
  4. col.resizable = true;
  5. var crp = new CellRendererPixbuf ();
  6. col.pack_start (crp, false);
  7. col.add_attribute (crp, “pixbuf”, 0);
  8. var crt = new CellRendererText ();
  9. col.pack_start (crt, false);
  10. col.add_attribute (crt, “text”, 1);
  11. tree_view.insert_column (col, 1);

I hacked up a simple application that shows all installed programs – that has a .desktop entry I guess – in a list (the screenshot above). The sources is available at my Github repository.

Happy coding!

Roxen Application Launcher 1.1

Published 9 November, 2011 in Applications , Linux , Roxen - 0 Comments
This is not the latest version of Roxen Application Launcher. You’ll find the latest version at the download page.

Screenshot of Roxen Application Launcher

There’s a new release of Roxen Application Launcher (come again?) for Linux.

I have updated the application launcher to use GTK3 so that it builds on Ubuntu 11.10 and any other Linux distribution using GTK3. This also made it possible to drop the dependency for libunique since Gtk.Application can handle single instance applications.

I also fixed a bug which made it impossible to use the appliction launcher on sites not running on port 80 or 443.

So there’s no new features in this release.

Roxen Application Launcher 1.1

Sources is available at the Roxen Application Launcher Github repository

Roxen Application Launcher 1.0.10

Published 22 June, 2011 in Applications , Linux , Roxen - 0 Comments
This is not the latest version of Roxen Application Launcher. You’ll find the latest version at the download page.

There’s a new release of Roxen Application Launcher (come again?) for Linux.

No big news, but the GTK+ tree view of files is now sortable. The “minimize to tray” function is now actually invoked when the window is minimized rather than closed. A right click in the file list now also let you go the the file’s directory in the Sitebuilder.

Also fixed a bug where the locales didn’t get installed correctly and also fixed a bug which scrambled the configuration file a bit.

Roxen Application Launcher 1.0.10

Sources is available at the Roxen Application Launcher Github repository

Notification area icons in Ubuntu 11.04

Published 3 May, 2011 in Linux - 0 Comments

If you’r an Ubuntu user and have upgraded to 11.04 and use the new desktop environment Unity, you might have noticed that some applications that implement the GTK status icon doesn’t show up in the notification area – or tray or systray as it also may be called.

The reason for this is that Ubuntu now utilise a “whitelist” for which applications can be displayed in the notification area. You can (maybe not that) easily add any application to the whitelist by invoking the command gsettings in the following way:

1 lines of Bash
  1. gsettings set com.canonical.Unity.Panel systray-whitelist [‘app-1’, ‘app-2’, ‘app-3’]

Now, this can be quite a difficult command to remember and since you will need to first grab the whitelist, alter it, and then put it back. Since I’m lame at Bash I thought it would be a nice misson to create a Bash script that makes this interference simpler, just to pick up some more Bash knowledge. So I did!

The script can be used like this:

8 lines of Bash
  1. # Add MyApplication to whitelist
  2. systray-whitelist add MyApplication
  3. # Remove MyApplication from whitelist
  4. systray-whitelist remove MyApplication
  5. # Show applications in whitelist
  6. systray-whitelist show

And that’s that.

Download systray-whitelist 00:05, Wed 04 May 2011 :: 2.5 kB

Variable length argument segfaults valac

Published 26 October, 2010 in Programming - 0 Comments

Hm, found a bug in valac (the Vala compiler) today. If an abstract or virtual method contains a variable length argument (va_list) valac will segmentation fault.

19 lines of Vala
  1. // valac -o test sample.vala
  2. int main(string[] args)
  3. {
  4. return 0;
  5. }
  6. public abstract class Base : Object
  7. {
  8. public abstract int query(string query, ... );
  9. }
  10. public class Child : Base
  11. {
  12. public override int query(string query, ... )
  13. {
  14. return 1;
  15. }
  16. }

I’ve filed a bug about it so we’ll see what the problem is and if it can be fixed rapidly.

Roxen Application Launcher 1.0.3

Published 24 September, 2010 in Applications , Linux , Roxen - 0 Comments
This is not the latest version of Roxen Application Launcher. You’ll find the latest version at the download page.

Screenshot of Roxen Application Launcher

In this release of Roxen Application Launcher (come again?) for Linux I’ve gotten rid of a few dependencies, namely: gconf, libgee and libgnome. The reason I dumped gconf and libgnome was to make it easier to install in KDE. I’ve verified it installs in KDE, although I noticed the translation doesn’t work and the Roxen SVG logo doesn’t show up in the window top border.

Screenshot of Roxen Application Launcher
Roxen Application Launcher in KDE

Libgee is a collections API written in Vala and since I used a newer version than what is available in most package managers, and I’m not sure all Linux distros provide libgee, I decided to dump it and implement the same functionality with the generic collection classes in Vala. And since the collections used in RAL is quite simple that worked out just fine.

I have also tried to implement bundled download, which is only used in Roxen Editorial Portal. Since I don’t have access to such an installation I haven’t been able to verify it works as expected. I re-implemented the same behavior as in the launcher written in Pike by the Roxen guys.

Oh, and if you already have an installation of my RAL your previously downloaded files and settings will not be available to the new install. Since I dumped gconf I now store the settings in a plain text file and I have put the RAL application directory in ~/.conf/roxenlauncher since ~/.conf is where you should put application specific data according to freedesktop.org. In previous versions of RAL I stored application data in ~/.roxenlauncher so if you want your previously downloaded files copy ~/.roxenlauncher/files to ~/.conf/roxenlauncher/files.

The sources is available at Github.

Roxen Appliction Launcher 1.0.3 00:43, Fri 24 September 2010 :: 384.8 kB

Roxen Application Launcher 1.0

Published 12 September, 2010 in Applications , Linux , Roxen - 0 Comments
This is not the latest version of Roxen Application Launcher. You’ll find the latest version at the download page.

Screenshot of Roxen Application Launcher with context menu

So I had a go at the Roxen Application Launcher (come again?) for Linux. I added a context menu – when you right click – to the file list. When you right click a file in the list you get the option to view that file in the Sitebuilder, edit it or remove it.

Other than that there’s nothing new. And since the application seems to be very stable I decided to bump the version number to 1.0.

The sources is available at Github.

Roxen Appliction Launcher 1.0 00:06, Sun 12 September 2010 :: 376.2 kB

Pike project – module stub creator

Published 20 August, 2010 in Programming - 0 Comments

Screenshot of Pike project

I recently began learning how to create Pike modules in C. The Pike module C API seems great and once you’ve sorted things out the modules are easy to build and install. Non the less, when creating a C module from scratch there’s a couple of files you need and some configurations of those before everything is set for go. And here comes “pike-project” into play.

Pike-project is a simple GTK program (works as command line tool also) written in Pike it self. The program will create the basics for a running Pike C module, or a plain installable Pike module. Then it’s just starting programming.

The program is available at my Github repository.

BTW! At the moment it only works on Linux I suppose.

1 2 3 7