Notes/LearningXUL

edit
revisions

what's new
search
help

kiwi


Learning XUL

XUL stands for eXtensible User-interface Language, and is a very promising technology proposed by the Mozilla development platform. This page tries to sum-up and collect what information about XUL, while I am learning it.

Basic concepts

Chrome

In Mozilla, user interface definitions are contained in the chrome directory (typically /usr/lib/mozilla/chrome). Mozilla UI definitions are composed of three main type of elements:

  • Content: declares UI elements (windows, buttons, etc), how they are laid out, and how they react. UI element are describe in XUL (.xul) files, while UI behaviour is described in JavaScript? (.js).
  • Skins: CSS stylesheets and images that allow to customize the appearance of Mozilla UI elements.
  • Locales: text and translations in different languages. Text and translations are provided as DTD (.dtd) to share entity definitions, and property files (.properties).

Chrome seems to be a term that is used in different context, and seems to have somewhat different meanings. In this respect, I prefer to simply cite a Mozilla webpage:

"In general, chrome refers to a XUL interface and all of its supporting files; chrome means the XUL content and structure, plus the CSS skin, plus whatever localization and platform-specific files are part of that XUL interface".

Packages

Mozilla UI definitions are usually packaged in one or more jar files, usually one for the content, and one for each specific skin and specific locales (EN, FR, etc).

In fact, locales and skins should always be distributed as separate packages, because even if a user has multiple skins and locales for a XUL application, only one skin and locale can be active at a time. Apart from this restriction, there is no required packaging strategy.

Every package may contain subdirectories, structuring its content. In fact, directories and .jar files are considered as packages.

Every package content should be described by an RDF file named contents.rdf, which is called the manifest. This file is used to tell Mozilla where are and what to do with the files contained in the package.

Mozilla packages can be located anywhere on the local filesystem or on the Internet: their location is defined in a file named chrome.rdf, both available globally in the Mozilla chrome directory, or in the user profile.

More information on Mozilla packages can be found here.

References

last modified on September 27, 2005, at 07:35 PM

© type-z.org and its contributing authors, 2001-2004.
Content is licensed under a Creative Commons License.