You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2016/03/28 19:52:22 UTC

[2/3] git commit: [flex-asjs] [refs/heads/spark] - 0 errors in GCC (some warnings though)

0 errors in GCC (some warnings though)


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3b3b8374
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3b3b8374
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3b3b8374

Branch: refs/heads/spark
Commit: 3b3b8374ef9a1356a3f9ba738f957b3e9c3ac8ed
Parents: 463fae8
Author: Alex Harui <ah...@apache.org>
Authored: Mon Mar 28 10:37:03 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Mar 28 10:37:03 2016 -0700

----------------------------------------------------------------------
 frameworks/projects/MX/build.xml                |  2 -
 .../src/main/flex/mx/core/UIComponentGlobals.as | 74 ++++++++++++++++++++
 .../src/main/flex/mx/effects/EffectManager.as   | 30 ++++----
 .../main/flex/mx/styles/CSSStyleDeclaration.as  |  2 +-
 .../src/main/flex/mx/styles/StyleProtoChain.as  |  5 +-
 .../flex/mx/utils/DescribeTypeCacheRecord.as    |  1 +
 .../MX/src/main/flex/mx/utils/ObjectUtil.as     |  8 ++-
 .../MX/src/main/resources/mx-manifest.xml       |  1 +
 8 files changed, 106 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b3b8374/frameworks/projects/MX/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/build.xml b/frameworks/projects/MX/build.xml
index 04521f7..003b7ee 100644
--- a/frameworks/projects/MX/build.xml
+++ b/frameworks/projects/MX/build.xml
@@ -37,9 +37,7 @@
     </target>
     
     <target name="test" unless="is.jenkins">
-        <!-- no tests yet
          <ant dir="src/test/flex"/>
-         -->
     </target>
     
     <target name="test-js" unless="is.jenkins">

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b3b8374/frameworks/projects/MX/src/main/flex/mx/core/UIComponentGlobals.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/core/UIComponentGlobals.as b/frameworks/projects/MX/src/main/flex/mx/core/UIComponentGlobals.as
index 45d62ed..5acc825 100644
--- a/frameworks/projects/MX/src/main/flex/mx/core/UIComponentGlobals.as
+++ b/frameworks/projects/MX/src/main/flex/mx/core/UIComponentGlobals.as
@@ -33,6 +33,8 @@ COMPILE::LATER
 	import flash.geom.Matrix;		
 }
 import mx.managers.ILayoutManager;
+import mx.managers.SystemManagerGlobals;
+import mx.managers.ISystemManager;
 
 use namespace mx_internal;
 
@@ -155,6 +157,78 @@ public class UIComponentGlobals
     {
         _catchCallLaterExceptions = value;
     }
+	
+	/**
+	 *  Blocks the background processing of methods
+	 *  queued by <code>callLater()</code>,
+	 *  until <code>resumeBackgroundProcessing()</code> is called.
+	 *
+	 *  <p>These methods can be useful when you have time-critical code
+	 *  which needs to execute without interruption.
+	 *  For example, when you set the <code>suspendBackgroundProcessing</code>
+	 *  property of an Effect to <code>true</code>,
+	 *  <code>suspendBackgroundProcessing()</code> is automatically called
+	 *  when it starts playing, and <code>resumeBackgroundProcessing</code>
+	 *  is called when it stops, in order to ensure that the animation
+	 *  is smooth.</p>
+	 *
+	 *  <p>Since the LayoutManager uses <code>callLater()</code>,
+	 *  this means that <code>commitProperties()</code>,
+	 *  <code>measure()</code>, and <code>updateDisplayList()</code>
+	 *  is not called in between calls to
+	 *  <code>suspendBackgroundProcessing()</code> and
+	 *  <code>resumeBackgroundProcessing()</code>.</p>
+	 *
+	 *  <p>It is safe for both an outer method and an inner method
+	 *  (i.e., one that the outer methods calls) to call
+	 *  <code>suspendBackgroundProcessing()</code>
+	 *  and <code>resumeBackgroundProcessing()</code>, because these
+	 *  methods actually increment and decrement a counter
+	 *  which determines whether background processing occurs.</p>
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public static function suspendBackgroundProcessing():void
+	{
+		UIComponentGlobals.callLaterSuspendCount++;
+	}
+	
+	/**
+	 *  Resumes the background processing of methods
+	 *  queued by <code>callLater()</code>, after a call to
+	 *  <code>suspendBackgroundProcessing()</code>.
+	 *
+	 *  <p>Refer to the description of
+	 *  <code>suspendBackgroundProcessing()</code> for more information.</p>
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public static function resumeBackgroundProcessing():void
+	{
+		if (UIComponentGlobals.callLaterSuspendCount > 0)
+		{
+			UIComponentGlobals.callLaterSuspendCount--;
+			
+			// Once the suspend count gets back to 0, we need to
+			// force a render event to happen
+			if (UIComponentGlobals.callLaterSuspendCount == 0)
+			{
+				var sm:ISystemManager = SystemManagerGlobals.topLevelSystemManagers[0];
+				COMPILE::AS3
+				{
+					if (sm && sm.topOfDisplayList)
+						sm.topOfDisplayList.invalidate();
+				}
+			}
+		}
+	}
+
 }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b3b8374/frameworks/projects/MX/src/main/flex/mx/effects/EffectManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/effects/EffectManager.as b/frameworks/projects/MX/src/main/flex/mx/effects/EffectManager.as
index 0cf1b66..8add486 100644
--- a/frameworks/projects/MX/src/main/flex/mx/effects/EffectManager.as
+++ b/frameworks/projects/MX/src/main/flex/mx/effects/EffectManager.as
@@ -47,6 +47,7 @@ import mx.core.IDeferredInstantiationUIComponent;
 import mx.core.IFlexDisplayObject;
 import mx.core.IUIComponent;
 import mx.core.UIComponent;
+import mx.core.UIComponentGlobals;
 import mx.core.mx_internal;
 import mx.events.EffectEvent;
 import mx.events.FlexEvent;
@@ -72,6 +73,7 @@ use namespace mx_internal;
  *  @playerversion Flash 9
  *  @playerversion AIR 1.1
  *  @productversion Flex 3
+ *  @flexjsignoreimport mx.core.UIComponent
  */
 public class EffectManager extends EventDispatcher
 {
@@ -314,7 +316,7 @@ public class EffectManager extends EventDispatcher
         }
         
         var effectClass:Class;      
-        if (target is UIComponent && target.moduleFactory)
+        if (target is IUIComponent && target.moduleFactory)
         {
 			COMPILE::LATER
 			{
@@ -604,6 +606,7 @@ public class EffectManager extends EventDispatcher
 
     /**
      *  @private
+	 *  @flexjsignorecoercion mx.core.UIComponent
      */
     mx_internal static function eventHandler(eventObj:Event):void
     {   
@@ -635,18 +638,19 @@ public class EffectManager extends EventDispatcher
             
         if (eventObj.type == UIBase.CHILD_REMOVED)
         {
-            if (eventObj.target is UIComponent)
+			var uic:UIComponent = eventObj.target as UIComponent;
+            if (uic)
             {
-                if (UIComponent(eventObj.target).initialized == false)
+                if (uic.initialized == false)
                 {
                     return;
                 }
-                else if (UIComponent(eventObj.target).isEffectStarted)
+                else if (uic.isEffectStarted)
                 {
-                    for (var i:int = 0; i < UIComponent(eventObj.target)._effectsStarted.length; i++)
+                    for (var i:int = 0; i < uic._effectsStarted.length; i++)
                     {
                         // Don't allow removedEffect to trigger more than one effect at a time
-                        if (UIComponent(eventObj.target)._effectsStarted[i].triggerEvent.type == UIBase.CHILD_REMOVED)
+                        if (uic._effectsStarted[i].triggerEvent.type == UIBase.CHILD_REMOVED)
                             return;
                     }
                 }
@@ -663,12 +667,12 @@ public class EffectManager extends EventDispatcher
                     var index:int = parent.getChildIndex(targ);
                     if (index >= 0)
                     {
-                        if (targ is UIComponent)    
+                        if (uic)    
                         {
                             // Since we get the "removed" event before the child is actually removed, 
                             // we need to delay adding back the child. We must exit the current 
                             // script block must exit before the child can be removed.
-                            UIComponent(targ).callLater(removedEffectHandler, [targ, parent, index, eventObj]);
+                            uic.callLater(removedEffectHandler, [targ, parent, index, eventObj]);
                         }
                     }
                 }
@@ -682,6 +686,7 @@ public class EffectManager extends EventDispatcher
     
     /**
      *  @private
+	 *  @flexjsignorecoercion mx.core.UIComponent
      */ 
     private static function createAndPlayEffect(eventObj:Event, target:Object):void
     {
@@ -757,8 +762,9 @@ public class EffectManager extends EventDispatcher
         // previously animating the same properties of my target object,
         // then finish the other effect before starting this new one.
         //
-        if (effectInst.target is UIComponent &&
-            UIComponent(effectInst.target).isEffectStarted)
+		var uic:UIComponent = effectInst.target as UIComponent;
+        if (uic &&
+            uic.isEffectStarted)
         {
             var affectedProps:Array = effectInst.getAffectedProperties();
             for (i = 0; i < affectedProps.length; i++)
@@ -834,7 +840,7 @@ public class EffectManager extends EventDispatcher
         // Block all layout, responses from web services, and other background
         // processing until the effect finishes executing.
         if (effectInst.suspendBackgroundProcessing)
-            UIComponent.suspendBackgroundProcessing();
+            UIComponentGlobals.suspendBackgroundProcessing();
     }
 
     /**
@@ -908,7 +914,7 @@ public class EffectManager extends EventDispatcher
 
         // Resume the background processing that was suspended earlier
         if (effectInst.suspendBackgroundProcessing)
-            UIComponent.resumeBackgroundProcessing();       
+            UIComponentGlobals.resumeBackgroundProcessing();       
     }
 
     //--------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b3b8374/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as b/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as
index ada63a8..62e360c 100644
--- a/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as
@@ -829,7 +829,7 @@ public class CSSStyleDeclaration extends EventDispatcher
      */
     public function clearStyle(styleProp:String):void
     {
-        public::setStyle(styleProp, undefined);
+        setStyle(styleProp, undefined);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b3b8374/frameworks/projects/MX/src/main/flex/mx/styles/StyleProtoChain.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/StyleProtoChain.as b/frameworks/projects/MX/src/main/flex/mx/styles/StyleProtoChain.as
index ed7db75..342e7ca 100644
--- a/frameworks/projects/MX/src/main/flex/mx/styles/StyleProtoChain.as
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/StyleProtoChain.as
@@ -49,6 +49,7 @@ import mx.core.IFontContextComponent;
 import mx.core.IInvalidating;
 import mx.core.IUITextField;
 import mx.core.IVisualElement;
+import mx.core.IUIComponent;
 import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.utils.NameUtil;
@@ -64,6 +65,7 @@ use namespace object_proxy;
  *  @private
  *  This is an all-static class with methods for building the protochains
  *  that Flex uses to look up CSS style properties.
+ *  @flexjsignoreimport mx.core.UIComponent
  */
 public class StyleProtoChain
 {
@@ -162,6 +164,7 @@ public class StyleProtoChain
      *  @private
      *  Implements the initProtoChain() logic for UIComponent and TextBase.
      *  The 'object' parameter will be one or the other.
+	 *  @flexjsignorecoercion mx.core.UIComponent
      */
     public static function initProtoChain(object:IStyleClient, inheritPopUpStylesFromOwner:Boolean=true):void
     {
@@ -778,7 +781,7 @@ public class StyleProtoChain
             styleProp == "styleName" ||
             styleProp == "themeColor")
         {
-        	if (object is UIComponent)
+        	if (object is IUIComponent)
                 object["initThemeColor"]();
         }
         

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b3b8374/frameworks/projects/MX/src/main/flex/mx/utils/DescribeTypeCacheRecord.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/DescribeTypeCacheRecord.as b/frameworks/projects/MX/src/main/flex/mx/utils/DescribeTypeCacheRecord.as
index dc8f00f..5572500 100644
--- a/frameworks/projects/MX/src/main/flex/mx/utils/DescribeTypeCacheRecord.as
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/DescribeTypeCacheRecord.as
@@ -35,6 +35,7 @@ use namespace flash_proxy;
  *  This class represents a single cache entry, this gets created
  *  as part of the <code>describeType</code> method call on the 
  *  <code>DescribeTypeCache</code>  class.
+ *  @flexjsignoreimport mx.utils.DescribeTypeCache
  */
 
 public dynamic class DescribeTypeCacheRecord extends Proxy

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b3b8374/frameworks/projects/MX/src/main/flex/mx/utils/ObjectUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/utils/ObjectUtil.as b/frameworks/projects/MX/src/main/flex/mx/utils/ObjectUtil.as
index d210ab0..b38d635 100644
--- a/frameworks/projects/MX/src/main/flex/mx/utils/ObjectUtil.as
+++ b/frameworks/projects/MX/src/main/flex/mx/utils/ObjectUtil.as
@@ -793,11 +793,14 @@ public class ObjectUtil
         if (b == null)
             return -1;
            
+		COMPILE::LATER
+		{
         if (a is ObjectProxy)
             a = ObjectProxy(a).object_proxy::object;
             
         if (b is ObjectProxy)
             b = ObjectProxy(b).object_proxy::object;
+		}
             
         var typeOfA:String = typeof(a);
         var typeOfB:String = typeof(b);
@@ -1003,9 +1006,12 @@ public class ObjectUtil
         var n:int;
         var i:int;
 
+		COMPILE::LATER
+		{
         if (obj is ObjectProxy)
             obj = ObjectProxy(obj).object_proxy::object;
-
+		}
+		
         if (options == null)
             options = { includeReadOnly: true, uris: null, includeTransient: true };
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3b3b8374/frameworks/projects/MX/src/main/resources/mx-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/resources/mx-manifest.xml b/frameworks/projects/MX/src/main/resources/mx-manifest.xml
index a1c9fd5..21e0e8b 100644
--- a/frameworks/projects/MX/src/main/resources/mx-manifest.xml
+++ b/frameworks/projects/MX/src/main/resources/mx-manifest.xml
@@ -22,5 +22,6 @@
 <componentPackage>
 
     <!--<component id="Button" class="org.apache.flex.html.Button"/>-->
+    <component id="UIComponent" class="mx.core.UIComponent"/>
     
 </componentPackage>