From 6ba701b0a9060912681c51d6198eec4e16601403 Mon Sep 17 00:00:00 2001 From: Pyogenics Date: Sun, 26 Jan 2025 09:33:21 +0000 Subject: [PATCH] Remove flex source --- src/mx/core/BitmapAsset.as | 465 ------------------------- src/mx/core/FlexBitmap.as | 31 -- src/mx/core/IAssetLayoutFeatures.as | 89 ----- src/mx/core/IFlexAsset.as | 8 - src/mx/core/IFlexDisplayObject.as | 125 ------- src/mx/core/ILayoutDirectionElement.as | 12 - src/mx/core/IRepeaterClient.as | 22 -- src/mx/core/mx_internal.as | 5 - src/mx/utils/NameUtil.as | 94 ----- 9 files changed, 851 deletions(-) delete mode 100644 src/mx/core/BitmapAsset.as delete mode 100644 src/mx/core/FlexBitmap.as delete mode 100644 src/mx/core/IAssetLayoutFeatures.as delete mode 100644 src/mx/core/IFlexAsset.as delete mode 100644 src/mx/core/IFlexDisplayObject.as delete mode 100644 src/mx/core/ILayoutDirectionElement.as delete mode 100644 src/mx/core/IRepeaterClient.as delete mode 100644 src/mx/core/mx_internal.as delete mode 100644 src/mx/utils/NameUtil.as diff --git a/src/mx/core/BitmapAsset.as b/src/mx/core/BitmapAsset.as deleted file mode 100644 index 049f012..0000000 --- a/src/mx/core/BitmapAsset.as +++ /dev/null @@ -1,465 +0,0 @@ -package mx.core -{ - import flash.display.BitmapData; - import flash.display.DisplayObjectContainer; - import flash.events.Event; - import flash.geom.Point; - import flash.system.ApplicationDomain; - - use namespace mx_internal; - - public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject, ILayoutDirectionElement - { - private static var FlexVersionClass:Class; - - private static var MatrixUtilClass:Class; - - mx_internal static const VERSION:String = "4.5.0.19786"; - - private var layoutFeaturesClass:Class; - - private var layoutFeatures:IAssetLayoutFeatures; - - private var _height:Number; - - private var _layoutDirection:String = "ltr"; - - public function BitmapAsset(bitmapData:BitmapData = null, pixelSnapping:String = "auto", smoothing:Boolean = false) - { - var appDomain:ApplicationDomain = null; - super(bitmapData,pixelSnapping,smoothing); - if(FlexVersionClass == null) - { - appDomain = ApplicationDomain.currentDomain; - if(appDomain.hasDefinition("mx.core::FlexVersion")) - { - FlexVersionClass = Class(appDomain.getDefinition("mx.core::FlexVersion")); - } - } - if(Boolean(FlexVersionClass) && FlexVersionClass["compatibilityVersion"] >= FlexVersionClass["VERSION_4_0"]) - { - this.addEventListener(Event.ADDED,this.addedHandler); - } - } - - override public function get x() : Number - { - return this.layoutFeatures == null ? super.x : Number(this.layoutFeatures.layoutX); - } - - override public function set x(value:Number) : void - { - if(this.x == value) - { - return; - } - if(this.layoutFeatures == null) - { - super.x = value; - } - else - { - this.layoutFeatures.layoutX = value; - this.validateTransformMatrix(); - } - } - - override public function get y() : Number - { - return this.layoutFeatures == null ? super.y : Number(this.layoutFeatures.layoutY); - } - - override public function set y(value:Number) : void - { - if(this.y == value) - { - return; - } - if(this.layoutFeatures == null) - { - super.y = value; - } - else - { - this.layoutFeatures.layoutY = value; - this.validateTransformMatrix(); - } - } - - override public function get z() : Number - { - return this.layoutFeatures == null ? super.z : Number(this.layoutFeatures.layoutZ); - } - - override public function set z(value:Number) : void - { - if(this.z == value) - { - return; - } - if(this.layoutFeatures == null) - { - super.z = value; - } - else - { - this.layoutFeatures.layoutZ = value; - this.validateTransformMatrix(); - } - } - - override public function get width() : Number - { - var p:Point = null; - if(this.layoutFeatures == null) - { - return super.width; - } - if(MatrixUtilClass != null) - { - p = MatrixUtilClass["transformSize"](this.layoutFeatures.layoutWidth,this._height,transform.matrix); - } - return Boolean(p) ? Number(p.x) : super.width; - } - - override public function set width(value:Number) : void - { - if(this.width == value) - { - return; - } - if(this.layoutFeatures == null) - { - super.width = value; - } - else - { - this.layoutFeatures.layoutWidth = value; - this.layoutFeatures.layoutScaleX = this.measuredWidth != 0 ? value / this.measuredWidth : 0; - this.validateTransformMatrix(); - } - } - - override public function get height() : Number - { - var p:Point = null; - if(this.layoutFeatures == null) - { - return super.height; - } - if(MatrixUtilClass != null) - { - p = MatrixUtilClass["transformSize"](this.layoutFeatures.layoutWidth,this._height,transform.matrix); - } - return Boolean(p) ? Number(p.y) : super.height; - } - - override public function set height(value:Number) : void - { - if(this.height == value) - { - return; - } - if(this.layoutFeatures == null) - { - super.height = value; - } - else - { - this._height = value; - this.layoutFeatures.layoutScaleY = this.measuredHeight != 0 ? value / this.measuredHeight : 0; - this.validateTransformMatrix(); - } - } - - override public function get rotationX() : Number - { - return this.layoutFeatures == null ? super.rotationX : Number(this.layoutFeatures.layoutRotationX); - } - - override public function set rotationX(value:Number) : void - { - if(this.rotationX == value) - { - return; - } - if(this.layoutFeatures == null) - { - super.rotationX = value; - } - else - { - this.layoutFeatures.layoutRotationX = value; - this.validateTransformMatrix(); - } - } - - override public function get rotationY() : Number - { - return this.layoutFeatures == null ? super.rotationY : Number(this.layoutFeatures.layoutRotationY); - } - - override public function set rotationY(value:Number) : void - { - if(this.rotationY == value) - { - return; - } - if(this.layoutFeatures == null) - { - super.rotationY = value; - } - else - { - this.layoutFeatures.layoutRotationY = value; - this.validateTransformMatrix(); - } - } - - override public function get rotationZ() : Number - { - return this.layoutFeatures == null ? super.rotationZ : Number(this.layoutFeatures.layoutRotationZ); - } - - override public function set rotationZ(value:Number) : void - { - if(this.rotationZ == value) - { - return; - } - if(this.layoutFeatures == null) - { - super.rotationZ = value; - } - else - { - this.layoutFeatures.layoutRotationZ = value; - this.validateTransformMatrix(); - } - } - - override public function get rotation() : Number - { - return this.layoutFeatures == null ? super.rotation : Number(this.layoutFeatures.layoutRotationZ); - } - - override public function set rotation(value:Number) : void - { - if(this.rotation == value) - { - return; - } - if(this.layoutFeatures == null) - { - super.rotation = value; - } - else - { - this.layoutFeatures.layoutRotationZ = value; - this.validateTransformMatrix(); - } - } - - override public function get scaleX() : Number - { - return this.layoutFeatures == null ? super.scaleX : Number(this.layoutFeatures.layoutScaleX); - } - - override public function set scaleX(value:Number) : void - { - if(this.scaleX == value) - { - return; - } - if(this.layoutFeatures == null) - { - super.scaleX = value; - } - else - { - this.layoutFeatures.layoutScaleX = value; - this.layoutFeatures.layoutWidth = Math.abs(value) * this.measuredWidth; - this.validateTransformMatrix(); - } - } - - override public function get scaleY() : Number - { - return this.layoutFeatures == null ? super.scaleY : Number(this.layoutFeatures.layoutScaleY); - } - - override public function set scaleY(value:Number) : void - { - if(this.scaleY == value) - { - return; - } - if(this.layoutFeatures == null) - { - super.scaleY = value; - } - else - { - this.layoutFeatures.layoutScaleY = value; - this._height = Math.abs(value) * this.measuredHeight; - this.validateTransformMatrix(); - } - } - - override public function get scaleZ() : Number - { - return this.layoutFeatures == null ? super.scaleZ : Number(this.layoutFeatures.layoutScaleZ); - } - - override public function set scaleZ(value:Number) : void - { - if(this.scaleZ == value) - { - return; - } - if(this.layoutFeatures == null) - { - super.scaleZ = value; - } - else - { - this.layoutFeatures.layoutScaleZ = value; - this.validateTransformMatrix(); - } - } - - [Inspectable(category="General",enumeration="ltr,rtl")] - public function get layoutDirection() : String - { - return this._layoutDirection; - } - - public function set layoutDirection(value:String) : void - { - if(value == this._layoutDirection) - { - return; - } - this._layoutDirection = value; - this.invalidateLayoutDirection(); - } - - public function get measuredHeight() : Number - { - if(Boolean(bitmapData)) - { - return bitmapData.height; - } - return 0; - } - - public function get measuredWidth() : Number - { - if(Boolean(bitmapData)) - { - return bitmapData.width; - } - return 0; - } - - public function invalidateLayoutDirection() : void - { - var mirror:Boolean = false; - for(var p:DisplayObjectContainer = parent; Boolean(p); ) - { - if(p is ILayoutDirectionElement) - { - mirror = this._layoutDirection != null && ILayoutDirectionElement(p).layoutDirection != null && this._layoutDirection != ILayoutDirectionElement(p).layoutDirection; - if(mirror && this.layoutFeatures == null) - { - this.initAdvancedLayoutFeatures(); - if(this.layoutFeatures != null) - { - this.layoutFeatures.mirror = mirror; - this.validateTransformMatrix(); - } - break; - } - if(!mirror && Boolean(this.layoutFeatures)) - { - this.layoutFeatures.mirror = mirror; - this.validateTransformMatrix(); - this.layoutFeatures = null; - } - break; - } - p = p.parent; - } - } - - public function move(x:Number, y:Number) : void - { - this.x = x; - this.y = y; - } - - public function setActualSize(newWidth:Number, newHeight:Number) : void - { - this.width = newWidth; - this.height = newHeight; - } - - private function addedHandler(event:Event) : void - { - this.invalidateLayoutDirection(); - } - - private function initAdvancedLayoutFeatures() : void - { - var appDomain:ApplicationDomain = null; - var features:IAssetLayoutFeatures = null; - if(this.layoutFeaturesClass == null) - { - appDomain = ApplicationDomain.currentDomain; - if(appDomain.hasDefinition("mx.core::AdvancedLayoutFeatures")) - { - this.layoutFeaturesClass = Class(appDomain.getDefinition("mx.core::AdvancedLayoutFeatures")); - } - if(MatrixUtilClass == null) - { - if(appDomain.hasDefinition("mx.utils::MatrixUtil")) - { - MatrixUtilClass = Class(appDomain.getDefinition("mx.utils::MatrixUtil")); - } - } - } - if(this.layoutFeaturesClass != null) - { - features = new this.layoutFeaturesClass(); - features.layoutScaleX = this.scaleX; - features.layoutScaleY = this.scaleY; - features.layoutScaleZ = this.scaleZ; - features.layoutRotationX = this.rotationX; - features.layoutRotationY = this.rotationY; - features.layoutRotationZ = this.rotation; - features.layoutX = this.x; - features.layoutY = this.y; - features.layoutZ = this.z; - features.layoutWidth = this.width; - this._height = this.height; - this.layoutFeatures = features; - } - } - - private function validateTransformMatrix() : void - { - if(this.layoutFeatures != null) - { - if(this.layoutFeatures.is3D) - { - super.transform.matrix3D = this.layoutFeatures.computedMatrix3D; - } - else - { - super.transform.matrix = this.layoutFeatures.computedMatrix; - } - } - } - } -} - diff --git a/src/mx/core/FlexBitmap.as b/src/mx/core/FlexBitmap.as deleted file mode 100644 index a449e54..0000000 --- a/src/mx/core/FlexBitmap.as +++ /dev/null @@ -1,31 +0,0 @@ -package mx.core -{ - import flash.display.Bitmap; - import flash.display.BitmapData; - import mx.utils.NameUtil; - - use namespace mx_internal; - - public class FlexBitmap extends Bitmap - { - mx_internal static const VERSION:String = "4.5.0.19786"; - - public function FlexBitmap(bitmapData:BitmapData = null, pixelSnapping:String = "auto", smoothing:Boolean = false) - { - super(bitmapData,pixelSnapping,smoothing); - try - { - name = NameUtil.createUniqueName(this); - } - catch(e:Error) - { - } - } - - override public function toString() : String - { - return NameUtil.displayObjectToString(this); - } - } -} - diff --git a/src/mx/core/IAssetLayoutFeatures.as b/src/mx/core/IAssetLayoutFeatures.as deleted file mode 100644 index 6725f0e..0000000 --- a/src/mx/core/IAssetLayoutFeatures.as +++ /dev/null @@ -1,89 +0,0 @@ -package mx.core -{ - import flash.geom.Matrix; - import flash.geom.Matrix3D; - - public interface IAssetLayoutFeatures - { - function set layoutX(param1:Number) : void; - - function get layoutX() : Number; - - function set layoutY(param1:Number) : void; - - function get layoutY() : Number; - - function set layoutZ(param1:Number) : void; - - function get layoutZ() : Number; - - function get layoutWidth() : Number; - - function set layoutWidth(param1:Number) : void; - - function set transformX(param1:Number) : void; - - function get transformX() : Number; - - function set transformY(param1:Number) : void; - - function get transformY() : Number; - - function set transformZ(param1:Number) : void; - - function get transformZ() : Number; - - function set layoutRotationX(param1:Number) : void; - - function get layoutRotationX() : Number; - - function set layoutRotationY(param1:Number) : void; - - function get layoutRotationY() : Number; - - function set layoutRotationZ(param1:Number) : void; - - function get layoutRotationZ() : Number; - - function set layoutScaleX(param1:Number) : void; - - function get layoutScaleX() : Number; - - function set layoutScaleY(param1:Number) : void; - - function get layoutScaleY() : Number; - - function set layoutScaleZ(param1:Number) : void; - - function get layoutScaleZ() : Number; - - function set layoutMatrix(param1:Matrix) : void; - - function get layoutMatrix() : Matrix; - - function set layoutMatrix3D(param1:Matrix3D) : void; - - function get layoutMatrix3D() : Matrix3D; - - function get is3D() : Boolean; - - function get layoutIs3D() : Boolean; - - function get mirror() : Boolean; - - function set mirror(param1:Boolean) : void; - - function get stretchX() : Number; - - function set stretchX(param1:Number) : void; - - function get stretchY() : Number; - - function set stretchY(param1:Number) : void; - - function get computedMatrix() : Matrix; - - function get computedMatrix3D() : Matrix3D; - } -} - diff --git a/src/mx/core/IFlexAsset.as b/src/mx/core/IFlexAsset.as deleted file mode 100644 index 8390e21..0000000 --- a/src/mx/core/IFlexAsset.as +++ /dev/null @@ -1,8 +0,0 @@ -package mx.core -{ - public interface IFlexAsset - { - - } -} - diff --git a/src/mx/core/IFlexDisplayObject.as b/src/mx/core/IFlexDisplayObject.as deleted file mode 100644 index 29f81f3..0000000 --- a/src/mx/core/IFlexDisplayObject.as +++ /dev/null @@ -1,125 +0,0 @@ -package mx.core -{ - import flash.accessibility.AccessibilityProperties; - import flash.display.DisplayObject; - import flash.display.DisplayObjectContainer; - import flash.display.IBitmapDrawable; - import flash.display.LoaderInfo; - import flash.display.Stage; - import flash.events.IEventDispatcher; - import flash.geom.Point; - import flash.geom.Rectangle; - import flash.geom.Transform; - - public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher - { - function get root() : DisplayObject; - - function get stage() : Stage; - - function get name() : String; - - function set name(param1:String) : void; - - function get parent() : DisplayObjectContainer; - - function get mask() : DisplayObject; - - function set mask(param1:DisplayObject) : void; - - function get visible() : Boolean; - - function set visible(param1:Boolean) : void; - - function get x() : Number; - - function set x(param1:Number) : void; - - function get y() : Number; - - function set y(param1:Number) : void; - - function get scaleX() : Number; - - function set scaleX(param1:Number) : void; - - function get scaleY() : Number; - - function set scaleY(param1:Number) : void; - - function get mouseX() : Number; - - function get mouseY() : Number; - - function get rotation() : Number; - - function set rotation(param1:Number) : void; - - function get alpha() : Number; - - function set alpha(param1:Number) : void; - - function get width() : Number; - - function set width(param1:Number) : void; - - function get height() : Number; - - function set height(param1:Number) : void; - - function get cacheAsBitmap() : Boolean; - - function set cacheAsBitmap(param1:Boolean) : void; - - function get opaqueBackground() : Object; - - function set opaqueBackground(param1:Object) : void; - - function get scrollRect() : Rectangle; - - function set scrollRect(param1:Rectangle) : void; - - function get filters() : Array; - - function set filters(param1:Array) : void; - - function get blendMode() : String; - - function set blendMode(param1:String) : void; - - function get transform() : Transform; - - function set transform(param1:Transform) : void; - - function get scale9Grid() : Rectangle; - - function set scale9Grid(param1:Rectangle) : void; - - function globalToLocal(param1:Point) : Point; - - function localToGlobal(param1:Point) : Point; - - function getBounds(param1:DisplayObject) : Rectangle; - - function getRect(param1:DisplayObject) : Rectangle; - - function get loaderInfo() : LoaderInfo; - - function hitTestObject(param1:DisplayObject) : Boolean; - - function hitTestPoint(param1:Number, param2:Number, param3:Boolean = false) : Boolean; - - function get accessibilityProperties() : AccessibilityProperties; - - function set accessibilityProperties(param1:AccessibilityProperties) : void; - - function get measuredHeight() : Number; - - function get measuredWidth() : Number; - - function move(param1:Number, param2:Number) : void; - - function setActualSize(param1:Number, param2:Number) : void; - } -} - diff --git a/src/mx/core/ILayoutDirectionElement.as b/src/mx/core/ILayoutDirectionElement.as deleted file mode 100644 index e386166..0000000 --- a/src/mx/core/ILayoutDirectionElement.as +++ /dev/null @@ -1,12 +0,0 @@ -package mx.core -{ - public interface ILayoutDirectionElement - { - function get layoutDirection() : String; - - function set layoutDirection(param1:String) : void; - - function invalidateLayoutDirection() : void; - } -} - diff --git a/src/mx/core/IRepeaterClient.as b/src/mx/core/IRepeaterClient.as deleted file mode 100644 index 907dc03..0000000 --- a/src/mx/core/IRepeaterClient.as +++ /dev/null @@ -1,22 +0,0 @@ -package mx.core -{ - public interface IRepeaterClient - { - function get instanceIndices() : Array; - - function set instanceIndices(param1:Array) : void; - - function get isDocument() : Boolean; - - function get repeaterIndices() : Array; - - function set repeaterIndices(param1:Array) : void; - - function get repeaters() : Array; - - function set repeaters(param1:Array) : void; - - function initializeRepeaterArrays(param1:IRepeaterClient) : void; - } -} - diff --git a/src/mx/core/mx_internal.as b/src/mx/core/mx_internal.as deleted file mode 100644 index af32887..0000000 --- a/src/mx/core/mx_internal.as +++ /dev/null @@ -1,5 +0,0 @@ -package mx.core -{ - public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal"; -} - diff --git a/src/mx/utils/NameUtil.as b/src/mx/utils/NameUtil.as deleted file mode 100644 index 5e8d917..0000000 --- a/src/mx/utils/NameUtil.as +++ /dev/null @@ -1,94 +0,0 @@ -package mx.utils -{ - import flash.display.DisplayObject; - import flash.utils.getQualifiedClassName; - import mx.core.IRepeaterClient; - import mx.core.mx_internal; - - use namespace mx_internal; - - public class NameUtil - { - mx_internal static const VERSION:String = "4.5.0.19786"; - - private static var counter:int = 0; - - public function NameUtil() - { - super(); - } - - public static function createUniqueName(object:Object) : String - { - if(!object) - { - return null; - } - var name:String = getQualifiedClassName(object); - var index:int = int(name.indexOf("::")); - if(index != -1) - { - name = name.substr(index + 2); - } - var charCode:int = int(name.charCodeAt(name.length - 1)); - if(charCode >= 48 && charCode <= 57) - { - name += "_"; - } - return name + counter++; - } - - public static function displayObjectToString(displayObject:DisplayObject) : String - { - var result:String = null; - var o:DisplayObject = null; - var s:String = null; - var indices:Array = null; - try - { - for(o = displayObject; o != null; ) - { - if(o.parent && o.stage && o.parent == o.stage) - { - break; - } - s = "id" in o && Boolean(o["id"]) ? o["id"] : o.name; - if(o is IRepeaterClient) - { - indices = IRepeaterClient(o).instanceIndices; - if(Boolean(indices)) - { - s += "[" + indices.join("][") + "]"; - } - } - result = result == null ? s : s + "." + result; - o = o.parent; - } - } - catch(e:SecurityError) - { - } - return result; - } - - public static function getUnqualifiedClassName(object:Object) : String - { - var name:String = null; - if(object is String) - { - name = object as String; - } - else - { - name = getQualifiedClassName(object); - } - var index:int = int(name.indexOf("::")); - if(index != -1) - { - name = name.substr(index + 2); - } - return name; - } - } -} -