Shumway Inspector
Open File
@@ -166,7 +180,12 @@
+
+
diff --git a/examples/inspector/inspector.js b/examples/inspector/inspector.js
index 94f767bca..5e5e3fef3 100644
--- a/examples/inspector/inspector.js
+++ b/examples/inspector/inspector.js
@@ -65,13 +65,19 @@ var playerGlobalPath = "../../src/flash/playerGlobal.min.abc";
* when the page loads.
*/
if (rfile) {
+ $('#openFileToolbar')[0].setAttribute('hidden', true);
executeFile(rfile);
}
+function showMessage(msg) {
+ $('#message').text(msg);
+ $('#message')[0].parentElement.removeAttribute('hidden');
+}
+
function executeFile(file, buffer) {
// All execution paths must now load AVM2.
if (!state.compiler) {
- alert ("Running in the Interpreter");
+ showMessage("Running in the Interpreter");
}
var appMode = state.compiler ? EXECUTION_MODE.COMPILE : EXECUTION_MODE.INTERPRET;
if (file.endsWith(".abc")) {
diff --git a/examples/inspector/inspectorLoader.js b/examples/inspector/inspectorLoader.js
index df8c6b2f2..d6d14b37b 100644
--- a/examples/inspector/inspectorLoader.js
+++ b/examples/inspector/inspectorLoader.js
@@ -34,3 +34,6 @@ $("#openFile").click(function () {
$("#files").click();
});
+$(".closeButton").click(function (event) {
+ event.target.parentElement.setAttribute('hidden', true);
+});
diff --git a/examples/inspector/inspectorSettings.js b/examples/inspector/inspectorSettings.js
index d1a4db708..1ce53728b 100644
--- a/examples/inspector/inspectorSettings.js
+++ b/examples/inspector/inspectorSettings.js
@@ -1,5 +1,11 @@
function loadState() {
- return localStorage["Inspector-Settings"] ? JSON.parse(localStorage["Inspector-Settings"]): {};
+ return localStorage["Inspector-Settings"] ? JSON.parse(localStorage["Inspector-Settings"]) : {
+ compiler: true,
+ verifier: true,
+ optimizer: true,
+ inlineCaching: true,
+ release: true
+ };
}
function saveState(state) {
diff --git a/examples/inspector/style/style.css b/examples/inspector/style/style.css
index 0dd117015..565866fa6 100644
--- a/examples/inspector/style/style.css
+++ b/examples/inspector/style/style.css
@@ -1,4 +1,4 @@
-html
+html
{
height: 100%;
}
@@ -12,7 +12,7 @@ body {
@media screen and (-webkit-min-device-pixel-ratio:0) {
body {
- background: #1a2633;
+ background-color: #1a2633;
}
}
@@ -22,35 +22,50 @@ body {
}
.toolbarInfo {
- padding: 4px 8px;
- background: url(images/background-noise-toolbar.png),
- -moz-linear-gradient(hsl(210,11%,36%), hsl(210,11%,18%));
- border-radius: 4px;
- box-shadow: 0 1px 0 hsla(210,16%,76%,.2) inset,
- 0 0 0 1px hsla(0,0%,0%,.15),
- 0 10px 14px hsla(0,0%,0%,.4);
- font-family: Consolas, Lucida Grande, sans-serif;
+ font-family: Consolas, Lucida Grande, sans-serif;
- 0 0 0 1px hsla(210,16%,76%,.15) inset,
- 0 1px 0 hsla(210,16%,76%,.15);
- color: hsl(210,30%,85%);
- font-size: 10px;
- line-height: 22px;
- text-shadow: 0 -1px 0 hsla(210,8%,5%,.45);
- cursor: default;
-
- line-height: 1.2em;
- font-size: 11px;
-
- overflow-x: auto;
+ padding: 4px 8px;
+ background-image: url(images/background-noise-toolbar.png),
+ linear-gradient(hsl(210,11%,36%), hsl(210,11%,18%));
+ background-image: url(images/background-noise-toolbar.png),
+ -moz-linear-gradient(hsl(210,11%,36%), hsl(210,11%,18%));
+ background-image: url(images/background-noise-toolbar.png),
+ -webkit-linear-gradient(hsl(210,11%,36%), hsl(210,11%,18%));
+ background-image: url(images/background-noise-toolbar.png),
+ -o-linear-gradient(hsl(210,11%,36%), hsl(210,11%,18%));
+ background-image: url(images/background-noise-toolbar.png),
+ -ms-linear-gradient(hsl(210,11%,36%), hsl(210,11%,18%));
+ border-radius: 4px;
+ box-shadow: 0 1px 0 hsla(210,16%,76%,.2) inset,
+ 0 0 0 1px hsla(0,0%,0%,.15),
+ 0 10px 14px hsla(0,0%,0%,.4),
+ 0 0 0 1px hsla(210,16%,76%,.15) inset,
+ 0 1px 0 hsla(210,16%,76%,.15);
+ color: hsl(210,30%,85%);
+ font-size: 10px;
+ line-height: 22px;
+ text-shadow: 0 -1px 0 hsla(210,8%,5%,.45);
+ cursor: default;
+ line-height: 1.2em;
+ font-size: 11px;
+ overflow-x: auto;
}
.toolbarBox {
padding: 4px 8px;
width: 600px;
height: 24px;
+ background: url(images/background-noise-toolbar.png),
+ linear-gradient(hsl(210,11%,36%), hsl(210,11%,18%));
background: url(images/background-noise-toolbar.png),
-moz-linear-gradient(hsl(210,11%,36%), hsl(210,11%,18%));
+ background: url(images/background-noise-toolbar.png),
+ -webkit-linear-gradient(hsl(210,11%,36%), hsl(210,11%,18%));
+ background: url(images/background-noise-toolbar.png),
+ -o-linear-gradient(hsl(210,11%,36%), hsl(210,11%,18%));
+ background: url(images/background-noise-toolbar.png),
+ -ms-linear-gradient(hsl(210,11%,36%), hsl(210,11%,18%));
+ background: url(images/background-noise-toolbar.png),
border-radius: 4px;
box-shadow: 0 1px 0 hsla(210,16%,76%,.2) inset,
0 0 0 1px hsla(0,0%,0%,.15),
@@ -58,6 +73,24 @@ body {
font-family: Lucida Grande, sans-serif;
}
+.toolbarBox.withEmphasis {
+ background: url(images/background-noise-toolbar.png),
+ linear-gradient(hsl(0,51%,36%), hsl(0,51%,18%));
+ background: url(images/background-noise-toolbar.png),
+ -moz-linear-gradient(hsl(0,51%,36%), hsl(0,51%,18%));
+ background: url(images/background-noise-toolbar.png),
+ -webkit-linear-gradient(hsl(0,51%,36%), hsl(0,51%,18%));
+ background: url(images/background-noise-toolbar.png),
+ -o-linear-gradient(hsl(0,51%,36%), hsl(0,51%,18%));
+ background: url(images/background-noise-toolbar.png),
+ -ms-linear-gradient(hsl(0,51%,36%), hsl(0,51%,18%));
+ border-radius: 4px;
+ box-shadow: 0 1px 0 hsla(0,56%,76%,.2) inset,
+ 0 0 0 1px hsla(0,0%,0%,.15),
+ 0 10px 14px hsla(0,0%,0%,.4);
+ font-family: Lucida Grande, sans-serif;
+}
+
.closeButton {
float: left;
width: 16px;
@@ -75,19 +108,21 @@ body {
}
.toolbarLabel {
- float: left;
- width: 78px;
- height: 22px;
- margin-right: 10px;
- 0 0 0 1px hsla(210,16%,76%,.15) inset,
- 0 1px 0 hsla(210,16%,76%,.15);
- color: hsl(210,30%,85%);
- font-size: 12px;
- line-height: 22px;
- text-align: center;
- text-shadow: 0 -1px 0 hsla(210,8%,5%,.45);
- -moz-user-select: none;
- cursor: default;
+ float: left;
+ width: 78px;
+ height: 22px;
+ margin-right: 10px;
+ color: hsl(210,30%,85%);
+ font-size: 12px;
+ line-height: 22px;
+ text-align: center;
+ text-shadow: 0 -1px 0 hsla(210,8%,5%,.45);
+ user-select: none;
+ -moz-user-select: none;
+ -webkit-user-select: none;
+ -o-user-select: none;
+ -ms-user-select: none;
+ cursor: default;
}
.toolbarButton {
@@ -97,7 +132,11 @@ body {
margin-right: 10px;
border: 1px solid hsla(210,8%,5%,.45);
border-radius: 3px;
+ background: linear-gradient(hsla(212,7%,57%,.35), hsla(212,7%,57%,.1));
background: -moz-linear-gradient(hsla(212,7%,57%,.35), hsla(212,7%,57%,.1));
+ background: -webkit-linear-gradient(hsla(212,7%,57%,.35), hsla(212,7%,57%,.1));
+ background: -o-linear-gradient(hsla(212,7%,57%,.35), hsla(212,7%,57%,.1));
+ background: -ms-linear-gradient(hsla(212,7%,57%,.35), hsla(212,7%,57%,.1));
background-clip: padding-box;
box-shadow: 0 1px 0 hsla(210,16%,76%,.15) inset,
0 0 0 1px hsla(210,16%,76%,.15) inset,
@@ -107,13 +146,21 @@ body {
line-height: 22px;
text-align: center;
text-shadow: 0 -1px 0 hsla(210,8%,5%,.45);
+ user-select: none;
-moz-user-select: none;
+ -webkit-user-select: none;
+ -o-user-select: none;
+ -ms-user-select: none;
cursor: default;
}
.toolbarButton:not(.pressedState):hover:active {
border: 1px solid hsla(210,8%,5%,.6);
+ background: linear-gradient(hsla(220,6%,10%,.3), hsla(212,7%,57%,.15) 65%, hsla(212,7%,57%,.3));
background: -moz-linear-gradient(hsla(220,6%,10%,.3), hsla(212,7%,57%,.15) 65%, hsla(212,7%,57%,.3));
+ background: -webkit-linear-gradient(hsla(220,6%,10%,.3), hsla(212,7%,57%,.15) 65%, hsla(212,7%,57%,.3));
+ background: -o-linear-gradient(hsla(220,6%,10%,.3), hsla(212,7%,57%,.15) 65%, hsla(212,7%,57%,.3));
+ background: -ms-linear-gradient(hsla(220,6%,10%,.3), hsla(212,7%,57%,.15) 65%, hsla(212,7%,57%,.3));
box-shadow: 0 0 3px hsla(210,8%,5%,.25) inset,
0 1px 3px hsla(210,8%,5%,.25) inset,
0 1px 0 hsla(210,16%,76%,.15);
@@ -121,7 +168,11 @@ body {
.toolbarButton.pressedState {
border: 1px solid hsla(210,8%,5%,.6);
+ background: linear-gradient(hsla(220,6%,10%,.6), hsla(210,11%,18%,.45) 75%, hsla(210,11%,30%,.4));
background: -moz-linear-gradient(hsla(220,6%,10%,.6), hsla(210,11%,18%,.45) 75%, hsla(210,11%,30%,.4));
+ background: -webkit-linear-gradient(hsla(220,6%,10%,.6), hsla(210,11%,18%,.45) 75%, hsla(210,11%,30%,.4));
+ background: -o-linear-gradient(hsla(220,6%,10%,.6), hsla(210,11%,18%,.45) 75%, hsla(210,11%,30%,.4));
+ background: -ms-linear-gradient(hsla(220,6%,10%,.6), hsla(210,11%,18%,.45) 75%, hsla(210,11%,30%,.4));
box-shadow: 0 1px 3px hsla(210,8%,5%,.25) inset,
0 1px 3px hsla(210,8%,5%,.25) inset,
0 1px 0 hsla(210,16%,76%,.15);
@@ -142,7 +193,11 @@ body {
line-height: 22px;
text-align: center;
text-shadow: 0 -1px 0 hsla(210,8%,5%,.45);
+ user-select: none;
-moz-user-select: none;
+ -webkit-user-select: none;
+ -o-user-select: none;
+ -ms-user-select: none;
cursor: default;
}
@@ -151,10 +206,18 @@ body {
padding: 0 4px;
height: 24px;
border-width: 0 13px 0 8px;
+ border-image: url(images/breadcrumb-mac-start.png) 0 13 0 8 repeat;
-moz-border-image: url(images/breadcrumb-mac-start.png) 0 13 0 8 repeat;
+ -webkit-border-image: url(images/breadcrumb-mac-start.png) 0 13 0 8 repeat;
+ -o-border-image: url(images/breadcrumb-mac-start.png) 0 13 0 8 repeat;
+ -ms-border-image: url(images/breadcrumb-mac-start.png) 0 13 0 8 repeat;
}
.breadcrumbBarStart:hover:active {
+ border-image: url(images/breadcrumb-mac-start-pressed.png) 0 13 0 8 repeat;
-moz-border-image: url(images/breadcrumb-mac-start-pressed.png) 0 13 0 8 repeat;
+ -webkit-border-image: url(images/breadcrumb-mac-start-pressed.png) 0 13 0 8 repeat;
+ -o-border-image: url(images/breadcrumb-mac-start-pressed.png) 0 13 0 8 repeat;
+ -ms-border-image: url(images/breadcrumb-mac-start-pressed.png) 0 13 0 8 repeat;
}
.breadcrumbBarMiddle {
@@ -163,10 +226,18 @@ body {
float: left;
height: 24px;
border-width: 0 13px;
+ border-image: url(images/breadcrumb-mac-middle.png) 0 13 0 13 repeat;
+ -moz-border-image: url(images/breadcrumb-mac-middle.png) 0 13 0 13 repeat;
+ -webkit-border-image: url(images/breadcrumb-mac-middle.png) 0 13 0 13 repeat;
+ -o-border-image: url(images/breadcrumb-mac-middle.png) 0 13 0 13 repeat;
-moz-border-image: url(images/breadcrumb-mac-middle.png) 0 13 0 13 repeat;
}
.breadcrumbBarMiddle:hover:active {
+ border-image: url(images/breadcrumb-mac-middle-pressed.png) 0 13 0 13 repeat;
-moz-border-image: url(images/breadcrumb-mac-middle-pressed.png) 0 13 0 13 repeat;
+ -webkit-border-image: url(images/breadcrumb-mac-middle-pressed.png) 0 13 0 13 repeat;
+ -o-border-image: url(images/breadcrumb-mac-middle-pressed.png) 0 13 0 13 repeat;
+ -ms-border-image: url(images/breadcrumb-mac-middle-pressed.png) 0 13 0 13 repeat;
}
.breadcrumbBarEnd {
@@ -175,37 +246,70 @@ body {
float: left;
height: 24px;
border-width: 0 8px 0 13px;
+ border-image: url(images/breadcrumb-mac-end-selected.png) 0 8 0 13 repeat;
-moz-border-image: url(images/breadcrumb-mac-end-selected.png) 0 8 0 13 repeat;
+ -webkit-border-image: url(images/breadcrumb-mac-end-selected.png) 0 8 0 13 repeat;
+ -o-border-image: url(images/breadcrumb-mac-end-selected.png) 0 8 0 13 repeat;
+ -ms-border-image: url(images/breadcrumb-mac-end-selected.png) 0 8 0 13 repeat;
color: hsl(208,100%,60%);
}
.breadcrumbBarEnd:hover:active {
+ border-image: url(images/breadcrumb-mac-end-selected-pressed.png) 0 8 0 13 repeat;
-moz-border-image: url(images/breadcrumb-mac-end-selected-pressed.png) 0 8 0 13 repeat;
+ -webkit-border-image: url(images/breadcrumb-mac-end-selected-pressed.png) 0 8 0 13 repeat;
+ -o-border-image: url(images/breadcrumb-mac-end-selected-pressed.png) 0 8 0 13 repeat;
+ -ms-border-image: url(images/breadcrumb-mac-end-selected-pressed.png) 0 8 0 13 repeat;
}
-
.textInput {
- float: left;
- -moz-appearance: none;
- margin: 0 3px;
- background-color: transparent;
- height: 22px;
- border: 1px solid hsla(210,8%,5%,.6);
- border-radius: 6px;
- background-image: -moz-linear-gradient(hsla(210,16%,76%,.15), hsla(210,16%,76%,.35));
- background-repeat: no-repeat;
- background-position: 4px center, top left, top left;
- padding-top: 0;
- padding-bottom: 0;
- -moz-padding-start: 10px;
- -moz-padding-end: 4px;
- box-shadow: 0 1px 1px hsla(210,8%,5%,.3) inset,
- 0 0 0 1px hsla(210,16%,76%,.1) inset,
- 0 1px 0 hsla(210,16%,76%,.15);
- color: hsl(210,30%,85%);
- font-weight: bolder;
-
+ float: left;
+ appearance: none;
+ -moz-appearance: none;
+ -webkit-appearance: none;
+ -o-appearance: none;
+ -ms-appearance: none;
+ margin: 0 3px;
+ background-color: transparent;
+ height: 22px;
+ border: 1px solid hsla(210,8%,5%,.6);
+ border-radius: 6px;
+ background-image: linear-gradient(hsla(210,16%,76%,.15), hsla(210,16%,76%,.35));
+ background-image: -moz-linear-gradient(hsla(210,16%,76%,.15), hsla(210,16%,76%,.35));
+ background-image: -webkit-linear-gradient(hsla(210,16%,76%,.15), hsla(210,16%,76%,.35));
+ background-image: -o-linear-gradient(hsla(210,16%,76%,.15), hsla(210,16%,76%,.35));
+ background-image: -ms-linear-gradient(hsla(210,16%,76%,.15), hsla(210,16%,76%,.35));
+ background-repeat: no-repeat;
+ background-position: 4px center, top left, top left;
+ padding-top: 0;
+ padding-bottom: 0;
+ padding-start: 10px;
+ -moz-padding-start: 10px;
+ -webkit-padding-start: 10px;
+ -o-padding-start: 10px;
+ -ms-padding-start: 10px;
+ padding-end: 4px;
+ -moz-padding-end: 4px;
+ -webkit-padding-end: 4px;
+ -o-padding-end: 4px;
+ -ms-padding-end: 4px;
+ box-shadow: 0 1px 1px hsla(210,8%,5%,.3) inset,
+ 0 0 0 1px hsla(210,16%,76%,.1) inset,
+ 0 1px 0 hsla(210,16%,76%,.15);
+ color: hsl(210,30%,85%);
+ font-weight: bolder;
}
.textInput:-moz-locale-dir(rtl) {
- background-position: calc(100% - 4px) center, top left, top left;
+ background-position: calc(100% - 4px) center, top left, top left;
+}
+
+#stage {
+ float: left;
+}
+
+#xstats {
+ position: absolute;
+ right: 0;
+ top: 0;
+ z-index: 1;
}
diff --git a/examples/pac/pac.fla b/examples/pac/pac.fla
index 7aa7573d7..7d7ee847c 100644
Binary files a/examples/pac/pac.fla and b/examples/pac/pac.fla differ
diff --git a/examples/pac/pac.swf b/examples/pac/pac.swf
index df6faf768..cf9ab3c42 100644
Binary files a/examples/pac/pac.swf and b/examples/pac/pac.swf differ
diff --git a/examples/racing/avm2utils.js b/examples/racing/avm2utils.js
new file mode 100644
index 000000000..c00ebe66d
--- /dev/null
+++ b/examples/racing/avm2utils.js
@@ -0,0 +1,61 @@
+enableVerifier.value = true;
+enableOpt.value = true;
+enableInlineCaching.value = true;
+release = true;
+
+var avm2Root = SHUMWAY_ROOT + "avm2/";
+var builtinPath = avm2Root + "generated/builtin/builtin.abc";
+var libraryPath = avm2Root + "generated/shell/shell.abc";
+var playerGlobalPath = SHUMWAY_ROOT + "flash/playerGlobal.min.abc";
+
+var BinaryFileReader = (function binaryFileReader() {
+ function constructor(url, responseType) {
+ this.url = url;
+ this.responseType = responseType || "arraybuffer";
+ }
+
+ constructor.prototype = {
+ readAll: function(progress, complete) {
+ var xhr = new XMLHttpRequest();
+ var async = true;
+ xhr.open("GET", this.url, async);
+ xhr.responseType = this.responseType;
+ if (progress) {
+ xhr.onprogress = function(event) {
+ progress(xhr.response, event.loaded, event.total);
+ };
+ }
+ xhr.onreadystatechange = function(event) {
+ if (xhr.readyState === 4) {
+ if (xhr.status !== 200 && xhr.status !== 0) {
+ complete(null, xhr.statusText);
+ return;
+ }
+ complete(xhr.response);
+ }
+ }
+ xhr.setRequestHeader("If-Modified-Since", "Fri, 01 Jan 1960 00:00:00 GMT"); // no-cache
+ xhr.send(null);
+ }
+ };
+ return constructor;
+})();
+
+// avm2 must be global.
+var avm2;
+
+function createAVM2(builtinPath, libraryPath, sysMode, appMode, next) {
+ assert (builtinPath);
+ new BinaryFileReader(builtinPath).readAll(null, function (buffer) {
+ avm2 = new AVM2(sysMode, appMode);
+ avm2.systemDomain.executeAbc(new AbcFile(new Uint8Array(buffer), "builtin.abc"));
+ if (libraryPath) {
+ new BinaryFileReader(libraryPath).readAll(null, function (buffer) {
+ avm2.systemDomain.executeAbc(new AbcFile(new Uint8Array(buffer), libraryPath));
+ next(avm2);
+ });
+ } else {
+ next(avm2);
+ }
+ });
+}
diff --git a/examples/racing/index.html b/examples/racing/index.html
index b5c8d25f3..10daf0870 100644
--- a/examples/racing/index.html
+++ b/examples/racing/index.html
@@ -24,9 +24,10 @@
color: Yellow;
}
-
-
-
+
+
@@ -50,9 +51,6 @@
-
-
-
@@ -61,29 +59,108 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+