- XUL
-
XUL Filename extension .xul
Internet media type application/
vnd.mozilla.xul+xmlDeveloped by Mozilla Foundation Type of format markup language In computer programming, XUL (pronounced /ˈzuːl/ zuul), the XML User Interface Language, is an XML user interface markup language developed by the Mozilla project. XUL operates in Mozilla cross-platform applications such as Firefox. The Mozilla Gecko layout engine provides an implementation of XUL used in the Firefox browser.[1]
Contents
Design
XUL relies on multiple existing Web standards and Web technologies, including CSS, JavaScript, and DOM. Such reliance makes XUL relatively easy to learn for people with a background in Web programming and design.
XUL has no formal specification and does not inter-operate with non-Gecko implementations. However, it uses an open source implementation of Gecko, tri-licensed under the GPL, LGPL, and MPL.[2]
Mozilla provides experimental XULRunner builds to let developers build their applications on top of the Mozilla application framework and of XUL in particular.
XUL provides a portable definition for common widgets, allowing them to move easily to any platform on which Mozilla applications run.[3]
XUL documents
Programmers typically define a XUL interface as three discrete sets of components:
- content: the XUL document(s), whose elements define the layout of the user interface
- skin: the CSS and image files, which define the appearance of an application
- locale: the files containing user-visible strings for easy software localization
XUL elements
XUL defines a wide range of elements, which roughly belong to the following types:
- top-level elements
- window, page, dialog, wizard, etc.
- widgets
- label, button, text box, list box, combo box, radio button, check box, tree, menu, toolbar, group box, tab box, colorpicker, spacer, splitter, etc.
- box model
- box, grid, stack, deck, etc.
- events and scripts
- script, command, key, broadcaster, observer, etc.
- data source
- template, rule, etc.
- others
- overlay (analogous to SSI, but client-side and more powerful, with higher performance), iframe, browser, editor, etc.
One can use elements from other applications of XML within XUL documents, such as XHTML, SVG, and MathML.
Mozilla added some common widgets —
<scale/>
(sometimes called "slider"),<textbox type="number"/>
(spinbox), time and date pickers — during the Gecko 1.9 development cycle.[4]XUL applications
While XUL serves primarily for constructing Mozilla applications and their extensions, it may also feature in Web applications transferred over HTTP. The Mozilla Amazon Browser, a former XUL application of this type (and well-known in its day[5]), provided a rich interface for searching books at Amazon.com.
However, many of the powerful features of Mozilla (such as privileged XPCOM objects) remain unavailable to unprivileged XUL documents unless the script has a digital signature, and unless the user obtains grants of certain[which?] privileges to the application. Such documents also suffer from various limitations of the browser, including the inability to load remote XUL, DTD, and RDF documents.
As Gecko provides the only full implementation of XUL, such applications remain inaccessible to users of browsers not based on Mozilla. Mozilla-programmers sometimes refer to XUL applications running locally as chrome.[6]
Other applications using XUL are:
- The Ample SDK Open-Source GUI Framework provides a cross-browser implementation of XUL in JavaScript.
- The ActiveState Komodo IDE uses XUL as well as the Open Komodo project announced in 2007.
- The Songbird music-player and Miro video-player both use built-in XUL.
- The Elixon WCMS/XUL Content management system uses exclusively remote XUL, thus overcoming some of the aforementioned limits of remote unprivileged XUL documents.
- The developers of the Celtx media pre-production application used XUL.
- The Flickr Uploadr was built using XUL
With the release of Firefox 4, support for remote XUL was disabled by default, due to security concerns.[7] Loading an XUL page via HTTP would now display an error unless the domain was added to a hidden whitelist.
The name
The name "XUL" references the film Ghostbusters (1984), in which the ghost of an ancient Sumerian deity called Zuul possesses the character Dana Barrett (played by Sigourney Weaver) and declares, "There is no Dana, only Zuul". Since XUL, like MXML, uses XML to define an interface rather than a document, its developers adopted the slogan: "There is no data, there is only XUL". Hence the XML namespace URI at the beginning of every XUL document:
http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul
The linked document displays the slogan in large letters in the center of the screen.
"Keymaster" and "gatekeeper" also refer to the plot-line of the Ghostbusters film . (Other references to Ghostbusters also occur within Mozilla products: for instance, the JavaScript debugger component is called Venkman, after one of the main characters in the film.)
Example
This example shows 3 buttons stacked on top of each other in a vertical box container:[8]
<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="vbox example" title="Example 3...." xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox> <button id="yes" label="Yes"/> <button id="no" label="No"/> <button id="maybe" label="Maybe"/> </vbox> </window>
Similar languages
HTML Application resembles XUL in that it provides a stand-alone capability to run applications based on HTML, DHTML, and Javascript outside of a Web browser for the Microsoft Windows environment developed by Microsoft.
The Microsoft Windows Presentation Foundation (WPF) defines XAML, another declarative UI language similar to XUL — it runs on top of the .NET Framework stack.
See also
- Extensible User Interface Protocol (XUP)
- Layout manager
- Mozilla application framework
- XBL
- XULRunner
- ZK Framework
References
- ^ "Gecko FAQ". Mozilla Developer Center. Mozilla Foundation. 2008-03-15. https://developer.mozilla.org/en/Gecko_FAQ. Retrieved 2009-03-26.
- ^ Mozilla Foundation. "Mozilla Code Licensing". http://www.mozilla.org/MPL/. Retrieved 2007-09-17.
- ^ "The Joy of XUL". Mozilla Foundation. 2007-09-09. https://developer.mozilla.org/en/The_Joy_of_XUL. Retrieved 2009-03-26.
- ^ Firefox 3 for developers
- ^ "Remote Application Development with Mozilla, Part 2: A Case Study of the Mozilla Amazon Browser (MAB)". Oreillynet. 2003-02-05. http://www.oreillynet.com/pub/a/mozilla/2003/05/02/casestudy2.html.
- ^ Feldt, Kenneth C. (2007). Programming Firefox: Building Rich Internet Applications with XUL. O'Reilly Media. pp. 76–77. ISBN 0596102437. http://books.google.co.nz/books?id=ryEKOKnHFa8C&pg=PA392&lpg=PA392&dq=xul+chrome+programming+firefox#PPP1,M1. Retrieved 2008-03-04.
- ^ "Firefox 4 for developers". https://developer.mozilla.org/En/Firefox_4_for_developers#Remote_XUL_support_removed.
- ^ https://developer.mozilla.org/en/XUL_Tutorial/The_Box_Model
External links
- XUL documentation on developer.mozilla.org
- XUL Tutorial
- XUL Periodic Table — Visual demonstration of XUL capabilities (requires a Gecko-based (XUL-enabled) browser such as Mozilla Firefox)
Mozilla Project Mozilla LabsMozilla ResearchBoot 2 Gecko · RustCamino · Firefox (2 · 3 · 3.5 · 3.6 · 4 · 5 · 6 · 7 · 8 · 9 · 10 · 11 · 12 · Mobile) · SeaMonkey
more- Origin and lineage: Mozilla Application Suite · Netscape Navigator · Netscape Communicator · Netscape Communications · Beonex Communicator
- Forks: BurningDog · Flock · Gnuzilla · Iceape · IceCat · Icedove · Iceowl · Miro · Netscape 9 · Portable Edition · Songbird · Swiftfox · Swiftweasel · TenFourFox · XeroBank
- Framework: add-on · Gecko · Necko · XBL · XPCOM · XPConnect · XPInstall · XUL · XULRunner
- Componentry: Application Object Model · Composer · NSPR · NSS · Rhino · SpiderMonkey · Tamarin · Venkman
- Project: Personas, Snowl, Test Pilot — Chromatabs, Geode, Joey, Operator, The Coop
- Discontinued: Calendar Project · Grendel · Minimo
Organization Former Mozilla Organization · Mozilla Foundation (Subsidiary: Mozilla Corporation · Mozilla Messaging · Mozilla Online)Official affiliateCommunity See also List of widget toolkits Low-level High-level On Amiga OSOn WindowsOn Unix,
under X11Cross-platform,
by languageAdobe Flex · AsWingXMLAmple SDK · CougarXML · GladeXML · Lively Kernel · Pyjamas · Rialto Toolkit · XAML · XML User Interface · XUL · WtdesktopwebGoogle Web Toolkit · ExtJS GWTC or C++CEGUI · Component Library for Cross Platform · FLTK · FOX toolkit · OpenGL User Interface Library · GTK+ · Juce · JX Application Framework · Qt · Wt · Tk · TnFOX · Visual Component Framework · wxWidgets · YAAF · XForms · XVT · Ultimate++Common LispObject PascalQtRubyCategories:- User interface markup languages
- XML-based standards
- Mozilla
- RDF data access
Wikimedia Foundation. 2010.