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