# The Original Code is KaiRo-Mandelbrot.
#
# The Initial Developer of the Original Code is
-# Robert Kaiser.
-# Portions created by the Initial Developer are Copyright (C) 2010
+# Robert Kaiser <kairo@kairo.at>.
+# Portions created by the Initial Developer are Copyright (C) 2010-2011
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
-# Robert Kaiser <kairo@kairo.at>
+# 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
include $(DEPTH)/config/autoconf.mk
-MODULE = mandelbrot
+ifdef ENABLE_TESTS
+PARALLEL_DIRS += tests
+endif
+
+MODULE = mandelbrot
-EXTENSION_VERSION = 4.0b2
+EXTENSION_VERSION = 4.0b3
XPI_NAME = mandelbrot
USE_EXTENSION_MANIFEST = 1
INSTALL_EXTENSION_ID = mandelbrot@kairo.at
XPI_PKGNAME = mandelbrot-$(EXTENSION_VERSION)
-DIST_FILES = extension/install.rdf
+DIST_FILES = \
+ install.rdf \
+ $(NULL)
-EXTRA_COMPONENTS = extension/aboutMandelbrot.js
+PREF_JS_EXPORTS = \
+ $(srcdir)/prefs.js \
+ $(NULL)
-# this interferes with e.g. Firefox prefs
-#PREF_JS_EXPORTS = $(srcdir)/xulapp/defaults/preferences/prefs.js
+EXTRA_COMPONENTS = \
+ aboutMandelbrot.js \
+ $(NULL)
# include config.mk before using the AB_CD var
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
-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)
updatePaletteMenu();
gMbrotBundle = document.getElementById("mbrotBundle");
document.getElementById("statusLabel").value = gMbrotBundle.getString("statusEmpty");
+
+ let img = document.getElementById("mbrotImage");
+ img.addEventListener("mouseup", imgEvHandler, false);
+ img.addEventListener("mousedown", imgEvHandler, false);
+ img.addEventListener("mousemove", imgEvHandler, false);
+ img.addEventListener("touchstart", imgEvHandler, false);
+ img.addEventListener("touchend", imgEvHandler, false);
+ img.addEventListener("touchcancel", imgEvHandler, false);
+ img.addEventListener("touchleave", imgEvHandler, false);
+ img.addEventListener("touchmove", imgEvHandler, false);
}
function getAdjustPref(prefname) {
var zoomstart;
var imgBackup;
-function mouseevent(etype, event) {
- let canvas = document.getElementById("mbrotImage");
- let context = canvas.getContext("2d");
- switch (etype) {
- case 'down':
- if (event.button == 0) {
- // left button - start dragzoom
- zoomstart = {x: event.clientX - canvas.offsetLeft,
- y: event.clientY - canvas.offsetTop};
- imgBackup = context.getImageData(0, 0, canvas.width, canvas.height);
- }
- break;
- case 'up':
- if (event.button == 0 && zoomstart) {
- context.putImageData(imgBackup, 0, 0);
- let zoomend = {x: event.clientX - canvas.offsetLeft,
- y: event.clientY - canvas.offsetTop};
-
- // make sure zoomend is bigger than zoomstart
- if ((zoomend.x == zoomstart.x) || (zoomend.y == zoomstart.y)) {
- // cannot zoom what has no area, discard it
- zoomstart = undefined;
- return;
+let imgEvHandler = {
+ handleEvent: function(aEvent) {
+ let canvas = document.getElementById("mbrotImage");
+ let context = canvas.getContext("2d");
+ switch (aEvent.type) {
+ case 'mousedown':
+ case 'touchstart':
+ if (aEvent.button == 0) {
+ // left button - start dragzoom
+ zoomstart = {x: aEvent.clientX - canvas.offsetLeft,
+ y: aEvent.clientY - canvas.offsetTop};
+ imgBackup = context.getImageData(0, 0, canvas.width, canvas.height);
+ }
+ break;
+ case 'mouseup':
+ case 'touchend':
+ if (aEvent.button == 0 && zoomstart) {
+ context.putImageData(imgBackup, 0, 0);
+ let zoomend = {x: aEvent.clientX - canvas.offsetLeft,
+ y: aEvent.clientY - canvas.offsetTop};
+
+ // make sure zoomend is bigger than zoomstart
+ if ((zoomend.x == zoomstart.x) || (zoomend.y == zoomstart.y)) {
+ // cannot zoom what has no area, discard it
+ zoomstart = undefined;
+ return;
+ }
+ if (zoomend.x < zoomstart.x)
+ [zoomend.x, zoomstart.x] = [zoomstart.x, zoomend.x];
+ if (zoomend.y < zoomstart.y)
+ [zoomend.y, zoomstart.y] = [zoomstart.y, zoomend.y];
+
+ // determine new "coordinates"
+ let CWidth = gCurrentImageData.C_max.r - gCurrentImageData.C_min.r;
+ let CHeight = gCurrentImageData.C_max.i - gCurrentImageData.C_min.i;
+ let newC_min = new complex(
+ gCurrentImageData.C_min.r + zoomstart.x / gCurrentImageData.iWidth * CWidth,
+ gCurrentImageData.C_min.i + zoomstart.y / gCurrentImageData.iHeight * CHeight);
+ let newC_max = new complex(
+ gCurrentImageData.C_min.r + zoomend.x / gCurrentImageData.iWidth * CWidth,
+ gCurrentImageData.C_min.i + zoomend.y / gCurrentImageData.iHeight * CHeight);
+
+ adjustCoordsAndDraw(newC_min, newC_max);
+ }
+ zoomstart = undefined;
+ break;
+ case 'mousemove':
+ case 'touchmove':
+ if (aEvent.button == 0 && zoomstart) {
+ context.putImageData(imgBackup, 0, 0);
+ context.strokeStyle = "rgb(255,255,31)";
+ context.strokeRect(zoomstart.x, zoomstart.y,
+ aEvent.clientX - canvas.offsetLeft - zoomstart.x,
+ aEvent.clientY - canvas.offsetTop - zoomstart.y);
}
- if (zoomend.x < zoomstart.x)
- [zoomend.x, zoomstart.x] = [zoomstart.x, zoomend.x];
- if (zoomend.y < zoomstart.y)
- [zoomend.y, zoomstart.y] = [zoomstart.y, zoomend.y];
-
- // determine new "coordinates"
- let CWidth = gCurrentImageData.C_max.r - gCurrentImageData.C_min.r;
- let CHeight = gCurrentImageData.C_max.i - gCurrentImageData.C_min.i;
- let newC_min = new complex(
- gCurrentImageData.C_min.r + zoomstart.x / gCurrentImageData.iWidth * CWidth,
- gCurrentImageData.C_min.i + zoomstart.y / gCurrentImageData.iHeight * CHeight);
- let newC_max = new complex(
- gCurrentImageData.C_min.r + zoomend.x / gCurrentImageData.iWidth * CWidth,
- gCurrentImageData.C_min.i + zoomend.y / gCurrentImageData.iHeight * CHeight);
-
- adjustCoordsAndDraw(newC_min, newC_max);
- }
- zoomstart = undefined;
break;
- case 'move':
- if (event.button == 0 && zoomstart) {
- context.putImageData(imgBackup, 0, 0);
- context.strokeStyle = "rgb(255,255,31)";
- context.strokeRect(zoomstart.x, zoomstart.y,
- event.clientX - canvas.offsetLeft - zoomstart.x,
- event.clientY - canvas.offsetTop - zoomstart.y);
- }
- break;
+ }
}
-}
+};
function saveImage() {
const nsIFilePicker = Components.interfaces.nsIFilePicker;
gPref.setCharPref("mandelbrot.use_algorithm", algoID);
}
-function addonsManager(aPane) {
- let theEM = Components.classes["@mozilla.org/appshell/window-mediator;1"]
- .getService(Components.interfaces.nsIWindowMediator)
- .getMostRecentWindow("Extension:Manager");
- if (theEM) {
- theEM.focus();
- if (aPane)
- theEM.showView(aPane);
- return;
- }
-
- const EMURL = "chrome://mozapps/content/extensions/extensions.xul";
- const EMFEATURES = "all,dialog=no";
- if (aPane)
- window.openDialog(EMURL, "", EMFEATURES, aPane);
- else
- window.openDialog(EMURL, "", EMFEATURES);
-}
-
-function errorConsole() {
- toOpenWindowByType("global:console", "chrome://global/content/console.xul");
-}
-
function initImgSettings() {
// Get values from prefs.
for each (let coord in ["Cr", "Ci"]) {
let othercoord = (coord == "Ci") ? "Cr" : "Ci";
let owndim = (coord == "Ci") ? "height" : "width";
let otherdim = (coord == "Ci") ? "width" : "height";
+ let myscale;
if (target == "scale") {
- var myscale =
+ myscale =
parseFloat(document.getElementById("is_" + coord + "_max").value) -
parseFloat(document.getElementById("is_" + coord + "_min").value);
document.getElementById("is_" + coord + "_scale").value = roundCoord(myscale);
parseFloat(document.getElementById("is_" + coord + "_min").value) +
parseFloat(document.getElementById("is_" + coord + "_scale").value);
document.getElementById("is_" + coord + "_max").value = roundCoord(mymax);
- var myscale = document.getElementById("is_" + coord + "_scale").value;
+ myscale = document.getElementById("is_" + coord + "_scale").value;
}
if (document.getElementById("is_syncProp").checked) {
let otherscale = myscale *
// save the canvas data to the file
persist.saveURI(source, null, null, null, null, aDestFile);
}
-
-// function below is from http://developer.mozilla.org/en/docs/How_to_Quit_a_XUL_Application
-function quitApp(aForceQuit) {
- var appStartup = Components.classes['@mozilla.org/toolkit/app-startup;1']
- .getService(Components.interfaces.nsIAppStartup);
-
- // eAttemptQuit will try to close each XUL window, but the XUL window can cancel the quit
- // process if there is unsaved data. eForceQuit will quit no matter what.
- var quitSeverity = aForceQuit ? Components.interfaces.nsIAppStartup.eForceQuit :
- Components.interfaces.nsIAppStartup.eAttemptQuit;
- appStartup.quit(quitSeverity);
-}
-
-// functions below are from comm-central/suite/common/tasksOverlay.js
-function toOpenWindow(aWindow) {
- try {
- // Try to focus the previously focused window e.g. message compose body
- aWindow.document.commandDispatcher.focusedWindow.focus();
- } catch (e) {
- // e.g. full-page plugin or non-XUL document; just raise the top window
- aWindow.focus();
- }
-}
-
-function toOpenWindowByType(inType, uri, features) {
- // don't do several loads in parallel
- if (uri in window)
- return;
-
- var topWindow = Components.classes["@mozilla.org/appshell/window-mediator;1"]
- .getService(Components.interfaces.nsIWindowMediator)
- .getMostRecentWindow(inType);
- if ( topWindow )
- toOpenWindow( topWindow );
- else {
- // open the requested window, but block it until it's fully loaded
- function newWindowLoaded(event) {
- // make sure that this handler is called only once
- window.removeEventListener("unload", newWindowLoaded, false);
- window[uri].removeEventListener("load", newWindowLoaded, false);
- delete window[uri];
- }
- // remember the newly loading window until it's fully loaded
- // or until the current window passes away
- window[uri] = window.openDialog(uri, "", features || "all,dialog=no");
- window[uri].addEventListener("load", newWindowLoaded, false);
- window.addEventListener("unload", newWindowLoaded, false);
- }
-}
-
- The Initial Developer of the Original Code is
- Robert Kaiser <kairo@kairo.at>.
- - Portions created by the Initial Developer are Copyright (C) 2008
+ - Portions created by the Initial Developer are Copyright (C) 2008-2011
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://mandelbrot/skin/" type="text/css"?>
-<!DOCTYPE window [
+<!DOCTYPE page [
<!ENTITY % mandelOverlayDTD SYSTEM "chrome://mandelbrot/locale/mandelbrot-overlay.dtd">
%mandelOverlayDTD;
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%mandelbrotDTD;
]>
-<window id="mandelbrotWindow" title="&windowTitle;"
- width="650" height="750"
- onload="Startup()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:html="http://www.w3.org/1999/xhtml">
+<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"/>
</commandset>
<toolbox>
- <menubar id="mandelbrotMenubar">
- <menu id="fileMenu" label="&fileMenu.label;">
- <menupopup id="menu_filePopup">
- <menuitem id="fileDraw" label="&fileDraw.label;" oncommand="drawImage();"/>
- <menuitem id="fileSave" label="&fileSave.label;" oncommand="saveImage();"/>
- <menuseparator/>
- <menuitem id="fileQuit" label="&fileQuit.label;" oncommand="exitMandelbrot();"/>
- </menupopup>
- </menu>
- <menu id="bookmarkMenu" label="&bookmarkMenu.label;">
+ <toolbar class="chromeclass-toolbar"
+ id="mandelbrotToolbar"
+ align="center">
+ <toolbarbutton id="fileDraw" label="&fileDraw.label;" oncommand="drawImage();"/>
+ <toolbarbutton id="fileSave" label="&fileSave.label;" oncommand="saveImage();"/>
+ <toolbarbutton id="bookmarkMenu"
+ type="menu"
+ class="tabbable"
+ label="&bookmarkMenu.label;">
<menupopup id="menu_bookmarkPopup"
onpopupshowing="updateBookmarkMenu(event.target);"
oncommand="callBookmark(event.target);">
<menuitem id="bookmarkSave" label="&bookmarkSave.label;" oncommand="saveBookmark();"/>
<menuseparator id="bookmarkSeparator"/>
</menupopup>
- </menu>
- <menu id="prefMenu" label="&prefMenu.label;">
+ </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);">
</menu>
<menuitem id="imgSettings" label="&imgSettings.label;" oncommand="imgSettings();"/>
</menupopup>
- </menu>
- <menu id="debugMenu" label="&debugMenu.label;">
+ </toolbarbutton>
+ <toolbarbutton id="debugMenu"
+ type="menu"
+ class="tabbable"
+ label="&debugMenu.label;">
<menupopup id="menu_debugPopup" onpopupshowing="updateDebugMenu();">
<menuitem type="checkbox" id="jitEnabled" label="&tracejitEnabled.label;" oncommand="toggleJITState(event.target, '');" hidden="true"/>
<menuitem type="checkbox" id="tracejitEnabled" label="&tracejitEnabled.label;" oncommand="toggleJITState(event.target, 'trace');"/>
<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>
- </menu>
- </menubar>
+ </toolbarbutton>
+ </toolbar>
</toolbox>
<panel id="imgSettingsPanel"
onpopupshowing="initImgSettings();"
</panel>
<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 id="mbrotImage" width="300" height="300">
</html:canvas>
<button id="drawButton" label="&fileDraw.label;" oncommand="drawImage();"/>
</stack>
<hbox pack="end" align="end">
<description id="statusLabel"/>
</hbox>
-</window>
+</page>
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>@INSTALL_EXTENSION_ID@</em:id>
+ <em:type>2</em:type>
<em:version>@EXTENSION_VERSION@</em:version>
<em:name>KaiRo.at Mandelbrot</em:name>
<em:description>Mandelbrot browser, based on highschool final thesis work of Robert Kaiser, but completely rewritten</em:description>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>4.0b9</em:minVersion>
- <em:maxVersion>7.0a1</em:maxVersion>
+ <em:maxVersion>10.0a1</em:maxVersion>
</Description>
</em:targetApplication>
<!-- SeaMonkey -->
<Description>
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
<em:minVersion>2.1b1</em:minVersion>
- <em:maxVersion>2.4a1</em:maxVersion>
+ <em:maxVersion>2.7a1</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Fennec -->
<Description>
<em:id>{a23983c0-fd0e-11dc-95ff-0800200c9a66}</em:id>
<em:minVersion>4.0b3</em:minVersion>
- <em:maxVersion>7.0a1</em:maxVersion>
+ <em:maxVersion>10.0a1</em:maxVersion>
</Description>
</em:targetApplication>
<!-- toolkit -->
<Description>
<em:id>toolkit@mozilla.org</em:id>
<em:minVersion>1.9.0</em:minVersion>
- <em:maxVersion>7.0a1</em:maxVersion>
+ <em:maxVersion>10.0</em:maxVersion>
</Description>
</em:targetApplication>
</Description>
% 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://navigator/content/navigator.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/fxOverlay.xul (extension/fxOverlay.xul)
- content/mandelbrot/mobileOverlay.xul (extension/mobileOverlay.xul)
- content/mandelbrot/smOverlay.xul (extension/smOverlay.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)
- 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)
- locale/@AB_CD@/mandelbrot/mandelbrot-overlay.dtd (xulapp/chrome/mandelbrot/locales/@AB_CD@/mandelbrot-overlay.dtd)
+ content/mandelbrot/mandelbrot.js (content/mandelbrot.js)
+ content/mandelbrot/mandelbrot.xul (content/mandelbrot.xul)
+ content/mandelbrot/fxOverlay.xul (content/fxOverlay.xul)
+ content/mandelbrot/mobileOverlay.xul (content/mobileOverlay.xul)
+ content/mandelbrot/smOverlay.xul (content/smOverlay.xul)
+ skin/classic/mandelbrot/mandelbrot.css (skin/classic/mandelbrot.css)
+ skin/classic/mandelbrot/mandelbrotIcon16.png (skin/classic/mandelbrotIcon16.png)
+ skin/classic/mandelbrot/mandelbrotIcon32.png (skin/classic/mandelbrotIcon32.png)
+ skin/classic/mandelbrot/mobileUI.css (skin/classic/mobileUI.css)
+ locale/@AB_CD@/mandelbrot/mandelbrot.dtd (locales/@AB_CD@/mandelbrot.dtd)
+ locale/@AB_CD@/mandelbrot/mandelbrot.properties (locales/@AB_CD@/mandelbrot.properties)
+ locale/@AB_CD@/mandelbrot/mandelbrot-overlay.dtd (locales/@AB_CD@/mandelbrot-overlay.dtd)
<!ENTITY windowTitle "&mbVendorShortName; &mbBrandShortName; &mbBrandVersion;">
-<!ENTITY fileMenu.label "File">
<!ENTITY fileDraw.label "Draw Image">
<!ENTITY fileSave.label "Save Image…">
-<!ENTITY fileQuit.label "Quit">
<!ENTITY bookmarkMenu.label "Locations">
<!ENTITY bookmarkOverview.label "Overview">
<!ENTITY algoMenu.label "Algorithm">
<!ENTITY algoNumeric.label "Numeric">
<!ENTITY algoOO.label "Object-Oriented">
-<!ENTITY errorConsole.label "Error Console">
-<!ENTITY addonsManager.label "Add-ons Manager">
<!-- Image Settings panel -->
<!ENTITY imageSettings.title "Image Settings">
+++ /dev/null
-#!/bin/sh
-
-# ***** 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
-# 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 *****
-
-progname="$0"
-curdir=`dirname "$progname"`
-app_ini="$curdir/xulapp/application.ini"
-
-if test -e "/opt/xulrunner-trunk/xulrunner"; then
- xulrunner="/opt/xulrunner-trunk/xulrunner"
-fi
-if test -z "$xulrunner" && test -e "/opt/firefox-trunk/firefox"; then
- xulrunner="/opt/firefox-trunk/firefox"
-fi
-if test -z "$xulrunner" && test -e "/usr/local/xulrunner/xulrunner"; then
- xulrunner="/usr/local/xulrunner/xulrunner"
-fi
-if test -z "$xulrunner"; then
- # catch the last one of those in versioned directories
- for xrbin in /usr/local/lib/xulrunner-*/xulrunner; do
- if test -e "$xrbin"; then
- xulrunner="$xrbin"
- fi
- done
-fi
-if test -z "$xulrunner"; then
- # catch the last one of those in versioned directories
- for xrbin in /opt/mozilla/xulrunner-*/xulrunner; do
- if test -e "$xrbin"; then
- xulrunner="$xrbin"
- fi
- done
-fi
-if test -z "$xulrunner"; then
- xulrunner=`which xulrunner`
-fi
-if test -z "$xulrunner"; then
- echo "XULRunner not found!"
- exit 1
-fi
-
-# add -jsconsole for debugging
-
-$xulrunner --app $app_ini $@
# for the specific language governing rights and limitations under the
# License.
#
-# The Original Code is KaiRo.at Mandelbrot, XULRunner version.
+# The Original Code is KaiRo-Mandelbrot.
#
# The Initial Developer of the Original Code is
# Robert Kaiser <kairo@kairo.at>.
-# Portions created by the Initial Developer are Copyright (C) 2008
+# Portions created by the Initial Developer are Copyright (C) 2011
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
-# Robert Kaiser <kairo@kairo.at>
+# 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
#
# ***** END LICENSE BLOCK *****
-brandFullName=Mandelbrot
-brandShortName=Mandelbrot
-vendorShortName=KaiRo.at
-app.releaseNotesURL=http://www.kairo.at/software/mandelbrot/
-app.vendorURL=http://www.kairo.at/
+DEPTH = ../../..
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+relativesrcdir = extensions/mandelbrot/tests
+
+include $(topsrcdir)/config/rules.mk
+
+_BROWSER_FILES = \
+ $(NULL)
+
+libs:: $(_BROWSER_FILES)
+ $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
+++ /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) 2008-2009
-; 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 *****
-
-[App]
-Vendor=KaiRo.at
-Name=Mandelbrot
-Version=4.0b2pre
-BuildID=2010052900
-Copyright=Copyright (c) 2008-2010 KaiRo.at
-ID=mandelbrot@kairo.at
-
-[Gecko]
-MinVersion=1.9.0
-MaxVersion=2.0.*
-
-[XRE]
-EnableExtensionManager=0
+++ /dev/null
-locale branding en-US branding/locales/en-US/
+++ /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) 2008
- - 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 ***** -->
-
-<!-- import actual branding names from app for addon compat -->
-<!ENTITY % mandelOverlayDTD SYSTEM "chrome://mandelbrot/locale/mandelbrot-overlay.dtd">
-%mandelOverlayDTD;
-
-<!ENTITY brandFullName "&mbBrandFullName;">
-<!ENTITY brandShortName "&mbBrandShortName;">
-<!ENTITY brandVersion "&mbVersion;">
-<!ENTITY vendorShortName "&mbVendorShortName;">
-<!ENTITY copyright.string "Copyright © 2008 KaiRo.at - Robert Kaiser IT-Services.">
+++ /dev/null
-content mandelbrot mandelbrot/content/
-locale mandelbrot en-US mandelbrot/locales/en-US/
-skin mandelbrot classic/1.0 mandelbrot/skin/classic/
+++ /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="jitEnabled" label="&tracejitEnabled.label;" oncommand="toggleJITState(event.target, '');" hidden="true"/>
- <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>
- </menupopup>
- </toolbarbutton>
- </toolbar>
- </toolbox>
- <panel id="imgSettingsPanel"
- onpopupshowing="initImgSettings();"
- onpopuphiding="saveImgSettings();">
- <!-- |titlebar="normal" noautohide="true" close="true" label="&imageSettings.title;"|
- doesn't seem to work on the panel, so work around with a <titlebar> instead -->
- <titlebar><label value="&imageSettings.title;"/></titlebar>
- <groupbox>
- <caption label="&coord.title;"/>
- <description value="&coord.real.label;" class="coord-caption"/>
- <hbox align="center">
- <label value="&coord.min.label;" control="is_Cr_min"/>
- <textbox id="is_Cr_min" size="10"
- onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'scale');"/>
- <label value="&coord.max.label;" control="is_Cr_max"/>
- <textbox id="is_Cr_max" size="10"
- onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'scale');"/>
- <label value="&coord.scale.label;" control="is_Cr_scale"/>
- <textbox id="is_Cr_scale" size="10"
- onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'max');"/>
- </hbox>
- <separator class="thin"/>
- <description value="&coord.imag.label;" class="coord-caption"/>
- <hbox align="center">
- <label value="&coord.min.label;" control="is_Ci_min"/>
- <textbox id="is_Ci_min" size="10"
- onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'scale');"/>
- <label value="&coord.max.label;" control="is_Ci_max"/>
- <textbox id="is_Ci_max" size="10"
- onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'scale');"/>
- <label value="&coord.scale.label;" control="is_Ci_scale"/>
- <textbox id="is_Ci_scale" size="10"
- onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'max');"/>
- </hbox>
- </groupbox>
-
- <hbox flex="1">
- <groupbox>
- <caption label="&img.size.title;"/>
- <hbox align="center">
- <label value="&img.width.label;" control="is_img_width"/>
- <textbox id="is_img_width" size="4"
- onchange="checkISValue(this, 'dim'); recalcCoord('Ci', 'scale');"/>
- </hbox>
- <hbox align="center">
- <label value="&img.height.label;" control="is_img_height"/>
- <textbox id="is_img_height" size="4"
- onchange="checkISValue(this, 'dim'); recalcCoord('Cr', 'scale');"/>
- </hbox>
- </groupbox>
-
- <groupbox>
- <caption label="&preview.title;"/>
- <hbox flex="1" pack="center" align="center">
- <html:canvas id="is_mbrotPreview" width="50" height="50"></html:canvas>
- </hbox>
- <button id="is_previewButton" label="&previewDraw.label;" oncommand="drawPreview();"/>
- </groupbox>
-
- <groupbox>
- <caption label="&options.title;"/>
- <hbox align="center">
- <checkbox id="is_syncProp"
- label="&syncProp.label;"
- onclick="checkProportions();"/>
- </hbox>
- </groupbox>
- </hbox>
- <hbox>
- <button id="is_closeButton" label="&closeSettings.label;" oncommand="closeImgSettings();"/>
- <spacer flex="1"/>
- <button id="is_drawButton" label="&drawImageButton.label;" oncommand="closeImgSettings(); drawImage();"/>
- </hbox>
- </panel>
- <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>