a9cb1e4de14b7777af4c92f7b8bea95d17d9a30c
[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="tracejitEnabled" label="&tracejitEnabled.label;" oncommand="toggleJITState(event.target, 'trace');"/>
113           <menuitem type="checkbox" id="methodjitEnabled" label="&methodjitEnabled.label;" oncommand="toggleJITState(event.target, 'method');"/>
114           <menu id="algoMenu" label="&algoMenu.label;">
115             <menupopup id="menu_algoPopup" onpopupshowing="updateAlgoMenu();" oncommand="setAlgorithm(event.target.value);">
116               <menuitem type="radio" name="algorithm" value="numeric" label="&algoNumeric.label;"/>
117               <menuitem type="radio" name="algorithm" value="oo" label="&algoOO.label;"/>
118             </menupopup>
119           </menu>
120           <menuitem id="errorConsole" label="&errorConsole.label;"
121                     oncommand="errorConsole();"/>
122           <menuitem id="addonsMgr" label="&addonsManager.label;"
123                     oncommand="addonsManager();"/>
124         </menupopup>
125       </menu>
126     </menubar>
127   </toolbox>
128   <panel id="imgSettingsPanel"
129          onpopupshowing="initImgSettings();"
130          onpopuphiding="saveImgSettings();">
131     <!-- |titlebar="normal" noautohide="true" close="true" label="&imageSettings.title;"|
132          doesn't seem to work on the panel, so work around with a <titlebar> instead -->
133     <titlebar><label value="&imageSettings.title;"/></titlebar>
134     <groupbox>
135       <caption label="&coord.title;"/>
136       <description value="&coord.real.label;" class="coord-caption"/>
137       <hbox align="center">
138         <label value="&coord.min.label;" control="is_Cr_min"/>
139         <textbox id="is_Cr_min" size="10"
140                  onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'scale');"/>
141         <label value="&coord.max.label;" control="is_Cr_max"/>
142         <textbox id="is_Cr_max" size="10"
143                  onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'scale');"/>
144         <label value="&coord.scale.label;" control="is_Cr_scale"/>
145         <textbox id="is_Cr_scale" size="10"
146                  onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'max');"/>
147       </hbox>
148       <separator class="thin"/>
149       <description value="&coord.imag.label;" class="coord-caption"/>
150       <hbox align="center">
151         <label value="&coord.min.label;" control="is_Ci_min"/>
152         <textbox id="is_Ci_min" size="10"
153                  onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'scale');"/>
154         <label value="&coord.max.label;" control="is_Ci_max"/>
155         <textbox id="is_Ci_max" size="10"
156                  onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'scale');"/>
157         <label value="&coord.scale.label;" control="is_Ci_scale"/>
158         <textbox id="is_Ci_scale" size="10"
159                  onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'max');"/>
160       </hbox>
161     </groupbox>
162
163     <hbox flex="1">
164       <groupbox>
165         <caption label="&img.size.title;"/>
166         <hbox align="center">
167           <label value="&img.width.label;" control="is_img_width"/>
168           <textbox id="is_img_width" size="4"
169                    onchange="checkISValue(this, 'dim'); recalcCoord('Ci', 'scale');"/>
170         </hbox>
171         <hbox align="center">
172           <label value="&img.height.label;" control="is_img_height"/>
173           <textbox id="is_img_height" size="4"
174                    onchange="checkISValue(this, 'dim'); recalcCoord('Cr', 'scale');"/>
175         </hbox>
176       </groupbox>
177
178       <groupbox>
179         <caption label="&preview.title;"/>
180         <hbox flex="1" pack="center" align="center">
181           <html:canvas id="is_mbrotPreview" width="50" height="50"></html:canvas>
182         </hbox>
183         <button id="is_previewButton" label="&previewDraw.label;" oncommand="drawPreview();"/>
184       </groupbox>
185
186       <groupbox>
187         <caption label="&options.title;"/>
188         <hbox align="center">
189           <checkbox id="is_syncProp"
190                     onclick="checkProportions();"/>
191           <label value="&syncProp.label;" control="is_syncProp"/>
192         </hbox>
193       </groupbox>
194     </hbox>
195     <hbox>
196       <button id="is_closeButton" label="&closeSettings.label;" oncommand="closeImgSettings();"/>
197       <spacer flex="1"/>
198       <button id="is_drawButton" label="&drawImageButton.label;" oncommand="closeImgSettings(); drawImage();"/>
199     </hbox>
200   </panel>
201   <hbox flex="1" pack="center" align="center">
202     <stack>
203       <html:canvas id="mbrotImage" width="300" height="300"
204                    onmousedown="mouseevent('down', event);"
205                    onmouseup="mouseevent('up',event);"
206                    onmousemove="mouseevent('move',event);">
207       </html:canvas>
208       <button id="drawButton" label="&fileDraw.label;" oncommand="drawImage();"/>
209     </stack>
210   </hbox>
211   <hbox pack="end" align="end">
212     <description id="statusLabel"/>
213   </hbox>
214 </window>