This is an automated email from the ASF dual-hosted git repository. aharui pushed a commit to branch feature/MXRoyale in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 67efe4fff528ca71d5522db6a5252a56f1c8c2c2 Author: Alex Harui <[email protected]> AuthorDate: Thu Mar 22 14:12:03 2018 -0700 try unwrapping the SWF side. Otherwise Basic views would need to be adjusted to use . Seems to work. SWF mxtests passed --- .../MXRoyale/src/main/royale/mx/core/Container.as | 12 +++++ .../MXRoyale/src/main/royale/mx/core/IChildList.as | 41 +++++++++++---- .../main/royale/mx/core/IDisplayObjectInterface.as | 4 +- .../src/main/royale/mx/core/IFlexDisplayObject.as | 7 +++ .../src/main/royale/mx/core/UIComponent.as | 61 +++++----------------- 5 files changed, 66 insertions(+), 59 deletions(-) diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as index 5565ac5..feca242 100644 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as @@ -77,6 +77,10 @@ import mx.events.ChildExistenceChangedEvent; */ import mx.events.FlexEvent; import mx.events.IndexChangedEvent; +COMPILE::SWF +{ +import flash.display.DisplayObject; +} /* import mx.events.ScrollEvent; @@ -853,6 +857,14 @@ public class Container extends UIComponent return contentView.getElementAt(index); } + COMPILE::SWF + override public function getChildAt(index:int):DisplayObject + { + var layoutHost:ILayoutHost = view as ILayoutHost; + var contentView:IParent = layoutHost.contentView as IParent; + return contentView.getElementAt(index) as DisplayObject; + } + /* * IStrandPrivate * diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IChildList.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IChildList.as index 0801f18..1f12495 100644 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IChildList.as +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IChildList.as @@ -20,7 +20,10 @@ package mx.core { -import org.apache.royale.geom.Point; +COMPILE::SWF +{ + import flash.display.DisplayObject; +} /** * The IChildList interface defines the properties and methods @@ -109,8 +112,10 @@ public interface IChildList * @playerversion AIR 1.1 * @productversion Flex 3 */ - [SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")] + COMPILE::JS function addChild(child:IUIComponent):IUIComponent; + COMPILE::SWF + function addChild(child:DisplayObject):DisplayObject; /** * Adds a child DisplayObject to this child list at the index specified. @@ -133,8 +138,10 @@ public interface IChildList * @playerversion AIR 1.1 * @productversion Flex 3 */ - [SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject,int",altparams="org.apache.royale.core.IUIComponent,int")] + COMPILE::JS function addChildAt(child:IUIComponent, index:int):IUIComponent; + COMPILE::SWF + function addChildAt(child:DisplayObject, index:int):DisplayObject; /** * Removes the specified child DisplayObject from this child list. @@ -155,8 +162,10 @@ public interface IChildList * @playerversion AIR 1.1 * @productversion Flex 3 */ - [SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")] + COMPILE::JS function removeChild(child:IUIComponent):IUIComponent; + COMPILE::SWF + function removeChild(child:DisplayObject):DisplayObject; /** * Removes the child DisplayObject at the specified index @@ -177,8 +186,10 @@ public interface IChildList * @playerversion AIR 1.1 * @productversion Flex 3 */ - [SWFOverride(returns="flash.display.DisplayObject")] + COMPILE::JS function removeChildAt(index:int):IUIComponent; + COMPILE::SWF + function removeChildAt(index:int):DisplayObject; /** * Gets the child DisplayObject at the specified index in this child list. @@ -193,8 +204,10 @@ public interface IChildList * @playerversion AIR 1.1 * @productversion Flex 3 */ - [SWFOverride(returns="flash.display.DisplayObject")] + COMPILE::JS function getChildAt(index:int):IUIComponent; + COMPILE::SWF + function getChildAt(index:int):DisplayObject; /** * Gets the child DisplayObject with the specified name @@ -209,8 +222,10 @@ public interface IChildList * @playerversion AIR 1.1 * @productversion Flex 3 */ - [SWFOverride(returns="flash.display.DisplayObject")] + COMPILE::JS function getChildByName(name:String):IUIComponent; + COMPILE::SWF + function getChildByName(name:String):DisplayObject; /** * Gets the index of a specific child in this child list. @@ -254,8 +269,10 @@ public interface IChildList * @playerversion AIR 1.1 * @productversion Flex 3 */ - [SWFOverride(params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")] + COMPILE::JS function getChildIndex(child:IUIComponent):int; + COMPILE::SWF + function getChildIndex(child:DisplayObject):int; /** * Changes the index of a particular child in this child list. @@ -272,8 +289,10 @@ public interface IChildList * @playerversion AIR 1.1 * @productversion Flex 3 */ - [SWFOverride(params="flash.display.DisplayObject,int",altparams="org.apache.royale.core.IUIComponent,int")] + COMPILE::JS function setChildIndex(child:IUIComponent, newIndex:int):void; + COMPILE::SWF + function setChildIndex(child:DisplayObject, newIndex:int):void; /** * Determines if a DisplayObject is in this child list, @@ -290,8 +309,10 @@ public interface IChildList * @playerversion AIR 1.1 * @productversion Flex 3 */ - [SWFOverride(params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")] + COMPILE::JS function contains(child:IUIComponent):Boolean; + COMPILE::SWF + function contains(child:DisplayObject):Boolean; } } diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IDisplayObjectInterface.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IDisplayObjectInterface.as index c338f0d..abb957a 100644 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IDisplayObjectInterface.as +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IDisplayObjectInterface.as @@ -170,7 +170,7 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ - [SWFOverride(returns="flash.geom.Point",params="flash.geom.Point",altparams="org.apache.royale.geom.Point")] + COMPILE::JS function globalToLocal(point:Point):Point; /** @@ -181,6 +181,6 @@ * @playerversion AIR 1.1 * @productversion Flex 3 */ - [SWFOverride(returns="flash.geom.Point",params="flash.geom.Point",altparams="org.apache.royale.geom.Point")] + COMPILE::JS function localToGlobal(point:Point):Point; diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IFlexDisplayObject.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IFlexDisplayObject.as index a6ff897..0ca3f86 100644 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IFlexDisplayObject.as +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IFlexDisplayObject.as @@ -23,7 +23,14 @@ package mx.core import org.apache.royale.core.IParent; import org.apache.royale.events.IEventDispatcher; import org.apache.royale.geom.Rectangle; +COMPILE::JS +{ import org.apache.royale.geom.Point; +} +COMPILE::SWF +{ +import flash.geom.Point; +} /** * The IFlexDisplayObject interface defines the interface for skin elements. diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as index f9002e4..3e41a81 100644 --- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as @@ -59,6 +59,7 @@ import org.apache.royale.geom.Point; import org.apache.royale.geom.Rectangle; import org.apache.royale.html.accessories.ToolTipBead; import org.apache.royale.utils.loadBeadFromValuesManager; +import org.apache.royale.utils.PointUtils; /* import mx.managers.IToolTipManagerClient; @@ -2026,9 +2027,7 @@ public class UIComponent extends UIBase * @private * @royaleignorecoercion mx.core.IUIComponent */ - COMPILE::SWF - { override } - [SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")] + COMPILE::JS public function addChild(child:IUIComponent):IUIComponent { return addElement(child) as IUIComponent; @@ -2038,11 +2037,7 @@ public class UIComponent extends UIBase * @private * @royaleignorecoercion mx.core.IUIComponent */ - COMPILE::SWF - { - override - } - [SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject,int",altparams="org.apache.royale.core.IUIComponent,int")] + COMPILE::JS public function addChildAt(child:IUIComponent, index:int):IUIComponent { @@ -2053,11 +2048,7 @@ public class UIComponent extends UIBase * @private * @royaleignorecoercion mx.core.IUIComponent */ - [SWFOverride(returns="flash.display.DisplayObject",params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")] - COMPILE::SWF - { - override - } + COMPILE::JS public function removeChild(child:IUIComponent):IUIComponent { return removeElement(child) as IUIComponent; @@ -2068,11 +2059,7 @@ public class UIComponent extends UIBase * @private * @royaleignorecoercion mx.core.IUIComponent */ - [SWFOverride(returns="flash.display.DisplayObject")] - COMPILE::SWF - { - override - } + COMPILE::JS public function removeChildAt(index:int):IUIComponent { if (GOOG::DEBUG) @@ -2085,11 +2072,7 @@ public class UIComponent extends UIBase * @private * @royaleignorecoercion mx.core.IUIComponent */ - [SWFOverride(returns="flash.display.DisplayObject")] - COMPILE::SWF - { - override - } + COMPILE::JS public function getChildAt(index:int):IUIComponent { return getElementAt(index) as IUIComponent; @@ -2108,9 +2091,7 @@ public class UIComponent extends UIBase /** * @private */ - [SWFOverride(params="flash.display.DisplayObject,int",altparams="org.apache.royale.core.IUIComponent,int")] - COMPILE::SWF - { override } + COMPILE::JS public function setChildIndex(child:IUIComponent, index:int):void { if (GOOG::DEBUG) @@ -2120,9 +2101,7 @@ public class UIComponent extends UIBase /** * @private */ - [SWFOverride(params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")] - COMPILE::SWF - { override } + COMPILE::JS public function getChildIndex(child:IUIComponent):int { return getElementIndex(child); @@ -2131,9 +2110,7 @@ public class UIComponent extends UIBase /** * @private */ - [SWFOverride(returns="flash.display.DisplayObject")] - COMPILE::SWF - { override } + COMPILE::JS public function getChildByName(name:String):IUIComponent { if (GOOG::DEBUG) @@ -2144,9 +2121,7 @@ public class UIComponent extends UIBase /** * @private */ - [SWFOverride(params="flash.display.DisplayObject",altparams="org.apache.royale.core.IUIComponent")] - COMPILE::SWF - { override } + COMPILE::JS public function contains(child:IUIComponent):Boolean { if (GOOG::DEBUG) @@ -2425,14 +2400,10 @@ public class UIComponent extends UIBase * @playerversion AIR 1.1 * @productversion Flex 3 */ - COMPILE::SWF - { override } - [SWFOverride(returns="flash.geom.Point",params="flash.geom.Point",altparams="org.apache.royale.geom.Point")] + COMPILE::JS public function localToGlobal(value:Point):Point { - if (GOOG::DEBUG) - trace("localToGlobal not implemented"); - return value; + return PointUtils.localToGlobal(value, this); } /** @@ -2443,14 +2414,10 @@ public class UIComponent extends UIBase * @playerversion AIR 1.1 * @productversion Flex 3 */ - COMPILE::SWF - { override } - [SWFOverride(returns="flash.geom.Point",params="flash.geom.Point",altparams="org.apache.royale.geom.Point")] + COMPILE::JS public function globalToLocal(value:Point):Point { - if (GOOG::DEBUG) - trace("globalToLocal not implemented"); - return value; + return PointUtils.globalToLocal(value, this); } /** -- To stop receiving notification emails like this one, please contact [email protected].
