Luxor: The "Linux Kernel" for Desktop Apps

Uniting XUL, SVG, HTML, Velocity, Web Start, XSL/T, Python and more

Gerald Bauer (Chairmain, CEO, CFO and CTO of Me, Myself & I, Inc.)
Vancouver XML Developers Association (VanX) Talk, July 2002

Table of Contents

Luxor Overview

Who is this guy?

Agenda - The Road Ahead

What is XUL?

XUL Vision

make building cross-platform user interfaces as easy as building web pages

-> no hard-coded, os-specific, toolkit-specific user interfaces (e.g. MFC, WindopeForms, Swing, Gtk+, etc.)
-> the answer is not yet another GUI API

use XML tags to create UIs for rich desktop apps

XUL Tag Sampling

Box Tags: <box>, <hbox>, <vbox>, <groupbox>, <caption>

Grid Tags: <grid>, <columns>, <column>, <rows>, <row>

Table Tags: <table>, <tr>, <td>

Tab Box Tags: <tabbox>, <tabs>, <tab>, <tabpanels>, <tabpanel>

Widget Tags: <button>, <checkbox>, <choice>, <label>, <spacer>, <text>, <image>, <gadget>

Menu Tags: <menubar>, <menu>, <menuref>, <menitem>, <displayurl>

Data Tags: <list>, <map>, <entry>

Portal Tags: <portal>, <portlet>

And Much More

First Impression - Xul In Action - Toolbar Example


  <toolbar id="MAIN">

     <toolbarbutton command="COPY_FORM"
         label="Copy Form"
         tooltip="Copy Form Data To Clipboard"
         accesskey="C" />

     <toolbarbutton command="PASTE_FORM"
         label="Paste Form"
         tooltip="Paste Form Data From Clipboard; Auto-Fill"
         accesskey="P" />



What is a Rich Desktop App? Mind Your Language


(!) taboo word likely to shock and best avoided

Why Xul? Isn't Dynamic HTML (aka HTML, DOM, JavaScript) enough?

Excurs: What's wrong with Applets for rich zero-admin desktop apps?

Beyond DHTML/Javascript: Inside a Rich Desktop App

Real World Desktop App Example

Venus Application Publisher (Vamp)

Component Provider
HTML Browser Swing JEditorPane
HTTP Server Rachel (Open-Source, Ultra-Light Weight, Multi-Threaded HTTP Server)
Template Engine Apache Velocity, XSL-T
Portal Engine Luxor (Porlet API, Portal Markup)
XUL Motor Luxor (Nile)
Scripting Engine Jython (Python)
SVG 2D Graphics Apache Batik
Download/Upload Manager Homegrown (Upcoming)
Bookmark/History Manager Homegrown (Upcoming)
Themes, Skins, Look & Feels CSS, Skin L&F, Kunststoff L&F, Oyoaha L&F
Zero-Admin, Zero-Hassle, Always Up-To-Date Web Start (Single-Click Magic)

Xul Motors: The Big Three

Mozilla - Xul Granddaddy; runs on Mac OS, Linux, Solaris, FreeBSD, Irix, BeOS, HPUX, OS/2, BSD, and more

Luxor - Xul toolkit includes web server, portal engine, template engine, scripting interpreter and more

XML Windowing Toolkit (XWT) - Xul "Lite"; available as self-installing ActiveX browser plug-in

More Xul Motors: The Minor League

The Late HP Bluestone's XwingML - Failed Early XUL Attempt


  <JFrame name="MainFrame" title="Bluestone XMLEdit" image="icon.gif" x="10%" y="10%" width="80%" height="80%">
      <JMenu text="File" mnemonic="F">
        <JMenuItem icon="open.gif" text="Open..." mnemonic="O"  accelerator="VK_O,CTRL_MASK" actionListener="OpenFile"/>
        <JMenuItem icon="save.gif" text="Save" mnemonic="S" accelerator="VK_S,CTRL_MASK" actionCommand="save"  actionListener="SaveFile"/>
     <Tab title="XML">
        <JTextArea name="EditorArea" tabSize="3" fontName="Monospaced" fontSize="14"/>
     <Tab title="DOM">
         <JTree name="DocumentTree" className="DOMTree">

Sun Java Bean Persistance - Java Rules, XML is not for Humans

Swing XML Java Bean Persistance Haystack:

<object class="javax.swing.JPanel">
  <void method="add">
    <object id="button1" class="javax.swing.JButton"/>
  <void method="add">
    <object class="javax.swing.JLabel">
      <void method="setLabelFor">
        <object idref="button1"/>

Java Swing Hard-Core Version:

JPanel panel1 = new JPanel();
JButton button1 = new JButton();
JLabel label1 = new JLabel();

XUL Contestant:

  <button id="button1" />
  <label  for="button1" />   

And the winner is... Do I need to comment?

XUL Architecture - Beyond Hairballs and Spaghetti Code

Break UI into Four Parts

Xul Apps: Proof of the Pudding

Mozilla XUL World Wonder:

Komodo / Active State - Dev Studio for Perl, Python, XSL-T and more

Xul Apps Continued: Please, Touch Me

Luxor XUL Beauty Queen:

Venus Application Publisher (Vamp) / Boy Toys (including Hazel, Vanessa, Clare, Pam, Alice, and so on)

Menu Example


 <menubar id="MAIN">

  <menu id="View" label="View" accesskey="V">

   <menuitem id="ResetTransform"
             label="Initial View"
             command="ResetTransformAction" />

   <menuitem id="ZoomIn"
             label="Zoom In"
             command="ZoomInAction" />

   <menuitem id="ZoomOut"
             label="Zoom Out"
             command="ZoomOutAction" />
   <menuref id="UseStylesheet" label="Use Stylesheet" icon="BLANK" />


   <menuitem id="PreviousTransform"
             label="Previous Transform"
             command="PreviousTransformAction" />

   <menuitem id="NextTransform"
             label="Next Transform"
             command="NextTransformAction" />

   <menuitem id="SetTransform"
             command="SetTransformAction" />

   <menuitem id="ThumbnailDialog"
             command="ThumbnailDialogAction" />

   <menuitem id="ViewSource"
             label="View Source"
             command="ViewSourceAction" />



Menu Example Continued: Icons and Shortcuts

  <icon id="BLANK"    ref="images/16x16/blank.gif" />
  <icon id="ZOOMIN"   ref="images/16x16/zoomin.gif" />
  <icon id="ZOOMOUT"  ref="images/16x16/zoomout.gif" />
  <icon id="SOURCE"   ref="images/16x16/source.gif" />

     <key id="ResetTransform"    modifiers="control" key="T" />
     <key id="ZoomIn"            modifiers="control" key="I" />
     <key id="ZoomOut"           modifiers="control" key="O" />
     <key id="PreviousTransform" modifiers="control" key="K" />
     <key id="NextTransform"     modifiers="control" key="L" />
     <key id="SetTransform"      modifiers="control" key="S" />
     <key id="ThumbnailDialog"   modifiers="control" key="Y" />
     <key id="ViewSource"        modifiers="control" key="U" />

Menu Example Benefits: XUL vs Java

XML Version:

<menuitem id="ZoomIn"
   label="Zoom In"  icon="ZOOMIN"  accesskey="I"
   key="ZoomIn" command="ZoomInAction" />

Java Version:

JMenuItem mi = new JMenuItem( "Zoom In" );
mi.addActionListener( cmdZoomIn );
mi.setMnemonic( 'I' );
mi.setAccelerator( KeyStroke.getKeyStroke( "control I" ) );
mi.setIcon( new ImageIcon( "images/16x16/zoomin.gif" ) );

DisplayURL Menu Example

<menu id="help" label="Help" accesskey="H">

    <displayurl label="Venus Application Publisher Home Page"
        icon="BLANK_ICON" />
    <displayurl label="Venus Application Publisher Discussion Forum"
        icon="BLANK_ICON" />
    <displayurl label="Frequently Asked Questions (FAQ)"
        icon="BLANK_ICON" />


    <displayurl label="Java Web Start Home Page"
        icon="BLANK_ICON" />
    <displayurl label="Java Web Start Discussion Forum"
        icon="BLANK_ICON" />
    <displayurl label="Java Web Start FAQ"
        icon="BLANK_ICON" />

    <menuitem command="about"
        label="About..." icon="ABOUT_ICON" />

Target Attribute - Display in Built-In or Household Browser

Choice Example

<list id="card">
  <entry value="American Express" />
  <entry value="Discover" />
  <entry value="Master Card" />
  <entry value="Visa" />
  <label value="Choose a method of payment:" />
  <choice list="card" />       

  <label value="Choose a method of payment:" />
  <choice list="card" type="radio" />       

Multiple Choice Example

<list id="activity">
  <entry value="Aerobics" />
  <entry value="Aikido" />
  <entry value="Basketball" />
  <entry value="Bicycling" />
  <entry value="Golfing" />
  <entry value="Hiking" />
  <label value="Choose the activities you enjoy:" />
  <mchoice list="activity" />

  <label value="Choose the activities you enjoy:" />
  <mchoice list="activity" type="list" />

Box Layout Example

<list id="radio">
  <entry value="Mocha" />
  <entry value="Espresso" />
  <entry value="Cappucino" />

    <label value="Text field:" />
    <text id="name" value="Xul Rocks" cols="40" />

    <label value="Text area:" />
    <textarea rows="3" cols="20" />
    <label value="Password:" />
    <password cols="10" value="secrect" />

    <label value="Radio buttons:" />
    <choice list="radio" type="radio" />

    <label value="Check boxes:" />
    <checkbox label="Cream" />
    <checkbox label="Sugar" />
    <checkbox label="Milk" />
    <checkbox label="Chocolate" />


Portal Example

<portal id="select-icon">
  <portlet id="head"/>
  <div align="center">
    <table border="0" width="90%" cellspacing="0" cellpadding="0">

        <portlet id="user-banner" />
        <portlet id="title"/>
        <portlet id="directory-breadcrumb" />
        <portlet id="icon-file-list" />
        <portlet id="directory-list" />
        <portlet id="file-root-list" />


Luxor Xul Design Principles - Freedom, Choice, Excellence

Five Freedoms - Xul Charter

Luxor Combos - Pick and Choose

Runtime, Language / GUI Toolkit / Scripting

Walled Garden Deja Vu - The HTML Story Repeats Itself with XUL

Vendors push their own rich desktop app APIs hoping to lock-in a horde of suckers

Who is pushing Xul? How about you? Join the Free World.

XML is not ... / The "Golden Hammer" Fallacy

Golden Hammer - When you have a hammer in your hand, everything starts to look like a nail.

Don't get swamped away in the XML craze. XML has limits and is not the magic bullet that will solve everything from world hunger, to peace in the Middle East to folding your laundry and cleaning your carpet.

What's wrong with Javascript? Javascript vs. Python

Python's "object-based" subset is roughly equivalent to JavaScript. Like JavaScript (and unlike Java), Python supports a programming style that uses simple functions and variables without engaging in class definitions. However, for JavaScript, that's all there is. Python, on the other hand, supports writing much larger programs and better code reuse through a true object-oriented programming style, where classes and inheritance play an important role.

-- Guido van Rossum

Javascript's syntax is too complicated for casual use: Curly brackets, semicolons, and more

Summary: Javascript is too hard for beginners and too impotent for programmers.

DOM = Death by cOMmittee

JDOM Mission: There is no compelling reason for a Java API to manipulate XML to be complex, tricky, unintuitive, or a pain in the neck. JDOM is both Java-centric and Java-optimized. It behaves like Java, it uses Java collections, it is completely natural API for Java developers.

The Death of the General Purpose Language

Beyond Hairballs and Spaghetti Code.

Prefer the single-purpose languages below to general-purpose languages such as Java, C# or Shark.

Xul vs. XForms

Xul is to XForms what the USA is to Texas or what Canada is to Quebec.

Luxor will include a cleaned-up XForms engine.

Tags not found in XForms: <tree>, <datagrid>, <menubar>, <toolbar>, and many more

Modul-Mania: Luxor Building Blocks

XUL Benefits

Hello Web Start - Single-Click App Launcher Magic

Web Start XML Startup File (aka JNLP File)


<jnlp href="venus.jnlp" codebase="">

    <title>Venus Application Publisher</title>
    <vendor>Gerald Bauer</vendor>
    <homepage href=""/>
    <description>A user-friendly tool to help you package, sign and publish Java Network Launching Protocol (JNLP) apps.</description>
    <icon href="venus.gif"/>
    <offline-allowed />

    <all-permissions />

    <j2se version="1.4 1.3" />
    <jar href="lib/venus.jar" />
    <jar href="lib/luxor.jar" />
    <jar href="lib/bcel.jar" />
    <jar href="lib/kunststoff-1.11.jar" />
    <jar href="lib/velocity-1.1.jar" />
    <jar href="lib/log4j.jar" />
    <jar href="lib/skinlf-1.1.jar" />
    <jar href="lib/getopt108.jar" />

  <application-desc main-class="venus.Tool" />


Web Start In Action: Start Me Up

Web Start downloads all required Jars from Web Server

Download Vamp

Web Start In A Nutshell

Secure One-Click Startup From Any Browser, For Any Platform, From Anywhere.

Xul Library: Books for the Beach

Essential Xul Programming - by Vaughn Bullard, Kevin Smith and Michael Daconta (July 2001); covers the whole Mozilla Xul machinery including CSS, XBL and RDF (448 pages)

Creating Applications with Mozilla - upcoming O'Reilly Xul thriller (September 2002) by David Boswell, Brian King, Ian Oeschger, Pete Collins and Eric Murphy (480 pages)

XUL Links

Web Start Links

Web Start/JNLP

FAQs - Answers, Answers, Answers

That's it - The Future Just Happened

Visit or for more info