Diff for /books/www/chapters/ch02.html between versions 1.1 and 1.2

version 1.1, 2002/09/17 21:10:35 version 1.2, 2002/09/23 15:23:31
Line 25 Line 25
 <P>The next few sections describe this sample file in more detail. The covered topics include the file itself, the syntax of the markup, XUL namespaces, and the basic layout of a XUL file.  <P>The next few sections describe this sample file in more detail. The covered topics include the file itself, the syntax of the markup, XUL namespaces, and the basic layout of a XUL file.
 <BLOCKQUOTE><HR><B>The xFly Examples</B>  <BLOCKQUOTE><HR><B>The xFly Examples</B>
 <P>The best way to understand the possible uses of the Mozilla framework is to look more closely at a number of various existing applications. This book highlights several Mozilla development projects, such as ChatZilla and JSLib, as examples of how some people have already started using Mozilla's XPFE technologies.  <P>The best way to understand the possible uses of the Mozilla framework is to look more closely at a number of various existing applications. This book highlights several Mozilla development projects, such as ChatZilla and JSLib, as examples of how some people have already started using Mozilla's XPFE technologies.
<P>Along with these applications, you'll note the use of the name "xFly" in many examples in this chapter and elsewhere in this book. The xFly examples are used throughout <A HREF="#77048">Chapter 2</A> to <A HREF="ch06.htm#77063">Chapter 6</A> to show how to create and package a simple Mozilla application.<P>Along with these applications, you'll note the use of the name "xFly" in many examples in this chapter and elsewhere in this book. The xFly 
 examples are used throughout <A HREF="#77048">Chapter 2</A> to <A HREF="ch06.html#77063">Chapter 6</A> to show how to create and package a simple Mozilla application.
 <P>This simple application is useful because it provides a place to start exploring the new information that you will learn about in this book. As you read more about XUL, CSS, JavaScript, and the other parts of Mozilla's development framework, you can create and edit the xFly files to see how these technologies work in practice.<HR></BLOCKQUOTE>  <P>This simple application is useful because it provides a place to start exploring the new information that you will learn about in this book. As you read more about XUL, CSS, JavaScript, and the other parts of Mozilla's development framework, you can create and edit the xFly files to see how these technologies work in practice.<HR></BLOCKQUOTE>
   
 <H2><A NAME="77050"></A> Basic XUL Concepts</H2>  <H2><A NAME="77050"></A> Basic XUL Concepts</H2>
Line 33 Line 34
 <P>These activities are part of the basic and often transparent interaction between your application files and Mozilla. However, the format of your XUL files, their syntax and namespace, the XUL layout, and the windowing system are all basic to successful XUL programming.  <P>These activities are part of the basic and often transparent interaction between your application files and Mozilla. However, the format of your XUL files, their syntax and namespace, the XUL layout, and the windowing system are all basic to successful XUL programming.
 <H3><A NAME="77051"></A> The XUL File Format</H3>  <H3><A NAME="77051"></A> The XUL File Format</H3>
 <P>A XUL file is a simple text file  <!--INDEX XUL files -->  <!--INDEX files:XUL files --> that contains proper XML syntax and has a <I>.xul</I> file extension. Mozilla expects to draw UI widgets when it encounters a file with a <I>.xul</I> extension or when it encounters the XUL namespace in other markup files that it recognizes, including HTML and XML.  <P>A XUL file is a simple text file  <!--INDEX XUL files -->  <!--INDEX files:XUL files --> that contains proper XML syntax and has a <I>.xul</I> file extension. Mozilla expects to draw UI widgets when it encounters a file with a <I>.xul</I> extension or when it encounters the XUL namespace in other markup files that it recognizes, including HTML and XML.
<P>The MIME type registered  <!--INDEX MIME type, XUL files -->  <!--INDEX XUL files:MIME type registered --> for XUL files is <I>application/vnd.mozilla.xul+xml</I>. When editing and using XUL files locally, you shouldn't need to worry about setting this on your computer; however, sometimes you may need to set the MIME type, such as when you host XUL files on a server. <A HREF="ch12.htm#51383">Chapter 12</A> provides additional information about how you can set the correct file type for your system.<P>The MIME type registered  <!--INDEX MIME type, XUL files -->  <!--INDEX XUL files:MIME type registered --> for XUL files is 
 <I>application/vnd.mozilla.xul+xml</I>. When editing and using XUL files locally, you shouldn't need to worry about setting this on your computer; however, sometimes you may need to set the MIME type, such as when you host XUL files on a server. <A HREF="ch12.html#51383">Chapter 12</A> provides additional information about how you can set the correct file type for your system.
 <H3><A NAME="77052"></A> Conventions</H3>  <H3><A NAME="77052"></A> Conventions</H3>
 <P>XUL has to follow certain  <!--INDEX XUL (XML-based User-interface Language):conventions -->  <!--INDEX conventions, XUL --> conventions (as does XHTML or any other XML-based file) in order to be valid. Mozilla generates an error when it encounters an invalid XUL file.  <P>XUL has to follow certain  <!--INDEX XUL (XML-based User-interface Language):conventions -->  <!--INDEX conventions, XUL --> conventions (as does XHTML or any other XML-based file) in order to be valid. Mozilla generates an error when it encounters an invalid XUL file.
 <P>The first thing required in a XUL document is the XML declaration.  <P>The first thing required in a XUL document is the XML declaration.
Line 88  xmlns="<A HREF="http://www.mozilla.org/k Line 90  xmlns="<A HREF="http://www.mozilla.org/k
 <P>Commonly, an application has more than one window, with a number of dialogs and secondary windows. Each window is also  <!--INDEX window element, XUL --> contained within a <TT>&lt;window&gt;</TT> element (though recent additions to the XUL specification include the <TT>dialog</TT> and <TT>page</TT> elements, which are derived from <TT>window</TT> and can be used in its place as root elements in your XUL files).  <P>Commonly, an application has more than one window, with a number of dialogs and secondary windows. Each window is also  <!--INDEX window element, XUL --> contained within a <TT>&lt;window&gt;</TT> element (though recent additions to the XUL specification include the <TT>dialog</TT> and <TT>page</TT> elements, which are derived from <TT>window</TT> and can be used in its place as root elements in your XUL files).
 <P>As your application becomes more complex, you need a way to keep track of the windows and ensure that they can communicate with one another. In Mozilla, there is a way to do this by using  <!--INDEX toOpenWindowByType( ) function -->  <!--INDEX functions:toOpenWindowByType( ) --> the <TT>type</TT> attribute identifier, which allows you to use special window-opening functions like <TT>toOpenWindowByType( )</TT> to manage particular window types.  <P>As your application becomes more complex, you need a way to keep track of the windows and ensure that they can communicate with one another. In Mozilla, there is a way to do this by using  <!--INDEX toOpenWindowByType( ) function -->  <!--INDEX functions:toOpenWindowByType( ) --> the <TT>type</TT> attribute identifier, which allows you to use special window-opening functions like <TT>toOpenWindowByType( )</TT> to manage particular window types.
 <BLOCKQUOTE><CENTER><B>NOTE</B></CENTER>  <BLOCKQUOTE><CENTER><B>NOTE</B></CENTER>
<P>As with any existing Mozilla functions referred to in this book, you can look up <TT>toOpenWindowByType</TT> by using the LXR web-based source code viewer, described in <A HREF="appa.htm#90096">Appendix A</A> and available at <A HREF="http://lxr.mozilla.org/">http://lxr.mozilla.org/</A>.<P></BLOCKQUOTE><P>As with any existing Mozilla functions referred to in this book, you can look up <TT>toOpenWindowByType</TT> by using the LXR web-based source 
 code viewer, described in <A HREF="appa.html#90096">Appendix A</A> and available at <A HREF="http://lxr.mozilla.org/">http://lxr.mozilla.org/</A>.<P></BLOCKQUOTE>
 <H4><A NAME="77056"></A> Window features</H4>  <H4><A NAME="77056"></A> Window features</H4>
<P>An <TT>id</TT> attribute is present on  <!--INDEX XUL (XML-based User-interface Language):windows -->  <!--INDEX windows:XML --> the <TT>&lt;window&gt;</TT> element. Using this  <!--INDEX window element, XUL:id attribute --> attribute is not necessary to run the windows system, but it is a good idea to give each window a unique identifier because it makes nodes easier to find from script (see the DOM method <TT>getElementByID</TT> in <A HREF="ch05.htm#77037">Chapter 5</A> for information about how to get elements by identifier). This is how to set up an ID attribute:<P>An <TT>id</TT> attribute is present on  <!--INDEX XUL (XML-based User-interface Language):windows -->  <!--INDEX windows:XML --> the 
 <TT>&lt;window&gt;</TT> element. Using this  <!--INDEX window element, XUL:id attribute --> attribute is not necessary to run the windows system, but it is a good idea to give each window a unique identifier because it makes nodes easier to find from script (see the DOM method <TT>getElementByID</TT> in <A HREF="ch05.html#77037">Chapter 5</A> for information about how to get elements by identifier). This is how to set up an ID attribute:
 <PRE>&lt;window  <PRE>&lt;window
 xmlns:html="<A HREF="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>"  xmlns:html="<A HREF="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>"
 xmlns="<A HREF="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</A>"&gt;  xmlns="<A HREF="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</A>"&gt;
Line 104  onload="startUp( )" Line 108  onload="startUp( )"
 onunload="shutdown( )"  onunload="shutdown( )"
 onclose="onClose( )"&gt;</PRE>  onclose="onClose( )"&gt;</PRE>
 <P>When you load a XUL file that begins in this way, the event handler attributes <TT>onload</TT> and <TT>onunload</TT> carry out the functions listed as values (<TT>startUp( )</TT> and <TT>shutdown( )</TT>). In addition, Mozilla provides an <TT>onclose</TT> event handler that intercepts the upcoming window closure to carry out any extra processing you need. The close event is fired before the <TT>unload</TT> event, so you can stop the window from closing in the <TT>onclose</TT> event handler if necessary. To stop window closure, the close event must return <I>false</I>.  <P>When you load a XUL file that begins in this way, the event handler attributes <TT>onload</TT> and <TT>onunload</TT> carry out the functions listed as values (<TT>startUp( )</TT> and <TT>shutdown( )</TT>). In addition, Mozilla provides an <TT>onclose</TT> event handler that intercepts the upcoming window closure to carry out any extra processing you need. The close event is fired before the <TT>unload</TT> event, so you can stop the window from closing in the <TT>onclose</TT> event handler if necessary. To stop window closure, the close event must return <I>false</I>.
<P>Additional handlers are available for dialog windows. They are listed and their use is outlined in the section <A HREF="ch03.htm#77087">"Application Windows</A>" in <A HREF="ch03.htm#32764">Chapter 3</A>.<P>Additional handlers are available for dialog windows. They are listed and their use is outlined in the section <A 
 HREF="ch03.html#77087">"Application Windows</A>" in <A HREF="ch03.html#32764">Chapter 3</A>.
 <H4><A NAME="77057"></A> Window properties</H4>  <H4><A NAME="77057"></A> Window properties</H4>
 <P>The window declaration is  <!--INDEX windows:XUL:properties -->  <!--INDEX properties:windows, XUL -->  <!--INDEX XUL (XML-based User-interface Language):windows:properties --> expanding, but there is still plenty of room for more features. In addition to the <I>attributes-</I>the event handlers, the ID, and the namespace that appear within the <TT>&lt;window&gt;</TT> tag itself-a XUL window also has all of the properties of the DOM <TT>window</TT> object from HTML. These properties are listed below, along with additional properties for application specific tasks.  <P>The window declaration is  <!--INDEX windows:XUL:properties -->  <!--INDEX properties:windows, XUL -->  <!--INDEX XUL (XML-based User-interface Language):windows:properties --> expanding, but there is still plenty of room for more features. In addition to the <I>attributes-</I>the event handlers, the ID, and the namespace that appear within the <TT>&lt;window&gt;</TT> tag itself-a XUL window also has all of the properties of the DOM <TT>window</TT> object from HTML. These properties are listed below, along with additional properties for application specific tasks.
 <P><TABLE WIDTH=100% BORDER=1><TR><TD> Navigator</TD>   <TD> Document</TD>      <TD> window</TD>        <TD> Parent</TD></TR>  <P><TABLE WIDTH=100% BORDER=1><TR><TD> Navigator</TD>   <TD> Document</TD>      <TD> window</TD>        <TD> Parent</TD></TR>
Line 141  onclose="onClose( )"&gt;</PRE> Line 146  onclose="onClose( )"&gt;</PRE>
   
 <P>Special properties of the XUL window object include:  <P>Special properties of the XUL window object include:
 <DL><DT>window.content  <DL><DT>window.content
<DD>Using this property is a quick way  <!--INDEX window.content property, window object --> to access the content area of your window, if one exists. This property is useful only if your window uses one of the content elements, namely <TT>&lt;iframe&gt;</TT>, <TT>&lt;browser&gt;</TT>, and <TT>&lt;editor&gt;</TT>. Refer to the section <A HREF="ch03.htm#77123">"Content Panels</A>" in <A HREF="ch03.htm#32764">Chapter 3</A> for a more detailed discussion. The <TT>content</TT> property is linked only to the frame you have explicitly declared as the primary area.<P></DL><DD>Using this property is a quick way  <!--INDEX window.content property, window object --> to access the content area of your window, if one 
 exists. This property is useful only if your window uses one of the content elements, namely <TT>&lt;iframe&gt;</TT>, <TT>&lt;browser&gt;</TT>, 
 and <TT>&lt;editor&gt;</TT>. Refer to the section <A HREF="ch03.html#77123">"Content Panels</A>" in <A HREF="ch03.html#32764">Chapter 3</A> for a more detailed discussion. The <TT>content</TT> property is linked only to the frame you have explicitly declared as the primary area.<P></DL>
 &lt;browser type="content-primary" ...&gt;  &lt;browser type="content-primary" ...&gt;
 <DL><DD>Subsequently, you can access and manipulate the content.<P></DL>  <DL><DD>Subsequently, you can access and manipulate the content.<P></DL>
 window.content.focus( );  window.content.focus( );
Line 160  function ChangePalette(palette) Line 167  function ChangePalette(palette)
 <P><LI>Updating the window timestamp<P>  <P><LI>Updating the window timestamp<P>
 <P><LI>Updating the window title<P>  <P><LI>Updating the window title<P>
 <P><LI>Setting the Z-order position<P></UL>  <P><LI>Setting the Z-order position<P></UL>
<P><A HREF="ch08.htm#78382">Chapter 8</A> provides full details of how to understand and use XPCOM components.<P><A HREF="ch08.html#78382">Chapter 8</A> provides full details of how to understand and use XPCOM components.
 <H4><A NAME="77059"></A> Window behavior</H4>  <H4><A NAME="77059"></A> Window behavior</H4>
 <P>Mozilla supports the  <!--INDEX XUL (XML-based User-interface Language):windows:behaviors -->  <!--INDEX windows:XUL:behaviors -->  <!--INDEX window.open function (JavaScript) -->  <!--INDEX functions:JavaScript:window.open -->  <!--INDEX JavaScript:functions:window.open --> standard <TT>window.open</TT> JavaScript function, which has its origins in the world of browser scripting and the launching of new browser windows. Mozilla extends the function to provide some features for application development. It also provides the <TT>window.openDialog</TT>  <!--INDEX window.openDialog function, JavaScript -->  <!--INDEX functions:JavaScript:window.OpenDialog -->  <!--INDEX JavaScript:functions:window.openDialog --> function for opening windows in the XPFE scripting environment. The latter function has become the more commonly used method to open a new XUL window, although the two are interchangeable.  <P>Mozilla supports the  <!--INDEX XUL (XML-based User-interface Language):windows:behaviors -->  <!--INDEX windows:XUL:behaviors -->  <!--INDEX window.open function (JavaScript) -->  <!--INDEX functions:JavaScript:window.open -->  <!--INDEX JavaScript:functions:window.open --> standard <TT>window.open</TT> JavaScript function, which has its origins in the world of browser scripting and the launching of new browser windows. Mozilla extends the function to provide some features for application development. It also provides the <TT>window.openDialog</TT>  <!--INDEX window.openDialog function, JavaScript -->  <!--INDEX functions:JavaScript:window.OpenDialog -->  <!--INDEX JavaScript:functions:window.openDialog --> function for opening windows in the XPFE scripting environment. The latter function has become the more commonly used method to open a new XUL window, although the two are interchangeable.
 <P>The usage of <TT>window.open</TT> is:  <P>The usage of <TT>window.open</TT> is:
Line 253  src="chrome://global/content/dialogOverl Line 260  src="chrome://global/content/dialogOverl
 <P>The previous two main sections  <!--INDEX chrome:package content;packages:chrome and --> introduced the concept of chrome and the prospect of creating standalone application windows. The next step is to make the example into an actual package-a modularized collection of files that can be installed in Mozilla as a new application.  <P>The previous two main sections  <!--INDEX chrome:package content;packages:chrome and --> introduced the concept of chrome and the prospect of creating standalone application windows. The next step is to make the example into an actual package-a modularized collection of files that can be installed in Mozilla as a new application.
 <P>In the earlier section <A HREF="#77060">"Making Mozilla Work for You</A>," you added features and complexity to your XUL file. In this section, you pull those features into separate files-a CSS file, JS file, and a DTD file-register these files together, and make them installable as a single package.  <P>In the earlier section <A HREF="#77060">"Making Mozilla Work for You</A>," you added features and complexity to your XUL file. In this section, you pull those features into separate files-a CSS file, JS file, and a DTD file-register these files together, and make them installable as a single package.
 <P>Only when you have packaged your work will your files have access to Mozilla files, such as CSS and scripts, be accessible from the special <I>chrome://</I> type URLs, be able to accept new themes, and be able  <!--INDEX packages:CSS and;packages:scripts and;packages:themes and;packages:XPCOM objects and -->  <!--INDEX stylesheets:packages and;scripts:packages and;themes:packages and;XPCOM:methods:JavaScript implementation --> to get to the XPCOM objects in which much of the application for Mozilla is defined.  <P>Only when you have packaged your work will your files have access to Mozilla files, such as CSS and scripts, be accessible from the special <I>chrome://</I> type URLs, be able to accept new themes, and be able  <!--INDEX packages:CSS and;packages:scripts and;packages:themes and;packages:XPCOM objects and -->  <!--INDEX stylesheets:packages and;scripts:packages and;themes:packages and;XPCOM:methods:JavaScript implementation --> to get to the XPCOM objects in which much of the application for Mozilla is defined.
<P>Tools are available that help set up the files that form the basis of a new package. <A HREF="appb.htm#78077">Appendix B</A> provides information about XULKit, which is a collection of scripts that automates part of the package creation process. It is recommended that you try to set up your own package by hand first to understand how packages are put together before using the XULKit scripts.<P>Tools are available that help set up the files that form the basis of a new package. <A HREF="appb.html#78077">Appendix B</A> provides 
 information about XULKit, which is a collection of scripts that automates part of the package creation process. It is recommended that you try to set up your own package by hand first to understand how packages are put together before using the XULKit scripts.
 <H3><A NAME="77066"></A> Architecture of a Chrome Package</H3>  <H3><A NAME="77066"></A> Architecture of a Chrome Package</H3>
 <P>The architecture of the  <!--INDEX packages:architecture -->  <!--INDEX chrome:packages (see packages) --> Mozilla XPFE is component- or layer-based. One of the primary aims of the design was the separation of each different component of an application, namely content, functionality, and layout. This design results in greater modularization, making it easy to create and change a UI-to change skins for your application, for example, update the language in which the user interface is presented, or bring in new script elements.  <P>The architecture of the  <!--INDEX packages:architecture -->  <!--INDEX chrome:packages (see packages) --> Mozilla XPFE is component- or layer-based. One of the primary aims of the design was the separation of each different component of an application, namely content, functionality, and layout. This design results in greater modularization, making it easy to create and change a UI-to change skins for your application, for example, update the language in which the user interface is presented, or bring in new script elements.
 <P>When a package is modularized like it can be in Mozilla, design determinations can be left to the designer, language in the user interface can be left to writers, and the application framework itself can be handled by software developers (though the programmer handles all of these in many small- to medium-sized projects). The next several sections provide more detail about each component and its content and file types. The way basic packages fit components together can be the basis for your own application development.  <P>When a package is modularized like it can be in Mozilla, design determinations can be left to the designer, language in the user interface can be left to writers, and the application framework itself can be handled by software developers (though the programmer handles all of these in many small- to medium-sized projects). The next several sections provide more detail about each component and its content and file types. The way basic packages fit components together can be the basis for your own application development.
Line 261  src="chrome://global/content/dialogOverl Line 269  src="chrome://global/content/dialogOverl
 <H3><A NAME="77067"></A> Package Components</H3>  <H3><A NAME="77067"></A> Package Components</H3>
 <P>As you will discover, each  <!--INDEX packages:components --> component in a package is independent. It is possible for your application to exist with just one or two of these components. Yet they all tie together when necessary to create a full featured application, and they are all at your disposal to take advantage of.  <P>As you will discover, each  <!--INDEX packages:components --> component in a package is independent. It is possible for your application to exist with just one or two of these components. Yet they all tie together when necessary to create a full featured application, and they are all at your disposal to take advantage of.
 <H4><A NAME="77068"></A> Chrome content</H4>  <H4><A NAME="77068"></A> Chrome content</H4>
<P>The content is  <!--INDEX packages:chrome content;chrome:package content;XUL data, packages;XBL data, packages;packages:XUL data;packages:XBL data --> the XUL and XBL data, contained in one or more files. This content is pulled in at runtime from files, overlays, and bindings, for display in the window system. The cross-platform implementation ensures consistency in the native system, and fits into the "write once, run anywhere" model. The XUL defines a single set of UI elements for all platforms. The XUL parser is much less tolerant than many HTML parsers; in fact, it's completely intolerant. However, it needs to be because every element in XUL impacts others and affects the layout of the UI-especially in the context of the Box Model, which <A HREF="ch03.htm#77084">Chapter 3</A> describes in detail.<P>The content is  <!--INDEX packages:chrome content;chrome:package content;XUL data, packages;XBL data, packages;packages:XUL data;packages:XBL 
 data --> the XUL and XBL data, contained in one or more files. This content is pulled in at runtime from files, overlays, and bindings, for display in the window system. The cross-platform implementation ensures consistency in the native system, and fits into the "write once, run anywhere" model. The XUL defines a single set of UI elements for all platforms. The XUL parser is much less tolerant than many HTML parsers; in fact, it's completely intolerant. However, it needs to be because every element in XUL impacts others and affects the layout of the UI-especially in the context of the Box Model, which <A HREF="ch03.html#77084">Chapter 3</A> describes in detail.
 <P>The widget set consists of simple widgets that display by drawing themselves absolutely in their allotted space, and of more complex widgets that act as containers, draw on top of others, or  <!--INDEX packages:widget set;widgets:packages --> accept input. A <TT>&lt;label&gt;</TT> widget is an example of the former, while <TT>&lt;stack&gt;</TT> is of the latter, more complex group. If the parser does not find an element in the content files, it fails to load and returns an error. Errors vary by type. An XML syntax error, for example, displays in the window in place of the expected content. It gives you the file the error originated in, along with the line number and column number.  <P>The widget set consists of simple widgets that display by drawing themselves absolutely in their allotted space, and of more complex widgets that act as containers, draw on top of others, or  <!--INDEX packages:widget set;widgets:packages --> accept input. A <TT>&lt;label&gt;</TT> widget is an example of the former, while <TT>&lt;stack&gt;</TT> is of the latter, more complex group. If the parser does not find an element in the content files, it fails to load and returns an error. Errors vary by type. An XML syntax error, for example, displays in the window in place of the expected content. It gives you the file the error originated in, along with the line number and column number.
 <P>Built as a complementary  <!--INDEX XBL (eXtensible Binding Language):widget creation --> description language to XUL, XBL allows you to create your own widgets or add new behavior to existing XUL widgets. You may attach scripting and create (anonymous) content in a single binding or in many. With a little imagination, you can extend the content available to you infinitely by adding your own styling and behavior with XBL.  <P>Built as a complementary  <!--INDEX XBL (eXtensible Binding Language):widget creation --> description language to XUL, XBL allows you to create your own widgets or add new behavior to existing XUL widgets. You may attach scripting and create (anonymous) content in a single binding or in many. With a little imagination, you can extend the content available to you infinitely by adding your own styling and behavior with XBL.
 <H4><A NAME="77069"></A> Chrome appearance</H4>  <H4><A NAME="77069"></A> Chrome appearance</H4>
Line 368  src="chrome://global/content/dialogOverl Line 377  src="chrome://global/content/dialogOverl
    &lt;/RDF:Description&gt;     &lt;/RDF:Description&gt;
  &lt;/RDF:RDF&gt;</PRE>   &lt;/RDF:RDF&gt;</PRE>
   
<P>Manifests are detailed in <A HREF="ch06.htm#15291">Chapter 6</A>. For now, it's enough to see that each manifest describes the subdirectory in which it is located, and that the contents of those subdirectories make up the package collectively.<P>Manifests are detailed in <A HREF="ch06.html#15291">Chapter 6</A>. For now, it's enough to see that each manifest describes the subdirectory in 
 which it is located, and that the contents of those subdirectories make up the package collectively.
 <P>The content describes the content of the xFly package, the XUL, and the JavaScript. The skin describes the theme of xFly, or the CSS and images used to lay out the XUL. The third part describes the locale, or the strings in the UI that can be localized or adapted for various languages or locales.  <P>The content describes the content of the xFly package, the XUL, and the JavaScript. The skin describes the theme of xFly, or the CSS and images used to lay out the XUL. The third part describes the locale, or the strings in the UI that can be localized or adapted for various languages or locales.
 <H3><A NAME="77075"></A> Separating the Files</H3>  <H3><A NAME="77075"></A> Separating the Files</H3>
 <P>Once you have a subdirectory structure set up  <!--INDEX packages:file separation;files:separating, packages;separating files, packages --> in accordance with the package component structure of your application, you can pull the pieces of your XUL file out into their own files and modularize your application. These separate files-the basic XUL file and separate CSS, JS, and DTD files-are registered as a single package and can then be launched as a standalone application.  <P>Once you have a subdirectory structure set up  <!--INDEX packages:file separation;files:separating, packages;separating files, packages --> in accordance with the package component structure of your application, you can pull the pieces of your XUL file out into their own files and modularize your application. These separate files-the basic XUL file and separate CSS, JS, and DTD files-are registered as a single package and can then be launched as a standalone application.
Line 513  skin,install,url,resource:/chrome/xfly/s Line 523  skin,install,url,resource:/chrome/xfly/s
 locale,install,url,resource:/chrome/xfly/locale/</PRE>  locale,install,url,resource:/chrome/xfly/locale/</PRE>
   
 <P>When Mozilla starts up, it looks for the package manifests, reads them, and registers the xFly package.  <P>When Mozilla starts up, it looks for the package manifests, reads them, and registers the xFly package.
<P>When others install your application and use it on their machines (but do not use the hack to <I>installed-chrome.txt</I>), you can provide them with a JavaScript installation file that downloads and registers your package from a web page. See <A HREF="ch06.htm#15291">Chapter 6</A> for more information about these installation files and the XPInstall technology they are based upon.<P>When others install your application and use it on their machines (but do not use the hack to <I>installed-chrome.txt</I>), you can provide 
 them with a JavaScript installation file that downloads and registers your package from a web page. See <A HREF="ch06.html#15291">Chapter 6</A> for more information about these installation files and the XPInstall technology they are based upon.
 <H2><A NAME="77080"></A> Launching the Application</H2>  <H2><A NAME="77080"></A> Launching the Application</H2>
 <P>Once your package is registered, you can use these startup options to access your package directly.<A NAME="77081"></A>  <P>Once your package is registered, you can use these startup options to access your package directly.<A NAME="77081"></A>
 <H4><A NAME="77082"></A> Windows launch</H4>  <H4><A NAME="77082"></A> Windows launch</H4>

Removed from v.1.1  
changed lines
  Added in v.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>