MODULE = mandelbrot
-EXTENSION_VERSION = 4.0b1
+EXTENSION_VERSION = 4.0b2
XPI_NAME = mandelbrot
USE_EXTENSION_MANIFEST = 1
NO_JAR_AUTO_REG = 1
+NO_JS_MANIFEST = 1
INSTALL_EXTENSION_ID = mandelbrot@kairo.at
XPI_PKGNAME = mandelbrot-$(EXTENSION_VERSION)
DIST_FILES = extension/install.rdf
+EXTRA_COMPONENTS = extension/aboutMandelbrot.js
+
# this interferes with e.g. Firefox prefs
#PREF_JS_EXPORTS = $(srcdir)/xulapp/defaults/preferences/prefs.js
export::
$(NSINSTALL) -D $(FINAL_TARGET)/chrome/icons/default
$(INSTALL) $(srcdir)/xulapp/chrome/icons/default/mandelbrotWindow* $(FINAL_TARGET)/chrome/icons/default
+
+ifdef MOZ_OMNIJAR
+ABS_DIST = $(call core_abspath,$(DIST)/bin)
+
+libs::
+ @echo "Packaging $(INSTALL_EXTENSION_ID).xpi"
+ if test -d "$(ABS_DIST)/extensions/$(INSTALL_EXTENSION_ID)"; then \
+ cd $(ABS_DIST)/extensions/$(INSTALL_EXTENSION_ID)/; $(ZIP) -r9mX ../$(INSTALL_EXTENSION_ID).xpi *; \
+ rm -rf $(ABS_DIST)/extensions/$(INSTALL_EXTENSION_ID); \
+ fi
+endif
--- /dev/null
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the KaiRo.at Mandelbrot.
+ *
+ * The Initial Developer of the Original Code is
+ * Robert Kaiser <kairo@kairo.at>.
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Robert Kaiser <kairo@kairo.at> (original author)
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+Components.utils.import("resource://gre/modules/Services.jsm");
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+
+function AboutMandelbrot() { }
+AboutMandelbrot.prototype = {
+ classDescription: "about:mandelbrot",
+ contractID: "@mozilla.org/network/protocol/about;1?what=mandelbrot",
+ classID: Components.ID("{289dae5f-2a1d-4632-8df9-79c50147f91f}"),
+ QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIAboutModule]),
+
+ getURIFlags: function(aURI) {
+ return Components.interfaces.nsIAboutModule.ALLOW_SCRIPT;
+ },
+
+ newChannel: function(aURI) {
+ let channel = Services.io.newChannel("chrome://mandelbrot/content/mandelbrot-tab.xul",
+ null, null);
+ channel.originalURI = aURI;
+ return channel;
+ }
+};
+
+/**
+ * XPCOMUtils.generateNSGetFactory was introduced in Mozilla 2.
+ * XPCOMUtils.generateNSGetModule is for Mozilla 1.9.x.
+ */
+if (XPCOMUtils.generateNSGetFactory)
+ var NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutMandelbrot]);
+else
+ var NSGetModule = XPCOMUtils.generateNSGetModule([AboutMandelbrot]);
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.0</em:minVersion>
- <em:maxVersion>4.0b6pre</em:maxVersion>
+ <em:maxVersion>4.0.*</em:maxVersion>
</Description>
</em:targetApplication>
<!-- SeaMonkey -->
<Description>
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
<em:minVersion>2.0a1pre</em:minVersion>
- <em:maxVersion>2.1b1</em:maxVersion>
+ <em:maxVersion>2.1b2</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Fennec -->
<Description>
<em:id>{a23983c0-fd0e-11dc-95ff-0800200c9a66}</em:id>
<em:minVersion>0.1</em:minVersion>
- <em:maxVersion>2.0a1</em:maxVersion>
+ <em:maxVersion>4.0b4pre</em:maxVersion>
</Description>
</em:targetApplication>
<!-- toolkit -->
<commandset id="mainCommandSet">
<command id="Tools:Mandelbrot"
- oncommand="window.openDialog('chrome://mandelbrot/content/mandelbrot.xul', '_blank', 'all,dialog=no');"/>
+ oncommand="Browser.addTab('about:mandelbrot', true);"/>
</commandset>
- <box id="panel-controls">
- <toolbarbutton id="tool-mandelbrot" class="panel-button button-image"
+ <box id="browser-controls">
+ <toolbarbutton id="tool-mandelbrot" class="button-control"
command="Tools:Mandelbrot"
- insertbefore="tool-addons"/>
+ insertbefore="tool-panel-open"/>
</box>
</overlay>
% content mandelbrot %content/mandelbrot/
% skin mandelbrot classic/1.0 %skin/classic/mandelbrot/
% locale mandelbrot @AB_CD@ %locale/@AB_CD@/mandelbrot/
+% style chrome://mandelbrot/content/mandelbrot.xul chrome://mandelbrot/skin/mobileUI.css application={a23983c0-fd0e-11dc-95ff-0800200c9a66}
+% style chrome://mandelbrot/content/mandelbrot-tab.xul chrome://mandelbrot/skin/mobileUI.css application={a23983c0-fd0e-11dc-95ff-0800200c9a66}
+% style about:mandelbrot chrome://mandelbrot/skin/mobileUI.css application={a23983c0-fd0e-11dc-95ff-0800200c9a66}
% overlay chrome://browser/content/browser.xul chrome://mandelbrot/content/fxOverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
% overlay chrome://browser/content/browser.xul chrome://mandelbrot/content/mobileOverlay.xul application={a23983c0-fd0e-11dc-95ff-0800200c9a66}
% overlay chrome://communicator/content/tasksOverlay.xul chrome://mandelbrot/content/smOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
+% component {289dae5f-2a1d-4632-8df9-79c50147f91f} components/aboutMandelbrot.js
+% contract @mozilla.org/network/protocol/about;1?what=mandelbrot {289dae5f-2a1d-4632-8df9-79c50147f91f}
content/mandelbrot/mandelbrot.js (xulapp/chrome/mandelbrot/content/mandelbrot.js)
content/mandelbrot/mandelbrot.xul (xulapp/chrome/mandelbrot/content/mandelbrot.xul)
+ content/mandelbrot/mandelbrot-tab.xul (xulapp/chrome/mandelbrot/content/mandelbrot-tab.xul)
content/mandelbrot/image-settings.js (xulapp/chrome/mandelbrot/content/image-settings.js)
content/mandelbrot/image-settings.xul (xulapp/chrome/mandelbrot/content/image-settings.xul)
content/mandelbrot/fxOverlay.xul (extension/fxOverlay.xul)
skin/classic/mandelbrot/mandelbrot.css (xulapp/chrome/mandelbrot/skin/classic/mandelbrot.css)
skin/classic/mandelbrot/mandelbrotIcon16.png (xulapp/chrome/mandelbrot/skin/classic/mandelbrotIcon16.png)
skin/classic/mandelbrot/mandelbrotIcon32.png (xulapp/chrome/mandelbrot/skin/classic/mandelbrotIcon32.png)
+ skin/classic/mandelbrot/mobileUI.css (xulapp/chrome/mandelbrot/skin/classic/mobileUI.css)
skin/classic/mandelbrot/image-settings.css (xulapp/chrome/mandelbrot/skin/classic/image-settings.css)
locale/@AB_CD@/mandelbrot/mandelbrot.dtd (xulapp/chrome/mandelbrot/locales/@AB_CD@/mandelbrot.dtd)
locale/@AB_CD@/mandelbrot/mandelbrot.properties (xulapp/chrome/mandelbrot/locales/@AB_CD@/mandelbrot.properties)
--- /dev/null
+<?xml version="1.0"?>
+
+<!-- ***** BEGIN LICENSE BLOCK *****
+ - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ -
+ - The contents of this file are subject to the Mozilla Public License Version
+ - 1.1 (the "License"); you may not use this file except in compliance with
+ - the License. You may obtain a copy of the License at
+ - http://www.mozilla.org/MPL/
+ -
+ - Software distributed under the License is distributed on an "AS IS" basis,
+ - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ - for the specific language governing rights and limitations under the
+ - License.
+ -
+ - The Original Code is KaiRo.at Mandelbrot, XULRunner version.
+ -
+ - The Initial Developer of the Original Code is
+ - Robert Kaiser <kairo@kairo.at>.
+ - Portions created by the Initial Developer are Copyright (C) 2008-2011
+ - the Initial Developer. All Rights Reserved.
+ -
+ - Contributor(s):
+ - Robert Kaiser <kairo@kairo.at>
+ -
+ - Alternatively, the contents of this file may be used under the terms of
+ - either the GNU General Public License Version 2 or later (the "GPL"), or
+ - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ - in which case the provisions of the GPL or the LGPL are applicable instead
+ - of those above. If you wish to allow use of your version of this file only
+ - under the terms of either the GPL or the LGPL, and not to allow others to
+ - use your version of this file under the terms of the MPL, indicate your
+ - decision by deleting the provisions above and replace them with the notice
+ - and other provisions required by the LGPL or the GPL. If you do not delete
+ - the provisions above, a recipient may use your version of this file under
+ - the terms of any one of the MPL, the GPL or the LGPL.
+ -
+ - ***** END LICENSE BLOCK ***** -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://mandelbrot/skin/" type="text/css"?>
+
+<!DOCTYPE page [
+ <!ENTITY % mandelOverlayDTD SYSTEM "chrome://mandelbrot/locale/mandelbrot-overlay.dtd">
+ %mandelOverlayDTD;
+ <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
+ %brandDTD;
+ <!ENTITY % mandelbrotDTD SYSTEM "chrome://mandelbrot/locale/mandelbrot.dtd">
+ %mandelbrotDTD;
+]>
+
+<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ id="mandelbrotWindow" title="&windowTitle;"
+ disablefastfind="true"
+ onload="Startup();">
+
+ <html:link rel="shortcut icon"
+ href="chrome://mandelbrot/skin/mandelbrotIcon16.png"/>
+
+ <script type="application/x-javascript"
+ src="chrome://mandelbrot/content/mandelbrot.js"/>
+
+ <stringbundleset id="stringbundleset">
+ <stringbundle id="mbrotBundle" src="chrome://mandelbrot/locale/mandelbrot.properties"/>
+ </stringbundleset>
+
+ <commandset id="mainCommands">
+ </commandset>
+
+ <toolbox>
+ <toolbar class="chromeclass-toolbar"
+ id="mandelbrotToolbar"
+ align="center">
+ <toolbarbutton id="fileMenu"
+ type="menu"
+ class="tabbable"
+ label="&fileMenu.label;">
+ <menupopup id="menu_filePopup">
+ <menuitem id="fileDraw" label="&fileDraw.label;" oncommand="drawImage();"/>
+ <menuitem id="fileSave" label="&fileSave.label;" oncommand="saveImage();"/>
+ </menupopup>
+ </toolbarbutton>
+ <toolbarbutton id="bookmarkMenu"
+ type="menu"
+ class="tabbable"
+ label="&bookmarkMenu.label;">
+ <menupopup id="menu_bookmarkPopup"
+ onpopupshowing="updateBookmarkMenu(event.target);"
+ oncommand="callBookmark(event.target);">
+ <menuitem id="bookmarkOverview" label="&bookmarkOverview.label;"/>
+ <menuitem id="bookmarkSave" label="&bookmarkSave.label;" oncommand="saveBookmark();"/>
+ <menuseparator id="bookmarkSeparator"/>
+ </menupopup>
+ </toolbarbutton>
+ <toolbarbutton id="prefMenu"
+ type="menu"
+ class="tabbable"
+ label="&prefMenu.label;">
+ <menupopup id="menu_prefPopup">
+ <menu id="iterMenu" label="&iterMenu.label;">
+ <menupopup id="menu_iterPopup" onpopupshowing="updateIterMenu();" oncommand="setIter(event.target.value);">
+ <menuitem type="radio" name="iter" value="50" label="&iter50.label;"/>
+ <menuitem type="radio" name="iter" value="100" label="&iter100.label;"/>
+ <menuitem type="radio" name="iter" value="500" label="&iter500.label;"/>
+ <menuitem type="radio" name="iter" value="1000" label="&iter1000.label;"/>
+ </menupopup>
+ </menu>
+ <menu id="colorMenu" label="&colorMenu.label;">
+ <menupopup id="menu_palettePopup" onpopupshowing="updatePaletteMenu();" oncommand="setPalette(event.target.value);">
+ <menuitem type="radio" name="palette" value="bw" label="&colorBW.label;"/>
+ <menuitem type="radio" name="palette" value="kairo" label="&colorKairo.label;"/>
+ <menuitem type="radio" name="palette" value="rainbow-linear1" label="&colorRBLin1.label;"/>
+ <menuitem type="radio" name="palette" value="rainbow-squared1" label="&colorRBSq1.label;"/>
+ <menuitem type="radio" name="palette" value="rainbow-linear2" label="&colorRBLin2.label;"/>
+ <menuitem type="radio" name="palette" value="rainbow-squared2" label="&colorRBSq2.label;"/>
+ </menupopup>
+ </menu>
+ <menuitem id="imgSettings" label="&imgSettings.label;" oncommand="imgSettings();"/>
+ </menupopup>
+ </toolbarbutton>
+ <toolbarbutton id="debugMenu"
+ type="menu"
+ class="tabbable"
+ label="&debugMenu.label;">
+ <menupopup id="menu_debugPopup" onpopupshowing="updateDebugMenu();">
+ <menuitem type="checkbox" id="tracejitEnabled" label="&tracejitEnabled.label;" oncommand="toggleJITState(event.target, 'trace');"/>
+ <menuitem type="checkbox" id="methodjitEnabled" label="&methodjitEnabled.label;" oncommand="toggleJITState(event.target, 'method');"/>
+ <menu id="algoMenu" label="&algoMenu.label;">
+ <menupopup id="menu_algoPopup" onpopupshowing="updateAlgoMenu();" oncommand="setAlgorithm(event.target.value);">
+ <menuitem type="radio" name="algorithm" value="numeric" label="&algoNumeric.label;"/>
+ <menuitem type="radio" name="algorithm" value="oo" label="&algoOO.label;"/>
+ </menupopup>
+ </menu>
+ <menuitem id="errorConsole" label="&errorConsole.label;"
+ oncommand="errorConsole();"/>
+ <menuitem id="addonsMgr" label="&addonsManager.label;"
+ oncommand="addonsManager();"/>
+ </menupopup>
+ </toolbarbutton>
+ </toolbar>
+ </toolbox>
+ <hbox flex="1" pack="center" align="center">
+ <stack>
+ <html:canvas id="mbrotImage" width="300" height="300"
+ onmousedown="mouseevent('down', event);"
+ onmouseup="mouseevent('up', event);"
+ onmousemove="mouseevent('move', event);">
+ </html:canvas>
+ <button id="drawButton" label="&fileDraw.label;" oncommand="drawImage();"/>
+ </stack>
+ </hbox>
+ <hbox pack="end" align="end">
+ <description id="statusLabel"/>
+ </hbox>
+</page>
}
function updateDebugMenu() {
- var jitMenuItem = document.getElementById("jitEnabled");
- jitMenuItem.setAttribute("checked", gPref.getBoolPref("javascript.options.jit.chrome"));
+ let scope = (document.getElementById("mandelbrotWindow").nodeName == "page") ? "content" : "chrome";
+ for each (let type in ["tracejit", "methodjit"]) {
+ let jitMenuItem = document.getElementById(type + "Enabled");
+ jitMenuItem.setAttribute("checked", gPref.getBoolPref("javascript.options." + type + "." + scope));
+ }
}
-function toggleJITState(jitMenuItem) {
- var jitEnabled = !gPref.getBoolPref("javascript.options.jit.chrome");
- gPref.setBoolPref("javascript.options.jit.chrome", jitEnabled)
- jitMenuItem.setAttribute("checked", jitEnabled? "true" : "false");
+function toggleJITState(jitMenuItem, jittype) {
+ let scope = (document.getElementById("mandelbrotWindow").nodeName == "page") ? "content" : "chrome";
+ let jitpref = "javascript.options." + jittype + "jit." + scope;
+ let jitEnabled = !gPref.getBoolPref(jitpref);
+ gPref.setBoolPref(jitpref, jitEnabled)
+ jitMenuItem.setAttribute("checked", jitEnabled ? "true" : "false");
}
function updateAlgoMenu() {
</menu>
<menu id="debugMenu" label="&debugMenu.label;">
<menupopup id="menu_debugPopup" onpopupshowing="updateDebugMenu();">
- <menuitem type="checkbox" id="jitEnabled" label="&jitEnabled.label;" oncommand="toggleJITState(event.target);"/>
+ <menuitem type="checkbox" id="tracejitEnabled" label="&tracejitEnabled.label;" oncommand="toggleJITState(event.target, 'trace');"/>
+ <menuitem type="checkbox" id="methodjitEnabled" label="&methodjitEnabled.label;" oncommand="toggleJITState(event.target, 'method');"/>
<menu id="algoMenu" label="&algoMenu.label;">
<menupopup id="menu_algoPopup" onpopupshowing="updateAlgoMenu();" oncommand="setAlgorithm(event.target.value);">
<menuitem type="radio" name="algorithm" value="numeric" label="&algoNumeric.label;"/>
<!ENTITY imgSettings.label "Image Settingsā¦">
<!ENTITY debugMenu.label "Debug">
-<!ENTITY jitEnabled.label "Enable JIT (TraceMonkey)">
+<!ENTITY tracejitEnabled.label "Enable Tracing JIT">
+<!ENTITY methodjitEnabled.label "Enable Method JIT">
<!ENTITY algoMenu.label "Algorithm">
<!ENTITY algoNumeric.label "Numeric">
<!ENTITY algoOO.label "Object-Oriented">
*
* ***** END LICENSE BLOCK ***** */
+@namespace html "http://www.w3.org/1999/xhtml";
+
+/* HTML link elements do weird things to the layout if they are not hidden */
+html|link {
+ display: none;
+}
+
#tasksMenuMandelbrot, #menu_openMandelbrot {
list-style-image: url("chrome://mandelbrot/skin/mandelbrotIcon16.png");
}
--- /dev/null
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is KaiRo.at Mandelbrot, XULRunner version.
+ *
+ * The Initial Developer of the Original Code is
+ * Robert Kaiser <kairo@kairo.at>.
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Robert Kaiser <kairo@kairo.at>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#mandelbrotWindow {
+ /* font-family: helvetica,arial,clean,sans-serif;
+ color: #69645c; */
+}
+
+#mandelbrotToolbar {
+ -moz-appearance: none;
+ padding: 0;
+ /* panel-dark */
+ color: white;
+ background: rgb(94,97,102);
+ /* make it easier to touch */
+ font-size: 20px;
+}
+
+toolbarbutton {
+ -moz-appearance: none;
+ border: none;
+ margin: 0 6px;
+}
+
+.toolbarbutton-menu-dropmarker {
+ list-style-image: url("chrome://browser/skin/images/arrowdowndark-16.png");
+ -moz-margin-start: 3px;
+}
+
+toolbarbutton,
+menuitem,
+menu {
+ -moz-appearance: none;
+ font-size: inherit;
+ color: white;
+ padding: 3px;
+}
+
+toolbarbutton:hover:active,
+toolbarbutton[open],
+menuitem:hover,
+menuitem:hover:active,
+menu:hover,
+menu:hover:active,
+menu[open]{
+ background-color: #8db8d8;
+ color: black;
+ border: none;
+}
+
+toolbarbutton:hover:active > .toolbarbutton-menu-dropmarker,
+toolbarbutton[open] > .toolbarbutton-menu-dropmarker {
+ list-style-image: url("chrome://browser/skin/images/arrowdown-16.png");
+}
+
+.menu-right {
+ -moz-appearance: none;
+ list-style-image: url("chrome://browser/skin/images/arrowrightdark-16.png");
+}
+
+menu:hover > .menu-right,
+menu:hover:active > .menu-right,
+menu[open] > .menu-right {
+ list-style-image: url("chrome://browser/skin/images/arrowright-16.png");
+}
+
+menupopup {
+ background-color: #69645c;
+ color: white;
+ font-size: inherit;
+}
+
+menuitem[type="radio"][checked="true"] {
+ list-style-image: url("chrome://global/skin/radio/radio-check.gif");
+ list-style-image: url("chrome://browser/skin/images/scrubber-hdpi.png");
+}
+menuitem[type="checkbox"] {
+ list-style-image: url("chrome://browser/skin/images/check-unselected-30.png");
+}
+menuitem[type="checkbox"][checked="true"] {
+ list-style-image: url("chrome://browser/skin/images/check-selected-30.png");
+}