Wednesday, November 30, 2005

XUL-based applications/environment on the Nokia 770 device

If you are one of those guys that enjoy a good discussion, probably mailing lists are good places for you waste some words, and point out your opinions. These days a thread was rounding the maemo-developers list. Again, it was discussing about 'why has Nokia chosen building maEmo as GTK-based instead of a QT*-based environment'. Of course, some flames and aggressiveness posts, but it was a good talking after all. So, let me I reopen up this talking (between me and myself, I know), but this time, I wanna go deeper, revolutionizing and flaming :p

LET'S RAMBLE ABOUT GUI toolkits ...

Graphical applications, in general, are built of "small" components like dialog buttons and mail inbox folders, which we collectively term "widgets." Within a widget, drawing and user interactions are completely under control of the individual widget, and set when the widget was built. Relative placement of widgets, their interactions with each other, and optionally some of their configuration, will be controlled by a UI layout specified in a script whose structure is defined in this and related documents.

That's what GTK (QT and whatever toolkit) provides to, and even in the case of maEmo that is it. Having more the one toolkits supported on the device is I'd say unfeasible (for performance and storage points). However, I was thinking: are GTK and QT* the only ones available ?

HAVE YOU HEARD ABOUT XUL ???

XUL (XML User Interface Language) is a user interface markup language developed to support Mozilla applications like Firefox and Mozilla Thunderbird. The point is: it's becoming bigger than what they had in mind. I'd say that it is one of the most powered languages for UI programming available so far. I mean its main benefit is that it provides a simple and portable definition of common widgets. This reduces the software development effort in a way analogous to the savings offered by 4GL tools.

XUL defines a wide range of elements, which roughly belong to the following types:
  • Top-level elements
e.g. window, page, dialog, wizard, etc.
  • Widgets
e.g. label, button, text box, list box, combo box, radio button, check box, tree, menu, toolbar, group box, tab box, color picker, spacer, splitter, etc.
  • Box model
e.g. box, grid, stack, deck, etc.
  • Events and Scripts
e.g. script, command, key, broadcaster, observer, etc.
  • Data source
e.g. template, rule, etc.
  • Others
e.g. overlay (analogous to SSI, but client side and more powerful), iframe, browser, editor, etc.

It is possible to use elements from other applications of XML within XUL documents, such as XHTML, SVG and MathML.

ps: Some common widgets - such as spinbox, slider, and canvas - are not available in the current XUL widget set, but are planned for XUL 2.0

AND SO ??? ...

Well, regarding embedded environments, I'm not sure about its usage on projects like maemo-xul (notice it does not exist at al). IMHO, XUL is not as mature as it should be for so, but the ideia exists

... hey ... pymaemo's been ported before ! What about xulmaemo !?!?. Programming using XML and has a build for GTk would be amazing, wouldn't it ?!

Antonio Gomes
tonikitoo at gmail dot com

Monday, November 28, 2005

MANaOS Embedded Browser (for Nokia 770)


(selling a browser)


"MANaOS is an open source alternative Web Browser for some proprietary ones still shipped with the Nokia 770 device". It embeds mozilla and khtml (partially).

I'd say that a differencial feature between it and other similar Mozilla-based (or not) embedded open source web browsers is that MANaOS implements BIA (Browser Interface Agent). What a f... is that ?! Shortly, BIA is a not too complicated abstraction (software layer) for Rendering Engine independence at compile time. In other words, it enables you just adding a --with-engine=mozilla/khtml and it's done !

the MANaOS guys keep their focus on testing the Mozilla Embedded Project libs and the GtkMozEmbed set of widgets, measuring footprint and paying special attention on the performance of Minimo/Mozilla build on Nokia' 77'device, everything as an open source initiative. It uses a almost default Minimo build, except for the disabling XUL (--disable-xul specified on the mozconfig file (mozilla/minimo/config/mozconfig/linux_x86) and a simple extension for zoomming based on the colorzilla algorithm (this component is built in JS and suchs on a real device).



With regardings to the KHTML Engine' support, just some basic functionalities are provided so far, like go-stop-back-forward.

Some propaganda can be found here (from dougt's blog) ;)

GOOD-FOR-NOTHING -> repercussion of MANaOS after the annoucement of its first release is here on the maemo-developers mailing list.

ps1: I'll be releasing MANaOS 0.2 soon with some bugfixes and interesting improvements, like spatial-naviation and zooming support.
ps2: how to get it installed on the Nokia 770

Antonio Gomes
tonikitoo at gmail dot com

Sunday, November 27, 2005

Minimo (XUL) on the Nokia 770



These days I managed to run Minimo, that uses XUL get its UI built, on the Nokia 770. Although some hacking jobs are still needed, it is a great achievement regardless of these details :)

So, it's just a summarized howto of what I had to do to get it working on the 77'device.

RESOUCES USED:

** 1 Nokia 770 (hardware B4)
** 1 reduced size (rs) mmc
** 1 usb hub
** 1 usb cable (linking the device's usb port to another usb) - it comes with the device
** 1 usb-usb adapter (female-female)
** 1 usb cable (linking the adapter to the usb hub)
** 1 usb fast internet adapter (linked into the usb-hub)
** 1 usb-serial cable (link the device to the pc's serial port) - get root access.

  • Pull your rootstrap.
  • Flash the device (this step is not mandatory) - I flashed the newest rootstrap on 77'device actually a nokia's internal rootstrap instead of the public one available on the maEmo repository. If you're curious enough though,see here for more details.
  • copy the binaries to the device (humm, for this, I acessed the device via ethernet-serial port using an application called Minicom (I lot of cable involved:), but it can be done using a mmc card). btw, i've blogged it here before.
  • run minimoXUL from the x-terminal app inside the device.
$ cd path_to_your_dist/bin
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
$ run-standalone ./minimo

Minimo hasn't its inputs recognized by the environment (it's absolutily acceptable once it isn't a Hildon/GTK app), and I'm only able to browser on local files (I am not able to set up the proxies) ...

Antonio Gomes
tonikitoo at gmail dot com