re-introduce compatibility with Gecko < 2.0 apps
[mandelbrot.git] / xulapp / chrome / mandelbrot / content / mandelbrot.xul
1 <?xml version="1.0"?>
2
3 <!-- ***** BEGIN LICENSE BLOCK *****
4    - Version: MPL 1.1/GPL 2.0/LGPL 2.1
5    -
6    - The contents of this file are subject to the Mozilla Public License Version
7    - 1.1 (the "License"); you may not use this file except in compliance with
8    - the License. You may obtain a copy of the License at
9    - http://www.mozilla.org/MPL/
10    -
11    - Software distributed under the License is distributed on an "AS IS" basis,
12    - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13    - for the specific language governing rights and limitations under the
14    - License.
15    -
16    - The Original Code is KaiRo.at Mandelbrot, XULRunner version.
17    -
18    - The Initial Developer of the Original Code is
19    - Robert Kaiser <kairo@kairo.at>.
20    - Portions created by the Initial Developer are Copyright (C) 2008
21    - the Initial Developer. All Rights Reserved.
22    -
23    - Contributor(s):
24    -   Robert Kaiser <kairo@kairo.at>
25    -
26    - Alternatively, the contents of this file may be used under the terms of
27    - either the GNU General Public License Version 2 or later (the "GPL"), or
28    - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29    - in which case the provisions of the GPL or the LGPL are applicable instead
30    - of those above. If you wish to allow use of your version of this file only
31    - under the terms of either the GPL or the LGPL, and not to allow others to
32    - use your version of this file under the terms of the MPL, indicate your
33    - decision by deleting the provisions above and replace them with the notice
34    - and other provisions required by the LGPL or the GPL. If you do not delete
35    - the provisions above, a recipient may use your version of this file under
36    - the terms of any one of the MPL, the GPL or the LGPL.
37    -
38    - ***** END LICENSE BLOCK ***** -->
39
40 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
41 <?xml-stylesheet href="chrome://mandelbrot/skin/" type="text/css"?>
42
43 <!DOCTYPE window [
44   <!ENTITY % mandelOverlayDTD SYSTEM "chrome://mandelbrot/locale/mandelbrot-overlay.dtd">
45   %mandelOverlayDTD;
46   <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
47   %brandDTD;
48   <!ENTITY % mandelbrotDTD SYSTEM "chrome://mandelbrot/locale/mandelbrot.dtd">
49   %mandelbrotDTD;
50 ]>
51
52 <window id="mandelbrotWindow" title="&windowTitle;"
53         width="650" height="750"
54         onload="Startup()"
55         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
56         xmlns:html="http://www.w3.org/1999/xhtml">
57
58   <script type="application/x-javascript"
59           src="chrome://mandelbrot/content/mandelbrot.js"/>
60
61   <stringbundleset id="stringbundleset">
62     <stringbundle id="mbrotBundle" src="chrome://mandelbrot/locale/mandelbrot.properties"/>
63   </stringbundleset>
64
65   <commandset id="mainCommands">
66   </commandset>
67
68   <toolbox>
69     <menubar id="mandelbrotMenubar">
70       <menu id="fileMenu" label="&fileMenu.label;">
71         <menupopup id="menu_filePopup">
72           <menuitem id="fileDraw" label="&fileDraw.label;" oncommand="drawImage();"/>
73           <menuitem id="fileSave" label="&fileSave.label;" oncommand="saveImage();"/>
74           <menuseparator/>
75           <menuitem id="fileQuit" label="&fileQuit.label;" oncommand="exitMandelbrot();"/>
76         </menupopup>
77       </menu>
78       <menu id="bookmarkMenu" label="&bookmarkMenu.label;">
79         <menupopup id="menu_bookmarkPopup"
80                    onpopupshowing="updateBookmarkMenu(event.target);"
81                    oncommand="callBookmark(event.target);">
82           <menuitem id="bookmarkOverview" label="&bookmarkOverview.label;"/>
83           <menuitem id="bookmarkSave" label="&bookmarkSave.label;" oncommand="saveBookmark();"/>
84           <menuseparator id="bookmarkSeparator"/>
85         </menupopup>
86       </menu>
87       <menu id="prefMenu" label="&prefMenu.label;">
88         <menupopup id="menu_prefPopup">
89           <menu id="iterMenu" label="&iterMenu.label;">
90             <menupopup id="menu_iterPopup" onpopupshowing="updateIterMenu();" oncommand="setIter(event.target.value);">
91               <menuitem type="radio" name="iter" value="50" label="&iter50.label;"/>
92               <menuitem type="radio" name="iter" value="100" label="&iter100.label;"/>
93               <menuitem type="radio" name="iter" value="500" label="&iter500.label;"/>
94               <menuitem type="radio" name="iter" value="1000" label="&iter1000.label;"/>
95             </menupopup>
96           </menu>
97           <menu id="colorMenu" label="&colorMenu.label;">
98             <menupopup id="menu_palettePopup" onpopupshowing="updatePaletteMenu();" oncommand="setPalette(event.target.value);">
99               <menuitem type="radio" name="palette" value="bw" label="&colorBW.label;"/>
100               <menuitem type="radio" name="palette" value="kairo" label="&colorKairo.label;"/>
101               <menuitem type="radio" name="palette" value="rainbow-linear1" label="&colorRBLin1.label;"/>
102               <menuitem type="radio" name="palette" value="rainbow-squared1" label="&colorRBSq1.label;"/>
103               <menuitem type="radio" name="palette" value="rainbow-linear2" label="&colorRBLin2.label;"/>
104               <menuitem type="radio" name="palette" value="rainbow-squared2" label="&colorRBSq2.label;"/>
105             </menupopup>
106           </menu>
107           <menuitem id="imgSettings" label="&imgSettings.label;" oncommand="imgSettings();"/>
108         </menupopup>
109       </menu>
110       <menu id="debugMenu" label="&debugMenu.label;">
111         <menupopup id="menu_debugPopup" onpopupshowing="updateDebugMenu();">
112           <menuitem type="checkbox" id="jitEnabled" label="&tracejitEnabled.label;" oncommand="toggleJITState(event.target, '');" hidden="true"/>
113           <menuitem type="checkbox" id="tracejitEnabled" label="&tracejitEnabled.label;" oncommand="toggleJITState(event.target, 'trace');"/>
114           <menuitem type="checkbox" id="methodjitEnabled" label="&methodjitEnabled.label;" oncommand="toggleJITState(event.target, 'method');"/>
115           <menu id="algoMenu" label="&algoMenu.label;">
116             <menupopup id="menu_algoPopup" onpopupshowing="updateAlgoMenu();" oncommand="setAlgorithm(event.target.value);">
117               <menuitem type="radio" name="algorithm" value="numeric" label="&algoNumeric.label;"/>
118               <menuitem type="radio" name="algorithm" value="oo" label="&algoOO.label;"/>
119             </menupopup>
120           </menu>
121           <menuitem id="errorConsole" label="&errorConsole.label;"
122                     oncommand="errorConsole();"/>
123           <menuitem id="addonsMgr" label="&addonsManager.label;"
124                     oncommand="addonsManager();"/>
125         </menupopup>
126       </menu>
127     </menubar>
128   </toolbox>
129   <panel id="imgSettingsPanel"
130          onpopupshowing="initImgSettings();"
131          onpopuphiding="saveImgSettings();">
132     <!-- |titlebar="normal" noautohide="true" close="true" label="&imageSettings.title;"|
133          doesn't seem to work on the panel, so work around with a <titlebar> instead -->
134     <titlebar><label value="&imageSettings.title;"/></titlebar>
135     <groupbox>
136       <caption label="&coord.title;"/>
137       <description value="&coord.real.label;" class="coord-caption"/>
138       <hbox align="center">
139         <label value="&coord.min.label;" control="is_Cr_min"/>
140         <textbox id="is_Cr_min" size="10"
141                  onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'scale');"/>
142         <label value="&coord.max.label;" control="is_Cr_max"/>
143         <textbox id="is_Cr_max" size="10"
144                  onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'scale');"/>
145         <label value="&coord.scale.label;" control="is_Cr_scale"/>
146         <textbox id="is_Cr_scale" size="10"
147                  onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'max');"/>
148       </hbox>
149       <separator class="thin"/>
150       <description value="&coord.imag.label;" class="coord-caption"/>
151       <hbox align="center">
152         <label value="&coord.min.label;" control="is_Ci_min"/>
153         <textbox id="is_Ci_min" size="10"
154                  onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'scale');"/>
155         <label value="&coord.max.label;" control="is_Ci_max"/>
156         <textbox id="is_Ci_max" size="10"
157                  onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'scale');"/>
158         <label value="&coord.scale.label;" control="is_Ci_scale"/>
159         <textbox id="is_Ci_scale" size="10"
160                  onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'max');"/>
161       </hbox>
162     </groupbox>
163
164     <hbox flex="1">
165       <groupbox>
166         <caption label="&img.size.title;"/>
167         <hbox align="center">
168           <label value="&img.width.label;" control="is_img_width"/>
169           <textbox id="is_img_width" size="4"
170                    onchange="checkISValue(this, 'dim'); recalcCoord('Ci', 'scale');"/>
171         </hbox>
172         <hbox align="center">
173           <label value="&img.height.label;" control="is_img_height"/>
174           <textbox id="is_img_height" size="4"
175                    onchange="checkISValue(this, 'dim'); recalcCoord('Cr', 'scale');"/>
176         </hbox>
177       </groupbox>
178
179       <groupbox>
180         <caption label="&preview.title;"/>
181         <hbox flex="1" pack="center" align="center">
182           <html:canvas id="is_mbrotPreview" width="50" height="50"></html:canvas>
183         </hbox>
184         <button id="is_previewButton" label="&previewDraw.label;" oncommand="drawPreview();"/>
185       </groupbox>
186
187       <groupbox>
188         <caption label="&options.title;"/>
189         <hbox align="center">
190           <checkbox id="is_syncProp"
191                     label="&syncProp.label;"
192                     onclick="checkProportions();"/>
193         </hbox>
194       </groupbox>
195     </hbox>
196     <hbox>
197       <button id="is_closeButton" label="&closeSettings.label;" oncommand="closeImgSettings();"/>
198       <spacer flex="1"/>
199       <button id="is_drawButton" label="&drawImageButton.label;" oncommand="closeImgSettings(); drawImage();"/>
200     </hbox>
201   </panel>
202   <hbox flex="1" pack="center" align="center">
203     <stack>
204       <html:canvas id="mbrotImage" width="300" height="300"
205                    onmousedown="mouseevent('down', event);"
206                    onmouseup="mouseevent('up',event);"
207                    onmousemove="mouseevent('move',event);">
208       </html:canvas>
209       <button id="drawButton" label="&fileDraw.label;" oncommand="drawImage();"/>
210     </stack>
211   </hbox>
212   <hbox pack="end" align="end">
213     <description id="statusLabel"/>
214   </hbox>
215 </window>