
|
Home |
Mailing List |
Installation |
Source Code |
Bugs |
Screenshots
|
The Transition from a Mozilla Package to a Firebird Extension - a FAQ 
NOTE: THIS VERSION IS OLD. THE LATEST VERSION OF THE FAQ IS POSTED AT THE mozdev.org DEVELOPERS NOTES SECTION
Please send all corrections, suggestions, or experiences in creating a Firebird Extension to Brian King.
Is the transition difficult, and will my code work in the new environment?In short, no it is not difficult, yet this may depend on the scale of your add-on or application. The application I used, xFly, was straightforward. The application itself is unfinished and suffering from bit-rot, but that is a separate issue than the one discussed here.
Does the install.js file have to change?No, the installation file was just updated with some minor formatting changes. After a check for disk space, it adds the jar file, registers the chrome directories, and prompts the user to restart once successful. Nothing new here, see for yourself!
How do I add my application to the list of extensions in the Firebird Options (Tools->Options menu) window?All that is required is one line. In the extenstion manifest (main contents.rdf file), add the following to the package description:
chrome:extension="true"
This tells Firebird to list the program in the list of extensions once it is registered.
Here is the full description, which includes some other useful information such as the author, name,
URL (if there is one), and a description of the extenstion which will appear in the Options list:
xFly listed as an extension in the Options window
As a Mozilla package, xFly was launched from the Tools menu. This was the desired option for Firebird too, which has a Tools menu.
It can be achieved with some modification to the main contents.rdf file, which contains the overlay information.
Added following to the list of files to overlay:
<RDF:li resource="chrome://browser/content/browser.xul"/>
Then the description needs to be added for the file for this file:
browser.xul is the main window for the Firebird application, and what you are saying here is that this is the file that you will be overlaying (the file where the menuitem will be going). The menuitem definition is contained in the file xflyextensionsoverlay.xul.
This is just one of many methods to overlay Firebird and launch the application, with another possibility being a toolbar button. I want to add a toolbar button for my extension, and add it to the 'Customize' D&D mechanism. Can it be done?
Yes, it certainly can. There are several steps you have to take to get this up and running.
The first thing to do is to create your buttons. Note that to be effective you need to create 2 different size buttons,
16x16px and 32x32px. Firebird is capable of having small and large button icons.
Next up is to write the XUL for the button:
<toolbarbutton> is contained in a
<toolbarpalette>, the id of which (BrowserToolbarPalette) corresponds to the palette that contains the Drag
and Drop buttons for the toolbar. This palette lives in the file browser.xul.Finally, you need to get the styles right for your button, related to the appearance of the image you created. Here is some of the code for the large and small buttons contained in the overlay CSS file, xflyextensionsoverlay.css.
-moz-image-region property is important for determining the proportions of the image to fit in a large or small
button.You will fall at the last hurdle unless you register your stylesheet in the skin contents.rdf file.
xFly D&D button on palette
Now everything should be in place, and you can grab your button and move onto one of your Firebird toolbars in the position that you wish.
xFly button on toolbar
Disabling the extension will essentially hide all references to your extension, and make it impossible to load from any overlaid UI components. With xFly, the menu item and button disappeared. However, you do have to restart Firebird when you do this for it to take effect. Currently there is no prompt to tell you to do this, so interaction with user is poor on this feature. I am sure this will change in future versions.
Does my XUL/XBL code need to be re-written?The latest roadmap says:
Note: the Phoenix toolkit is a compatible reimplementation of the XPFE toolkit, with added features such as customizable toolbars. We are not starting a new C++ GUI toolkit, we are simply moving to the next generation XUL toolkit.
Due to the fact that the new toolkit should be compatible with the XPFE toolkit, your code should work fine.
However, don't forget to test it anyway, and if possible take advantage of new features.
The only new features I could find currently are related to toolbar customisation, with the addition of
the <toolbarpalette> and <toolbaritem> elements.
However, I am sure there will be more changes as the toolkit evolves.
Mozilla Firebird Project Page
http://mozilla.org/projects/phoenix/
Get latest builds
http://komodo.mozilla.org/pub/phoenix/nightly/latest-trunk/
Firebird Help, a comprehensive site with a lot of good information, including Themes, Extensions and Tips&Tricks
http://texturizer.net/firebird/
Various project at mozdev.org hosting Firebird Extensions:
http://cdn.mozdev.org/
http://themes.mozdev.org/
http://extensionroom.mozdev.org/
Releases Page
http://mozilla.org/projects/phoenix/releases.html