What is xul applications




















XUL provides the ability to create most elements found in modern graphical interfaces. Some elements that can be created are:.

The displayed content can be created from the contents of a XUL file or with data from a datasource. In Mozilla, such datasources include a user's mailbox, their bookmarks and search results. The contents of menus, trees and other elements can be populated with this data, or with your own data supplied in an RDF file. The first three types all require an installation to be performed on the user's machine.

However, these types of applications do not have security restrictions placed on them, so they may access local files and read and write preferences, for example.

For extensions, the XUL files and associated scripts and images used by an application would be packaged into a single file and downloaded and installed by the user.

Mozilla applications such as Firefox provide an extension manager which allows packages to be installed without having to write a lot of complex code. It is also possible to open XUL files directly from the file system or from a remote web site, however they will be restricted in the kinds of operations they can do, and some aspects of XUL will not work. XUL is usually stored in files with a. Here are some guidelines to keep in mind:.

XUL is supported in Mozilla and browsers that are also based upon on the Gecko engine, such as Netscape 6 or later and Mozilla Firefox. Due to various changes in XUL syntax over time, you will want to get the latest version for the examples to work properly. Most examples should work in Mozilla 1. XUL is fairly similar in Firefox and in other Mozilla-based browsers, although there are some specific differences such as support for customizable toolbars.

The files with js extensions are JavaScript files which contain scripts that handle the functionality of a window. Many XUL files have a script file associated with them, and some may have more than one. In the listing above, two files have been shown. There are others of course, but for simplicity they aren't shown. The file browser. The main window for a content package should have the same name as the package with a xul extension. In this case, the package name is 'browser', so we expect to find 'browser.

Some of the other XUL files describe separate windows. For example, the file pageInfo. Many packages will include a contents. However, this file is obsolete and has been replaced with a simpler mechanism. This newer method is the manifest file mentioned earlier, and you will find these as files with the.

For instance, browser. Several subdirectories, such as bookmarks and preferences, describe additional sections of the browser component. They are placed in different directories only to keep the files more organized.

The underlying code of Mozilla calls them skins, although the user interface calls them themes, but they both refer to the same thing. The classic. The structure is similar to the content packages. For example, examining classic. Again, this directory structure isn't necessary and is used for convenience. You can actually put all the files in one directory at the top level and not use subdirectories. However, for larger applications, subdirectories are used to separate the different components.

In the example above, a directory exists for theme related files for the browser and another for global theme related files. The global directory contains skin files that are general to all packages. These files will apply to all components and will be included with your own standalone applications.

The global part defines the appearance of all of the common XUL widgets, whereas the other directories have files that are specific to those applications. Firefox includes both the global and browser theme files in one archive, but they can be included separately. A skin is made up of CSS files and a number of images used to define the look of an interface.

Again, note how the file browser. By changing the CSS files, you can adjust the appearance of a window without changing its function. This is how you can create a new theme. The XUL part remains the same but the skin part changes independently. The file en-US. Like the skins, each language will contain files that specify text used by the package but for a specific language.

The locale structure is similar to the others, so it won't be listed it here. The localized text is stored in two types of files, DTD files, and properties files. The DTD files have a dtd extension and contain entity declarations, one for each text string that is used in a window.

For example, the file browser. In addition, keyboard shortcuts for each command are also defined, because they may be different for each language. The locale part also contains properties files, which are similar, but are used by script files. This structure allows you to translate Mozilla or a component into a different language by just adding a new locale for that language. You don't have to change the XUL part. In addition, another person could supply a separate package that applies a skin or locale to your content part, thus providing support for a new theme or language without having to change the original package.

There is a one special package called toolkit or global. We saw the global directory earlier for skins. The file toolkit. It contains some global dialogs and definitions. It also defines the default appearance and functionality of the various common XUL widgets such as textboxes and buttons. The files located in the global part of a skin package contain the default look for all of the XUL interface elements. The toolkit package is used by all XUL applications.

Mozilla places the packages that are included with the installation in the chrome directory. However, they do not need to be placed there.

This field is ; required. This ; field is optional. It specifies the minimum Gecko version that this ; application requires. Specifying 1. It specifies the maximum Gecko version that this ; application requires.

It should be specified if your application uses ; unfrozen interfaces. NOTE: Unix style file separators are required. Navigation menu Personal tools Log in Request account.

Namespaces XUL Discussion. Views Read View source View history.



0コメント

  • 1000 / 1000