1f15fb3f4c93f3bd065c199e4a869746165f1833
[mandelbrot.git] / xulapp / chrome / mandelbrot / content / mandelbrot-tab.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-2011
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 page [
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   <!ENTITY % imgSettingsDTD SYSTEM "chrome://mandelbrot/locale/image-settings.dtd">
51   %imgSettingsDTD;
52 ]>
53
54 <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
55       xmlns:html="http://www.w3.org/1999/xhtml"
56       id="mandelbrotWindow" title="&windowTitle;"
57       disablefastfind="true"
58       onload="Startup();">
59
60   <html:link rel="shortcut icon"
61               href="chrome://mandelbrot/skin/mandelbrotIcon16.png"/>
62
63   <script type="application/x-javascript"
64           src="chrome://mandelbrot/content/mandelbrot.js"/>
65
66   <stringbundleset id="stringbundleset">
67     <stringbundle id="mbrotBundle" src="chrome://mandelbrot/locale/mandelbrot.properties"/>
68   </stringbundleset>
69
70   <commandset id="mainCommands">
71   </commandset>
72
73   <toolbox>
74     <toolbar class="chromeclass-toolbar"
75              id="mandelbrotToolbar"
76              align="center">
77       <toolbarbutton id="fileMenu"
78                      type="menu"
79                      class="tabbable"
80                      label="&fileMenu.label;">
81         <menupopup id="menu_filePopup">
82           <menuitem id="fileDraw" label="&fileDraw.label;" oncommand="drawImage();"/>
83           <menuitem id="fileSave" label="&fileSave.label;" oncommand="saveImage();"/>
84         </menupopup>
85       </toolbarbutton>
86       <toolbarbutton id="bookmarkMenu"
87                      type="menu"
88                      class="tabbable"
89                      label="&bookmarkMenu.label;">
90         <menupopup id="menu_bookmarkPopup"
91                    onpopupshowing="updateBookmarkMenu(event.target);"
92                    oncommand="callBookmark(event.target);">
93           <menuitem id="bookmarkOverview" label="&bookmarkOverview.label;"/>
94           <menuitem id="bookmarkSave" label="&bookmarkSave.label;" oncommand="saveBookmark();"/>
95           <menuseparator id="bookmarkSeparator"/>
96         </menupopup>
97       </toolbarbutton>
98       <toolbarbutton id="prefMenu"
99                      type="menu"
100                      class="tabbable"
101                      label="&prefMenu.label;">
102         <menupopup id="menu_prefPopup">
103           <menu id="iterMenu" label="&iterMenu.label;">
104             <menupopup id="menu_iterPopup" onpopupshowing="updateIterMenu();" oncommand="setIter(event.target.value);">
105               <menuitem type="radio" name="iter" value="50" label="&iter50.label;"/>
106               <menuitem type="radio" name="iter" value="100" label="&iter100.label;"/>
107               <menuitem type="radio" name="iter" value="500" label="&iter500.label;"/>
108               <menuitem type="radio" name="iter" value="1000" label="&iter1000.label;"/>
109             </menupopup>
110           </menu>
111           <menu id="colorMenu" label="&colorMenu.label;">
112             <menupopup id="menu_palettePopup" onpopupshowing="updatePaletteMenu();" oncommand="setPalette(event.target.value);">
113               <menuitem type="radio" name="palette" value="bw" label="&colorBW.label;"/>
114               <menuitem type="radio" name="palette" value="kairo" label="&colorKairo.label;"/>
115               <menuitem type="radio" name="palette" value="rainbow-linear1" label="&colorRBLin1.label;"/>
116               <menuitem type="radio" name="palette" value="rainbow-squared1" label="&colorRBSq1.label;"/>
117               <menuitem type="radio" name="palette" value="rainbow-linear2" label="&colorRBLin2.label;"/>
118               <menuitem type="radio" name="palette" value="rainbow-squared2" label="&colorRBSq2.label;"/>
119             </menupopup>
120           </menu>
121           <menuitem id="imgSettings" label="&imgSettings.label;" oncommand="imgSettings();"/>
122         </menupopup>
123       </toolbarbutton>
124       <toolbarbutton id="debugMenu"
125                      type="menu"
126                      class="tabbable"
127                      label="&debugMenu.label;">
128         <menupopup id="menu_debugPopup" onpopupshowing="updateDebugMenu();">
129           <menuitem type="checkbox" id="tracejitEnabled" label="&tracejitEnabled.label;" oncommand="toggleJITState(event.target, 'trace');"/>
130           <menuitem type="checkbox" id="methodjitEnabled" label="&methodjitEnabled.label;" oncommand="toggleJITState(event.target, 'method');"/>
131           <menu id="algoMenu" label="&algoMenu.label;">
132             <menupopup id="menu_algoPopup" onpopupshowing="updateAlgoMenu();" oncommand="setAlgorithm(event.target.value);">
133               <menuitem type="radio" name="algorithm" value="numeric" label="&algoNumeric.label;"/>
134               <menuitem type="radio" name="algorithm" value="oo" label="&algoOO.label;"/>
135             </menupopup>
136           </menu>
137         </menupopup>
138       </toolbarbutton>
139     </toolbar>
140   </toolbox>
141   <panel id="imgSettingsPanel"
142          level="floating"
143          titlebar="normal"
144          noautohide="true"
145          close="true"
146          onpopupshowing="initImgSettings();"
147          onpopuphiding="saveImgSettings();"
148          label="&imageSettings.title;">
149     <titlebar><label value="&imageSettings.title;"/></titlebar>
150     <groupbox>
151       <caption label="&coord.title;"/>
152       <description value="&coord.real.label;" class="coord-caption"/>
153       <hbox align="center">
154         <label value="&coord.min.label;" control="is_Cr_min"/>
155         <textbox id="is_Cr_min" size="10"
156                  onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'scale');"/>
157         <label value="&coord.max.label;" control="is_Cr_max"/>
158         <textbox id="is_Cr_max" size="10"
159                  onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'scale');"/>
160         <label value="&coord.scale.label;" control="is_Cr_scale"/>
161         <textbox id="is_Cr_scale" size="10"
162                  onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'max');"/>
163       </hbox>
164       <separator class="thin"/>
165       <description value="&coord.imag.label;" class="coord-caption"/>
166       <hbox align="center">
167         <label value="&coord.min.label;" control="is_Ci_min"/>
168         <textbox id="is_Ci_min" size="10"
169                  onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'scale');"/>
170         <label value="&coord.max.label;" control="is_Ci_max"/>
171         <textbox id="is_Ci_max" size="10"
172                  onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'scale');"/>
173         <label value="&coord.scale.label;" control="is_Ci_scale"/>
174         <textbox id="is_Ci_scale" size="10"
175                  onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'max');"/>
176       </hbox>
177     </groupbox>
178
179     <hbox flex="1">
180       <groupbox>
181         <caption label="&img.size.title;"/>
182         <hbox align="center">
183           <label value="&img.width.label;" control="is_img_width"/>
184           <textbox id="is_img_width" size="4"
185                    onchange="checkISValue(this, 'dim'); recalcCoord('Ci', 'scale');"/>
186         </hbox>
187         <hbox align="center">
188           <label value="&img.height.label;" control="is_img_height"/>
189           <textbox id="is_img_height" size="4"
190                    onchange="checkISValue(this, 'dim'); recalcCoord('Cr', 'scale');"/>
191         </hbox>
192       </groupbox>
193
194       <groupbox>
195         <caption label="&preview.title;"/>
196         <hbox flex="1" pack="center" align="center">
197           <html:canvas id="is_mbrotPreview" width="50" height="50"></html:canvas>
198         </hbox>
199         <button id="is_previewButton" label="&previewDraw.label;" oncommand="drawPreview();"/>
200       </groupbox>
201
202       <groupbox>
203         <caption label="&options.title;"/>
204         <hbox align="center">
205           <checkbox id="is_syncProp"
206                     onclick="checkProportions();"/>
207           <label value="&syncProp.label;" control="is_syncProp"/>
208         </hbox>
209       </groupbox>
210     </hbox>
211     <hbox>
212       <button id="is_closeButton" label="&closeSettings.label;" oncommand="closeImgSettings();"/>
213       <spacer flex="1"/>
214       <button id="is_drawButton" label="&DrawImageButton.label;" oncommand="closeImgSettings(); drawImage();"/>
215     </hbox>
216   </panel>
217   <hbox flex="1" pack="center" align="center">
218     <stack>
219       <html:canvas id="mbrotImage" width="300" height="300"
220                    onmousedown="mouseevent('down', event);"
221                    onmouseup="mouseevent('up', event);"
222                    onmousemove="mouseevent('move', event);">
223       </html:canvas>
224       <button id="drawButton" label="&fileDraw.label;" oncommand="drawImage();"/>
225     </stack>
226   </hbox>
227   <hbox pack="end" align="end">
228     <description id="statusLabel"/>
229   </hbox>
230 </page>