Bug 757375: concurrency changes, update asdocs (p=proberts,r=proberts)
   integrate CL 1098415

CL@1101447

--- core/concurrent.as
+++ core/concurrent.as
@@ -44,34 +44,40 @@
 include "api-versions.as"

 /**
- * A Mutex is an object that facilitates "mutual exclusion"
- * of competing threads of execution in critical sections.
- *
- * At any given time there can be at most one thread of execution
- * which has ownership of a given mutex.
- * Transitions between who owns a mutex and who does not are always atomic.
- * The methods of this class are such that a critical section can be guarded
- * by acquiring and then releasing a mutex at its boundaries.
- *
- * Every new running worker contains at least one new thread of execution.
- * Mutexes treat all threads the same, irrespective of the workers they are in.
- * Thus mutexes can be used to control concurrency between workers as a whole
- * as well as threads within and across them.
- *
- * When a mutex is transported to another worker via an argument of a
- * MessageChannel call or via Worker.setSharedProperty()
- * then the remote copy of the mutex will continue to use
- * the identical underlying lock handling data structures.
- * This makes the original mutex effectively shared between workers,
- * which can thus create critical sections that exclude each other.
- *
- * Note that locking and unlocking are not lexically paired.
- * Also note that these mutexes are recursive,
- * i.e. repeated locking increases an internal lock count
- * and only an equal amount of unlock calls finally releases a mutex.
- * Otherwise it stays locked.
- *
- * Any attempt to unlock a mutex that is not owned by the caller throws an error.
+ * The Mutex (short for "mutual exclusion") class provides a way to make sure
+ * that only one set of code operates on a particular block of memory or other
+ * shared resource at a time. The primary use for a Mutex is to manage code in
+ * different workers accessing a shareable byte array (a ByteArray object whose
+ * shareable property is true). However, a Mutex can be
+ * used to manage workers' access to any shareable resource, such as an AIR native
+ * extension or a filesystem file. No matter what the resource, the purpose of
+ * the mutex is to ensure that only one set of code accesses the resource at a time.
+ *
+ *
A mutex manages access using the concept of resource ownership. At any
+ time a single mutex is "owned" by at most one worker. When ownership of a
+ mutex switches from one worker to another the transision is atomic. This
+ guarantees that it will never be possible for more than one worker to take
+ ownership of the mutex. As long as code in a worker only operates on a shared
+ resource when that worker owns the mutex, you can be certain that there will
+ never be a conflict from multiple workers.

+ *
+ *
Use the tryLock() method to take ownership of the mutex if
+ * it is available. Use the lock() method to pause the current
+ * worker's execution until the mutex is available, then take ownership of the
+ * mutex. Once the current worker has ownership of the mutex, it can safely
+ * operate on the shared resource. When those operations are complete, call the
+ * unlock() method to release the mutex. At that point the current
+ * worker should no longer access the shared resource.

+ *
+ *
The Mutex class is one of the special object types that are shared
+ * between workers rather than copied between them. When you pass a mutex from
+ * one worker to another worker either by calling the Worker object's
+ * setSharedProperty() method or by using a MessageChannel object,
+ * both workers have a reference to the same Mutex object in the runtime's memory.

+ *
+ * @see flash.system.Worker Worker class
+ * @see flash.utils.ByteArray#shareable ByteArray.shareable property
+ * @see flash.concurrent.Condition Condition class
  *
  * @langversion 3.0
  * @playerversion Flash 11.4
@@ -82,9 +88,7 @@
 final public class Mutex
 {
     /**
-     * The constructor for mutexes.
-     *
-     * The initial internal lock count of every new mutex is zero.
+     * Creates a new Mutex instance.
      *
      * @langversion 3.0
      * @playerversion Flash 11.4
@@ -96,13 +100,27 @@
     }

     /**
-     * Wait until this mutex is available and then take exclusive ownership,
-     * increase the mutex's lock count by one, and proceed.
-     * This is also known as "acquiring" this mutex.
-     *
-     * If a thread already owns a mutex when this call is made to lock it,
-     * then its internal lock count is increased and no other action occurs.
-     *
+     * Pauses execution of the current worker until this mutex is available and
+     * then takes ownership of the mutex. If another worker currently owns the
+     * mutex, the calling worker's execution thread pauses at the
+     * lock() call and the worker is added to the queue of ownership
+     * requests. Once it is this worker's turn to own the mutex, the worker's
+     * execution continues with the line of code following the
+     * lock() call.
+     *
+     *
Once the current worker has ownership of the mutex, it can safely
+     * operate on the shared resource. When those operations are complete, call
+     * the unlock() method to release the mutex. At that point the
+     * current worker should no longer access the shared resource.

+     *
+     *
Internally, a mutex keeps a count of the number of lock requests it
+     * has received. The mutex must receive the same number of unlock requests
+     * before it is completely released. If code in the worker that owns the
+     * mutex locks it again (by calling the lock() method) the
+     * internal lock count increases by one. You must call the
+     * unlock() method as many times as the number of lock requests
+     * to release ownership of the mutex.

+     *
      * @langversion 3.0
      * @playerversion Flash 11.4
      * @playerversion AIR 3.4
@@ -110,17 +128,18 @@
     public native function lock() :void

     /**
-     * Attempt to acquire ownership of this mutex.
-     *
-     * If and only if the mutex is available, acquire it,
-     * increase its lock count, and immediately return true.
-     * Otherwise, do not acquire the mutex and immediately return false.
-     * Do all of the above atomically.
-     *
-     * If the mutex is already owned by the current thread/worker,
-     * the lock count is increased and no other action occurs.
-     *
-     * @return true if the lock was acquired, false otherwise.
+     * Acquires ownership of the mutex if it is available. Otherwise, calling
+     * this method returns false and code execution continues
+     * immediately.
+     *
+     *
Once the current worker has ownership of the mutex, it can safely
+     * operate on the shared resource. When those operations are complete, call
+     * the unlock() method to release the mutex. At that point the
+     * current worker should no longer access the shared resource.

+     *
+     * @return true if the mutex was available (and is now owned
+     * by the current worker), or false if the current worker did
+     * not acquire ownership of the mutex
      *
      * @langversion 3.0
      * @playerversion Flash 11.4
@@ -129,13 +148,16 @@
     public native function tryLock() :Boolean;

     /**
-     * Release ownership of this mutex,
-     * allowing any thread/worker to acquire it and proceed.
-     *
-     * This mutex must be locked and owned by the current thread/worker.
-     * Otherwise an error is thrown.
-     *
-     * @throws IllegalOperationException when the current thread doesn't own the mutex.
+     * Releases ownership of this mutex, allowing any worker to acquire it and
+     * perform work on the associated resource.
+     *
+     *
Internally, a mutex keeps a count of the number of lock requests it
+     * has received. Code in a worker must call the unlock()
+     * method as many times as the number of lock requests in order to release
+     * ownership of the mutex.

+     *
+     * @throws flash.errors.IllegalOperationError when the current worker
+     *         doesn't own the mutex.
      *
      * @langversion 3.0
      * @playerversion Flash 11.4
@@ -147,13 +169,55 @@
 }

 /**
- * A Condition (aka condition variable) is a synchronization primitive that facilitates
- * making threads of execution wait until a particular condition occurs.
- *
- * A condition is always associated with a mutex.
- * It can only be manipulated in conjunction with that mutex.
- * This ensures atomic state transitions for all involved threads of execution.
- *
+ * A Condition object is a tool for sharing a resource between workers with the
+ * additional capability of pausing execution until a particular condition is
+ * satisfied. A Condition object is used in conjunction with a Mutex object, and
+ * adds additional functionality to the mutex's behavior. By working in
+ * combination with a mutex, the runtime ensures that each transition of
+ * ownership between workers is atomic.
+ *
+ *
The following is one possible workflow for using a Condition object:

+ *

+ *
Before using a Condition object, the first worker must take ownership
+ *       of the condition's associated mutex by calling the Mutex object's
+ *       lock() or tryLock() methods.

+ *
The worker's code operates on the shared resource until some condition
+ *       becomes false, preventing the worker from doing more work with the
+ *       shared resource. For example, if the shared resource is a set of data
+ *       to process, when there is no more data to process the worker can't
+ *       do any more work.

+ *
At that point, call the Condition object's wait() method
+ *       to pause the worker's execution and release ownership of the mutex.

+ *
At some point, a second worker takes ownership of the mutex. Because
+ *       the mutex is available, it is safe for the second worker's code to
+ *       operate on the shared resource. The second worker does whatever is
+ *       necessary to satisfy the condition so that the first worker can do its
+ *       work again. For example, if the first worker has no data to process,
+ *       the second worker could pass more data to process into the shared resource.

+ *
At that point, the condition related to the first worker's work is now
+ *       true, so the first worker needs to be notified that the condition is
+ *       fulfilled. To notify the first worker, the second worker's code calls
+ *       the Condition object's notify() method or its
+ *       notifyAll() method.

+ *
In addition to calling notify(), the second worker needs
+ *       to release ownership of the mutex. It does this either by calling the
+ *       Mutex object's unlock() method or the Condition object's
+ *       wait() method. Since the first worker called the
+ *       wait() method, ownership of the mutex returns to the
+ *       first worker. Code execution in the first worker then continues again
+ *       with the next line of code following the wait() call.

+ *

+ *
+ *
The Condition class is one of the special object types that are shared
+ * between workers rather than copied between them. When you pass a condition
+ * from one worker to another worker either by calling the Worker object's
+ * setSharedProperty() method or by using a MessageChannel object,
+ * both workers have a reference to the same Condition object in the runtime's
+ * memory.

+ *
+ * @see flash.concurrent.Mutex Mutex class
+ * @see flash.system.Worker Worker class
+ *
  * @langversion 3.0
  * @playerversion Flash 11.4
  * @playerversion AIR 3.4
@@ -163,9 +227,10 @@
 final public class Condition
 {
     /**
-     * The constructor for condition variables.
-     *
-     * @param mutex the mutex associated with the condition
+     * Creates a new Condition instance.
+     *
+     * @param mutex the mutex that the condition uses to control transitions
+    *               between workers
      *
      * @langversion 3.0
      * @playerversion Flash 11.4
@@ -179,7 +244,7 @@
     }

     /**
-     * Provides readonly access to mutex associated with this condition
+     * The mutex associated with this condition.
      *
      * @langversion 3.0
      * @playerversion Flash 11.4
@@ -189,15 +254,31 @@

     /**
-     * Releases the condition's mutex and then suspends the current thread/worker
-     * until it is awoken by 'notify()' or 'notifyAll()'. If the mutex is owned recursively,
-     * the recursion count will be restored upon return from wait.
-     *
-     * The current thread/worker must "own" the condition's mutex when making this call.
-     * Otherwise an exception is thrown and the mutex and the condition remain unaffected.
-     * @throws IllegalOperationException when the mutex is not owned by the current thread.
-     * @param timeout timeout in milliseconds, -1 if no timeout, fractional values will be rounded up to the nearest millisecond.
-     * @return false if wait() returned due to timeout, otherwise true.
+     * Specifies that the condition that this Condition object represents isn't
+     * satisfied, and the current worker needs to wait until it is satisfied
+     * before executing more code. Calling this method pauses the current
+     * worker's execution thread and releases ownership of the condition's mutex.
+     * These steps are performed as a single atomic operation. The worker remains
+     * paused until another worker calls this Condition object's
+     * notify() or notifyAll() methods.
+     *
+     * @param timeout the maximum amount of time, in milliseconds, that the
+     *                worker should pause execution before continuing. If this
+     *                value is -1 (the default) there is no no timeout and
+     *                execution pauses indefinitely.
+     *
+     * @return false if the method returned because the timeout
+     *         time elapsed. Otherwise the method returns true.
+     *
+     * @throws flash.errors.IllegalOperationError if the current worker doesn't
+     *         own this condition's mutex
+     *
+     * @throws ArgumentError if the timeout argument is less than
+     *         0 and not -1
+     *
+     * @throws flash.errors.ScriptTimeoutError if the method is called from
+     *         code in the primordial worker in Flash Player and worker pauses
+     *         longer than the script timeout limit (15 seconds by default)
      *
      * @langversion 3.0
      * @playerversion Flash 11.4
@@ -212,14 +293,23 @@
     }

     /**
-     * Wakes up one of the threads/workers waiting on this condition, if any,
-     * and releases its mutex.
-     * The awoken thread/worker acquires the mutex and then starts executing.
-     * All of the above happens atomically.
-     *
-     * The current thread/worker must "own" the condition's mutex when making this call.
-     * Otherwise an exception is thrown and the mutex and the condition remain unaffected.
-     * @throws IllegalOperationError if the condition's mutex is not owned by the current thread.
+     * Specifes that the condition that this Condition object represents has
+     been satisfied and that ownership of the mutex will be returned to the
+     next worker (if any) that's waiting on this condition.
+     *
+     *
Calling this method doesn't automatically release ownership of the
+     * mutex. After calling notify(), you should explicitly
+     * release ownership of the mutex in one of two ways: call the
+     * Mutex.unlock() method if the current worker doesn't need the
+     * mutex again, or call wait() if the worker should get
+     * ownership of the mutex again after other workers have completed their work.

+     *
+     *
One the mutex's lock is released, the next worker in the queue of
+     * workers that have called the wait() method acquires the
+     * mutex and resumes code execution.

+     *
+     * @throws flash.errors.IllegalOperationError if the current worker doesn't
+     *         own this condition's mutex
      *
      * @langversion 3.0
      * @playerversion Flash 11.4
@@ -233,18 +323,28 @@
     }

     /**
-     * Wakes up all threads/workers waiting on this condition, and releases its mutex.
-     * If any threads have been waiting, then one of them acquires the mutex and then
-     * starts executing.
-     * All of the above happens atomically.
-     *
-     * The awoken threads acquire the mutex and proceed one by one, in wait order.
-     * Each thread continues to wait until its predecessor releases the mutex
-     * (by calling Mutex.unlock or Condition.wait().
-     *
-     * The current thread/worker must "own" the condition's mutex when making this call.
-     * Otherwise an exception is thrown and the mutex and the condition remain unaffected.
-     * @throws IllegalOperationError if the condition's mutex is not owned by the current thread.
+     * Specifies that the condition that this Condition object represents has
+     * been satisfied and that ownership of the mutex will be returned to all
+     * workers that are waiting on this condition.
+     *
+     *
Calling this method doesn't automatically release ownership of the
+     * mutex. After calling notify(), you should explicitly release
+     * ownership of the mutex in one of two ways: call the
+     * Mutex.unlock() method if the current worker doesn't need the
+     * mutex again, or call wait() if the worker should get
+     * ownership of the mutex again after other workers have completed their work.

+     *
+     *
Once the mutex's lock is released, the waiting workers receive
+     * ownership one at a time in the order they called the wait()
+     * method. Each worker that has called the wait() method
+     * acquires the mutex in turn and resumes code execution. When that worker
+     * calls the Mutex.unlock() method or the wait()
+     * method, mutex ownership then switches to the next waiting worker. Each
+     * time mutex ownership switches between workers, the transition is performed
+     * as a single atomic operation.

+     *
+     * @throws flash.errors.IllegalOperationError if the current worker doesn't
+     *         own this condition's mutex
      *
      * @langversion 3.0
      * @playerversion Flash 11.4
@@ -272,6 +372,7 @@
 package avm2.intrinsics.memory
 {
     /**
+     * @private
      * A complete memory barrier for domainMemory (for both load and store instructions).
      *
      * @langversion 3.0
@@ -282,6 +383,7 @@
 	[native("ConcurrentMemory::mfence")]
 	public native function mfence():void;
     /**
+     * @private
      * A compare and swap for domainMemory.
      * Behaves like ByteArray.atomicCompareAndSwapIntAt but operates on the current domainMemory.
      *


Transferred from the Adobe Open Source Subversion Repository

Revision: 20687
Author:   smgilson@adobe.com
Date:     2011-03-08T20:09:56.755277Z

Log Message:
-----------
ASDoc updates

QE notes:
Doc notes:
Bugs:
Reviewer:
Tests run: checkintests
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/collections/ArrayCollection.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/collections/ArrayList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airframework/src/mx/controls/FlexNativeMenu.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/collections/SortField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/Label.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/containers/ViewStack.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/PopUpMenuButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/controls/MovieClipSWFLoader.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/advancedgrids/src/mx/collections/HierarchicalCollectionView.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/ComboBase.as</path>

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

--- frameworks/projects/mx/src/mx/controls/PopUpButton.as
+++ frameworks/projects/mx/src/mx/controls/PopUpButton.as
@@ -479,6 +479,11 @@
      *  pop-up control from closing on activity.</p>
      *
      *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get closeOnActivity():Boolean
     {


Add namespace minko around parameter data

M To have access to the bitmapData value (use for BitmapTextureEditorNode)

--- src/aerys/minko/scene/node/texture/BitmapTexture.as
+++ src/aerys/minko/scene/node/texture/BitmapTexture.as
@@ -1,5 +1,7 @@
 package aerys.minko.scene.node.texture
 {
+	import aerys.minko.ns.minko;
+
 	import flash.display.BitmapData;
 	import flash.display.DisplayObject;
 	import flash.geom.Matrix;
@@ -11,16 +13,24 @@
 	 * @author Jean-Marc Le Roux
 	 *
 	 */
+
+	use namespace minko;
+
 	public class BitmapTexture extends Texture
 	{
 		private static const TMP_MATRIX : Matrix = new Matrix();

-		private var _data		: BitmapData	= null;
+		minko var _data		: BitmapData	= null;
 		private var _mipmapping	: Boolean		= false;

 		protected function get bitmapData()	: BitmapData
 		{
 			return _data;
+		}
+
+		public function get mipmapping():Boolean
+		{
+			return _mipmapping;
 		}

 		public function updateFromBitmapData(value 		: BitmapData,
@@ -100,5 +110,7 @@

 			return new BitmapTexture(bmp);
 		}
+
+
 	}
 }


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@1269651 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/events/SliderEvent.as
+++ frameworks/projects/mx/src/mx/events/SliderEvent.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////

 package mx.events
 {


fix missing )

fix missing )

--- src/aerys/minko/render/shader/compiler/Serializer.as
+++ src/aerys/minko/render/shader/compiler/Serializer.as
@@ -99,7 +99,7 @@
 			}
 			else
 			{
-				throw new Error('Unsupported type:' + getQualifiedClassName(data);
+				throw new Error('Unsupported type:' + getQualifiedClassName(data));
 			}
 		}


added ColumnUtils.getRecords()

added ColumnUtils.getRecords()

--- WeaveJS/src/weavejs/data/ColumnUtils.as
+++ WeaveJS/src/weavejs/data/ColumnUtils.as
@@ -73,7 +73,7 @@
 		 * Generates a label to use when displaying the column in a list.
 		 * @param column
 		 * @return The column title followed by its dataType and/or keyType metadata.
-		 */
+		 */
 		public static function getColumnListLabel(column:IAttributeColumn):String
 		{
 			var title:String = ColumnUtils.getTitle(column);
@@ -458,6 +458,69 @@
 			}
 			return result;
 		}
+
+		/**
+		 * Generates records using a custom format.
+		 * @param format An object mapping names to IAttributeColumn objects or constant values to be included in every record.
+		 *               You can nest Objects or Arrays.
+		 * @param keys An Array of IQualifiedKeys
+		 * @param dataType A Class specifying the dataType to retrieve from columns: String/Number/Date/Array
+		 * @param keyProperty The property name which should be used to store the IQualifiedKey for a record.
+		 * @return An array of record objects matching the structure of the format object.
+		 */
+		public function getRecords(format:Object, keys:Array = null, dataType:Class = null, keyProperty:String = 'id'):Array
+		{
+			if (JS.isPrimitive(format) || format is IAttributeColumn)
+				throw new Error("Invalid record format");
+			if (!keys)
+				keys = getAllKeys(getColumnsFromFormat(format, []));
+			var records:Array = new Array(keys.length);
+			for (var i:int in keys)
+			{
+				records[i] = getRecord(format, keys[i], dataType);
+				if (keyProperty)
+					records[i][keyProperty] = keys[i];
+			}
+			return records;
+		}
+
+		private static function getColumnsFromFormat(format:Object, output:Array):Array
+		{
+			// check for primitive values
+			if (format === null || typeof format !== 'object')
+				return output;
+			for (var prop:String in format)
+				if (format[prop] is IAttributeColumn)
+					output.push(format[prop]);
+				else
+					getColumnsFromFormat(format[prop], output);
+			return output;
+		}
+
+		/**
+		 * Generates a record using a custom format.
+		 * @param format An object mapping names to IAttributeColumn objects or constant values to be included in every record.
+		 *               You can nest Objects or Arrays.
+		 * @param key An IQualifiedKey
+		 * @param dataType A Class specifying the dataType to retrieve from columns: String/Number/Date/Array
+		 * @return A record object matching the structure of the format object.
+		 */
+		public static function getRecord(format:Object, key:IQualifiedKey, dataType:Class):Object
+		{
+			// check for primitive values
+			if (format === null || typeof format !== 'object')
+				return format;
+
+			var column:IAttributeColumn = format as IAttributeColumn;
+			if (column)
+				return column.getValueFromKey(key, dataType);
+
+			var record:Object = format is Array ? [] : {};
+			for (var prop:String in format)
+				record[prop] = getRecord(format[prop], key, dataType);
+			return record;
+		}
+
 		/**
 		 * @param attrCols An array of IAttributeColumns or ILinkableHashMaps containing IAttributeColumns.
 		 * @return An Array of non-wrapper columns with duplicates removed.


Transferred from the Adobe Open Source Subversion Repository

Revision: 16559
Author:   cframpto@adobe.com
Date:     2010-06-14T19:32:51.793079Z

Log Message:
-----------
Revert part of 16547 that moved stuff into EventUtils.  Apparently UIComponent can't be in there.

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/framework/src/mx/utils/EventUtil.as</path>

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

--- frameworks/projects/framework/src/mx/utils/EventUtil.as
+++ frameworks/projects/framework/src/mx/utils/EventUtil.as
@@ -12,11 +12,7 @@
 package mx.utils
 {

-import flash.events.Event;
-import flash.events.IEventDispatcher;
 import flash.events.MouseEvent;
-
-import mx.core.UIComponent;
 import mx.events.SandboxMouseEvent;

 [ExcludeClass]
@@ -30,105 +26,6 @@
 {
 	include "../core/Version.as";

-    //--------------------------------------------------------------------------
-    //
-    //  Static Methods
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  Set up event listeners for a complete down-drag-up mouse gesture.
-     *
-     *  Add MOUSE_DOWN, MOUSE_MOVE, and MOUSE_UP listeners to the target component
-     *  which call the handleDown(), handleDrag(), and handleUp() functions respectively.
-     *
-     *  The handleDrag() method will be called for as long as the mouse button is down,
-     *  whenever the mouse is dragged within the stage.   The handleUp() method will be
-     *  called no matter where the mouse button is released, however a MouseEvent type argument
-     *  will only be provided if the button is released over the stage.
-     *
-     *  The handleDown() and handleDrag() functions are passed a single MouseEvent
-     *  argument, and the handleUp() is passed an Event which may be a MouseEvent
-     *  or a SandboxMouseEvent.  Typically handleUp() functions ignore their event
-     *  argument.
-     *
-     *  Any of the functions arguments can be null.
-     *
-     *  The implementation only adds MOUSE_MOVE and MOUSE_UP listeners in response
-     *  to a MOUSE_DOWN event.   Similarly, the implementation removes its MOUSE_MOVE
-     *  and MOUSE_UP listeners when it receives a MOUSE_UP event.
-     *
-     *  @param target A MOUSE_DOWN event on this component begins the down-drag-up gesture
-     *  @param handleDown A function with a MouseEvent parameter; called when the MOUSE_DOWN event occurs.
-     *  @param handleDrag A function with a MouseEvent parameter; called when the mouse moves with the button down.
-     *  @param handleUp A function with an Event parameter; called when the button is relesed.
-     *
-     *  @see #removeDownDragUpListeners
-     */
-    public static function addDownDragUpListeners(
-                                target:UIComponent,
-                                handleDown:Function,
-                                handleDrag:Function,
-                                handleUp:Function):void
-    {
-        var f:Function = function(e:Event):void
-        {
-            var sbr:IEventDispatcher;
-            switch(e.type)
-            {
-                case MouseEvent.MOUSE_DOWN:
-                    if (e.isDefaultPrevented())
-                        break;
-                    handleDown(e);
-                    sbr = target.systemManager.getSandboxRoot();
-                    sbr.addEventListener(MouseEvent.MOUSE_MOVE, f, true);
-                    sbr.addEventListener(MouseEvent.MOUSE_UP, f, true );
-                    sbr.addEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, f, true);
-                    break;
-                case MouseEvent.MOUSE_MOVE:
-                    handleDrag(e);
-                    break;
-                case MouseEvent.MOUSE_UP:
-                    handleUp(e);
-                    sbr = target.systemManager.getSandboxRoot();
-                    sbr.removeEventListener(MouseEvent.MOUSE_MOVE, f, true);
-                    sbr.removeEventListener(MouseEvent.MOUSE_UP, f, true);
-                    sbr.removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, f, true);
-                    break;
-                case "removeHandler":
-                    target.removeEventListener("removeHandler", f);
-                    target.removeEventListener(MouseEvent.MOUSE_DOWN, f);
-                    sbr = target.systemManager.getSandboxRoot();
-                    sbr.removeEventListener(MouseEvent.MOUSE_MOVE, f, true);
-                    sbr.removeEventListener(MouseEvent.MOUSE_UP, f, true);
-                    sbr.removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, f, true);
-                    break;
-            }
-        }
-        target.addEventListener(MouseEvent.MOUSE_DOWN, f);
-        target.addEventListener("removeHandler", f);
-    }
-
-    /**
-     *  Removes the listeners added by a matching addDownDragUpListeners call.
-     *
-     *  @param target A MOUSE_DOWN event on this component begins the down-drag-up gesture
-     *  @param handleDown The listener for MOUSE_DOWN events
-     *  @param handleDrag The listener for MOUSE_MOVE events when the button is down.
-     *  @param handleUp The listener for MOUSE_UP events
-     *
-     *  @see #addDownDragUpListeners
-     */
-    public static function removeDownDragUpListeners(
-                                target:UIComponent,
-                                handleDown:Function,
-                                handleDrag:Function,
-                                handleUp:Function):void
-    {
-        target.dispatchEvent(
-            new RemoveHandlerEvent(handleDown, handleDrag, handleUp));
-    }
-
 	//--------------------------------------------------------------------------
 	//
 	//  Class properties
@@ -214,26 +111,6 @@

 		return _mouseEventMap;
 	}
-
-}
 }

-/**
- * Event used to remove the handlers associated with the press-drag-release
- * gesture handlers.
- */
-class RemoveHandlerEvent extends flash.events.Event
-{
-    public var handleDown:Function;
-    public var handleDrag:Function;
-    public var handleUp:Function;
-    public function RemoveHandlerEvent(handleDown:Function,
-                                       handleDrag:Function = null,
-                                       handleUp:Function = null)
-    {
-        this.handleDown = handleDown;
-        this.handleDown = handleDrag;
-        this.handleUp = handleUp;
-        super("removeHandler");
-    }
 }


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@1274589 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/rpc/src/mx/rpc/xml/SchemaManager.as
+++ frameworks/projects/rpc/src/mx/rpc/xml/SchemaManager.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2006-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.rpc.xml
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 6472
Author:   gruehle@adobe.com
Date:     2009-05-01T20:12:36.368196Z

Log Message:
-----------
Skinning and styling bug fixes for Beta 1.

* Changed default closeDuration to 50. The default openDuration is 0, so it needed to be balanced by a short closeDuration.
* Made DownloadProgressBar.initCompleteHandler protected. It was private.
* Fixed data grid header resizing.

Bugs: SDK-20538, SDK-20119, SDK-18459
QA/Docs: Note changes to default value of closeDuration, and making DownloadProgressBar.initCompleteHandler protected.
Reviewer: Jason

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/preloaders/DownloadProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/sparkskins/src/mx/skins/spark/DataGridHeaderSeparatorSkin.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/Group.as
+++ frameworks/projects/spark/src/spark/components/Group.as
@@ -830,7 +830,7 @@
         {
             var child:IVisualElement = getElementAt(i);

-            if ( recursive && child is IStyleClient)
+            if (child is IStyleClient)
             {
                 // Does this object already have a proto chain?
                 // If not, there's no need to regenerate a new one.


Transferred from the Adobe Open Source Subversion Repository

Revision: 6588
Author:   clucier@adobe.com
Date:     2009-05-04T15:11:31.925304Z

Log Message:
-----------
Adding mouseOpaque flag to Group which when set, ensures a transparent background fill is rendered for the Group.  The fill is only renderered as necessary (when there are actual mouse listeners on the Group itself).

Bugs: SDK-20554
QE Notes: None
Reviewer: Glenn

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Group.as

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

--- frameworks/projects/spark/src/spark/components/Group.as
+++ frameworks/projects/spark/src/spark/components/Group.as
@@ -14,25 +14,24 @@

 import flash.display.BlendMode;
 import flash.display.DisplayObject;
+import flash.events.MouseEvent;
 import flash.geom.Rectangle;

-import spark.components.supportClasses.GroupBase;
-import mx.core.Container;
 import mx.core.IFontContextComponent;
-import mx.core.ILayoutElement;
 import mx.core.IUITextField;
 import mx.core.IVisualElement;
 import mx.core.IVisualElementContainer;
+import mx.core.UIComponent;
 import mx.core.mx_internal;
-import mx.core.UIComponent;
-import spark.events.ElementExistenceEvent;
-import spark.core.IGraphicElement;
-import spark.core.ISharedDisplayObject;
-import spark.primitives.supportClasses.TextGraphicElement;
-import spark.layouts.supportClasses.LayoutBase;
 import mx.styles.ISimpleStyleClient;
 import mx.styles.IStyleClient;
 import mx.styles.StyleProtoChain;
+
+import spark.components.supportClasses.GroupBase;
+import spark.core.IGraphicElement;
+import spark.core.ISharedDisplayObject;
+import spark.events.ElementExistenceEvent;
+import spark.primitives.supportClasses.TextGraphicElement;

 use namespace mx_internal;

@@ -315,6 +314,49 @@
     }

     //----------------------------------
+    //  mouseOpaque
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the mouseOpaque property
+     */
+    private var _mouseOpaque:Boolean = true;
+    private var mouseEventReferenceCount:int;
+
+    [Inspectable(category="General")]
+
+    /**
+     *  When set to true the mouseOpaque flag ensures that the entire bounds
+     *  of the Group are opaque to all mouse events such as clicks, rollOvers,
+     *  etc.
+     *
+     *  @default true
+     *
+     *  @langversion 4.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get mouseOpaque():Boolean
+    {
+        return _mouseOpaque;
+    }
+
+    /**
+     *  @private
+     */
+    public function set mouseOpaque(value:Boolean):void
+    {
+        if (value == _mouseOpaque)
+            return;
+
+        _mouseOpaque = value;
+        if (mouseEventReferenceCount != 0)
+            invalidateDisplayList();
+    }
+
+    //----------------------------------
     //  mxmlContent
     //----------------------------------

@@ -600,7 +642,69 @@
         	   !isNaN(scaleGridRight) &&
         	   !isNaN(scaleGridBottom);
     }
-
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: EventDispatcher
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  We render a transparent background fill by default when we have mouse
+     *  listeners.
+     */
+    override public function addEventListener(type:String, listener:Function,
+        useCapture:Boolean = false, priority:int = 0,
+        useWeakReference:Boolean = false):void
+    {
+        super.addEventListener(type, listener, useCapture, priority,
+            useWeakReference);
+
+        if (_mouseOpaque &&
+            type == MouseEvent.CLICK ||
+            type == MouseEvent.DOUBLE_CLICK ||
+            type == MouseEvent.MOUSE_DOWN ||
+            type == MouseEvent.MOUSE_MOVE ||
+            type == MouseEvent.MOUSE_OVER ||
+            type == MouseEvent.MOUSE_OUT ||
+            type == MouseEvent.ROLL_OUT ||
+            type == MouseEvent.ROLL_OVER ||
+            type == MouseEvent.MOUSE_UP ||
+            type == MouseEvent.MOUSE_WHEEL)
+        {
+            if (mouseEventReferenceCount++ == 0)
+                invalidateDisplayList();
+        }
+    }
+
+    /**
+     *  @private
+     *  We no longer render our default transparent background fill when we have
+     *  no mouse listeners.
+     */
+    override public function removeEventListener( type:String, listener:Function,
+        useCapture:Boolean = false):void
+    {
+        super.removeEventListener(type, listener, useCapture);
+
+        if (_mouseOpaque &&
+            type == MouseEvent.CLICK ||
+            type == MouseEvent.DOUBLE_CLICK ||
+            type == MouseEvent.MOUSE_DOWN ||
+            type == MouseEvent.MOUSE_MOVE ||
+            type == MouseEvent.MOUSE_OVER ||
+            type == MouseEvent.MOUSE_OUT ||
+            type == MouseEvent.ROLL_OUT ||
+            type == MouseEvent.ROLL_OVER ||
+            type == MouseEvent.MOUSE_UP ||
+            type == MouseEvent.MOUSE_WHEEL)
+        {
+            if (--mouseEventReferenceCount == 0)
+                invalidateDisplayList();
+        }
+    }
+
     //--------------------------------------------------------------------------
     //
     //  Overridden methods: UIComponent
@@ -713,6 +817,14 @@
         var sharedDisplayObject:ISharedDisplayObject = this;
         if (sharedDisplayObject.redrawRequested)
             graphics.clear();
+
+        // Render a transparent background fill as necessary to support the mouseOpaque flag.
+        if (_mouseOpaque && mouseEventReferenceCount != 0)
+        {
+            graphics.beginFill(0xFFFFFF, 0);
+            graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
+            graphics.endFill();
+        }

         // Iterate through the graphic elements. If an element has a displayObject that has been
         // invalidated, then validate all graphic elements that draw to this displayObject.


Transferred from the Adobe Open Source Subversion Repository

Revision: 4059
Author:   gosmith@adobe.com
Date:     2008-11-10T19:56:38.121345Z

Log Message:
-----------
The measure() and updateDisplayList() methods of TextBox and TextGraphic now return early if the inheritingStyles and nonInheritingStyles proto chains haven't been initialized, to avoid RTEs in the compose() method from invalid styles values.

QE Notes: None
Doc Notes: None
Bugs: SDK-17975
Reviewer: Jason

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as</path>

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

--- frameworks/projects/spark/src/spark/components/Label.as
+++ frameworks/projects/spark/src/spark/components/Label.as
@@ -124,6 +124,12 @@
     {
         super.measure();

+        // The measure() method of a GraphicElement can get called
+        // when its style chain hasn't been initialized.
+        // In that case, compose() must not be called.
+        if (!mx_internal::styleChainInitialized)
+            return;
+
         var width:Number = !isNaN(explicitWidth) ? explicitWidth : Infinity;
         var height:Number = !isNaN(explicitHeight) ? explicitHeight : Infinity;
         compose(width, height);
@@ -140,6 +146,12 @@
                                                   unscaledHeight:Number):void
     {
         super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        // The updateDisplayList() method of a GraphicElement can get called
+        // when its style chain hasn't been initialized.
+        // In that case, compose() must not be called.
+        if (!mx_internal::styleChainInitialized)
+            return;

         compose(unscaledWidth, unscaledHeight);
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 5098
Author:   gauravj@adobe.com
Date:     2009-02-27T02:21:27.489350Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
151 paths were modified

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

--- frameworks/projects/spark/src/spark/components/Panel.as
+++ frameworks/projects/spark/src/spark/components/Panel.as
@@ -20,6 +20,11 @@
  *  The FxPanel class is container whose skin usually contains a title
  *
  *  @see FxContainer
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 public class FxPanel extends FxContainer
 {
@@ -33,6 +38,11 @@

     /**
      *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function FxPanel()
     {
@@ -53,6 +63,11 @@

     /**
      * A skin part that defines the middle button(s).
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public var titleField:TextGraphicElement;

@@ -67,6 +82,11 @@
 	[Bindable]
     /**
      *  title that should appear in the header of the skin
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get title():String
     {


fix output paths for htmlTemplate when targeting Royale

--- src/ASConfigC.as
+++ src/ASConfigC.as
@@ -1605,7 +1605,20 @@
 				throw new Error("htmlTemplate path must be a directory. Invalid path: " + this._htmlTemplate);
 			}
 			var outputDir:String = findOutputDirectory(this._mainFile, this._outputPathForTarget, !this._outputIsJS);
-			copyHTMLTemplateDirectory(this._htmlTemplate, outputDir);
+			if (this._outputIsJS)
+			{
+				var debugOutputDir:String = path.join(outputDir, "bin", "js-debug");
+				copyHTMLTemplateDirectory(this._htmlTemplate, debugOutputDir);
+				if(!this._debugBuild)
+				{
+					var releaseOutputDir:String = path.join(outputDir, "bin", "js-release");
+					copyHTMLTemplateDirectory(this._htmlTemplate, releaseOutputDir);
+				}
+			}
+			else //swf
+			{
+				copyHTMLTemplateDirectory(this._htmlTemplate, outputDir);
+			}
 		}

 		private function copyHTMLTemplateDirectory(inputDir:String, outputDir:String):void