better error message

better error message

Change-Id: I193031f95a56a5304edb3ead20248f05b67816b4

--- WeaveUI/src/weave/Weave.as
+++ WeaveUI/src/weave/Weave.as
@@ -1,96 +1,96 @@
-/*
-    Weave (Web-based Analysis and Visualization Environment)
-    Copyright (C) 2008-2011 University of Massachusetts Lowell
-
-    This file is a part of Weave.
-
-    Weave is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License, Version 3,
-    as published by the Free Software Foundation.
-
-    Weave is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with Weave.  If not, see <http://www.gnu.org/licenses/>.
+/*
+    Weave (Web-based Analysis and Visualization Environment)
+    Copyright (C) 2008-2011 University of Massachusetts Lowell
+
+    This file is a part of Weave.
+
+    Weave is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License, Version 3,
+    as published by the Free Software Foundation.
+
+    Weave is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Weave.  If not, see <http://www.gnu.org/licenses/>.
 */

 package weave
-{
-	import flash.display.BitmapData;
-	import flash.events.Event;
-	import flash.external.ExternalInterface;
-	import flash.net.SharedObject;
-	import flash.utils.ByteArray;
-	import flash.utils.getQualifiedClassName;
-
-	import mx.core.UIComponent;
-	import mx.graphics.codec.PNGEncoder;
-	import mx.rpc.events.FaultEvent;
-	import mx.rpc.events.ResultEvent;
-	import mx.utils.UIDUtil;
-
-	import weave.api.WeaveAPI;
-	import weave.api.WeaveArchive;
-	import weave.api.core.ILinkableHashMap;
-	import weave.api.core.ILinkableObject;
-	import weave.api.getCallbackCollection;
-	import weave.api.reportError;
-	import weave.api.ui.IVisTool;
-	import weave.compiler.StandardLib;
-	import weave.core.ClassUtils;
-	import weave.core.LibraryUtils;
-	import weave.core.LinkableHashMap;
-	import weave.core.SessionStateLog;
-	import weave.core.WeaveXMLDecoder;
-	import weave.core.WeaveXMLEncoder;
-	import weave.data.AttributeColumns.BinnedColumn;
-	import weave.data.AttributeColumns.ColorColumn;
-	import weave.data.AttributeColumns.FilteredColumn;
-	import weave.data.KeySets.KeyFilter;
-	import weave.data.KeySets.KeySet;
-	import weave.utils.BitmapUtils;
-	import weave.utils.VectorUtils;
+{
+	import flash.display.BitmapData;
+	import flash.events.Event;
+	import flash.external.ExternalInterface;
+	import flash.net.SharedObject;
+	import flash.utils.ByteArray;
+	import flash.utils.getQualifiedClassName;
+
+	import mx.core.UIComponent;
+	import mx.graphics.codec.PNGEncoder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+	import mx.utils.UIDUtil;
+
+	import weave.api.WeaveAPI;
+	import weave.api.WeaveArchive;
+	import weave.api.core.ILinkableHashMap;
+	import weave.api.core.ILinkableObject;
+	import weave.api.getCallbackCollection;
+	import weave.api.reportError;
+	import weave.api.ui.IVisTool;
+	import weave.compiler.StandardLib;
+	import weave.core.ClassUtils;
+	import weave.core.LibraryUtils;
+	import weave.core.LinkableHashMap;
+	import weave.core.SessionStateLog;
+	import weave.core.WeaveXMLDecoder;
+	import weave.core.WeaveXMLEncoder;
+	import weave.data.AttributeColumns.BinnedColumn;
+	import weave.data.AttributeColumns.ColorColumn;
+	import weave.data.AttributeColumns.FilteredColumn;
+	import weave.data.KeySets.KeyFilter;
+	import weave.data.KeySets.KeySet;
+	import weave.utils.BitmapUtils;
+	import weave.utils.VectorUtils;

 	/**
 	 * Weave contains objects created dynamically from a session state.
 	 */
 	public class Weave
 	{
-		MXClasses; // Referencing this allows all Flex classes to be dynamically created at runtime.
-
-		public static var ALLOW_PLUGINS:Boolean = false; // TEMPORARY
-
-		public static var debug:Boolean = false;
-
-
-		private static var _root:ILinkableHashMap = null; // root object of Weave
+		MXClasses; // Referencing this allows all Flex classes to be dynamically created at runtime.
+
+		public static var ALLOW_PLUGINS:Boolean = false; // TEMPORARY
+
+		public static var debug:Boolean = false;
+
+
+		private static var _root:ILinkableHashMap = null; // root object of Weave
 		private static var _history:SessionStateLog = null; // root session history

 		/**
 		 * This is the root object in Weave, which is an ILinkableHashMap.
 		 */
 		public static function get root():ILinkableHashMap
-		{
+		{
 			if (_root == null)
-			{
-				_root = WeaveAPI.globalHashMap;
+			{
+				_root = WeaveAPI.globalHashMap;
 				createDefaultObjects(_root);
-				_history = new SessionStateLog(_root, 100);
-			}
-			return _root;
-		}
-
-		/**
-		 * This is a log of all previous session states
-		 */
-		public static function get history():SessionStateLog
-		{
-			if (!root) // this check will initialize the _history variable
-				throw "unexpected";
-			return _history;
+				_history = new SessionStateLog(_root, 100);
+			}
+			return _root;
+		}
+
+		/**
+		 * This is a log of all previous session states
+		 */
+		public static function get history():SessionStateLog
+		{
+			if (!root) // this check will initialize the _history variable
+				throw "unexpected";
+			return _history;
 		}

 		/**
@@ -99,16 +99,16 @@
 		public static function get properties():WeaveProperties
 		{
 			return root.getObject(DEFAULT_WEAVE_PROPERTIES) as WeaveProperties;
-		}
-
+		}
+
 		/**
 		 * This function gets the XML representation of the global session state.
 		 */
 		public static function getSessionStateXML():XML
-		{
-			var xml:XML = WeaveXMLEncoder.encode(root.getSessionState(), "Weave");
-			if (ALLOW_PLUGINS)
-				xml.@plugins = WeaveAPI.CSVParser.createCSV([getPluginList()]);
+		{
+			var xml:XML = WeaveXMLEncoder.encode(root.getSessionState(), "Weave");
+			if (ALLOW_PLUGINS)
+				xml.@plugins = WeaveAPI.CSVParser.createCSV([getPluginList()]);
 			return xml;
 		}

@@ -117,31 +117,31 @@
 		public static const DEFAULT_COLOR_COLUMN:String = "defaultColorColumn";
 		public static const DEFAULT_COLOR_BIN_COLUMN:String = "defaultColorBinColumn";
 		public static const DEFAULT_COLOR_DATA_COLUMN:String = "defaultColorDataColumn";
-
+
 		public static const DEFAULT_SUBSET_KEYFILTER:String = "defaultSubsetKeyFilter";
 		public static const DEFAULT_SELECTION_KEYSET:String = "defaultSelectionKeySet";
 		public static const DEFAULT_PROBE_KEYSET:String = "defaultProbeKeySet";
 		public static const ALWAYS_HIGHLIGHT_KEYSET:String = "alwaysHighlightKeySet";
 		public static const SAVED_SELECTION_KEYSETS:String = "savedSelections";
-		public static const SAVED_SUBSETS_KEYFILTERS:String = "savedSubsets";
-
-		public static function get defaultColorColumn():ColorColumn { return root.getObject(DEFAULT_COLOR_COLUMN) as ColorColumn; }
-		public static function get defaultColorBinColumn():BinnedColumn { return root.getObject(DEFAULT_COLOR_BIN_COLUMN) as BinnedColumn; }
-		public static function get defaultColorDataColumn():FilteredColumn { return root.getObject(DEFAULT_COLOR_DATA_COLUMN) as FilteredColumn; }
-
-		public static function get defaultSubsetKeyFilter():KeyFilter { return root.getObject(DEFAULT_SUBSET_KEYFILTER) as KeyFilter; }
-		public static function get defaultSelectionKeySet():KeySet { return root.getObject(DEFAULT_SELECTION_KEYSET) as KeySet; }
-		public static function get defaultProbeKeySet():KeySet { return root.getObject(DEFAULT_PROBE_KEYSET) as KeySet; }
-		public static function get alwaysHighlightKeySet():KeySet { return root.getObject(ALWAYS_HIGHLIGHT_KEYSET) as KeySet; }
-		public static function get savedSelectionKeySets():LinkableHashMap { return root.getObject(SAVED_SELECTION_KEYSETS) as LinkableHashMap; }
-		public static function get savedSubsetsKeyFilters():LinkableHashMap { return root.getObject(SAVED_SUBSETS_KEYFILTERS) as LinkableHashMap; }
-
+		public static const SAVED_SUBSETS_KEYFILTERS:String = "savedSubsets";
+
+		public static function get defaultColorColumn():ColorColumn { return root.getObject(DEFAULT_COLOR_COLUMN) as ColorColumn; }
+		public static function get defaultColorBinColumn():BinnedColumn { return root.getObject(DEFAULT_COLOR_BIN_COLUMN) as BinnedColumn; }
+		public static function get defaultColorDataColumn():FilteredColumn { return root.getObject(DEFAULT_COLOR_DATA_COLUMN) as FilteredColumn; }
+
+		public static function get defaultSubsetKeyFilter():KeyFilter { return root.getObject(DEFAULT_SUBSET_KEYFILTER) as KeyFilter; }
+		public static function get defaultSelectionKeySet():KeySet { return root.getObject(DEFAULT_SELECTION_KEYSET) as KeySet; }
+		public static function get defaultProbeKeySet():KeySet { return root.getObject(DEFAULT_PROBE_KEYSET) as KeySet; }
+		public static function get alwaysHighlightKeySet():KeySet { return root.getObject(ALWAYS_HIGHLIGHT_KEYSET) as KeySet; }
+		public static function get savedSelectionKeySets():LinkableHashMap { return root.getObject(SAVED_SELECTION_KEYSETS) as LinkableHashMap; }
+		public static function get savedSubsetsKeyFilters():LinkableHashMap { return root.getObject(SAVED_SUBSETS_KEYFILTERS) as LinkableHashMap; }
+
 		/**
 		 * This initializes a default set of objects in an ILinkableHashMap.
 		 */
 		private static function createDefaultObjects(target:ILinkableHashMap):void
 		{
-			target.requestObject(DEFAULT_WEAVE_PROPERTIES, WeaveProperties, true);
+			target.requestObject(DEFAULT_WEAVE_PROPERTIES, WeaveProperties, true);

 			// default color column
 			var cc:ColorColumn = target.requestObject(DEFAULT_COLOR_COLUMN, ColorColumn, true);
@@ -153,336 +153,345 @@
 			var subset:KeyFilter = target.requestObject(DEFAULT_SUBSET_KEYFILTER, KeyFilter, true);
 			subset.includeMissingKeys.value = true; // default subset should include all keys
 			target.requestObject(DEFAULT_SELECTION_KEYSET, KeySet, true);
-			var probe:KeySet = target.requestObject(DEFAULT_PROBE_KEYSET, KeySet, true);
-			var always:KeySet = target.requestObject(ALWAYS_HIGHLIGHT_KEYSET, KeySet, true);
-			var callback:Function = function():void { probe.addKeys(always.keys); };
-			probe.addImmediateCallback(always, callback);
-			always.addImmediateCallback(probe, callback);
+			var probe:KeySet = target.requestObject(DEFAULT_PROBE_KEYSET, KeySet, true);
+			var always:KeySet = target.requestObject(ALWAYS_HIGHLIGHT_KEYSET, KeySet, true);
+			var callback:Function = function():void { probe.addKeys(always.keys); };
+			probe.addImmediateCallback(always, callback);
+			always.addImmediateCallback(probe, callback);

 			target.requestObject(SAVED_SELECTION_KEYSETS, LinkableHashMap, true);
 			target.requestObject(SAVED_SUBSETS_KEYFILTERS, LinkableHashMap, true);
 		}
-
-
-
-		/******************************************************************************************/
-
-		private static const THUMBNAIL_SIZE:int = 200;
-		private static const ARCHIVE_THUMBNAIL_PNG:String = "thumbnail.png";
-		private static const ARCHIVE_PLUGINS_AMF:String = "plugins.amf";
-		private static const ARCHIVE_HISTORY_AMF:String = "history.amf";
-		private static const _pngEncoder:PNGEncoder = new PNGEncoder();
-
-		private static var _pluginList:Array = [];
-
-		/**
-		 * @return A copy of the list of plugins currently loaded.
-		 */
-		public static function getPluginList():Array
-		{
-			return _pluginList.concat();
-		}
-
-		/**
-		 * This function will alter the list of plugins.  If plugins need to be unloaded, externalReload() will be called.
-		 * @param newPluginList A new full list of plugins that should be loaded.
-		 * @param newWeaveContent The new Weave file content to load after plugins have been loaded.
-		 * @return true if the plugins are already loaded.
-		 */
-		public static function setPluginList(newPluginList:Array, newWeaveContent:Object):Boolean
-		{
-			if (debug)
-				reportError("setPluginList " + newPluginList);
-			// remove duplicates
-			var array:Array = [];
-			for (i = 0; i < newPluginList.length; i++)
-				if (array.indexOf(newPluginList[i]) < 0)
-					array.push(newPluginList[i]);
-			newPluginList = array;
-			// stop if no change
-			if (StandardLib.arrayCompare(_pluginList, newPluginList) == 0)
-			{
-				return true;
-			}
-
-			var i:int;
-			var needReload:Boolean = false;
-			if (newPluginList.length < _pluginList.length)
-			{
-				// need to unload plugins
-				needReload = true;
-			}
-			else
-			{
-				// check if order changed
-				for (i = 0; i < _pluginList.length; i++)
-				{
-					if (_pluginList[i] != newPluginList[i])
-						needReload = true;
-				}
-			}
-
-			// save new plugin list
-			_pluginList = newPluginList;
-
-			if (needReload)
-			{
-				externalReload(newWeaveContent);
-			}
-			else
-			{
-				// load missing plugins
-				var remaining:int = _pluginList.length;
-				var ILinkableObject_classQName:String = getQualifiedClassName(ILinkableObject);
-				var IVisTool_classQName:String = getQualifiedClassName(IVisTool);
-
-				function handlePlugin(event:Event, token:Object = null):void
-				{
-					var resultEvent:ResultEvent = event as ResultEvent;
-					var faultEvent:FaultEvent = event as FaultEvent;
-					if (resultEvent)
-					{
-						trace("Loaded plugin:", token);
-						var classQNames:Array = resultEvent.result as Array;
-						for (var i:int = 0; i < classQNames.length; i++)
-						{
-							var classQName:String = classQNames[i];
-							// check if it implements ILinkableObject
-							if (ClassUtils.classImplements(classQName, ILinkableObject_classQName))
-							{
-								trace(classQName);
-							}
-						}
-					}
-					else
-					{
-						if (debug)
-							reportError("Plugin failed to load: " + token);
-						trace("Plugin failed to load:", token);
-						reportError(faultEvent.fault);
-					}
-
-					remaining--;
-					if (debug)
-						reportError('remaining '+remaining);
-					if (remaining == 0)
-						loadWeaveFileContent(newWeaveContent);
-				}
-				if (remaining > 0)
-				{
-					for each (var plugin:String in _pluginList)
-					{
-						LibraryUtils.loadSWC(plugin, handlePlugin, handlePlugin, plugin);
-					}
-				}
-				else
-				{
-					reportError("Unexpected");
-					loadWeaveFileContent(newWeaveContent);
-				}
-			}
-			return false;
-		}
-
-		/**
-		 * This will change an ".xml" extension to ".weave" in a file name.
-		 * @param fileName A file name to fix.
-		 * @return A file name ending in ".weave".
-		 */
-		public static function fixWeaveFileName(fileName:String, useWeaveExtension:Boolean):String
-		{
-			var _xml:String = '.xml';
-			var _weave:String = '.weave';
-			var oldExt:String = useWeaveExtension ? _xml : _weave;
-			var newExt:String = useWeaveExtension ? _weave : _xml;
-
-			if (fileName.substr(-oldExt.length).toLowerCase() == oldExt)
-				fileName = fileName.substr(0, -oldExt.length);
-			if (fileName.substr(-newExt.length).toLowerCase() != newExt)
-				fileName += newExt;
-			return fileName;
-		}
-
-		/**
-		 * This function will create an object that can be saved to a file and recalled later with loadWeaveFileContent().
-		 */
-		public static function createWeaveFileContent():ByteArray
-		{
-			// thumbnail should go first in the stream because we will often just want to extract the thumbnail and nothing else.
-			var output:WeaveArchive = new WeaveArchive();
-
-			// screenshot thumbnail
-			try
-			{
-				var _thumbnail:BitmapData = BitmapUtils.getBitmapDataFromComponent(WeaveAPI.topLevelApplication as UIComponent, THUMBNAIL_SIZE, THUMBNAIL_SIZE);
-				output.files[ARCHIVE_THUMBNAIL_PNG] = _pngEncoder.encode(_thumbnail);
-			}
-			catch (e:SecurityError)
-			{
-				reportError(e, "Unable to create screenshot due to lack of permissive policy file for embedded image. " + e.message);
-			}
-
-			if (Weave.ALLOW_PLUGINS)
-				output.objects[ARCHIVE_PLUGINS_AMF] = _pluginList;
-
-			// session history
-			var _history:Object = history.getSessionState();
-			output.objects[ARCHIVE_HISTORY_AMF] = _history;
-
-			return output.serialize();
-		}
-
-		/**
-		 * This function will load content that was previously created with createWeaveFileContent().
-		 * @param content The contents of a Weave file.
-		 */
-		public static function loadWeaveFileContent(content:Object):void
-		{
-			if (debug)
-				reportError("loadWeaveFileContent",null,arguments);
-			var plugins:Array;
-			if (content is String)
-				content = XML(content);
-			if (content is XML)
-			{
-				// we must wait until all plugins are loaded before trying to decode the session state xml
-				var xml:XML = content as XML;
-				plugins = VectorUtils.flatten(WeaveAPI.CSVParser.parseCSV(xml.@plugins), []);
-				if (setPluginList(plugins, content))
-				{
-					var newState:Array = WeaveXMLDecoder.decodeDynamicState(xml);
-					root.setSessionState(newState, true);
-					// begin with empty history after loading the session state from the xml
-					history.clearHistory();
-				}
-			}
-			else if (content)
-			{
-				if (content is ByteArray)
-					content = new WeaveArchive(content as ByteArray);
-
-				var archive:WeaveArchive = content as WeaveArchive;
-				var _history:Object = archive.objects[ARCHIVE_HISTORY_AMF];
-				if (!_history)
-					throw new Error("Weave session history not found.");
-
-				plugins = archive.objects[ARCHIVE_PLUGINS_AMF] as Array || [];
-				if (setPluginList(plugins, content))
-				{
-					history.setSessionState(_history);
-				}
-			}
-
-			// hack for forcing VisApplication menu to refresh
-			getCallbackCollection(Weave.properties).triggerCallbacks();
-		}
-
-		private static const WEAVE_RELOAD_SHARED_OBJECT:String = "WeaveExternalReload";
-
-		/**
-		 * This function will restart the Flash application by reloading the SWF that is embedded in the browser window.
-		 */
-		public static function externalReload(weaveContent:Object = null):void
-		{
-			if (!weaveContent)
-				weaveContent = createWeaveFileContent();
-
-			var obj:SharedObject = SharedObject.getLocal(WEAVE_RELOAD_SHARED_OBJECT);
-			var uid:String = WEAVE_RELOAD_SHARED_OBJECT;
-			if (ExternalInterface.objectID)
-			{
-				// generate uid to be saved in parent node
-				uid = UIDUtil.createUID();
-			}
-
-			// save session history to shared object
-			if (weaveContent is XML)
-				weaveContent = (weaveContent as XML).toXMLString();
-			if (weaveContent is WeaveArchive)
-				weaveContent = (weaveContent as WeaveArchive).serialize();
-			obj.data[uid] = { date: new Date(), content: weaveContent };
-			obj.flush();
-			obj.close();
-
-			// reload the application
-			ExternalInterface.call(
-				"function(objectID, reloadID) {" +
-				"  if (objectID) {" +
-				"    var p = document.getElementById(objectID).parentNode;" +
-				"    p.weaveReloadID = reloadID;" +
-				"    p.innerHTML = p.innerHTML;" +
-				"  }" +
-				"  else {" +
-				"    location.reload(false);" +
-				"  }" +
-				"}",
-				ExternalInterface.objectID,
-				uid
-			);
-		}
-
-		/**
-		 * This function should be called when the application starts to restore session history after reloading the application.
-		 * @return true if the application was reloaded from within.
-		 */
-		public static function handleWeaveReload():Boolean
-		{
-			var obj:SharedObject = SharedObject.getLocal(WEAVE_RELOAD_SHARED_OBJECT);
-			var flush:Boolean = false;
-			var uid:String = WEAVE_RELOAD_SHARED_OBJECT;
-			if (ExternalInterface.objectID)
-			{
-				// get uid that was previously saved in parent node
-				uid = ExternalInterface.call(
-					"function(objectID) {" +
-					"  var p = document.getElementById(objectID).parentNode;" +
-					"  var reloadID = p.weaveReloadID;" +
-					"  p.weaveReloadID = undefined;" +
-					"  return reloadID;" +
-					"}",
-					ExternalInterface.objectID
-				);
-			}
-
-			// get session history from shared object
-			var saved:Object = obj.data[uid];
-			if (debug)
-				reportError("handleWeaveReload", null, saved);
-			if (saved)
-			{
-				// delete session history from shared object
-				delete obj.data[uid];
-				flush = true;
-
-				// restore old session history
-				loadWeaveFileContent(saved.content);
-			}
-
-			// delete all old saved data
-			const EXPIRATION_TIME:int = 5 * 60 * 1000; // minutes
-			var date:Date = new Date();
-			for (uid in obj.data)
-			{
-				try
-				{
-					if (date.getTime() - obj.data[uid].date.getTime() < EXPIRATION_TIME)
-						continue;
-				}
-				catch (e:Error)
-				{
-					// ignore error, entry will be deleted
-				}
-
-				delete obj.data[uid];
-				flush = true;
-			}
-
-			// save changes to shared object
-			if (flush)
-				obj.flush();
-			obj.close();
-
-			return saved != null;
-		}
+
+
+
+		/******************************************************************************************/
+
+		private static const THUMBNAIL_SIZE:int = 200;
+		private static const ARCHIVE_THUMBNAIL_PNG:String = "thumbnail.png";
+		private static const ARCHIVE_PLUGINS_AMF:String = "plugins.amf";
+		private static const ARCHIVE_HISTORY_AMF:String = "history.amf";
+		private static const _pngEncoder:PNGEncoder = new PNGEncoder();
+
+		private static var _pluginList:Array = [];
+
+		/**
+		 * @return A copy of the list of plugins currently loaded.
+		 */
+		public static function getPluginList():Array
+		{
+			return _pluginList.concat();
+		}
+
+		/**
+		 * This function will alter the list of plugins.  If plugins need to be unloaded, externalReload() will be called.
+		 * @param newPluginList A new full list of plugins that should be loaded.
+		 * @param newWeaveContent The new Weave file content to load after plugins have been loaded.
+		 * @return true if the plugins are already loaded.
+		 */
+		public static function setPluginList(newPluginList:Array, newWeaveContent:Object):Boolean
+		{
+			if (debug)
+				reportError("setPluginList " + newPluginList);
+			// remove duplicates
+			var array:Array = [];
+			for (i = 0; i < newPluginList.length; i++)
+				if (array.indexOf(newPluginList[i]) < 0)
+					array.push(newPluginList[i]);
+			newPluginList = array;
+			// stop if no change
+			if (StandardLib.arrayCompare(_pluginList, newPluginList) == 0)
+			{
+				return true;
+			}
+
+			var i:int;
+			var needReload:Boolean = false;
+			if (newPluginList.length < _pluginList.length)
+			{
+				// need to unload plugins
+				needReload = true;
+			}
+			else
+			{
+				// check if order changed
+				for (i = 0; i < _pluginList.length; i++)
+				{
+					if (_pluginList[i] != newPluginList[i])
+						needReload = true;
+				}
+			}
+
+			// save new plugin list
+			_pluginList = newPluginList;
+
+			if (needReload)
+			{
+				externalReload(newWeaveContent);
+			}
+			else
+			{
+				// load missing plugins
+				var remaining:int = _pluginList.length;
+				var ILinkableObject_classQName:String = getQualifiedClassName(ILinkableObject);
+				var IVisTool_classQName:String = getQualifiedClassName(IVisTool);
+
+				function handlePlugin(event:Event, token:Object = null):void
+				{
+					var resultEvent:ResultEvent = event as ResultEvent;
+					var faultEvent:FaultEvent = event as FaultEvent;
+					if (resultEvent)
+					{
+						trace("Loaded plugin:", token);
+						var classQNames:Array = resultEvent.result as Array;
+						for (var i:int = 0; i < classQNames.length; i++)
+						{
+							var classQName:String = classQNames[i];
+							// check if it implements ILinkableObject
+							if (ClassUtils.classImplements(classQName, ILinkableObject_classQName))
+							{
+								trace(classQName);
+							}
+						}
+					}
+					else
+					{
+						if (debug)
+							reportError("Plugin failed to load: " + token);
+						trace("Plugin failed to load:", token);
+						reportError(faultEvent.fault);
+					}
+
+					remaining--;
+					if (debug)
+						reportError('remaining '+remaining);
+					if (remaining == 0)
+						loadWeaveFileContent(newWeaveContent);
+				}
+				if (remaining > 0)
+				{
+					for each (var plugin:String in _pluginList)
+					{
+						LibraryUtils.loadSWC(plugin, handlePlugin, handlePlugin, plugin);
+					}
+				}
+				else
+				{
+					reportError("Unexpected");
+					loadWeaveFileContent(newWeaveContent);
+				}
+			}
+			return false;
+		}
+
+		/**
+		 * This will change an ".xml" extension to ".weave" in a file name.
+		 * @param fileName A file name to fix.
+		 * @return A file name ending in ".weave".
+		 */
+		public static function fixWeaveFileName(fileName:String, useWeaveExtension:Boolean):String
+		{
+			var _xml:String = '.xml';
+			var _weave:String = '.weave';
+			var oldExt:String = useWeaveExtension ? _xml : _weave;
+			var newExt:String = useWeaveExtension ? _weave : _xml;
+
+			if (fileName.substr(-oldExt.length).toLowerCase() == oldExt)
+				fileName = fileName.substr(0, -oldExt.length);
+			if (fileName.substr(-newExt.length).toLowerCase() != newExt)
+				fileName += newExt;
+			return fileName;
+		}
+
+		/**
+		 * This function will create an object that can be saved to a file and recalled later with loadWeaveFileContent().
+		 */
+		public static function createWeaveFileContent():ByteArray
+		{
+			// thumbnail should go first in the stream because we will often just want to extract the thumbnail and nothing else.
+			var output:WeaveArchive = new WeaveArchive();
+
+			// screenshot thumbnail
+			try
+			{
+				var _thumbnail:BitmapData = BitmapUtils.getBitmapDataFromComponent(WeaveAPI.topLevelApplication as UIComponent, THUMBNAIL_SIZE, THUMBNAIL_SIZE);
+				output.files[ARCHIVE_THUMBNAIL_PNG] = _pngEncoder.encode(_thumbnail);
+			}
+			catch (e:SecurityError)
+			{
+				reportError(e, "Unable to create screenshot due to lack of permissive policy file for embedded image. " + e.message);
+			}
+
+			if (Weave.ALLOW_PLUGINS)
+				output.objects[ARCHIVE_PLUGINS_AMF] = _pluginList;
+
+			// session history
+			var _history:Object = history.getSessionState();
+			output.objects[ARCHIVE_HISTORY_AMF] = _history;
+
+			return output.serialize();
+		}
+
+		/**
+		 * This function will load content that was previously created with createWeaveFileContent().
+		 * @param content The contents of a Weave file.
+		 */
+		public static function loadWeaveFileContent(content:Object):void
+		{
+			if (debug)
+				reportError("loadWeaveFileContent",null,arguments);
+			var plugins:Array;
+			if (content is String)
+				content = XML(content);
+			if (content is XML)
+			{
+				// we must wait until all plugins are loaded before trying to decode the session state xml
+				var xml:XML = content as XML;
+				plugins = VectorUtils.flatten(WeaveAPI.CSVParser.parseCSV(xml.@plugins), []);
+				if (setPluginList(plugins, content))
+				{
+					var newState:Array = WeaveXMLDecoder.decodeDynamicState(xml);
+					root.setSessionState(newState, true);
+					// begin with empty history after loading the session state from the xml
+					history.clearHistory();
+				}
+			}
+			else if (content)
+			{
+				if (content is ByteArray)
+				{
+					try
+					{
+						content = new WeaveArchive(content as ByteArray);
+					}
+					catch (e:Error)
+					{
+						throw new Error("Invalid Weave session state.");
+					}
+				}
+
+				var archive:WeaveArchive = content as WeaveArchive;
+				var _history:Object = archive.objects[ARCHIVE_HISTORY_AMF];
+				if (!_history)
+					throw new Error("Weave session history not found.");
+
+				plugins = archive.objects[ARCHIVE_PLUGINS_AMF] as Array || [];
+				if (setPluginList(plugins, content))
+				{
+					history.setSessionState(_history);
+				}
+			}
+
+			// hack for forcing VisApplication menu to refresh
+			getCallbackCollection(Weave.properties).triggerCallbacks();
+		}
+
+		private static const WEAVE_RELOAD_SHARED_OBJECT:String = "WeaveExternalReload";
+
+		/**
+		 * This function will restart the Flash application by reloading the SWF that is embedded in the browser window.
+		 */
+		public static function externalReload(weaveContent:Object = null):void
+		{
+			if (!weaveContent)
+				weaveContent = createWeaveFileContent();
+
+			var obj:SharedObject = SharedObject.getLocal(WEAVE_RELOAD_SHARED_OBJECT);
+			var uid:String = WEAVE_RELOAD_SHARED_OBJECT;
+			if (ExternalInterface.objectID)
+			{
+				// generate uid to be saved in parent node
+				uid = UIDUtil.createUID();
+			}
+
+			// save session history to shared object
+			if (weaveContent is XML)
+				weaveContent = (weaveContent as XML).toXMLString();
+			if (weaveContent is WeaveArchive)
+				weaveContent = (weaveContent as WeaveArchive).serialize();
+			obj.data[uid] = { date: new Date(), content: weaveContent };
+			obj.flush();
+			obj.close();
+
+			// reload the application
+			ExternalInterface.call(
+				"function(objectID, reloadID) {" +
+				"  if (objectID) {" +
+				"    var p = document.getElementById(objectID).parentNode;" +
+				"    p.weaveReloadID = reloadID;" +
+				"    p.innerHTML = p.innerHTML;" +
+				"  }" +
+				"  else {" +
+				"    location.reload(false);" +
+				"  }" +
+				"}",
+				ExternalInterface.objectID,
+				uid
+			);
+		}
+
+		/**
+		 * This function should be called when the application starts to restore session history after reloading the application.
+		 * @return true if the application was reloaded from within.
+		 */
+		public static function handleWeaveReload():Boolean
+		{
+			var obj:SharedObject = SharedObject.getLocal(WEAVE_RELOAD_SHARED_OBJECT);
+			var flush:Boolean = false;
+			var uid:String = WEAVE_RELOAD_SHARED_OBJECT;
+			if (ExternalInterface.objectID)
+			{
+				// get uid that was previously saved in parent node
+				uid = ExternalInterface.call(
+					"function(objectID) {" +
+					"  var p = document.getElementById(objectID).parentNode;" +
+					"  var reloadID = p.weaveReloadID;" +
+					"  p.weaveReloadID = undefined;" +
+					"  return reloadID;" +
+					"}",
+					ExternalInterface.objectID
+				);
+			}
+
+			// get session history from shared object
+			var saved:Object = obj.data[uid];
+			if (debug)
+				reportError("handleWeaveReload", null, saved);
+			if (saved)
+			{
+				// delete session history from shared object
+				delete obj.data[uid];
+				flush = true;
+
+				// restore old session history
+				loadWeaveFileContent(saved.content);
+			}
+
+			// delete all old saved data
+			const EXPIRATION_TIME:int = 5 * 60 * 1000; // minutes
+			var date:Date = new Date();
+			for (uid in obj.data)
+			{
+				try
+				{
+					if (date.getTime() - obj.data[uid].date.getTime() < EXPIRATION_TIME)
+						continue;
+				}
+				catch (e:Error)
+				{
+					// ignore error, entry will be deleted
+				}
+
+				delete obj.data[uid];
+				flush = true;
+			}
+
+			// save changes to shared object
+			if (flush)
+				obj.flush();
+			obj.close();
+
+			return saved != null;
+		}
 	}
-}
+}


Ugh, turns out this still threw an error if the attribute didn't exist.

--- exporter/src/main/as/flump/export/BetwixtPublisher.as
+++ exporter/src/main/as/flump/export/BetwixtPublisher.as
@@ -14,6 +14,7 @@
 import flump.xfl.XmlConverter;

 import com.threerings.util.Log;
+import com.threerings.util.XmlUtil;

 public class BetwixtPublisher
 {
@@ -75,8 +76,10 @@
                 var movieXml :XML = movie.toXML();
                 movieXml.@authoredDevice = authoredDevice.name();
                 movieXml.@name = prefix + movieXml.@name;
-                for each (var kf :XML in movieXml..kf.(@ref != null)) {
-                    kf.@ref = prefix + kf.@ref;
+                for each (var kf :XML in movieXml..kf) {
+                    if (XmlUtil.hasAttr(kf, "ref")) {
+                        kf.@ref = prefix + kf.@ref;
+                    }
                 }
                 xml.appendChild(movieXml);
             }


Transferred from the Adobe Open Source Subversion Repository

Revision: 7593
Author:   srahim@adobe.com
Date:     2009-06-05T22:45:37.893107Z

Log Message:
-----------
ASDoc update per community help comments.
QE Notes: None
Doc Notes: None
Bugs: n/a
Checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButtonGroup.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1268431 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/controls/RadioButton.as
+++ frameworks/projects/mx/src/mx/controls/RadioButton.as
@@ -69,12 +69,14 @@
  *  The RadioButton control lets the user make a single choice
  *  within a set of mutually exclusive choices.
  *  A RadioButton group is composed of two or more RadioButton controls
- *  with the same groupName property.
- *  The RadioButton group can refer to a group created by the
+ *  with the same groupName property. While grouping RadioButton instances
+ *  in a RadioButtonGroup is optional, a group lets you do things
+ *  like set a single event handler on a group of buttons, rather than
+ *  on each individual button. The RadioButton group can refer to a group created by the
  *  <mx:RadioButtonGroup> tag.
  *  The user selects only one member of the group at a time.
  *  Selecting an unselected group member deselects the currently selected
- *  RadioButton control within that group.
+ *  RadioButton control within that group.
  *
  *
The RadioButton control has the following default characteristics:

  *


fixed legend plotter word wrap display bug

Change-Id: I97b8b0f19c5b2a5babc1420c2609bdc49d26ea8f

--- WeaveUI/src/weave/utils/LegendUtils.as
+++ WeaveUI/src/weave/utils/LegendUtils.as
@@ -53,19 +53,15 @@
 				maxColumns = totalItemCount;
 			var maxRows:int = Math.ceil(totalItemCount / maxColumns);

-			var xMin:Number = fullScreenBounds.getXNumericMin();
-			var yMin:Number = fullScreenBounds.getYNumericMin();
-			var xMax:Number = fullScreenBounds.getXNumericMax();
-			var yMax:Number = fullScreenBounds.getYNumericMax();
-			var xSpacing:Number = (xMax - xMin) / maxColumns;
-			var ySpacing:Number = (yMax - yMin) / maxRows;
+			var xSpacing:Number = fullScreenBounds.getXCoverage() / maxColumns;
+			var ySpacing:Number = fullScreenBounds.getYCoverage() / maxRows;
 			var desiredColumn:int = index % maxColumns;
 			var desiredRow:int = index / maxColumns;
 			if (transposeInRow)
 				desiredColumn = (maxColumns - 1) - desiredColumn;

-			var xMinDesired:Number = xMin + xSpacing * desiredColumn;
-			var yMinDesired:Number = yMin + ySpacing * desiredRow;
+			var xMinDesired:Number = fullScreenBounds.getXNumericMin() + xSpacing * desiredColumn;
+			var yMinDesired:Number = fullScreenBounds.getYNumericMin() + ySpacing * desiredRow;
 			var xMaxDesired:Number = xMinDesired + xSpacing;
 			var yMaxDesired:Number = yMinDesired + ySpacing;
 			outputScreenBounds.setBounds(xMinDesired, yMinDesired, xMaxDesired, yMaxDesired);
@@ -90,16 +86,11 @@
 			bitmapText.textFormat.underline = Weave.properties.axisFontUnderline.value;
 			bitmapText.verticalAlign = BitmapText.VERTICAL_ALIGN_CENTER;

-			var xMin:Number = itemScreenBounds.getXNumericMin();
-			var yMin:Number = itemScreenBounds.getYNumericMin();
-			var xMax:Number = itemScreenBounds.getXNumericMax();
-			var yMax:Number = itemScreenBounds.getYNumericMax();
-			xMin += iconGap;
-
 			bitmapText.text = text;
-			bitmapText.x = xMin;
-			bitmapText.y = (yMin + yMax) / 2;
-			bitmapText.maxWidth = (xMax - xMin);
+			bitmapText.x = itemScreenBounds.getXNumericMin() + iconGap;
+			bitmapText.y = itemScreenBounds.getYCenter();
+			bitmapText.maxWidth = itemScreenBounds.getXCoverage() - iconGap;
+			bitmapText.maxHeight = itemScreenBounds.getYCoverage();
 			bitmapText.draw(destination, null, null, null, clipRectangle );
 		}


Bug 672484: regression tests (r=fklockii, sr pending=dschaffe).

--- test/acceptance/ecma3/JSON/regress.as
+++ test/acceptance/ecma3/JSON/regress.as
@@ -49,6 +49,10 @@
             '"mn\\u0001op\\u0002qr\\u0003st"',
             JSON.stringify('mn\u0001op\u0002qr\u0003st'));

+// Bugzilla 672484: The string literal "\u000FF " *is* valid JSON input.
+AddTestCase("JSON.parse('\"\\u000FF \"')", "\u000FF ", JSON.parse('"\\u000FF "'));
+AddTestCase("JSON.parse('\"\\u0061F \"')", "aF ", JSON.parse('"\\u0061F "'));
+
 // Another problem: the JSON.parse and JSON.stringify routines
 // are written as recursive procedures.  How do they handle
 // inputs where the recursion must descend deep into the structure?


unique() added support for unique by field

--- src/asx/array/unique.as
+++ src/asx/array/unique.as
@@ -12,8 +12,10 @@
    *  assertThat(uniq, equalTo([1, 2, 3, 5, 8]));
    *  </listing>
    */
-  public function unique(array:Array):Array {
-    return inject([], array, uniqueIterator) as Array;
+  public function unique(array:Array, field:String=null):Array {
+    return field
+      ? inject([], array, uniqueFieldIterator(field)) as Array
+      : inject([], array, uniqueIterator) as Array;
   }
 }

@@ -25,3 +27,18 @@
   }
   return memo;
 }
+
+internal function uniqueFieldIterator(field:String):Function
+{
+  var fieldValues:Array = [];
+  return function(memo:Array, value:Object):Array
+  {
+    var fieldValue:* = value[field];
+    if (!contains(fieldValues, fieldValue))
+    {
+      fieldValues.push(fieldValue);
+      memo.push(value);
+    }
+    return memo;
+  };
+}


説明用のファイルを削除

説明用のファイルを削除

git-svn-id: 667ccd08e5f160307f6512a0947301cac150914e@873 ceb3ebad-0e53-d446-8596-a45b2b8d79cd

--- package/win32/common/hpi3structs64.as
+++ package/win32/common/hpi3structs64.as
@@ -1,640 +0,0 @@
-// HSPvOC̍\̂萔̃wb_t@C(Win64)
-
-#ifndef HPI3STRUCTS64_H
-#define HPI3STRUCTS64_H
-
-
-// 萔
-
-#const  PARAM_OK            0
-#const  PARAM_SPLIT         (-1)
-#const  PARAM_END           (-2)
-#const  PARAM_DEFAULT       (-3)
-#const  PARAM_ENDSPLIT      (-4)
-
-#const  TYPE_MARK           0
-#const  TYPE_VAR            1
-#const  TYPE_STRING         2
-#const  TYPE_DNUM           3
-#const  TYPE_INUM           4
-#const  TYPE_STRUCT         5
-#const  TYPE_XLABEL         6
-#const  TYPE_LABEL          7
-#const  TYPE_INTCMD         8
-#const  TYPE_EXTCMD         9
-#const  TYPE_EXTSYSVAR      10
-#const  TYPE_CMPCMD         11
-#const  TYPE_MODCMD         12
-#const  TYPE_INTFUNC        13
-#const  TYPE_SYSVAR         14
-#const  TYPE_PROGCMD        15
-#const  TYPE_DLLFUNC        16
-#const  TYPE_DLLCTRL        17
-#const  TYPE_USERDEF        18
-
-#const  HSP3_FUNC_MAX   TYPE_USERDEF
-#const  HSP3_TYPE_USER  TYPE_USERDEF
-
-#const  TYPE_ERROR      (-1)
-#const  TYPE_CALCERROR  (-2)
-
-#const  EXFLG_0         0x1000
-#const  EXFLG_1         0x2000
-#const  EXFLG_2         0x4000
-#const  EXFLG_3         0x8000
-
-#const  CSTYPE          0xfff
-
-#const  HSPCTX_REFSTR_MAX       4096
-#const  HSPCTX_CMDLINE_MAX      1024
-
-#const  HSPVAR_MODE_NONE        (-1)
-#const  HSPVAR_MODE_MALLOC      1
-#const  HSPVAR_MODE_CLONE       2
-
-#const  HSPVAR_FLAG_NONE        0
-#const  HSPVAR_FLAG_LABEL       1
-#const  HSPVAR_FLAG_STR         2
-#const  HSPVAR_FLAG_DOUBLE      3
-#const  HSPVAR_FLAG_INT         4
-#const  HSPVAR_FLAG_STRUCT      5
-#const  HSPVAR_FLAG_COMSTRUCT   6
-#const  HSPVAR_FLAG_USERDEF     8
-#const  HSPVAR_FLAG_MAX         HSPVAR_FLAG_USERDEF
-
-#const  HSPVAR_SUPPORT_STORAGE      1
-#const  HSPVAR_SUPPORT_FLEXSTORAGE  2
-#const  HSPVAR_SUPPORT_FIXEDARRAY   4
-#const  HSPVAR_SUPPORT_FLEXARRAY    8
-#const  HSPVAR_SUPPORT_ARRAYOBJ     16
-#const  HSPVAR_SUPPORT_MISCTYPE     HSPVAR_SUPPORT_ARRAYOBJ
-#const  HSPVAR_SUPPORT_FLEXSIZE     32
-#const  HSPVAR_SUPPORT_NOCONVERT    64
-#const  HSPVAR_SUPPORT_VARUSE       128
-#const  HSPVAR_SUPPORT_TEMPVAR      256
-#const  HSPVAR_SUPPORT_USER1        0x4000
-#const  HSPVAR_SUPPORT_USER2        0x8000
-
-#const  HSPERR_NONE                         0
-#const  HSPERR_UNKNOWN_CODE                 1
-#const  HSPERR_SYNTAX                       2
-#const  HSPERR_ILLEGAL_FUNCTION             3
-#const  HSPERR_WRONG_EXPRESSION             4
-#const  HSPERR_NO_DEFAULT                   5
-#const  HSPERR_TYPE_MISMATCH                6
-#const  HSPERR_ARRAY_OVERFLOW               7
-#const  HSPERR_LABEL_REQUIRED               8
-#const  HSPERR_TOO_MANY_NEST                9
-#const  HSPERR_RETURN_WITHOUT_GOSUB         10
-#const  HSPERR_LOOP_WITHOUT_REPEAT          11
-#const  HSPERR_FILE_IO                      12
-#const  HSPERR_PICTURE_MISSING              13
-#const  HSPERR_EXTERNAL_EXECUTE             14
-#const  HSPERR_PRIORITY                     15
-#const  HSPERR_TOO_MANY_PARAMETERS          16
-#const  HSPERR_TEMP_BUFFER_OVERFLOW         17
-#const  HSPERR_WRONG_NAME                   18
-#const  HSPERR_DIVIDED_BY_ZERO              19
-#const  HSPERR_BUFFER_OVERFLOW              20
-#const  HSPERR_UNSUPPORTED_FUNCTION         21
-#const  HSPERR_EXPRESSION_COMPLEX           22
-#const  HSPERR_VARIABLE_REQUIRED            23
-#const  HSPERR_INTEGER_REQUIRED             24
-#const  HSPERR_BAD_ARRAY_EXPRESSION         25
-#const  HSPERR_OUT_OF_MEMORY                26
-#const  HSPERR_TYPE_INITALIZATION_FAILED    27
-#const  HSPERR_NO_FUNCTION_PARAMETERS       28
-#const  HSPERR_STACK_OVERFLOW               29
-#const  HSPERR_INVALID_PARAMETER            30
-#const  HSPERR_INVALID_ARRAYSTORE           31
-#const  HSPERR_INVALID_FUNCPARAM            32
-#const  HSPERR_WINDOW_OBJECT_FULL           33
-#const  HSPERR_INVALID_ARRAY                34
-#const  HSPERR_STRUCT_REQUIRED              35
-#const  HSPERR_INVALID_STRUCT_SOURCE        36
-#const  HSPERR_INVALID_TYPE                 37
-#const  HSPERR_DLL_ERROR                    38
-#const  HSPERR_COMDLL_ERROR                 39
-#const  HSPERR_NORETVAL                     40
-#const  HSPERR_FUNCTION_SYNTAX              41
-
-#const  HSPVAR_ERROR_INVALID                HSPERR_WRONG_EXPRESSION
-#const  HSPVAR_ERROR_DIVZERO                HSPERR_DIVIDED_BY_ZERO
-#const  HSPVAR_ERROR_TYPEMISS               HSPERR_TYPE_MISMATCH
-#const  HSPVAR_ERROR_ARRAYOVER              HSPERR_ARRAY_OVERFLOW
-#const  HSPVAR_ERROR_ILLEGALPRM             HSPERR_ILLEGAL_FUNCTION
-
-#const  HSPERR_INTJUMP                      42
-#const  HSPERR_EXITRUN                      43
-#const  HSPERR_MAX                          44
-
-#const  DEBUGINFO_GENERAL                   0
-#const  DEBUGINFO_VARNAME                   1
-#const  DEBUGINFO_INTINFO                   2
-#const  DEBUGINFO_GRINFO                    3
-#const  DEBUGINFO_MMINFO                    4
-#const  DEBUGINFO_MAX                       5
-
-#const  HSPDEBUG_NONE                       0
-#const  HSPDEBUG_RUN                        1
-#const  HSPDEBUG_STOP                       2
-#const  HSPDEBUG_STEPIN                     3
-#const  HSPDEBUG_STEPOVER                   4
-#const  HSPDEBUG_MAX                        5
-
-#const  CALCCODE_ADD    0
-#const  CALCCODE_SUB    1
-#const  CALCCODE_MUL    2
-#const  CALCCODE_DIV    3
-#const  CALCCODE_MOD    4
-#const  CALCCODE_AND    5
-#const  CALCCODE_OR     6
-#const  CALCCODE_XOR    7
-#const  CALCCODE_EQ     8
-#const  CALCCODE_NE     9
-#const  CALCCODE_GT     10
-#const  CALCCODE_LT     11
-#const  CALCCODE_GTEQ   12
-#const  CALCCODE_LTEQ   13
-#const  CALCCODE_RR     14
-#const  CALCCODE_LR     15
-#const  CALCCODE_MAX    16
-
-#const  FLEXVAL_TYPE_NONE   0
-#const  FLEXVAL_TYPE_ALLOC  1
-#const  FLEXVAL_TYPE_CLONE  2
-
-#const  HSP3_REPEAT_MAX     32
-
-#const  HSPSTAT_NORMAL      0
-#const  HSPSTAT_DEBUG       1
-#const  HSPSTAT_SSAVER      2
-
-#const  TYPE_EX_SUBROUTINE      0x100
-#const  TYPE_EX_CUSTOMFUNC      0x101
-#const  TYPE_EX_ENDOFPARAM      0x200
-#const  TYPE_EX_ARRAY_VARS      0x201
-#const  TYPE_EX_LOCAL_VARS      0x202
-
-#const  HSPEVENT_ENABLE_COMMAND     0x1
-#const  HSPEVENT_ENABLE_HSPIRQ      0x2
-#const  HSPEVENT_ENABLE_GETKEY      0x4
-#const  HSPEVENT_ENABLE_FILE        0x8
-#const  HSPEVENT_ENABLE_MEDIA       0x10
-#const  HSPEVENT_ENABLE_PICLOAD     0x20
-
-#const  HSPEVENT_NONE               0
-#const  HSPEVENT_COMMAND            1
-#const  HSPEVENT_HSPIRQ             2
-#const  HSPEVENT_GETKEY             3
-#const  HSPEVENT_STICK              4
-#const  HSPEVENT_FNAME              5
-#const  HSPEVENT_FREAD              6
-#const  HSPEVENT_FWRITE             6
-#const  HSPEVENT_FEXIST             7
-#const  HSPEVENT_FDELETE            8
-#const  HSPEVENT_FMKDIR             9
-#const  HSPEVENT_FCHDIR             10
-#const  HSPEVENT_FCOPY              11
-#const  HSPEVENT_FDIRLIST1          12
-#const  HSPEVENT_FDIRLIST2          13
-#const  HSPEVENT_GETPICSIZE         14
-#const  HSPEVENT_PICLOAD            15
-#const  HSPEVENT_MAX                16
-
-#const  HSPIRQ_ONEXIT               0
-#const  HSPIRQ_ONERROR              1
-#const  HSPIRQ_ONKEY                2
-#const  HSPIRQ_ONCLICK              3
-#const  HSPIRQ_USERDEF              4
-#const  HSPIRQ_MAX                  5
-
-#const  IRQ_FLAG_NONE       0
-#const  IRQ_FLAG_DISABLE    1
-#const  IRQ_FLAG_ENABLE     2
-
-#const  IRQ_OPT_GOTO        0
-#const  IRQ_OPT_GOSUB       1
-#const  IRQ_OPT_CALLBACK    2
-
-#const  MODVAR_MAGICCODE    0x55aa
-
-#const  HSPHED_BOOTOPT_DEBUGWIN             0x1
-#const  HSPHED_BOOTOPT_WINHIDE              0x2
-#const  HSPHED_BOOTOPT_DIRSAVE              0x4
-#const  HSPHED_BOOTOPT_SAVER                0x100
-
-#const  HSPHED_BOOTOPT_RUNTIME              0x1000
-#const  HSPHED_BOOTOPT_NOMMTIMER            0x2000
-#const  HSPHED_BOOTOPT_NOGDIP               0x4000
-#const  HSPHED_BOOTOPT_FLOAT32              0x8000
-#const  HSPHED_BOOTOPT_ORGRND               0x10000
-
-#const  HPIDAT_FLAG_TYPEFUNC                0
-#const  HPIDAT_FLAG_SELFFUNC                (-1)
-#const  HPIDAT_FLAG_VARFUNC                 1
-#const  HPIDAT_FLAG_DLLFUNC                 2
-
-#const  MPTYPE_NONE     0
-#const  MPTYPE_VAR      1
-#const  MPTYPE_STRING   2
-#const  MPTYPE_DNUM     3
-#const  MPTYPE_INUM     4
-#const  MPTYPE_STRUCT   5
-#const  MPTYPE_LABEL    7
-
-#const  MPTYPE_LOCALVAR     (-1)
-#const  MPTYPE_ARRAYVAR     (-2)
-#const  MPTYPE_SINGLEVAR    (-3)
-#const  MPTYPE_FLOAT        (-4)
-#const  MPTYPE_STRUCTTAG    (-5)
-#const  MPTYPE_LOCALSTRING  (-6)
-#const  MPTYPE_MODULEVAR    (-7)
-#const  MPTYPE_PPVAL        (-8)
-#const  MPTYPE_PBMSCR       (-9)
-#const  MPTYPE_PVARPTR      (-10)
-#const  MPTYPE_IMODULEVAR   (-11)
-
-#const  MPTYPE_IOBJECTVAR   (-12)
-#const  MPTYPE_LOCALWSTR    (-13)
-#const  MPTYPE_FLEXSPTR     (-14)
-#const  MPTYPE_FLEXWPTR     (-15)
-#const  MPTYPE_PTR_REFSTR   (-16)
-#const  MPTYPE_PTR_EXINFO   (-17)
-#const  MPTYPE_PTR_DPMINFO  (-18)
-#const  MPTYPE_NULLPTR      (-19)
-#const  MPTYPE_TMODULEVAR   (-20)
-
-#const  STRUCTPRM_SUBID_STACK       (-1)
-#const  STRUCTPRM_SUBID_STID        (-2)
-#const  STRUCTPRM_SUBID_DLL         (-3)
-#const  STRUCTPRM_SUBID_DLLINIT     (-4)
-#const  STRUCTPRM_SUBID_OLDDLL      (-5)
-#const  STRUCTPRM_SUBID_OLDDLLINIT  (-6)
-#const  STRUCTPRM_SUBID_COMOBJ      (-7)
-
-#const  STRUCTCODE_THISMOD      (-1)
-
-#const  TYPE_OFFSET_COMOBJ      0x1000
-
-#const  STRUCTDAT_OT_NONE       0
-#const  STRUCTDAT_OT_CLEANUP    1
-#const  STRUCTDAT_OT_STATEMENT  2
-#const  STRUCTDAT_OT_FUNCTION   4
-
-#const  STRUCTDAT_INDEX_FUNC            (-1)
-#const  STRUCTDAT_INDEX_CFUNC           (-2)
-#const  STRUCTDAT_INDEX_STRUCT          (-3)
-#const  STRUCTDAT_FUNCFLAG_CLEANUP      0x10000
-
-#const  LIBDAT_FLAG_NONE        0
-#const  LIBDAT_FLAG_DLL         1
-#const  LIBDAT_FLAG_DLLINIT     2
-#const  LIBDAT_FLAG_MODULE      3
-#const  LIBDAT_FLAG_COMOBJ      4
-
-
-// \
-
-
-#const  HSPEXINFO_ver                   0
-#const  HSPEXINFO_min                   HSPEXINFO_ver                   +2
-#const  HSPEXINFO_er                    HSPEXINFO_min                   +2      +4
-#const  HSPEXINFO_pstr                  HSPEXINFO_er                    +8
-#const  HSPEXINFO_stmp                  HSPEXINFO_pstr                  +8
-#const  HSPEXINFO_mpval                 HSPEXINFO_stmp                  +8
-#const  HSPEXINFO_actscr                HSPEXINFO_mpval                 +8
-#const  HSPEXINFO_nptype                HSPEXINFO_actscr                +8
-#const  HSPEXINFO_npval                 HSPEXINFO_nptype                +8
-#const  HSPEXINFO_strsize               HSPEXINFO_npval                 +8
-#const  HSPEXINFO_refstr                HSPEXINFO_strsize               +8
-#const  HSPEXINFO_HspFunc_prm_getv      HSPEXINFO_refstr                +8
-#const  HSPEXINFO_HspFunc_prm_geti      HSPEXINFO_HspFunc_prm_getv      +8
-#const  HSPEXINFO_HspFunc_prm_getdi     HSPEXINFO_HspFunc_prm_geti      +8
-#const  HSPEXINFO_HspFunc_prm_gets      HSPEXINFO_HspFunc_prm_getdi     +8
-#const  HSPEXINFO_HspFunc_prm_getds     HSPEXINFO_HspFunc_prm_gets      +8
-#const  HSPEXINFO_HspFunc_val_realloc   HSPEXINFO_HspFunc_prm_getds     +8
-#const  HSPEXINFO_HspFunc_fread         HSPEXINFO_HspFunc_val_realloc   +8
-#const  HSPEXINFO_HspFunc_fsize         HSPEXINFO_HspFunc_fread         +8
-#const  HSPEXINFO_HspFunc_getbmscr      HSPEXINFO_HspFunc_fsize         +8
-#const  HSPEXINFO_HspFunc_getobj        HSPEXINFO_HspFunc_getbmscr      +8
-#const  HSPEXINFO_HspFunc_setobj        HSPEXINFO_HspFunc_getobj        +8
-#const  HSPEXINFO_size26                HSPEXINFO_HspFunc_setobj        +8
-#const  HSPEXINFO_npexflag              HSPEXINFO_HspFunc_setobj        +8
-#const  HSPEXINFO_hspctx                HSPEXINFO_npexflag              +8
-#const  HSPEXINFO_HspFunc_addobj        HSPEXINFO_hspctx                +8
-#const  HSPEXINFO_HspFunc_puterror      HSPEXINFO_HspFunc_addobj        +8
-#const  HSPEXINFO_HspFunc_getproc       HSPEXINFO_HspFunc_puterror      +8
-#const  HSPEXINFO_HspFunc_seekproc      HSPEXINFO_HspFunc_getproc       +8
-#const  HSPEXINFO_HspFunc_prm_next      HSPEXINFO_HspFunc_seekproc      +8
-#const  HSPEXINFO_HspFunc_prm_get       HSPEXINFO_HspFunc_prm_next      +8
-#const  HSPEXINFO_HspFunc_prm_getd      HSPEXINFO_HspFunc_prm_get       +8
-#const  HSPEXINFO_HspFunc_prm_getdd     HSPEXINFO_HspFunc_prm_getd      +8
-#const  HSPEXINFO_HspFunc_prm_getlb     HSPEXINFO_HspFunc_prm_getdd     +8
-#const  HSPEXINFO_HspFunc_prm_getpval   HSPEXINFO_HspFunc_prm_getlb     +8
-#const  HSPEXINFO_HspFunc_prm_getva     HSPEXINFO_HspFunc_prm_getpval   +8
-#const  HSPEXINFO_HspFunc_prm_setva     HSPEXINFO_HspFunc_prm_getva     +8
-#const  HSPEXINFO_HspFunc_malloc        HSPEXINFO_HspFunc_prm_setva     +8
-#const  HSPEXINFO_HspFunc_free          HSPEXINFO_HspFunc_malloc        +8
-#const  HSPEXINFO_HspFunc_expand        HSPEXINFO_HspFunc_free          +8
-#const  HSPEXINFO_HspFunc_addirq        HSPEXINFO_HspFunc_expand        +8
-#const  HSPEXINFO_HspFunc_hspevent      HSPEXINFO_HspFunc_addirq        +8
-#const  HSPEXINFO_HspFunc_registvar     HSPEXINFO_HspFunc_hspevent      +8
-#const  HSPEXINFO_HspFunc_setpc         HSPEXINFO_HspFunc_registvar     +8
-#const  HSPEXINFO_HspFunc_call          HSPEXINFO_HspFunc_setpc         +8
-#const  HSPEXINFO_HspFunc_mref          HSPEXINFO_HspFunc_call          +8
-#const  HSPEXINFO_HspFunc_dim           HSPEXINFO_HspFunc_mref          +8
-#const  HSPEXINFO_HspFunc_redim         HSPEXINFO_HspFunc_dim           +8
-#const  HSPEXINFO_HspFunc_array         HSPEXINFO_HspFunc_redim         +8
-
-#const  HSPEXINFO_SIZE30_               HSPEXINFO_HspFunc_array         +8
-#const  HSPEXINFO_HspFunc_varname       HSPEXINFO_HspFunc_array         +8
-#const  HSPEXINFO_HspFunc_seekvar       HSPEXINFO_HspFunc_varname       +8
-
-#const  HSPEXINFO_SIZE31_               HSPEXINFO_HspFunc_seekvar       +8
-#const  HSPEXINFO_SIZE_                 HSPEXINFO_SIZE31_
-
-
-#const  LOOPDAT_time        0
-#const  LOOPDAT_cnt         LOOPDAT_time    +4
-#const  LOOPDAT_step        LOOPDAT_cnt     +4
-#const  LOOPDAT_pt          LOOPDAT_step    +4      +4
-
-#const  LOOPDAT_SIZE_       LOOPDAT_pt      +8
-
-
-#const  HSPCTX_hsphed       0
-#const  HSPCTX_mcs          HSPCTX_hsphed       +8
-#const  HSPCTX_mem_mcs      HSPCTX_mcs          +8
-#const  HSPCTX_mem_di       HSPCTX_mem_mcs      +8
-#const  HSPCTX_mem_ot       HSPCTX_mem_di       +8
-#const  HSPCTX_mem_irq      HSPCTX_mem_ot       +8
-#const  HSPCTX_irqmax       HSPCTX_mem_irq      +8      +8
-#const  HSPCTX_iparam       HSPCTX_irqmax       +4
-#const  HSPCTX_wparam       HSPCTX_iparam       +4
-#const  HSPCTX_lparam       HSPCTX_wparam       +4
-#const  HSPCTX_mem_var      HSPCTX_lparam       +4
-#const  HSPCTX_exinfo       HSPCTX_mem_var      +8
-#const  HSPCTX_runmode      HSPCTX_exinfo       +HSPEXINFO_SIZE30_
-#const  HSPCTX_waitcount    HSPCTX_runmode      +4
-#const  HSPCTX_waitbase     HSPCTX_waitcount    +4
-#const  HSPCTX_waittick     HSPCTX_waitbase     +4
-#const  HSPCTX_lasttick     HSPCTX_waittick     +4
-#const  HSPCTX_sublev       HSPCTX_lasttick     +4
-#const  HSPCTX_mem_loop     HSPCTX_sublev       +4
-#const  HSPCTX_looplev      HSPCTX_mem_loop     +LOOPDAT_SIZE_  * HSP3_REPEAT_MAX
-#const  HSPCTX_err          HSPCTX_looplev      +4
-#const  HSPCTX_hspstat      HSPCTX_err          +4
-#const  HSPCTX_stat         HSPCTX_hspstat      +4
-#const  HSPCTX_strsize      HSPCTX_stat         +4
-#const  HSPCTX_refstr       HSPCTX_strsize      +4      +4
-#const  HSPCTX_fnbuffer     HSPCTX_refstr       +8
-#const  HSPCTX_instance     HSPCTX_fnbuffer     +8
-#const  HSPCTX_intwnd_id    HSPCTX_instance     +8
-#const  HSPCTX_note_pval    HSPCTX_intwnd_id    +4      +4
-#const  HSPCTX_note_aptr    HSPCTX_note_pval    +8
-#const  HSPCTX_notep_pval   HSPCTX_note_aptr    +4      +4
-#const  HSPCTX_notep_aptr   HSPCTX_notep_pval   +8
-#const  HSPCTX_stmp         HSPCTX_notep_aptr   +4      +4
-#const  HSPCTX_prmstack     HSPCTX_stmp         +8
-#const  HSPCTX_mem_linfo    HSPCTX_prmstack     +8
-#const  HSPCTX_mem_minfo    HSPCTX_mem_linfo    +8
-#const  HSPCTX_mem_finfo    HSPCTX_mem_minfo    +8
-#const  HSPCTX_retval_level HSPCTX_mem_finfo    +8
-#const  HSPCTX_endcode      HSPCTX_retval_level +4
-#const  HSPCTX_msgfunc      HSPCTX_endcode      +4
-#const  HSPCTX_wnd_parent   HSPCTX_msgfunc      +8
-#const  HSPCTX_refdval      HSPCTX_wnd_parent   +8
-#const  HSPCTX_cmdline      HSPCTX_refdval      +8
-
-#const  HSPCTX_SIZE30_      HSPCTX_cmdline      +8
-#const  HSPCTX_exinfo2      HSPCTX_cmdline      +8
-
-#const  HSPCTX__SIZE31_     HSPCTX_exinfo2      +8
-#const  HSPCTX_SIZE_        HSPCTX__SIZE31_
-
-
-#const  HSPHED_h1           0
-#const  HSPHED_h2           HSPHED_h1           +1
-#const  HSPHED_h3           HSPHED_h2           +1
-#const  HSPHED_h4           HSPHED_h3           +1
-#const  HSPHED_version      HSPHED_h4           +1
-#const  HSPHED_max_val      HSPHED_version      +4
-#const  HSPHED_allsize      HSPHED_max_val      +4
-#const  HSPHED_pt_cs        HSPHED_allsize      +4
-#const  HSPHED_max_cs       HSPHED_pt_cs        +4
-#const  HSPHED_pt_ds        HSPHED_max_cs       +4
-#const  HSPHED_max_ds       HSPHED_pt_ds        +4
-#const  HSPHED_pt_ot        HSPHED_max_ds       +4
-#const  HSPHED_max_ot       HSPHED_pt_ot        +4
-#const  HSPHED_pt_dinfo     HSPHED_max_ot       +4
-#const  HSPHED_max_dinfo    HSPHED_pt_dinfo     +4
-#const  HSPHED_pt_linfo     HSPHED_max_dinfo    +4
-#const  HSPHED_max_linfo    HSPHED_pt_linfo     +4
-#const  HSPHED_pt_finfo     HSPHED_max_linfo    +4
-#const  HSPHED_max_finfo    HSPHED_pt_finfo     +4
-#const  HSPHED_pt_mifno     HSPHED_max_finfo    +4
-#const  HSPHED_max_minfo    HSPHED_pt_mifno     +4
-#const  HSPHED_pt_finfo2    HSPHED_max_minfo    +4
-#const  HSPHED_max_finfo2   HSPHED_pt_finfo2    +4
-#const  HSPHED_pt_hpidat    HSPHED_max_finfo2   +4
-#const  HSPHED_max_hpi      HSPHED_pt_hpidat    +4
-#const  HSPHED_max_varhpi   HSPHED_max_hpi      +2
-#const  HSPHED_bootoption   HSPHED_max_varhpi   +2
-#const  HSPHED_runtime      HSPHED_bootoption   +4
-
-#const  HSPHED_SIZE30_      HSPHED_runtime      +4
-#const  HSPHED_pt_sr        HSPHED_runtime      +4
-#const  HSPHED_max_sr       HSPHED_pt_sr        +4
-#const  HSPHED_opt1         HSPHED_max_sr       +4
-#const  HSPHED_opt2         HSPHED_opt1         +4
-#const  HSPHED_SIZE35_      HSPHED_opt2         +4
-#const  HSPHED_SIZE_        HSPHED_SIZE35_
-
-
-#const  PVAL_flag       0
-#const  PVAL_mode       PVAL_flag       +2
-#const  PVAL_len        PVAL_mode       +2
-#const  PVAL_size       PVAL_len        +4*5
-#const  PVAL_pt         PVAL_size       +4      +4
-
-#const  PVAL_SIZE25_    PVAL_pt         +8
-#const  PVAL_master     PVAL_pt         +8
-#const  PVAL_support    PVAL_master     +8
-#const  PVAL_arraycnt   PVAL_support    +2
-#const  PVAL_offset     PVAL_arraycnt   +2
-#const  PVAL_arraymul   PVAL_offset     +4
-
-#const  PVAL_SIZE30_    PVAL_arraymul   +4      +4
-#const  PVAL_SIZE_      PVAL_SIZE30_
-
-
-#const  HSPROUTINE_stacklev     0
-#const  HSPROUTINE_mcsret       HSPROUTINE_stacklev     +4      +4
-#const  HSPROUTINE_param        HSPROUTINE_mcsret       +8
-#const  HSPROUTINE_oldtack      HSPROUTINE_param        +8
-
-#const  HSPROUTINE_SIZE_        HSPROUTINE_oldtack      +8
-
-
-#const  STRUCTPRM_mptype        0
-#const  STRUCTPRM_subid         STRUCTPRM_mptype        +2
-#const  STRUCTPRM_offset        STRUCTPRM_subid         +2
-
-#const  STRUCTPRM_SIZE_         STRUCTPRM_offset        +4
-
-
-#const  MPVARDATA_pval          0
-#const  MPVARDATA_aptr          MPVARDATA_pval  +8
-
-#const  MPVARDATA_SIZE_         MPVARDATA_aptr  +4      +4
-
-
-#const  MPMODVARDATA_subid      0
-#const  MPMODVARDATA_magic      MPMODVARDATA_subid      +2
-#const  MPMODVARDATA_pval       MPMODVARDATA_magic      +2      +4
-#const  MPMODVARDATA_aptr       MPMODVARDATA_pval       +8
-
-#const  MPMODVARDATA_SIZE_      MPMODVARDATA_aptr       +4      +4
-
-
-#const  HSP3DEBUG_flag          0
-#const  HSP3DEBUG_line          HSP3DEBUG_flag          +4
-#const  HSP3DEBUG_fname         HSP3DEBUG_line          +4
-#const  HSP3DEBUG_dbgwin        HSP3DEBUG_fname         +8
-#const  HSP3DEBUG_dbgval        HSP3DEBUG_dbgwin        +8
-#const  HSP3DEBUG_hspctx        HSP3DEBUG_dbgval        +8
-#const  HSP3DEBUG_get_value     HSP3DEBUG_hspctx        +8
-#const  HSP3DEBUG_get_varinf    HSP3DEBUG_get_value     +8
-#const  HSP3DEBUG_dbg_close     HSP3DEBUG_get_varinf    +8
-#const  HSP3DEBUG_dbg_curinf    HSP3DEBUG_dbg_close     +8
-#const  HSP3DEBUG_dbg_set       HSP3DEBUG_dbg_curinf    +8
-
-#const  HSP3DEBUG_SIZE_         HSP3DEBUG_dbg_set       +8
-
-
-#const  HSP3TYPEINFO_type       0
-#const  HSP3TYPEINFO_option     HSP3TYPEINFO_type       +2
-#const  HSP3TYPEINFO_hspctx     HSP3TYPEINFO_option     +2      +4
-#const  HSP3TYPEINFO_hspexinfo  HSP3TYPEINFO_hspctx     +8
-#const  HSP3TYPEINFO_cmdfunc    HSP3TYPEINFO_hspexinfo  +8
-#const  HSP3TYPEINFO_reffunc    HSP3TYPEINFO_cmdfunc    +8
-#const  HSP3TYPEINFO_termfunc   HSP3TYPEINFO_reffunc    +8
-#const  HSP3TYPEINFO_msgfunc    HSP3TYPEINFO_termfunc   +8
-#const  HSP3TYPEINFO_eventfunc  HSP3TYPEINFO_msgfunc    +8
-
-#const  HSP3TYPEINFO_SIZE_      HSP3TYPEINFO_eventfunc  +8
-
-
-#const  FLEXVALUE_type          0
-#const  FLEXVALUE_myid          FLEXVALUE_type          +2
-#const  FLEXVALUE_customid      FLEXVALUE_myid          +2
-#const  FLEXVALUE_clonetype     FLEXVALUE_customid      +2
-#const  FLEXVALUE_size          FLEXVALUE_clonetype     +2
-#const  FLEXVALUE_ptr           FLEXVALUE_size          +4      +4
-
-#const  FLEXVALUE_SIZE_         FLEXVALUE_ptr           +8
-
-
-#const  HSPVARPROC_flag             0
-#const  HSPVARPROC_aftertype        HSPVARPROC_flag             +2
-#const  HSPVARPROC_version          HSPVARPROC_aftertype        +2
-#const  HSPVARPROC_support          HSPVARPROC_version          +2
-#const  HSPVARPROC_basesize         HSPVARPROC_support          +2
-#const  HSPVARPROC_opt              HSPVARPROC_basesize         +2
-#const  HSPVARPROC_vartype_name     HSPVARPROC_opt              +2      +4
-#const  HSPVARPROC_user             HSPVARPROC_vartype_name     +8
-#const  HSPVARPROC_Cnv              HSPVARPROC_user             +8
-#const  HSPVARPROC_CnvCustom        HSPVARPROC_Cnv              +8
-#const  HSPVARPROC_GetPtr           HSPVARPROC_CnvCustom        +8
-#const  HSPVARPROC_ArrayObjectRead  HSPVARPROC_GetPtr           +8
-#const  HSPVARPROC_ArrayObject      HSPVARPROC_ArrayObjectRead  +8
-#const  HSPVARPROC_ObjectWrite      HSPVARPROC_ArrayObject      +8
-#const  HSPVARPROC_ObjectMethod     HSPVARPROC_ObjectWrite      +8
-#const  HSPVARPROC_Alloc            HSPVARPROC_ObjectMethod     +8
-#const  HSPVARPROC_Free             HSPVARPROC_Alloc            +8
-#const  HSPVARPROC_GetSize          HSPVARPROC_Free             +8
-#const  HSPVARPROC_GetUsing         HSPVARPROC_GetSize          +8
-#const  HSPVARPROC_GetBlockSize     HSPVARPROC_GetUsing         +8
-#const  HSPVARPROC_AllocBlock       HSPVARPROC_GetBlockSize     +8
-#const  HSPVARPROC_Set              HSPVARPROC_AllocBlock       +8
-#const  HSPVARPROC_AddI             HSPVARPROC_Set              +8
-#const  HSPVARPROC_SubI             HSPVARPROC_AddI             +8
-#const  HSPVARPROC_MulI             HSPVARPROC_SubI             +8
-#const  HSPVARPROC_DivI             HSPVARPROC_MulI             +8
-#const  HSPVARPROC_ModI             HSPVARPROC_DivI             +8
-#const  HSPVARPROC_AndI             HSPVARPROC_ModI             +8
-#const  HSPVARPROC_OrI              HSPVARPROC_AndI             +8
-#const  HSPVARPROC_XOrI             HSPVARPROC_OrI              +8
-#const  HSPVARPROC_EqI              HSPVARPROC_XOrI             +8
-#const  HSPVARPROC_NeI              HSPVARPROC_EqI              +8
-#const  HSPVARPROC_GtI              HSPVARPROC_NeI              +8
-#const  HSPVARPROC_LtI              HSPVARPROC_GtI              +8
-#const  HSPVARPROC_GtEqI            HSPVARPROC_LtI              +8
-#const  HSPVARPROC_LtEqI            HSPVARPROC_GtEqI            +8
-#const  HSPVARPROC_RrI              HSPVARPROC_LtEqI            +8
-#const  HSPVARPROC_LrI              HSPVARPROC_RrI              +8
-
-#const  HSPVARPROC_SIZE_            HSPVARPROC_LrI              +8
-
-
-#const  HED_STRUCTDAT_index     0
-#const  HED_STRUCTDAT_subid     HED_STRUCTDAT_index     +2
-#const  HED_STRUCTDAT_prmindex  HED_STRUCTDAT_subid     +2
-#const  HED_STRUCTDAT_prmmax    HED_STRUCTDAT_prmindex  +4
-#const  HED_STRUCTDAT_nameidx   HED_STRUCTDAT_prmmax    +4
-#const  HED_STRUCTDAT_size      HED_STRUCTDAT_nameidx   +4
-#const  HED_STRUCTDAT_otindex   HED_STRUCTDAT_size      +4
-#const  HED_STRUCTDAT_funcflag  HED_STRUCTDAT_otindex   +4
-
-#const  HED_STRUCTDAT_SIZE_     HED_STRUCTDAT_funcflag  +4
-
-
-#const  STRUCTDAT_index     0
-#const  STRUCTDAT_subid     STRUCTDAT_index     +2
-#const  STRUCTDAT_prmindex  STRUCTDAT_subid     +2
-#const  STRUCTDAT_prmmax    STRUCTDAT_prmindex  +4
-#const  STRUCTDAT_nameidx   STRUCTDAT_prmmax    +4
-#const  STRUCTDAT_size      STRUCTDAT_nameidx   +4
-#const  STRUCTDAT_otindex   STRUCTDAT_size      +4
-#const  STRUCTDAT_proc      STRUCTDAT_otindex   +4
-#const  STRUCTDAT_funcflag  STRUCTDAT_proc      +8
-
-#const  STRUCTDAT_SIZE_     STRUCTDAT_funcflag  +4      +4
-
-
-#const  HED_LIBDAT_flag     0
-#const  HED_LIBDAT_nameidx  HED_LIBDAT_flag         +4
-#const  HED_LIBDAT_p_hlib   HED_LIBDAT_nameidx      +4
-#const  HED_LIBDAT_clsid    HED_LIBDAT_p_hlib       +4
-
-#const  HED_LIBDAT_SIZE_    HED_LIBDAT_clsid        +4
-
-
-#const  LIBDAT_flag     0
-#const  LIBDAT_nameidx  LIBDAT_flag         +4
-#const  LIBDAT_hlib     LIBDAT_nameidx      +4
-#const  LIBDAT_clsid    LIBDAT_hlib         +8
-
-#const  LIBDAT_SIZE_    LIBDAT_clsid        +4      +4
-
-
-#const  MEM_HPIDAT_flag         0
-#const  MEM_HPIDAT_option       MEM_HPIDAT_flag         +2
-#const  MEM_HPIDAT_libname      MEM_HPIDAT_option       +2
-#const  MEM_HPIDAT_funcname     MEM_HPIDAT_libname      +4
-#const  MEM_HPIDAT_libptr       MEM_HPIDAT_funcname     +4      +4
-
-#const  MEM_HPIDAT_SIZE_        MEM_HPIDAT_libptr       +8
-
-
-#const  HPIDAT_flag         0
-#const  HPIDAT_option       HPIDAT_flag         +2
-#const  HPIDAT_libname      HPIDAT_option       +2
-#const  HPIDAT_funcname     HPIDAT_libname      +4
-#const  HPIDAT_p_libptr     HPIDAT_funcname     +4
-
-#const  HPIDAT_SIZE_        HPIDAT_p_libptr     +4
-
-
-#endif


Update MainScript.as

Update MainScript.as

Removed someone elses commented out code


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1258764 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/collections/errors/ItemPendingError.as
+++ frameworks/projects/framework/src/mx/collections/errors/ItemPendingError.as
@@ -0,0 +1,105 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2006 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.collections.errors
+{
+
+import mx.rpc.IResponder;
+
+/**
+ *  This error is thrown when retrieving an item from a collection view
+ *  requires an asynchronous call. This error occurs when the backing data
+ *  is provided from a remote source and the data is not yet available locally.
+ *
+ *
If the receiver of this error needs notification when the requested item
+ *  becomes available (that is, when the asynchronous call completes), it must
+ *  use the addResponder() method and specify
+ *  an object that  supports the mx.rpc.IResponder
+ *  interface to respond when the item is available.
+ *  The mx.collections.ItemResponder class implements the
+ *  IResponder interface and supports a data property.

+ *
+ *  @see mx.collections.ItemResponder
+ *  @see mx.rpc.IResponder
+ */
+public class ItemPendingError extends Error
+{
+    include "../../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+	 *  Constructor.
+	 *
+	 *
Called by the Flex Framework when a request is made
+	 *  for an item that isn't local.

+	 *
+	 *  @param message A message providing information about the error cause.
+     */
+    public function ItemPendingError(message:String)
+    {
+        super(message);
+    }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+	// responder
+	//----------------------------------
+
+    /**
+	 *  @private
+	 */
+	private var _responders:Array;
+
+    /**
+     *  An array of IResponder handlers that will be called when
+     *  the asynchronous request completes.
+	 */
+	public function get responders():Array
+	{
+		return _responders;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  addResponder adds a responder to an Array of responders.
+     *  The object assigned to the responder parameter must implement the
+     *  mx.rpc.IResponder interface.
+	 *
+	 *  @param responder A handler which will be called when the asynchronous request completes.
+	 *
+	 *  @see	mx.rpc.IResponder
+	 *  @see	mx.collections.ItemResponder
+     */
+	public function addResponder(responder:IResponder):void
+	{
+		if (!_responders)
+			_responders = [];
+
+		_responders.push(responder);
+	}
+}
+
+}


fixed bug handling non-CallbackCollection objects implementing ICallbackCollection

--- WeaveCore/src/weave/core/SessionManager.as
+++ WeaveCore/src/weave/core/SessionManager.as
@@ -800,8 +800,8 @@
 					var triggerCount:int = _dUnbusyTriggerCounts[owner];
 					delete _dUnbusyTriggerCounts[owner]; // affects next for loop iteration - mitigated by outer loop

-					var cc:CallbackCollection = CallbackCollection(getCallbackCollection(owner));
-					if (cc.wasDisposed)
+					var cc:ICallbackCollection = getCallbackCollection(owner);
+					if (cc is CallbackCollection ? (cc as CallbackCollection).wasDisposed : objectWasDisposed(owner))
 						continue; // already disposed

 					if (cc.triggerCounter != triggerCount)


SUP-2094 partial fix

SUP-2094 partial fix

--- plugins/googleAnalyticsPlugin/src/com/kaltura/kdpfl/plugin/googleAnalytics/GAStatisticsMediator.as
+++ plugins/googleAnalyticsPlugin/src/com/kaltura/kdpfl/plugin/googleAnalytics/GAStatisticsMediator.as
@@ -71,7 +71,7 @@
 		 */
 		public var urchinCode : String;

-		public var defaultCategory:String;
+		public var defaultCategory:String = 'Kaltura Video Events';
 		private var _isLive:Boolean = false;
 		/**
 		 *Constructor.


Fix wrong matrix math in gizmo scaling. Take zoom into account.

--- bin/Data/Scripts/Editor/EditorGizmo.as
+++ bin/Data/Scripts/Editor/EditorGizmo.as
@@ -181,12 +181,12 @@
     if (gizmo is null || !gizmo.enabled)
         return;

-    float scale = 0.1;
+    float scale = 0.1 / camera.zoom;

     if (camera.orthographic)
         scale *= camera.orthoSize;
     else
-        scale *= (camera.view.Inverse() * gizmoNode.position).z;
+        scale *= (camera.view * gizmoNode.position).z;

     gizmoNode.scale = Vector3(scale, scale, scale);
 }


Added traces for the claim, as it is apparent this code changes claims as well as the reasons.

--- unittests/TestDisjunctiveSyllogism.as
+++ unittests/TestDisjunctiveSyllogism.as
@@ -55,15 +55,18 @@
 		[Test(order=1)]
 		public function testNotPTrue():void{
 			djs.notP(true);
+
 			trace("~~ Printing all reasons in NotPTrue");
 			for each (var reason:String in djs.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djs.getClaim());
 			djsReverse.notP(true);
 			trace("~~ Printing all reasons in Reverse NotPTrue");
 			for each (reason in djsReverse.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djsReverse.getClaim());
 		}
 		[Test(order=2)]
 		public function testNotPFalse():void{
@@ -72,11 +75,13 @@
 			for each (var reason:String in djs.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djs.getClaim());
 			djsReverse.notP(false);
 			trace("~~ Printing all reasons in Reverse NotPFalse");
 			for each (reason in djsReverse.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djsReverse.getClaim());
 		}
 		[Test(order=3)]
 		public function testNotQTrue():void{
@@ -85,11 +90,13 @@
 			for each (var reason:String in djs.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djs.getClaim());
 			djsReverse.notQ(true);
 			trace("~~ Printing all reasons in Reverse NotQTrue");
 			for each (reason in djsReverse.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djsReverse.getClaim());
 		}
 		[Test(order=4)]
 		public function testNotQFalse():void{
@@ -98,11 +105,13 @@
 			for each (var reason:String in djs.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djs.getClaim());
 			djsReverse.notQ(false);
 			trace("~~ Printing all reasons in Reverse NotQFalse");
 			for each (reason in djsReverse.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djsReverse.getClaim());
 		}
 		[Test(order=5)]
 		public function testAlternatePTrue():void{
@@ -111,11 +120,13 @@
 			for each (var reason:String in djs.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djs.getClaim());
 			djsReverse.alternateP(true);
 			trace("~~ Printing all reasons in Reverse AlternatePTrue");
 			for each (reason in djsReverse.getReason()){
 				trace(reason);
-			}
+			}
+			trace("Claim: ", djsReverse.getClaim());
 		}
 		[Test(order=6)]
 		public function testAlternatePFalse():void{
@@ -124,11 +135,13 @@
 			for each (var reason:String in djs.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djs.getClaim());
 			djsReverse.alternateP(false);
 			trace("~~ Printing all reasons in Reverse AlternatePFalse");
 			for each (reason in djsReverse.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djsReverse.getClaim());
 		}
 		[Test(order=7)]
 		public function testAlternateQTrue():void{
@@ -137,11 +150,13 @@
 			for each (var reason:String in djs.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djs.getClaim());
 			djsReverse.alternateQ(true);
 			trace("~~ Printing all reasons in Reverse AlternateQTrue");
 			for each (reason in djsReverse.getReason()){
 				trace(reason);
-			}
+			}
+			trace("Claim: ", djsReverse.getClaim());
 		}
 		[Test(order=8)]
 		public function testAlternateQFalse():void{
@@ -150,11 +165,13 @@
 			for each (var reason:String in djs.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djs.getClaim());
 			djsReverse.alternateQ(false);
 			trace("~~ Printing all reasons in Reverse AlternateQFalse");
 			for each (reason in djsReverse.getReason()){
 				trace(reason);
 			}
+			trace("Claim: ", djsReverse.getClaim());
 		}
 	}
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 23247
Author:   cframpto@adobe.com
Date:     2011-12-20T19:21:13.134833Z

Log Message:
-----------
Remove ADOBE SYSTEMS license and replace with Apache license in headers - frameworks.  A 2nd pass will be needed to get the files not handled up by the scripts.

Modified Paths:
--------------
4959 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1283445 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/effects/AnimateColor.as
+++ frameworks/projects/spark/src/spark/effects/AnimateColor.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2008 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////
 package spark.effects


create context lazily to avoid intermittent #3500 errors

--- actionscript/src/com/freshplanet/ane/AirPushNotification/PushNotification.as
+++ actionscript/src/com/freshplanet/ane/AirPushNotification/PushNotification.as
@@ -57,6 +57,21 @@
             return _instance ? _instance : new PushNotification();
         }

+        private function callContext(...args):*
+        {
+            var context: ExtensionContext = getContext();
+            if(!context) {
+                _log("ERROR", "Extension context is null. Please check if extension.xml is setup correctly.")
+                return null;
+            }
+            try {
+                return context.call.apply(context, args);
+            } catch (e: Error) {
+                _log("ERROR", "Error calling extension context: " + e.message + " : " + e.getStackTrace());
+            }
+            return null;
+        }
+
 		/**
 		 *  return true if notifs are enabled for this app in device settings
 		 *  If iOS < 8 or android < 4.1 this isn't available, so will always return true.
@@ -66,7 +81,7 @@
 			if (!isSupported)
 				return;

-			_context.call("getNotificationsEnabled");
+			callContext("getNotificationsEnabled");
 		}

 		/**
@@ -83,7 +98,7 @@
 				return true;

-			return _context.call("checkNotificationChannelEnabled", channelId);
+			return callContext("checkNotificationChannelEnabled", channelId);
 		}

 		/**
@@ -94,7 +109,7 @@
 			if (!isSupported)
 				return false;

-			return _context.call("getCanSendUserToSettings");
+			return callContext("getCanSendUserToSettings");
 		}

         /**
@@ -106,7 +121,7 @@
 				channelId = "";

 			if (isSupported)
-                _context.call("openDeviceNotificationSettings", channelId);
+                callContext("openDeviceNotificationSettings", channelId);
 		}

         /**
@@ -121,9 +136,9 @@
 				return;

 			if (_isAndroid())
-                _context.call("registerPush", projectId);
+                callContext("registerPush", projectId);
 			else if(_isIOS())
-				_context.call("registerPush", iOSNotificationCategories != null ? JSON.stringify(iOSNotificationCategories) : null);
+				callContext("registerPush", iOSNotificationCategories != null ? JSON.stringify(iOSNotificationCategories) : null);
 		}

         /**
@@ -133,7 +148,7 @@
 		public function setBadgeNumberValue(value:int):void {

 			if (isSupported)
-                _context.call("setBadgeNb", value);
+                callContext("setBadgeNb", value);
 		}

 		/**
@@ -176,7 +191,7 @@
 			if(!categoryId)
 				categoryId = "";

-			_context.call("sendLocalNotification", message, timestamp, title, recurrenceType, notificationId, deepLinkPath, iconPath, groupId, categoryId, makeSquare);
+			callContext("sendLocalNotification", message, timestamp, title, recurrenceType, notificationId, deepLinkPath, iconPath, groupId, categoryId, makeSquare);

 		}

@@ -189,9 +204,9 @@
 	       	if (isSupported) {

 	         	if (notificationId == DEFAULT_LOCAL_NOTIFICATION_ID)
-                    _context.call("cancelLocalNotification");
+                    callContext("cancelLocalNotification");
 	         	else
-                    _context.call("cancelLocalNotification", notificationId);
+                    callContext("cancelLocalNotification", notificationId);
 	       	}
 	    }

@@ -201,7 +216,7 @@
 		public function cancelAllLocalNotifications():void {

 			if (isSupported)
-                _context.call("cancelAllLocalNotifications");
+                callContext("cancelAllLocalNotifications");
 		}

         /**
@@ -211,7 +226,7 @@
 		public function setIsAppInForeground(value:Boolean, appGroupId:String):void {

 			if (isSupported)
-                _context.call("setIsAppInForeground", value, appGroupId);
+                callContext("setIsAppInForeground", value, appGroupId);
 		}

         /**
@@ -223,14 +238,14 @@
 			if (isSupported) {

 				this.addEventListener(PushNotificationEvent.APP_STARTING_FROM_NOTIFICATION_EVENT, listener);
-                _context.call("fetchStarterNotification");
+                callContext("fetchStarterNotification");
 			}
 		}

 		public function checkAppNotificationSettingsRequest():void {

 			if (_isIOS()) {
-				_context.call("checkAppNotificationSettingsRequest");
+				callContext("checkAppNotificationSettingsRequest");
 			}
 		}

@@ -239,7 +254,7 @@
         public function storeTrackingNotifUrl(url:String, appGroupId:String):void {

             if (isSupported)
-                _context.call("storeNotifTrackingInfo", url, appGroupId);
+                callContext("storeNotifTrackingInfo", url, appGroupId);
         }

 		/**
@@ -253,7 +268,7 @@
 		public function createAndroidNotificationChannel(channelId:String, channelName:String, importance:int, enableLights:Boolean, enableVibration:Boolean):void {

 			if (_isAndroid())
-				_context.call("createNotificationChannel", channelId, channelName, importance, enableLights, enableVibration);
+				callContext("createNotificationChannel", channelId, channelName, importance, enableLights, enableVibration);
 		}

@@ -267,7 +282,6 @@

         private static const EXTENSION_ID:String = "com.freshplanet.ane.AirPushNotification";
         private static var _instance:PushNotification = null;
-        private var _context:ExtensionContext = null;

         /**
          * "private" singleton constructor
@@ -280,13 +294,20 @@
                 throw Error("This is a singleton, use getInstance(), do not call the constructor directly.");

             _instance = this;
-
-            _context = ExtensionContext.createExtensionContext(EXTENSION_ID, null);
-
-            if (!_context)
-                _log("ERROR", "Extension context is null. Please check if extension.xml is setup correctly.");
-            else
-                _context.addEventListener(StatusEvent.STATUS, _onStatus);
+        }
+
+        private var __context:ExtensionContext;
+        private function getContext():ExtensionContext
+        {
+            if (!__context) {
+                __context = ExtensionContext.createExtensionContext(EXTENSION_ID, null);
+                if (!__context) {
+                    _log("ERROR", "Extension context is null. Please check if extension.xml is setup correctly.");
+                } else {
+                    __context.addEventListener(StatusEvent.STATUS, _onStatus);
+                }
+            }
+            return __context;
         }

         /**


OFC-597 Plot numbers and other entity ids should be sorted in pulldown
entity selector

Do not sort entities without defined keys

--- collect-flex/collect-flex-client/src/generated/flex/org/openforis/collect/model/proxy/EntityProxy.as
+++ collect-flex/collect-flex-client/src/generated/flex/org/openforis/collect/model/proxy/EntityProxy.as
@@ -152,14 +152,18 @@
 				return 0;
 			} else {
 				var keyValues1:Array = entity1.getKeyValues();
-				var keyValues2:Array = entity2.getKeyValues();
-				for (var i:int = 0; i < keyValues1.length; i++) {
-					var keyValue1:Object = keyValues1[i];
-					var keyValue2:Object = keyValues2[i];
-					var partialCompareResult:int = _SORT.compareFunction.call(null, keyValues1, keyValue2, fields);
-					if ( partialCompareResult != 0 ) {
-						return partialCompareResult;
-					}
+				if ( keyValues1.length > 0 ) {
+					var keyValues2:Array = entity2.getKeyValues();
+					for (var i:int = 0; i < keyValues1.length; i++) {
+						var keyValue1:Object = keyValues1[i];
+						var keyValue2:Object = keyValues2[i];
+						var partialCompareResult:int = _SORT.compareFunction.call(null, keyValues1, keyValue2, fields);
+						if ( partialCompareResult != 0 ) {
+							return partialCompareResult;
+						}
+					}
+				} else {
+					return _SORT.compareFunction.call(null, entity1.index, entity2.index, fields);
 				}
 			}
 			return 0;


Transferred from the Adobe Open Source Subversion Repository

Revision: 8741
Author:   jimurphy@adobe.com
Date:     2009-07-22T21:00:56.965677Z

Log Message:
-----------
Merged 3.x revisions 8623,8685,8740 -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/mxml/IMXMLSupport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/SimpleXMLDecoder.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/AbstractOperation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/mxml/RemoteObject.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/ISOAPDecoder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/AbstractService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/remoting/Operation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/AbstractWebService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/messages/MessagePerformanceUtils.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPMultiService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/xml/SimpleXMLEncoder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/HTTPService.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/http/Operation.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1273969 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/rpc/src/mx/messaging/messages/MessagePerformanceUtils.as
+++ frameworks/projects/rpc/src/mx/messaging/messages/MessagePerformanceUtils.as
@@ -286,16 +286,8 @@
         }

         /**
-         * Time, in milliseconds, that this message sat on the server after it was ready
-         * to be pushed to this client but before it was picked up by a poll request.
-         *
-         *
For a streaming or RTMP (LiveCycle Data Services ES only) channel, this value is always 0.

-         *
-         *  @langversion 3.0
-         *  @playerversion Flash 9
-         *  @playerversion AIR 1.1
-         *  @productversion BlazeDS 4
-         *  @productversion LCDS 3
+         * Time that the message waited on the server after it was ready to be pushed to the client
+         * but had not yet been polled for.
          */
         public function get serverPollDelay():Number
         {


Transferred from the Adobe Open Source Subversion Repository

Revision: 16729
Author:   hmuller@adobe.com
Date:     2010-06-29T22:37:23.013026Z

Log Message:
-----------
The following changes apply to Spark DataGrid only.   Code reviews have been deferred until the implementation is closer to completion.

Added Grid requestedRowCount, requestedColumnCount, requestedMinRowCount, requestedMinColumnCount properties.   They're similar to the Vertical,HorizontalLayout properties of the same name and are used by GridLayout/measure().   Added covers for same to DataGrid and made requestedRowCount=10 by default.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Grid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridDimensions.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/GridLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/GridContainerBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ColumnHeaderBarLayout.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1281496 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as
+++ frameworks/projects/spark/src/spark/components/gridClasses/GridDimensions.as
@@ -163,7 +163,7 @@
     //  defaultRowHeight
     //----------------------------------

-    private var _defaultRowHeight:Number = 32;
+    private var _defaultRowHeight:Number = 22;

     /**
      *  The default height of a row. The defaultRowHeight is always
@@ -605,18 +605,22 @@
     }

     /**
-     *  Returns the total layout width of the content including gaps.
-     */
-    public function get contentWidth():Number
-    {
+     *  Returns the total layout width of the content including gaps.   If
+	 *  columnCountOverride is specified, then the overall width of as many columns
+	 *  is returned.
+     */
+    public function getContentWidth(columnCountOverride:int = -1):Number
+    {
+		const nCols:int = (columnCountOverride == -1) ? columnCount : columnCountOverride;
+
         if (!_columnWidths)
-            return (_columnCount * (defaultColumnWidth + columnGap)) - columnGap;
+            return (nCols * (defaultColumnWidth + columnGap)) - columnGap;

         var width:Number = 0;

-        for (var i:int = 0; i < _columnCount; i++)
-        {
-            if (isNaN(_columnWidths[i]))
+        for (var i:int = 0; i < nCols; i++)
+        {
+            if ((i >= _columnWidths.length) || isNaN(_columnWidths[i]))
                 width += defaultColumnWidth + columnGap;
             else
                 width += _columnWidths[i] + columnGap;
@@ -626,15 +630,19 @@
     }

     /**
-     *  Returns the total layout height of the content including gaps.
-     */
-    public function get contentHeight():Number
-    {
+     *  Returns the total layout height of the content including gaps.  If
+	 *  rowHeightOverride is specified, then the overall height of as many rows
+	 *  is returned.
+     */
+    public function getContentHeight(rowCountOverride:int = -1):Number
+    {
+		const nRows:int = (rowCountOverride == -1) ? rowCount : rowCountOverride;
+
         if (!isNaN(fixedRowHeight))
-            return (rowCount * (fixedRowHeight + rowGap)) - rowGap;
+            return (nRows * (fixedRowHeight + rowGap)) - rowGap;

         if (rowList.length == 0)
-            return (rowCount * (defaultRowHeight + rowGap)) - rowGap;
+            return (nRows * (defaultRowHeight + rowGap)) - rowGap;

         var height:Number = 0;
         var node:GridRowNode = rowList.first;
@@ -647,7 +655,7 @@
             node = node.next;
         }

-        return height + ((rowCount - numRows) * (defaultRowHeight) + (rowCount - 1) * rowGap);
+        return height + ((nRows - numRows) * (defaultRowHeight) + (nRows - 1) * rowGap);
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1260098 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/core/Version.as
+++ frameworks/projects/framework/src/mx/core/Version.as
@@ -0,0 +1,18 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+import mx.core.mx_internal;
+
+/**
+ *  @private
+ *  Version string for this class.
+ */
+mx_internal static const VERSION:String = "3.0.0.0";


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1269491 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/effects/easing/Sine.as
+++ frameworks/projects/mx/src/mx/effects/easing/Sine.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2004-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.effects.easing
 {


TextFormat支持bytes

TextFormat支持bytes

--- as3/com/netease/protobuf/TextFormat.as
+++ as3/com/netease/protobuf/TextFormat.as
@@ -1,4 +1,4 @@
-// vim: tabstop=4 shiftwidth=4
+// vim: tabstop=4 shiftwidth=4

 // Copyright (c) 2011 , Yang Bo All rights reserved.
 //
@@ -291,6 +291,11 @@
 						if (enumRepeatedFieldDescriptor) {
 							printEnum(output, int(value),
 									enumRepeatedFieldDescriptor.enumType)
+						} else if (
+								fieldDescriptor is FieldDescriptor$TYPE_BYTES ||
+								fieldDescriptor is
+										RepeatedFieldDescriptor$TYPE_BYTES) {
+							printBytes(output, ByteArray(value))
 						} else {
 							output.writeUTFBytes(value.toString())
 						}
@@ -639,6 +644,9 @@
 				} else {
 					fieldDescriptor = Object(message).constructor[
 							name.toUpperCase()]
+					if (!fieldDescriptor) {
+						throw new IOError("Unknown field: " + name);
+					}
 				}
 			}
 			const repeatedFieldDescriptor:RepeatedFieldDescriptor =


include the following data about the country in the bottom right hand corner of the AS diagram: network complexity, points of control, ip addresses, points of control / ip address

--- asn_visualization/asn_visualization.as
+++ asn_visualization/asn_visualization.as
@@ -1,8 +1,9 @@
 package
 {

+    import com.adobe.serialization.json.JSON;
+
     import flare.analytics.graph.ShortestPaths;
-    import flare.data.converters.JSONConverter;
     import flare.display.DirtySprite;
     import flare.display.TextSprite;
     import flare.query.methods.update;
@@ -55,10 +56,9 @@
             var ldr:URLLoader=new URLLoader(new URLRequest(get_json_url()));
             _bar.loadURL(ldr, function():void
                 {
-                    var jsc:JSONConverter=new JSONConverter();
-                    var arr:Array=jsc.parse(ldr.data, null);
-
-                    var data:Data=buildData(arr);
+                    var json:Object=JSON.decode(ldr.data)
+
+                    var data:Data=buildData(json);
                     visualize(data);
                     _bar=null;
                     update();
@@ -92,6 +92,7 @@
         private var _node_click_behavior_toggle:TextSprite;

         private var _below_vis:TextSprite;
+        private var _country_info_box:TextSprite;

         private var layout_format:uint=CIRCLE_LAYOUT;

@@ -106,6 +107,8 @@

         private static const show_edges:Boolean=true;
         private var vis:Visualization;
+
+        private var country_level_info:Object; // Country stats such as network complexity, PoC, etc.

         public function visualize(data:Data):void
         {
@@ -270,6 +273,22 @@

             _below_vis=new TextSprite("XXX", null, TextSprite.DEVICE);
             addChild(_below_vis);
+
+            var number_base:NumberBase=new NumberBase();
+
+            _country_info_box=new TextSprite("XXX", null, TextSprite.DEVICE);
+
+            _country_info_box.textField.multiline=true;
+            var country_info_string:String=country_info_string="<b>Country Summary:</b>\n";
+            country_info_string+="Network Complexity: " + number_base.formatPrecision(country_level_info['complexity'], 3) + "\n";
+            country_info_string+=number_base.formatThousands(country_level_info['total_ips']) + " IP Addresses" + "\n";
+            country_info_string+=number_base.formatThousands(country_level_info["points_of_control"]) + " Points of Control: " + "\n";
+            country_info_string+=number_base.formatThousands(country_level_info["ips_per_points_of_control"]) + " IPs per Point of Control";
+
+            _country_info_box.htmlText=country_info_string;
+
+            addChild(_country_info_box);
+
         }

         private function addDetail():void
@@ -287,7 +306,7 @@
             return ret;
         }

-        private function buildData(arr:Array):Data
+        private function buildData(json:Object):Data
         {
             var data:Data=new Data(true);

@@ -296,6 +315,10 @@
             var total_ips:int=0;

             var o:Object;
+
+            country_level_info=json.country_level_info;
+
+            var arr:Array=json.asns;
             for each (o in arr)
             {
                 var nodeSprite:NodeSprite=data.addNode(o);
@@ -676,7 +699,7 @@
             if (_detail)
             {
                 _detail.x=vis.bounds.width + 1;
-                _detail.y=vis.bounds.y + vis.bounds.height / 5;
+                _detail.y=vis.bounds.y + vis.bounds.height / 8;
             }

             if (_node_click_behavior_toggle)
@@ -691,9 +714,15 @@
             _below_vis.text+="vis bounds  " + vis.bounds;
             _below_vis.text+=" vis.x " + vis.x;
             _below_vis.text+=" vis.y " + vis.y;
-            _below_vis.y=vis.y + vis.bounds.height;
+            _below_vis.y=vis.y + vis.bounds.height - 10;
             _below_vis.x=vis.y + vis.bounds.width / 2;
             _below_vis.text+="under vis " + _below_vis.y
+
+            if (_country_info_box)
+            {
+                _country_info_box.x=vis.x + vis.width - 48;
+                _country_info_box.y=vis.y + vis.height - _country_info_box.height + 10;
+            }
         }

         private function restore_edges_color():void