diff --git a/.gitignore b/.gitignore index e3383bfc..a58d999e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ docs node_modules package-lock.json lib/_gen +lib/**/*.as npm-debug.log dist /tests/**/bin diff --git a/lib/starling/animation/BezierEasing.as b/lib/starling/animation/BezierEasing.as deleted file mode 100644 index cf143eb6..00000000 --- a/lib/starling/animation/BezierEasing.as +++ /dev/null @@ -1,11 +0,0 @@ -package starling.animation { - - /** - * @externs - */ - public class BezierEasing - { - public static function create(x1:Number, y1:Number, x2:Number, y2:Number):Function { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/animation/DelayedCall.as b/lib/starling/animation/DelayedCall.as deleted file mode 100644 index cebd97f8..00000000 --- a/lib/starling/animation/DelayedCall.as +++ /dev/null @@ -1,29 +0,0 @@ -package starling.animation { - - - import starling.events.EventDispatcher; - - - /** - * @externs - */ - public class DelayedCall extends EventDispatcher implements IAnimatable { - - - public function get arguments ():Array { return null; } - public function get callback ():Function { return null; } - public function get currentTime ():Number { return 0; } - public function get isComplete ():Boolean { return false; } - public var repeatCount:int; - public function get totalTime ():Number { return 0; } - - public function DelayedCall (callback:Function, delay:Number, args:Array = null) {} - public function reset (callback:Function, delay:Number, args:Array = null):DelayedCall { return null; } - public function advanceTime (time:Number):void {} - public function complete ():void {} - - - } - - -} \ No newline at end of file diff --git a/lib/starling/animation/IAnimatable.as b/lib/starling/animation/IAnimatable.as deleted file mode 100644 index 70244064..00000000 --- a/lib/starling/animation/IAnimatable.as +++ /dev/null @@ -1,16 +0,0 @@ -package starling.animation { - - - /** - * @externs - */ - public interface IAnimatable { - - - function advanceTime (time:Number):void; - - - } - - -} \ No newline at end of file diff --git a/lib/starling/animation/Juggler.as b/lib/starling/animation/Juggler.as deleted file mode 100644 index 27d08f5f..00000000 --- a/lib/starling/animation/Juggler.as +++ /dev/null @@ -1,37 +0,0 @@ -package starling.animation { - - - // import openfl.Vector; - - - /** - * @externs - */ - public class Juggler implements IAnimatable { - - - public function get elapsedTime ():Number { return 0; } - public function get objects ():Vector. { return null; } - public var timeScale:Number; - - public function Juggler () {} - public function add (object:IAnimatable):uint { return 0; } - public function addWithID (object:IAnimatable, objectID:uint):uint { return 0; } - public function contains (object:IAnimatable):Boolean { return false; } - public function remove (object:IAnimatable):uint { return 0; } - public function removeByID (objectID:uint):uint { return 0; } - public function removeTweens(target:Object):void {} - public function removeDelayedCalls (callback:Function):void {} - public function containsTweens (target:Object):Boolean { return false; } - public function containsDelayedCalls (callback:Function):Boolean { return false; } - public function purge ():void {} - public function delayCall (call:Function, delay:Number, args:Array = null):uint { return 0; } - public function repeatCall (call:Function, interval:Number, repeatCount:int = 0, args:Array = null):uint { return 0; } - public function tween (target:Object, time:Number, properties:Object):uint { return 0; } - public function advanceTime (time:Number):void {} - - - } - - -} \ No newline at end of file diff --git a/lib/starling/animation/Transitions.as b/lib/starling/animation/Transitions.as deleted file mode 100644 index 60ad3750..00000000 --- a/lib/starling/animation/Transitions.as +++ /dev/null @@ -1,36 +0,0 @@ -package starling.animation { - - - /** - * @externs - */ - public class Transitions { - - - public static const LINEAR:String = "linear"; - public static const EASE_IN:String = "easeIn"; - public static const EASE_OUT:String = "easeOut"; - public static const EASE_IN_OUT:String = "easeInOut"; - public static const EASE_OUT_IN:String = "easeOutIn"; - public static const EASE_IN_BACK:String = "easeInBack"; - public static const EASE_OUT_BACK:String = "easeOutBack"; - public static const EASE_IN_OUT_BACK:String = "easeInOutBack"; - public static const EASE_OUT_IN_BACK:String = "easeOutInBack"; - public static const EASE_IN_ELASTIC:String = "easeInElastic"; - public static const EASE_OUT_ELASTIC:String = "easeOutElastic"; - public static const EASE_IN_OUT_ELASTIC:String = "easeInOutElastic"; - public static const EASE_OUT_IN_ELASTIC:String = "easeOutInElastic"; - public static const EASE_IN_BOUNCE:String = "easeInBounce"; - public static const EASE_OUT_BOUNCE:String = "easeOutBounce"; - public static const EASE_IN_OUT_BOUNCE:String = "easeInOutBounce"; - public static const EASE_OUT_IN_BOUNCE:String = "easeOutInBounce"; - - - public static function getTransition (name:String):Function { return null; } - public static function register (name:String, func:Function):void {} - - - } - - -} \ No newline at end of file diff --git a/lib/starling/animation/Tween.as b/lib/starling/animation/Tween.as deleted file mode 100644 index ae4fcb06..00000000 --- a/lib/starling/animation/Tween.as +++ /dev/null @@ -1,50 +0,0 @@ -package starling.animation { - - - import starling.events.EventDispatcher; - - - /** - * @externs - */ - public class Tween extends EventDispatcher implements IAnimatable { - - - public function get isComplete ():Boolean { return false; } - public function get target ():Object { return null; } - public var transition:String; - public var transitionFunc:Function; - public function get totalTime ():Number { return 0; } - public function get currentTime ():Number { return 0; } - public function get progress ():Number { return 0; } - public var delay:Number; - public var repeatCount:int; - public var repeatDelay:Number; - public var reverse:Boolean; - public var roundToInt:Boolean; - public var onStart:Function; - public var onUpdate:Function; - public var onRepeat:Function; - public var onComplete:Function; - public var onStartArgs:Array; - public var onUpdateArgs:Array; - public var onRepeatArgs:Array; - public var onCompleteArgs:Array; - public var nextTween:Tween; - - public function Tween (target:Object, time:Number, transition:Object = "linear") {} - public function reset (target:Object, time:Number, transition:Object = "linear"):Tween { return null; } - public function animate (property:String, endValue:Number):void {} - public function scaleTo (factor:Number):void {} - public function moveTo (x:Number, y:Number):void {} - public function fadeTo (alpha:Number):void {} - public function rotateTo (angle:Number, type:String = "rad"):void {} - public function advanceTime (time:Number):void {} - public function getEndValue (property:String):Number { return 0; } - public function animatesProperty (property:String):Boolean { return false; } - - - } - - -} \ No newline at end of file diff --git a/lib/starling/assets/AssetFactory.as b/lib/starling/assets/AssetFactory.as deleted file mode 100644 index 8db6e90d..00000000 --- a/lib/starling/assets/AssetFactory.as +++ /dev/null @@ -1,73 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.assets { - - import openfl.utils.ByteArray; - // import openfl.Vector; - - /** - * @externs - * An AssetFactory is responsible for creating a concrete instance of an asset. - * - *

The AssetManager contains a list of AssetFactories, registered via 'registerFactory'. - * When the asset queue is processed, each factory (sorted by priority) will be asked if it - * can handle a certain AssetReference (via the 'canHandle') method. If it can, the 'create' - * method will be called, which is responsible for creating at least one asset.

- * - *

By extending 'AssetFactory' and registering your class at the AssetManager, you can - * customize how assets are being created and even add new types of assets.

- */ - public class AssetFactory - { - /** Creates a new instance. */ - public function AssetFactory() {} - - /** Returns 'true' if this factory can handle the given reference. The default - * implementation checks if extension and/or mime type of the reference match those - * of the factory. */ - public function canHandle(reference:AssetReference):Boolean { return false; } - - /** This method will only be called if 'canHandle' returned 'true' for the given reference. - * It's responsible for creating at least one concrete asset and passing it to 'onComplete'. - * - * @param reference The asset to be created. If a local or remote URL is referenced, - * it will already have been loaded, and 'data' will contain a ByteArray. - * @param helper Contains useful utility methods to be used by the factory. Look - * at the class documentation for more information. - * @param onComplete To be called with the name and asset as parameters when loading - * is successful.
function(name:String, asset:Object):void;
- * @param onError To be called when creation fails for some reason. Do not call - * 'onComplete' when that happens.
function(error:String):void
- */ - public function create(reference:AssetReference, helper:AssetFactoryHelper, - onComplete:Function, onError:Function):void {} - - /** Add one or more mime types that identify the supported data types. Used by - * 'canHandle' to figure out if the factory is suitable for an asset reference. */ - public function addMimeTypes(args:Array):void {} - - /** Add one or more file extensions (without leading dot) that identify the supported data - * types. Used by 'canHandle' to figure out if the factory is suitable for an asset - * reference. */ - public function addExtensions(args:Array):void {} - - /** Returns the mime types this factory supports. */ - public function getMimeTypes(out:Vector.=null):Vector. { return null; } - - /** Returns the file extensions this factory supports. */ - public function getExtensions(out:Vector.=null):Vector. { return null; } - - public var priority:int; //with private + @:allow I get a runtime error in AssetManager.comparePriorities - protected function get_priority():int { return 0; } - protected function set_priority(value:int):int { return 0; } - } - -} \ No newline at end of file diff --git a/lib/starling/assets/AssetFactoryHelper.as b/lib/starling/assets/AssetFactoryHelper.as deleted file mode 100644 index 5bc16e83..00000000 --- a/lib/starling/assets/AssetFactoryHelper.as +++ /dev/null @@ -1,70 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.assets { - - import starling.utils.Execute; - import starling.utils.SystemUtil; - import openfl.utils.ByteArray; - - /** - * @externs - * A helper class that's passed to an AssetFactory's "create" method. - */ - public class AssetFactoryHelper - { - /** Forwarded to the AssetManager's method with the same name. */ - public function getNameFromUrl(url:String):String { return null; } - - /** Forwarded to the AssetManager's method with the same name. */ - public function getExtensionFromUrl(url:String):String { return null; } - - /** Accesses a URL (local or remote) and passes the loaded ByteArray to the - * 'onComplete' callback - or executes 'onError' when the data can't be loaded. - * - * @param url a string containing an URL. - * @param onComplete function(data:ByteArray, mimeType:String):void; - * @param onError function(error:String):void; - */ - public function loadDataFromUrl(url:String, onComplete:Function, onError:Function):void {} - - /** Adds a method to be called by the AssetManager when the queue has finished processing. - * Useful e.g. if assets depend on other assets (like an atlas XML depending on the atlas - * texture). - * - * @param processor function(manager:AssetManager):void; - * @param priority Processors with a higher priority will be called first. - * The default processor for texture atlases is called with a - * priority of '100', others with '0'. - */ - public function addPostProcessor(processor:Function, priority:int=0):void {} - - /** Textures are required to call this method when they begin their restoration process - * after a context loss. */ - public function onBeginRestore():void {} - - /** Textures are required to call this method when they have finished their restoration - * process after a context loss. */ - public function onEndRestore():void {} - - /** Forwarded to the AssetManager's method with the same name. */ - public function log(message:String):void {} - - /** Adds additional assets to the AssetManager. To be called when the factory - * creates more than one asset. */ - public function addComplementaryAsset(name:String, asset:Object, type:String=null):void {} - - /** Delay the execution of 'call' until it's allowed. (On mobile, the context - * may not be accessed while the application is in the background.) - */ - public function executeWhenContextReady(call:Function, args:Array = null):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/assets/AssetManager.as b/lib/starling/assets/AssetManager.as deleted file mode 100644 index 89d9efcb..00000000 --- a/lib/starling/assets/AssetManager.as +++ /dev/null @@ -1,404 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.assets { - - import openfl.errors.ArgumentError; - import openfl.errors.Error; - import openfl.media.Sound; - import openfl.media.SoundChannel; - import openfl.media.SoundTransform; - import openfl.net.URLRequest; - import openfl.system.System; - import openfl.utils.ByteArray; - // import openfl.Vector; - //import openfl.utils.describeType; - //import openfl.utils.getQualifiedClassName; - //import openfl.utils.setTimeout; - - import starling.core.Starling; - import starling.events.Event; - import starling.events.EventDispatcher; - import starling.text.BitmapFont; - import starling.textures.Texture; - import starling.textures.TextureAtlas; - import starling.textures.TextureOptions; - import starling.utils.MathUtil; - import starling.utils.Execute; - - /** Dispatched when all textures have been restored after a context loss. */ - //@:meta(Event(name="texturesRestored", type="starling.events.Event")) - - /** - * @externs - * The AssetManager handles loading and accessing a variety of asset types. You can - * add assets directly (via the 'add...' methods) or asynchronously via a queue. This allows - * you to deal with assets in a unified way, no matter if they are loaded from a file, - * directory, URL, or from an embedded object. - * - *

The class can deal with the following media types: - *

    - *
  • Textures (either from Bitmaps or ATF data)
  • - *
  • Texture atlases
  • - *
  • Bitmap Fonts
  • - *
  • Sounds
  • - *
  • XML data
  • - *
  • JSON data
  • - *
  • ByteArrays
  • - *
  • other AssetManagers
  • - *
- *

- * - *

For more information on how to add assets from different sources, read the documentation - * of the "enqueue()" method.

- * - * Context Loss - * - *

When the stage3D context is lost, the AssetManager will automatically restore all - * loaded textures. To save memory, it will get them from their original sources. Since - * this is done asynchronously, your images might not reappear all at once, but during - * a time frame of several seconds. If you want, you can pause your game during that time; - * the AssetManager dispatches an "Event.TEXTURES_RESTORED" event when all textures have - * been restored.

- * - * Error Handling - * - *

Loading of some assets may fail while the queue is being processed. In that case, the - * AssetManager will call the 'onError' callback that you can optional provide to the - * 'loadQueue' method. Queue processing will continue after an error, so it's always - * guaranteed that the 'onComplete' callback is executed, too.

- * - * Texture Properties - * - *

When you enqueue a texture, its properties for "format", "scale", "mipMapping", and - * "repeat" will reflect the settings of the AssetManager at the time they were enqueued. - * This means that you can enqueue a bunch of textures, then change the settings and enqueue - * some more. Like this:

- * - * - * var appDir:File = File.applicationDirectory; - * var assets:AssetManager = new AssetManager(); - * - * assets.textureOptions.format = Context3DTextureFormat.BGRA; - * assets.enqueue(appDir.resolvePath("textures/32bit")); - * - * assets.textureOptions.format = Context3DTextureFormat.BGRA_PACKED; - * assets.enqueue(appDir.resolvePath("textures/16bit")); - * - * assets.loadQueue(...); - * - * Nesting - * - *

When you enqueue one or more AssetManagers to another one, the "loadQueue" method will - * oad the Assets of the "child" AssetManager, as well. Later, when accessing assets, - * the "parent" AssetManager will return the "child" assets as well - just like it returns, - * say, the SubTextures from a contained TextureAtlas.

- * - *

The main advantage of grouping your assets like this is something else, though: it - * allows to remove (and dispose) a complete group of assets in one step. The example - * below loads the assets from two directories. When the contents of one of them are no - * longer needed, all its assets are removed together.

- * - * - * var manager:AssetManager = new AssetManager(); - * var appDir:File = File.applicationDirectory; - * - * var redAssets:AssetManager = new AssetManager(); - * manager.enqueueSingle(appDir.resolvePath("textures/red/", "redAssets"); - * - * var greenAssets:AssetManager = new AssetManager(); - * manager.enqueueSingle(appDir.resolvePath("textures/green/", "greenAssets"); - * - * manager.loadQueue(...); // loads both "red" and "green" assets - * - * // ... later, remove all "red" assets together - * manager.removeAssetManager("redAssets"); - * - * Customization - * - *

You can customize how assets are created by extending the 'AssetFactory' class and - * registering an instance of your new class at the AssetManager via 'registerFactory'. - * Factories are probed by priority; any factory with a priority > 0 will be executed - * before the built-in factories.

- * - *

An asset type is identified by a unique String. You can add your own asset types - * by creating a custom 'AssetFactory' and having it add the asset with custom string - * identifier.

- * - *

By overriding the methods 'getNameFromUrl', 'getExtensionFromUrl', 'disposeAsset', - * and 'log', you can customize how assets are named and disposed, and you can forward - * any logging to an external logger. To customize the way data is loaded from URLs or - * files, you can assign a custom 'DataLoader' instance to the AssetManager.

- * - * @see starling.assets.AssetFactory - * @see starling.assets.AssetType - * @see starling.assets.DataLoader - */ - public class AssetManager extends EventDispatcher - { - /** Create a new instance with the given scale factor. */ - public function AssetManager(scaleFactor:Number= 1) {} - - /** Disposes all assets and purges the queue. - * - *

Beware that all references to the assets will remain intact, even though the assets - * are no longer valid. Call 'purge' if you want to remove all resources and reuse - * the AssetManager later.

- */ - public function dispose():void {} - - /** Removes assets of all types (disposing them along the way), empties the queue and - * aborts any pending load operations. */ - public function purge():void {} - - // queue processing - - /** Enqueues one or more raw assets; they will only be available after successfully - * executing the "loadQueue" method. This method accepts a variety of different objects: - * - *
    - *
  • Strings or URLRequests containing an URL to a local or remote resource. Supported - * types: png, jpg, gif, atf, mp3, xml, fnt, json, binary.
  • - *
  • Instances of the File class (AIR only) pointing to a directory or a file. - * Directories will be scanned recursively for all supported types.
  • - *
  • Classes that contain static embedded assets.
  • - *
  • If the file extension is not recognized, the data is analyzed to see if - * contains XML or JSON data. If it's neither, it is stored as ByteArray.
  • - *
- * - *

Suitable object names are extracted automatically: A file named "image.png" will be - * accessible under the name "image". When enqueuing embedded assets via a class, - * the variable name of the embedded object will be used as its name. An exception - * are texture atlases: they will have the same name as the actual texture they are - * referencing.

- * - *

XMLs are made available via "getXml()"; this includes XMLs containing texture - * atlases or bitmap fonts, which are processed along the way. Bitmap fonts are also - * registered at the TextField class.

- * - *

If you pass in JSON data, it will be parsed into an object and will be available via - * "getObject()".

- */ - public function enqueue(assets:Array):void {} - - /** Enqueues a single asset with a custom name that can be used to access it later. - * If the asset is a texture, you can also add custom texture options. - * - * @param asset The asset that will be enqueued; accepts the same objects as the - * 'enqueue' method. - * @param name The name under which the asset will be found later. If you pass null or - * omit the parameter, it's attempted to generate a name automatically. - * @param options Custom options that will be used if 'asset' points to texture data. - * @return the name with which the asset was registered. - */ - public function enqueueSingle(asset:Object, name:String=null, - options:TextureOptions=null):String { return null; } - - /** Empties the queue and aborts any pending load operations. */ - public function purgeQueue():void {} - - /** Loads all enqueued assets asynchronously. The 'onComplete' callback will be executed - * once all assets have been loaded - even when there have been errors, which are - * forwarded to the optional 'onError' callback. The 'onProgress' function will be called - * with a 'ratio' between '0.0' and '1.0' and is also optional. - * - *

When you call this method, the manager will save a reference to "Starling.current"; - * all textures that are loaded will be accessible only from within this instance. Thus, - * if you are working with more than one Starling instance, be sure to call - * "makeCurrent()" on the appropriate instance before processing the queue.

- * - * @param onComplete function():void {} - * @param onError function(error:String):void {} - * @param onProgress function(ratio:Float):void {} - */ - public function loadQueue(onComplete:Function, - onError:Function=null, onProgress:Function=null):void {} - - // basic accessing methods - - /** Add an asset with a certain name and type. - * - *

Beware: if the slot (name + type) was already taken, the existing object will be - * disposed and replaced by the new one.

- * - * @param name The name with which the asset can be retrieved later. Must be - * unique within this asset type. - * @param asset The actual asset to add (e.g. a texture, a sound, etc). - * @param type The type of the asset. If omitted, the type will be determined - * automatically (which works for all standard types defined within - * the 'AssetType' class). - */ - public function addAsset(name:String, asset:Object, type:String=null):void {} - - /** Retrieves an asset of the given type, with the given name. If 'recursive' is true, - * the method will traverse included texture atlases and asset managers. - * - *

Typically, you will use one of the type-safe convenience methods instead, like - * 'getTexture', 'getSound', etc.

- */ - public function getAsset(type:String, name:String, recursive:Boolean=true):Object { return null; } - - /** Retrieves an alphabetically sorted list of all assets that have the given type and - * start with the given prefix. If 'recursive' is true, the method will traverse included - * texture atlases and asset managers. */ - public function getAssetNames(assetType:String, prefix:String="", recursive:Boolean=true, - out:Vector.=null):Vector. { return null; } - - /** Removes the asset with the given name and type, and will optionally dispose it. */ - public function removeAsset(assetType:String, name:String, dispose:Boolean=true):void {} - - // convenience access methods - - /** Returns a texture with a certain name. Includes textures stored inside atlases. */ - public function getTexture(name:String):Texture { return null; } - - /** Returns all textures that start with a certain string, sorted alphabetically - * (especially useful for "MovieClip"). Includes textures stored inside atlases. */ - public function getTextures(prefix:String="", out:Vector.=null):Vector. { return null; } - - /** Returns all texture names that start with a certain string, sorted alphabetically. - * Includes textures stored inside atlases. */ - public function getTextureNames(prefix:String="", out:Vector.=null):Vector. { return null; } - - /** Returns a texture atlas with a certain name, or null if it's not found. */ - public function getTextureAtlas(name:String):TextureAtlas { return null; } - - /** Returns all texture atlas names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getTextureAtlasNames(prefix:String="", out:Vector.=null):Vector. { return null; } - - /** Returns a sound with a certain name, or null if it's not found. */ - public function getSound(name:String):Sound { return null; } - - /** Returns all sound names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getSoundNames(prefix:String="", out:Vector.=null):Vector. { return null; } - - /** Generates a new SoundChannel object to play back the sound. This method returns a - * SoundChannel object, which you can access to stop the sound and to control volume. */ - public function playSound(name:String, startTime:Number=0, loops:int=0, - transform:SoundTransform=null):SoundChannel { return null; } - - /** Returns an XML with a certain name, or null if it's not found. */ - public function getXml(name:String):Object { return null; } - - /** Returns all XML names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getXmlNames(prefix:String="", out:Vector.=null):Vector. { return null; } - - /** Returns an object with a certain name, or null if it's not found. Enqueued JSON - * data is parsed and can be accessed with this method. */ - public function getObject(name:String):Object { return null; } - - /** Returns all object names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getObjectNames(prefix:String="", out:Vector.=null):Vector. { return null; } - - /** Returns a byte array with a certain name, or null if it's not found. */ - public function getByteArray(name:String):ByteArray { return null; } - - /** Returns all byte array names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getByteArrayNames(prefix:String="", out:Vector.=null):Vector. { return null; } - - /** Returns a bitmap font with a certain name, or null if it's not found. */ - public function getBitmapFont(name:String):BitmapFont { return null; } - - /** Returns all bitmap font names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getBitmapFontNames(prefix:String="", out:Vector.=null):Vector. { return null; } - - /** Returns an asset manager with a certain name, or null if it's not found. */ - public function getAssetManager(name:String):AssetManager { return null; } - - /** Returns all asset manager names that start with a certain string, sorted alphabetically. - * If you pass an out-vector, the names will be added to that vector. */ - public function getAssetManagerNames(prefix:String="", out:Vector.=null):Vector. { return null; } - - /** Removes a certain texture, optionally disposing it. */ - public function removeTexture(name:String, dispose:Boolean=true):void {} - - /** Removes a certain texture atlas, optionally disposing it. */ - public function removeTextureAtlas(name:String, dispose:Boolean=true):void {} - - /** Removes a certain sound. */ - public function removeSound(name:String):void {} - - /** Removes a certain Xml object, optionally disposing it. */ - public function removeXml(name:String, dispose:Boolean=true):void {} - - /** Removes a certain object. */ - public function removeObject(name:String):void {} - - /** Removes a certain byte array, optionally disposing its memory right away. */ - public function removeByteArray(name:String, dispose:Boolean=true):void {} - - /** Removes a certain bitmap font, optionally disposing it. */ - public function removeBitmapFont(name:String, dispose:Boolean=true):void {} - - /** Removes a certain asset manager and optionally disposes it right away. */ - public function removeAssetManager(name:String, dispose:Boolean=true):void {} - - // registration of factories - - /** Registers a custom AssetFactory. If you use any priority > 0, the factory will - * be called before the default factories. The final factory to be invoked is the - * 'ByteArrayFactory', which is using a priority of '-100'. */ - public function registerFactory(factory:AssetFactory, priority:int=0):void {} - // properties - - /** When activated, the class will trace information about added/enqueued assets. - * @default true */ - public var verbose:Boolean; - protected function get_verbose():Boolean { return false; } - protected function set_verbose(value:Boolean):Boolean { return false; } - - /** Returns the number of raw assets that have been enqueued, but not yet loaded. */ - public function get numQueuedAssets():int { return 0; } - protected function get_numQueuedAssets():int { return 0; } - - /** The maximum number of parallel connections that are spawned when loading the queue. - * More connections can reduce loading times, but require more memory. @default 3. */ - public var numConnections:int; - protected function get_numConnections():int { return 0; } - protected function set_numConnections(value:int):int { return 0; } - - /** Textures will be created with the options set up in this object at the time of - * enqueuing. */ - public var textureOptions:TextureOptions; - protected function get_textureOptions():TextureOptions { return null; } - protected function set_textureOptions(value:TextureOptions):TextureOptions { return null; } - - /** The DataLoader is used to load any data from files or URLs. If you need to customize - * its behavior (e.g. to add a caching mechanism), assign your custom instance here. */ - public var dataLoader:DataLoader; - protected function get_dataLoader():DataLoader { return null; } - protected function set_dataLoader(value:DataLoader):DataLoader { return null; } - - /** Indicates if bitmap fonts should be registered with their "face" attribute from the - * font XML file. Per default, they are registered with the name of the texture file. - * @default false */ - public var registerBitmapFontsWithFontFace:Boolean; - protected function get_registerBitmapFontsWithFontFace():Boolean { return false; } - protected function set_registerBitmapFontsWithFontFace(value:Boolean):Boolean { return false; } - } - -} - -/** - * @externs - */ -// public class AssetPostProcessor -// { -// public function AssetPostProcessor(callback:Function, priority:int) {} - -// public function get priority():int { return 0; } -// protected function get_priority():int { return 0; } -// } \ No newline at end of file diff --git a/lib/starling/assets/AssetReference.as b/lib/starling/assets/AssetReference.as deleted file mode 100644 index 861c7e4b..00000000 --- a/lib/starling/assets/AssetReference.as +++ /dev/null @@ -1,59 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.assets { - - import starling.textures.TextureOptions; - - /** - * @externs - * The description of an asset to be created by an AssetFactory. - */ - public class AssetReference - { - /** Creates a new instance with the given data, which is typically some kind of file - * reference / URL or an instance of an asset class. If 'data' contains an URL, an - * equivalent value will be assigned to the 'url' property. */ - public function AssetReference(data:Object){} - - /** The name with which the asset should be added to the AssetManager. */ - public var name:String; - protected function get_name():String { return null; } - protected function set_name(value:String):String { return null; } - - /** The url from which the asset needs to be / has been loaded. */ - public var url:String; - protected function get_url():String { return null; } - protected function set_url(value:String):String { return null; } - - /** The raw data of the asset. This property often contains an URL; when it's passed - * to an AssetFactory, loading has already completed, and the property contains a - * ByteArray with the loaded data. */ - public var data:Object; - protected function get_data():Object { return null; } - protected function set_data(value:Object):Object { return null; } - - /** The mime type of the asset, if loaded from a server. */ - public var mimeType:String; - protected function get_mimeType():String { return null; } - protected function set_mimeType(value:String):String { return null; } - - /** The file extension of the asset, if the filename or URL contains one. */ - public var extension:String; - protected function get_extension():String { return null; } - protected function set_extension(value:String):String { return null; } - - /** The TextureOptions describing how to create a texture, if the asset references one. */ - public var textureOptions:TextureOptions; - protected function get_textureOptions():TextureOptions { return null; } - protected function set_textureOptions(value:TextureOptions):TextureOptions { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/assets/AssetType.as b/lib/starling/assets/AssetType.as deleted file mode 100644 index 502c1c44..00000000 --- a/lib/starling/assets/AssetType.as +++ /dev/null @@ -1,32 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.assets { - - /** - * @externs - * An enumeration class containing all the asset types supported by the AssetManager. - */ - public class AssetType - { - public static const TEXTURE:String = "texture"; - public static const TEXTURE_ATLAS:String = "textureAtlas"; - public static const SOUND:String = "sound"; - public static const XML_DOCUMENT:String = "xml"; - public static const OBJECT:String = "object"; - public static const BYTE_ARRAY:String = "byteArray"; - public static const BITMAP_FONT:String = "bitmapFont"; - public static const ASSET_MANAGER:String = "assetManager"; - - /** Figures out the asset type string from the type of the given instance. */ - public static function fromAsset(asset:Object):String { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/assets/AtfTextureFactory.as b/lib/starling/assets/AtfTextureFactory.as deleted file mode 100644 index ae56db35..00000000 --- a/lib/starling/assets/AtfTextureFactory.as +++ /dev/null @@ -1,28 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.assets { - - import openfl.utils.ByteArray; - - import starling.textures.AtfData; - import starling.textures.Texture; - - /** - * @externs - * This AssetFactory creates texture assets from ATF files. - */ - public class AtfTextureFactory extends AssetFactory - { - /** Creates a new instance. */ - public function AtfTextureFactory(){} - } - -} \ No newline at end of file diff --git a/lib/starling/assets/BitmapTextureFactory.as b/lib/starling/assets/BitmapTextureFactory.as deleted file mode 100644 index 3dc7a4a0..00000000 --- a/lib/starling/assets/BitmapTextureFactory.as +++ /dev/null @@ -1,36 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - - -package starling.assets { - - import openfl.display.Bitmap; - import openfl.display.BitmapData; - import openfl.display.Loader; - import openfl.display.LoaderInfo; - import openfl.events.Event; - import openfl.events.IOErrorEvent; - import openfl.system.LoaderContext; - import openfl.utils.ByteArray; - - import starling.textures.Texture; - import starling.utils.Execute; - - /** - * @externs - * This AssetFactory creates texture assets from bitmaps and image files. - */ - public class BitmapTextureFactory extends AssetFactory - { - /** Creates a new instance. */ - public function BitmapTextureFactory(){} - } - -} \ No newline at end of file diff --git a/lib/starling/assets/ByteArrayFactory.as b/lib/starling/assets/ByteArrayFactory.as deleted file mode 100644 index d561a38f..00000000 --- a/lib/starling/assets/ByteArrayFactory.as +++ /dev/null @@ -1,26 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.assets { - - import openfl.utils.ByteArray; - - /** - * @externs - * This AssetFactory forwards ByteArrays to the AssetManager. It's the fallback when - * no other factory can handle an asset reference (default priority: -100). - */ - public class ByteArrayFactory extends AssetFactory - { - /** Creates a new instance. */ - public function ByteArrayFactory(); - } - -} \ No newline at end of file diff --git a/lib/starling/assets/DataLoader.as b/lib/starling/assets/DataLoader.as deleted file mode 100644 index 7e8ba81c..00000000 --- a/lib/starling/assets/DataLoader.as +++ /dev/null @@ -1,64 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.assets { - - import openfl.errors.Error; - import openfl.events.ErrorEvent; - import openfl.events.Event; - import openfl.events.HTTPStatusEvent; - import openfl.events.IOErrorEvent; - import openfl.events.ProgressEvent; - import openfl.events.SecurityErrorEvent; - import openfl.net.URLLoader; - import openfl.net.URLLoaderDataFormat; - import openfl.net.URLRequest; - import openfl.net.URLRequestHeader; - import openfl.utils.ByteArray; - - import starling.utils.Execute; - - /** - * @externs - * Loads binary data from a local or remote URL with a very simple callback system. - * - *

The DataLoader is used by the AssetManager to load any local or remote data. - * Its single purpose is to get the binary data that's stored at a specific URL.

- * - *

You can use this class for your own purposes (as an easier to use 'URLLoader' - * alternative), or you can extend the class to modify the AssetManager's behavior. - * E.g. you could extend this class to add a caching mechanism for remote assets. - * Assign an instance of your extended class to the AssetManager's dataLoader - * property.

- */ - public class DataLoader - { - /** Creates a new DataLoader instance. */ - public function DataLoader(); - - /** Loads the binary data from a specific URL. Always supply both 'onComplete' and - * 'onError' parameters; in case of an error, only the latter will be called. - * - * @param url a String containing an URL. - * @param onComplete will be called when the data has been loaded. - * function(data:ByteArray, mimeType:String):void - * @param onError will be called in case of an error. The 2nd parameter is optional. - * function(error:String, httpStatus:int):void - * @param onProgress will be called multiple times with the current load ratio (0-1). - * function(ratio:Number):void - */ - public function load(url:String, onComplete:Function, - onError:Function, onProgress:Function=null):void {} - - /** Aborts all current load operations. The loader can still be used, though. */ - public function close():void {} - } - -} \ No newline at end of file diff --git a/lib/starling/assets/JsonFactory.as b/lib/starling/assets/JsonFactory.as deleted file mode 100644 index 00d9ad86..00000000 --- a/lib/starling/assets/JsonFactory.as +++ /dev/null @@ -1,28 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.assets { - - import openfl.utils.ByteArray; - import openfl.errors.Error; - - import starling.utils.ByteArrayUtil; - - /** - * @externs - * This AssetFactory creates objects from JSON data. - */ - public class JsonFactory extends AssetFactory - { - /** Creates a new instance. */ - public function JsonFactory() {} - } - -} \ No newline at end of file diff --git a/lib/starling/assets/SoundFactory.as b/lib/starling/assets/SoundFactory.as deleted file mode 100644 index c13818c3..00000000 --- a/lib/starling/assets/SoundFactory.as +++ /dev/null @@ -1,27 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.assets { - - import openfl.media.Sound; - import openfl.utils.ByteArray; - import openfl.errors.Error; - - /** - * @externs - * This AssetFactory creates sound assets. - */ - public class SoundFactory extends AssetFactory - { - /** Creates a new instance. */ - public function SoundFactory(){} - } - -} \ No newline at end of file diff --git a/lib/starling/assets/XmlFactory.as b/lib/starling/assets/XmlFactory.as deleted file mode 100644 index ef066f24..00000000 --- a/lib/starling/assets/XmlFactory.as +++ /dev/null @@ -1,23 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.assets { - - /** - * @externs - * This AssetFactory creates XML assets, texture atlases and bitmap fonts. - */ - public class XmlFactory extends AssetFactory - { - /** Creates a new instance. */ - public function XmlFactory(){} - } - -} \ No newline at end of file diff --git a/lib/starling/core/Starling.as b/lib/starling/core/Starling.as deleted file mode 100644 index c95aad4f..00000000 --- a/lib/starling/core/Starling.as +++ /dev/null @@ -1,74 +0,0 @@ -package starling.core { - - - import openfl.display3D.Context3D; - import openfl.display3D.Context3DProfile; - import openfl.display3D.Context3DRenderMode; - import openfl.display.Stage; - import openfl.display.Stage3D; - import openfl.geom.Rectangle; - // import openfl.Vector; - import starling.animation.Juggler; - import starling.display.DisplayObject; - import starling.display.Sprite; - import starling.display.Stage; - import starling.events.EventDispatcher; - import starling.events.TouchProcessor; - import starling.rendering.Painter; - - - /** - * @externs - */ - public class Starling extends EventDispatcher { - - public static function get VERSION ():String { return null; } - - public function get isStarted():Boolean { return false; } - public function get juggler():Juggler { return null; } - public function get painter():Painter { return null; } - public function get context():Context3D { return null; } - public var simulateMultitouch:Boolean; - public var enableErrorChecking:Boolean; - public var antiAliasing:int; - public var viewPort:Rectangle; - public function get contentScaleFactor():Number { return 0; } - public function get nativeOverlay():Sprite { return null; } - public var showStats:Boolean; - public function get stage():starling.display.Stage { return null; } - public function get stage3D():Stage3D { return null; } - public function get nativeStage():openfl.display.Stage { return null; } - public function get root():DisplayObject { return null; } - public var rootClass:Class; - public var shareContext:Boolean; - public function get profile():String { return null; } - public var supportHighResolutions:Boolean; - public var supportBrowserZoom:Boolean; - public var skipUnchangedFrames:Boolean; - public var touchProcessor:TouchProcessor; - public function get frameID():uint { return 0; } - public function get contextValid():Boolean { return false; } - public static function get current():Starling { return null; } - public static function get all():Vector. { return null; } - public static var multitouchEnabled:Boolean; - - public function Starling(rootClass:Class, stage:openfl.display.Stage, - viewPort:Rectangle=null, stage3D:Stage3D=null, - renderMode:String="auto", profile:Object="auto") {} - public function dispose():void {} - public function nextFrame():void {} - public function advanceTime(passedTime:Number):void {} - public function render():void {} - public function stopWithFatalError(message:String):void {} - public function makeCurrent():void {} - public function start():void {} - public function stop(suspendRendering:Boolean=false):void {} - public function setRequiresRedraw():void {} - public function showStatsAt(horizontalAlign:String="left", - verticalAlign:String="top", scale:Number=1):void {} - - - } - - -} \ No newline at end of file diff --git a/lib/starling/core/StatsDisplay.as b/lib/starling/core/StatsDisplay.as deleted file mode 100644 index e9c92934..00000000 --- a/lib/starling/core/StatsDisplay.as +++ /dev/null @@ -1,21 +0,0 @@ -package starling.core { - - - import starling.display.Sprite; - - - /** - * @externs - */ - public class StatsDisplay extends Sprite { - public var drawCount:int; - public var fps:Number; - public var gpuMemory:Number; - public var memory:Number; - public function StatsDisplay():void {} - public function markFrameAsSkipped():void {} - public function update():void {} - } - - -} \ No newline at end of file diff --git a/lib/starling/display/BlendMode.as b/lib/starling/display/BlendMode.as deleted file mode 100644 index fa5663d9..00000000 --- a/lib/starling/display/BlendMode.as +++ /dev/null @@ -1,53 +0,0 @@ -package starling.display { - - - import starling.core.Starling; - - - /** - * @externs - */ - public class BlendMode { - - /** Inherits the blend mode from this display object's parent. */ - public static const AUTO:String = "auto"; - - /** Deactivates blending, i.e. disabling any transparency. */ - public static const NONE:String = "none"; - - /** The display object appears in front of the background. */ - public static const NORMAL:String = "normal"; - - /** Adds the values of the colors of the display object to the colors of its background. */ - public static const ADD:String = "add"; - - /** Multiplies the values of the display object colors with the the background color. */ - public static const MULTIPLY:String = "multiply"; - - /** Multiplies the complement (inverse) of the display object color with the complement of - * the background color, resulting in a bleaching effect. */ - public static const SCREEN:String = "screen"; - - /** Erases the background when drawn on a RenderTexture. */ - public static const ERASE:String = "erase"; - - /** When used on a RenderTexture, the drawn object will act as a mask for the current - * content, i.e. the source alpha overwrites the destination alpha. */ - public static const MASK:String = "mask"; - - /** Draws under/below existing objects; useful especially on RenderTextures. */ - public static const BELOW:String = "below"; - - public function get destinationFactor():String { return null; } - public function get name():String { return null; } - public function get sourceFactor():String { return null; } - public function BlendMode(name:String, sourceFactor:String, destinationFactor:String):void {} - public function activate():void {} - public function toString():String { return null; } - // public static function get(modeName:String):BlendMode { return null; } - public static function getByFactors(srcFactor:String, dstFactor:String):BlendMode { return null; } - public static function register(name:String, srcFactor:String, dstFactor:String):BlendMode { return null; } - } - - -} \ No newline at end of file diff --git a/lib/starling/display/Button.as b/lib/starling/display/Button.as deleted file mode 100644 index 2620c79d..00000000 --- a/lib/starling/display/Button.as +++ /dev/null @@ -1,44 +0,0 @@ -package starling.display { - - - import openfl.geom.Rectangle; - import starling.display.DisplayObjectContainer; - import starling.display.Sprite; - import starling.display.Image; - import starling.text.TextField; - import starling.text.TextFormat; - import starling.textures.Texture; - import starling.styles.MeshStyle; - - //@:meta(Event(name = "triggered", type = "starling.events.Event")) - - /** - * @externs - */ - public class Button extends DisplayObjectContainer { - public var alphaWhenDisabled:Number; - public var alphaWhenDown:Number; - public var color:uint; - public var disabledState:Texture; - public var downState:Texture; - public var enabled:Boolean; - public var overState:Texture; - public function get overlay():Sprite { return null; } - public var pixelSnapping:Boolean; - public var scale9Grid:Rectangle; - public var scaleWhenDown:Number; - public var scaleWhenOver:Number; - public var state:String; - public var style:MeshStyle; - public var text:String; - public var textBounds:Rectangle; - public var textFormat:TextFormat; - public var textStyle:MeshStyle; - public var textureSmoothing:String; - public var upState:Texture; - public function Button(upState:Texture, text:String = null, downState:Texture = null, overState:Texture = null, disabledState:Texture = null):void {} - public function readjustSize(resetTextBounds:Boolean = false):void {} - } - - -} \ No newline at end of file diff --git a/lib/starling/display/ButtonState.as b/lib/starling/display/ButtonState.as deleted file mode 100644 index 0147edd6..00000000 --- a/lib/starling/display/ButtonState.as +++ /dev/null @@ -1,20 +0,0 @@ -package starling.display { - - /** - * @externs - */ - public class ButtonState { - /** The button's default state. */ - public static const UP:String = "up"; - - /** The button is pressed. */ - public static const DOWN:String = "down"; - - /** The mouse hovers over the button. */ - public static const OVER:String = "over"; - - /** The button was disabled altogether. */ - public static const DISABLED:String = "disabled"; - } - -} \ No newline at end of file diff --git a/lib/starling/display/Canvas.as b/lib/starling/display/Canvas.as deleted file mode 100644 index 8381243f..00000000 --- a/lib/starling/display/Canvas.as +++ /dev/null @@ -1,23 +0,0 @@ -package starling.display { - - import starling.display.DisplayObjectContainer; - import starling.geom.Polygon; - import starling.rendering.VertexData; - import starling.rendering.IndexData; - import starling.display.Mesh; - - /** - * @externs - */ - public class Canvas extends DisplayObjectContainer { - public function Canvas():void {} - public function beginFill(color:uint = 0, alpha:Number = 0):void {} - public function clear():void {} - public function drawCircle(x:Number, y:Number, radius:Number):void {} - public function drawEllipse(x:Number, y:Number, width:Number, height:Number):void {} - public function drawPolygon(polygon:Polygon):void {} - public function drawRectangle(x:Number, y:Number, width:Number, height:Number):void {} - public function endFill():void {} - } - -} \ No newline at end of file diff --git a/lib/starling/display/DisplayObject.as b/lib/starling/display/DisplayObject.as deleted file mode 100644 index 3afde2a6..00000000 --- a/lib/starling/display/DisplayObject.as +++ /dev/null @@ -1,74 +0,0 @@ -package starling.display { - - import openfl.display.BitmapData; - import openfl.geom.Matrix; - import openfl.geom.Matrix3D; - import openfl.geom.Point; - import openfl.geom.Rectangle; - import openfl.geom.Vector3D; - import starling.events.EventDispatcher; - import starling.errors.AbstractMethodError; - import starling.filters.FragmentFilter; - import starling.utils.MatrixUtil; - import starling.utils.MathUtil; - import starling.core.Starling; - import starling.display.Stage; - import starling.utils.Color; - import starling.utils.SystemUtil; - import starling.rendering.BatchToken; - import starling.rendering.Painter; - - // @:meta(Event(name = "added", type = "starling.events.Event")) @:meta(Event(name = "addedToStage", type = "starling.events.Event")) @:meta(Event(name = "removed", type = "starling.events.Event")) @:meta(Event(name = "removedFromStage", type = "starling.events.Event")) @:meta(Event(name = "enterFrame", type = "starling.events.EnterFrameEvent")) @:meta(Event(name = "touch", type = "starling.events.TouchEvent")) @:meta(Event(name = "keyUp", type = "starling.events.KeyboardEvent")) @:meta(Event(name = "keyDown", type = "starling.events.KeyboardEvent")) - - /** - * @externs - */ - public class DisplayObject extends EventDispatcher { - public var alpha:Number; - public function get base():DisplayObject { return null; } - public var blendMode:String; - public function get bounds():Rectangle { return null; } - public var filter:FragmentFilter; - public var height:Number; - public function get is3D():Boolean { return false; } - public var mask:DisplayObject; - public var maskInverted:Boolean; - public var name:String; - public function get parent():DisplayObjectContainer { return null; } - public var pivotX:Number; - public var pivotY:Number; - public function get requiresRedraw():Boolean { return false; } - public function get root():DisplayObject { return null; } - public var rotation:Number; - public var scale:Number; - public var scaleX:Number; - public var scaleY:Number; - public var skewX:Number; - public var skewY:Number; - public function get stage():Stage { return null; } - public var touchable:Boolean; - public var transformationMatrix:Matrix; - public function get transformationMatrix3D():Matrix3D { return null; } - public var useHandCursor:Boolean; - public var visible:Boolean; - public var width:Number; - public var x:Number; - public var y:Number; - public function alignPivot(horizontalAlign:String = null, verticalAlign:String = null):void {} - public function dispose():void {} - public function drawToBitmapData(out:BitmapData = null, color:uint = 0, alpha:Number = 0):BitmapData { return null; } - public function getBounds(targetSpace:DisplayObject, out:Rectangle = null):Rectangle { return null; } - public function getTransformationMatrix(targetSpace:DisplayObject, out:Matrix = null):Matrix { return null; } - public function getTransformationMatrix3D(targetSpace:DisplayObject, out:Matrix3D = null):Matrix3D { return null; } - public function globalToLocal(globalPoint:Point, out:Point = null):Point { return null; } - public function globalToLocal3D(globalPoint:Point, out:Vector3D = null):Vector3D { return null; } - public function hitTest(localPoint:Point):DisplayObject { return null; } - public function hitTestMask(localPoint:Point):Boolean { return false; } - public function local3DToGlobal(localPoint:Vector3D, out:Point = null):Point { return null; } - public function localToGlobal(localPoint:Point, out:Point = null):Point { return null; } - public function removeFromParent(dispose:Boolean = false):void {} - public function render(painter:Painter):void {} - public function setRequiresRedraw():void {} - } - -} \ No newline at end of file diff --git a/lib/starling/display/DisplayObjectContainer.as b/lib/starling/display/DisplayObjectContainer.as deleted file mode 100644 index 5c428dc8..00000000 --- a/lib/starling/display/DisplayObjectContainer.as +++ /dev/null @@ -1,31 +0,0 @@ -package starling.display { - - import starling.display.DisplayObject; - import starling.utils.MatrixUtil; - import starling.events.Event; - import starling.rendering.BatchToken; - - /** - * @externs - */ - public class DisplayObjectContainer extends DisplayObject { - public function get numChildren():int { return 0; } - public var touchGroup:Boolean; - public function addChild(child:DisplayObject):DisplayObject { return null; } - public function addChildAt(child:DisplayObject, index:int):DisplayObject { return null; } - public function broadcastEvent(event:Event):void {} - public function broadcastEventWith(eventType:String, data:Object = null):void {} - public function contains(child:DisplayObject):Boolean { return false; } - public function getChildAt(index:int):DisplayObject { return null; } - public function getChildByName(name:String):DisplayObject { return null; } - public function getChildIndex(child:DisplayObject):int { return 0; } - public function removeChild(child:DisplayObject, dispose:Boolean = false):DisplayObject { return null; } - public function removeChildAt(index:int, dispose:Boolean = false):DisplayObject { return null; } - public function removeChildren(beginIndex:int = 0, endIndex:int = 0, dispose:Boolean = false):void {} - public function setChildIndex(child:DisplayObject, index:int):void {} - public function sortChildren(compareFunction:Function):void {} - public function swapChildren(child1:DisplayObject, child2:DisplayObject):void {} - public function swapChildrenAt(index1:int, index2:int):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/display/Image.as b/lib/starling/display/Image.as deleted file mode 100644 index 3b1641a6..00000000 --- a/lib/starling/display/Image.as +++ /dev/null @@ -1,25 +0,0 @@ -package starling.display { - - import openfl.geom.Rectangle; - import starling.display.Quad; - import starling.textures.Texture; - import starling.utils.MathUtil; - import starling.utils.Pool; - import starling.utils.RectangleUtil; - import starling.utils.Padding; - // import starling.display.TextureSetupSettings; - - /** - * @externs - */ - public class Image extends Quad { - public var scale9Grid:Rectangle; - public var tileGrid:Rectangle; - public function Image(texture:Texture):void { super (0, 0); } - public static function automateSetupForTexture(texture:Texture, onAssign:Function, onRelease:Function = null):void {} - public static function bindPivotPointToTexture(texture:Texture, pivotX:Number, pivotY:Number):void {} - public static function bindScale9GridToTexture(texture:Texture, scale9Grid:Rectangle):void {} - public static function resetSetupForTexture(texture:Texture):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/display/Mesh.as b/lib/starling/display/Mesh.as deleted file mode 100644 index 0818a719..00000000 --- a/lib/starling/display/Mesh.as +++ /dev/null @@ -1,45 +0,0 @@ -package starling.display { - - import openfl.geom.Point; - import starling.display.DisplayObject; - import starling.geom.Polygon; - import starling.utils.MeshUtil; - import starling.utils.MatrixUtil; - import starling.styles.MeshStyle; - import starling.textures.Texture; - import starling.rendering.VertexData; - import starling.rendering.VertexDataFormat; - import starling.rendering.IndexData; - - /** - * @externs - */ - public class Mesh extends DisplayObject { - public var color:uint; - public function get numIndices():int { return 0; } - public function get numTriangles():int { return 0; } - public function get numVertices():int { return 0; } - public var pixelSnapping:Boolean; - public var style:MeshStyle; - public var texture:Texture; - public var textureRepeat:Boolean; - public var textureSmoothing:String; - public function get vertexFormat():VertexDataFormat { return null; } - public function Mesh(vertexData:VertexData, indexData:starling.rendering.IndexData, style:starling.styles.MeshStyle = null):void {} - public function getTexCoords(vertexID:int, out:Point = null):Point { return null; } - public function getVertexAlpha(vertexID:int):Number { return 0; } - public function getVertexColor(vertexID:int):uint { return 0; } - public function getVertexPosition(vertexID:int, out:Point = null):Point { return null; } - public function setIndexDataChanged():void {} - public function setStyle(meshStyle:starling.styles.MeshStyle = null, mergeWithPredecessor:Boolean = false):void {} - public function setTexCoords(vertexID:int, u:Number, v:Number):void {} - public function setVertexAlpha(vertexID:int, alpha:Number):void {} - public function setVertexColor(vertexID:int, color:uint):void {} - public function setVertexDataChanged():void {} - public function setVertexPosition(vertexID:int, x:Number, y:Number):void {} - public static var defaultStyle:Class; - public static var defaultStyleFactory:Function; - public static function fromPolygon(polygon:starling.geom.Polygon, style:starling.styles.MeshStyle = null):Mesh { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/display/MeshBatch.as b/lib/starling/display/MeshBatch.as deleted file mode 100644 index 7556e624..00000000 --- a/lib/starling/display/MeshBatch.as +++ /dev/null @@ -1,23 +0,0 @@ -package starling.display { - - import openfl.geom.Matrix; - import starling.display.Mesh; - import starling.utils.MatrixUtil; - import starling.utils.MeshSubset; - import starling.rendering.VertexData; - import starling.rendering.IndexData; - - /** - * @externs - */ - public class MeshBatch extends Mesh { - public var batchable:Boolean; - public function MeshBatch():void { super (null, null); } - public function addMesh(mesh:Mesh, matrix:openfl.geom.Matrix = null, alpha:Number = 0, subset:starling.utils.MeshSubset = null, ignoreTransformations:Boolean = false):void {} - public function addMeshAt(mesh:Mesh, indexID:int, vertexID:int):void {} - public function canAddMesh(mesh:Mesh, numVertices:int = 0):Boolean { return false; } - public function clear():void {} - public static function get MAX_NUM_VERTICES ():int { return 0; } - } - -} \ No newline at end of file diff --git a/lib/starling/display/MovieClip.as b/lib/starling/display/MovieClip.as deleted file mode 100644 index abb402c7..00000000 --- a/lib/starling/display/MovieClip.as +++ /dev/null @@ -1,45 +0,0 @@ -package starling.display { - - import openfl.media.Sound; - import openfl.media.SoundTransform; - // import openfl.Vector; - import starling.animation.IAnimatable; - import starling.display.Image; - import starling.textures.Texture; - - // @:meta(Event(name = "complete", type = "starling.events.Event")) - - /** - * @externs - */ - public class MovieClip extends Image implements starling.animation.IAnimatable { - public var currentFrame:int; - public var currentTime:Number; - public var fps:Number; - public function get isComplete():Boolean { return false; } - public function get isPlaying():Boolean { return false; } - public var loop:Boolean; - public var muted:Boolean; - public function get numFrames():int { return 0; } - public var soundTransform:openfl.media.SoundTransform; - public function get totalTime():Number { return 0; } - public function MovieClip(textures:Vector., fps:Number = 0):void { super (null); } - public function addFrame(texture:starling.textures.Texture, sound:openfl.media.Sound = null, duration:Number = 0):void {} - public function addFrameAt(frameID:int, texture:starling.textures.Texture, sound:openfl.media.Sound = null, duration:Number = 0):void {} - public function advanceTime(passedTime:Number):void {} - public function getFrameAction(frameID:int):Function { return null; } - public function getFrameDuration(frameID:int):Number { return 0; } - public function getFrameSound(frameID:int):openfl.media.Sound { return null; } - public function getFrameTexture(frameID:int):starling.textures.Texture { return null; } - public function pause():void {} - public function play():void {} - public function removeFrameAt(frameID:int):void {} - public function reverseFrames():void {} - public function setFrameAction(frameID:int, action:Function):void {} - public function setFrameDuration(frameID:int, duration:Number):void {} - public function setFrameSound(frameID:int, sound:openfl.media.Sound):void {} - public function setFrameTexture(frameID:int, texture:starling.textures.Texture):void {} - public function stop():void {} - } - -} \ No newline at end of file diff --git a/lib/starling/display/Quad.as b/lib/starling/display/Quad.as deleted file mode 100644 index a698e6aa..00000000 --- a/lib/starling/display/Quad.as +++ /dev/null @@ -1,19 +0,0 @@ -package starling.display { - - import starling.display.Mesh; - import starling.utils.RectangleUtil; - import starling.rendering.VertexData; - import starling.styles.MeshStyle; - import starling.rendering.IndexData; - import starling.textures.Texture; - - /** - * @externs - */ - public class Quad extends Mesh { - public function Quad(width:Number, height:Number, color:uint = 0):void { super (null, null); } - public function readjustSize(width:Number = 0, height:Number = 0):void {} - public static function fromTexture(texture:starling.textures.Texture):Quad { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/display/Sprite.as b/lib/starling/display/Sprite.as deleted file mode 100644 index 26b889a7..00000000 --- a/lib/starling/display/Sprite.as +++ /dev/null @@ -1,12 +0,0 @@ -package starling.display { - - import starling.display.DisplayObjectContainer; - - /** - * @externs - */ - public class Sprite extends DisplayObjectContainer { - public function Sprite():void {} - } - -} \ No newline at end of file diff --git a/lib/starling/display/Sprite3D.as b/lib/starling/display/Sprite3D.as deleted file mode 100644 index 26ba4267..00000000 --- a/lib/starling/display/Sprite3D.as +++ /dev/null @@ -1,22 +0,0 @@ -package starling.display { - - import starling.display.DisplayObjectContainer; - import starling.utils.MatrixUtil; - import starling.utils.MathUtil; - import starling.display.DisplayObject; - - /** - * @externs - */ - public class Sprite3D extends DisplayObjectContainer { - public function get isFlat():Boolean { return false; } - public var pivotZ:Number; - public var rotationX:Number; - public var rotationY:Number; - public var rotationZ:Number; - public var scaleZ:Number; - public var z:Number; - public function Sprite3D():void {} - } - -} \ No newline at end of file diff --git a/lib/starling/display/Stage.as b/lib/starling/display/Stage.as deleted file mode 100644 index 599b9515..00000000 --- a/lib/starling/display/Stage.as +++ /dev/null @@ -1,31 +0,0 @@ -package starling.display { - - import openfl.geom.Point; - import openfl.geom.Rectangle; - import openfl.geom.Vector3D; - import starling.display.DisplayObjectContainer; - import starling.utils.RectangleUtil; - import starling.utils.MatrixUtil; - import starling.core.Starling; - import starling.events.EnterFrameEvent; - - // @:meta(Event(name = "resize", type = "starling.events.ResizeEvent")) - - /** - * @externs - */ - public class Stage extends DisplayObjectContainer { - public function get cameraPosition():openfl.geom.Vector3D { return null; } - public var color:uint; - public var fieldOfView:Number; - public var focalLength:Number; - public var projectionOffset:openfl.geom.Point; - public var stageHeight:int; - public var stageWidth:int; - public function get starling():starling.core.Starling { return null; } - public function advanceTime(passedTime:Number):void {} - public function getCameraPosition(space:DisplayObject = null, out:openfl.geom.Vector3D = null):openfl.geom.Vector3D { return null; } - public function getStageBounds(targetSpace:DisplayObject, out:openfl.geom.Rectangle = null):openfl.geom.Rectangle { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/errors/AbstractClassError.as b/lib/starling/errors/AbstractClassError.as deleted file mode 100644 index 9606b0a8..00000000 --- a/lib/starling/errors/AbstractClassError.as +++ /dev/null @@ -1,12 +0,0 @@ -package starling.errors { - - import openfl.errors.Error; - - /** - * @externs - */ - public class AbstractClassError extends openfl.errors.Error { - public function AbstractClassError(message:String = null, id:int = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/errors/AbstractMethodError.as b/lib/starling/errors/AbstractMethodError.as deleted file mode 100644 index c27eb593..00000000 --- a/lib/starling/errors/AbstractMethodError.as +++ /dev/null @@ -1,12 +0,0 @@ -package starling.errors { - - import openfl.errors.Error; - - /** - * @externs - */ - public class AbstractMethodError extends openfl.errors.Error { - public function AbstractMethodError(message:String = null, id:int = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/errors/MissingContextError.as b/lib/starling/errors/MissingContextError.as deleted file mode 100644 index 64dfce20..00000000 --- a/lib/starling/errors/MissingContextError.as +++ /dev/null @@ -1,12 +0,0 @@ -package starling.errors { - - import openfl.errors.Error; - - /** - * @externs - */ - public class MissingContextError extends openfl.errors.Error { - public function MissingContextError(message:String = null, id:int = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/errors/NotSupportedError.as b/lib/starling/errors/NotSupportedError.as deleted file mode 100644 index b134a800..00000000 --- a/lib/starling/errors/NotSupportedError.as +++ /dev/null @@ -1,12 +0,0 @@ -package starling.errors { - - import openfl.errors.Error; - - /** - * @externs - */ - public class NotSupportedError extends openfl.errors.Error { - public function NotSupportedError(message:String = null, id:int = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/events/EnterFrameEvent.as b/lib/starling/events/EnterFrameEvent.as deleted file mode 100644 index 7691bab6..00000000 --- a/lib/starling/events/EnterFrameEvent.as +++ /dev/null @@ -1,15 +0,0 @@ -package starling.events { - - import starling.events.Event; - - /** - * @externs - */ - public class EnterFrameEvent extends Event { - public function get passedTime():Number { return 0; } - public function EnterFrameEvent(type:String, passedTime:Number, bubbles:Boolean = false):void { super (null); } - /** Event type for a display object that is entering a new frame. */ - public static const ENTER_FRAME:String = "enterFrame"; - } - -} \ No newline at end of file diff --git a/lib/starling/events/Event.as b/lib/starling/events/Event.as deleted file mode 100644 index 3a0bff59..00000000 --- a/lib/starling/events/Event.as +++ /dev/null @@ -1,74 +0,0 @@ -package starling.events { - - import starling.utils.StringUtil; - - - /** - * @externs - */ - public class Event { - public function get bubbles():Boolean { return false; } - public function get currentTarget():EventDispatcher { return null; } - public function get data():Object { return null; } - public function get target():EventDispatcher { return null; } - public function get type():String { return null; } - public function Event(type:String, bubbles:Boolean = false, data:Object = null):void {} - public function stopImmediatePropagation():void {} - public function stopPropagation():void {} - public function toString():String { return null; } - /** Event type for a display object that is added to a parent. */ - public static const ADDED:String = "added"; - /** Event type for a display object that is added to the stage */ - public static const ADDED_TO_STAGE:String = "addedToStage"; - /** Event type for a display object that is entering a new frame. */ - public static const ENTER_FRAME:String = "enterFrame"; - /** Event type for a display object that is removed from its parent. */ - public static const REMOVED:String = "removed"; - /** Event type for a display object that is removed from the stage. */ - public static const REMOVED_FROM_STAGE:String = "removedFromStage"; - /** Event type for a triggered button. */ - public static const TRIGGERED:String = "triggered"; - /** Event type for a resized Flash Player. */ - public static const RESIZE:String = "resize"; - /** Event type that may be used whenever something finishes. */ - public static const COMPLETE:String = "complete"; - /** Event type for a (re)created stage3D rendering context. */ - public static const CONTEXT3D_CREATE:String = "context3DCreate"; - /** Event type that is dispatched by the Starling instance directly before rendering. */ - public static const RENDER:String = "render"; - /** Event type that indicates that the root DisplayObject has been created. */ - public static const ROOT_CREATED:String = "rootCreated"; - /** Event type for an animated object that requests to be removed from the juggler. */ - public static const REMOVE_FROM_JUGGLER:String = "removeFro__juggler"; - /** Event type that is dispatched by the AssetManager after a context loss. */ - public static const TEXTURES_RESTORED:String = "texturesRestored"; - /** Event type that is dispatched by the AssetManager when a file/url cannot be loaded. */ - public static const IO_ERROR:String = "ioError"; - /** Event type that is dispatched by the AssetManager when a file/url cannot be loaded. */ - public static const SECURITY_ERROR:String = "securityError"; - /** Event type that is dispatched by the AssetManager when an xml or json file couldn't - * be parsed. */ - public static const PARSE_ERROR:String = "parseError"; - /** Event type that is dispatched by the Starling instance when it encounters a problem - * from which it cannot recover, e.g. a lost device context. */ - public static const FATAL_ERROR:String = "fatalError"; - - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const CHANGE:String = "change"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const CANCEL:String = "cancel"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const SCROLL:String = "scroll"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const OPEN:String = "open"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const CLOSE:String = "close"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const SELECT:String = "select"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const READY:String = "ready"; - /** An event type to be utilized in custom events. Not used by Starling right now. */ - public static const UPDATE:String = "update"; - } - -} \ No newline at end of file diff --git a/lib/starling/events/EventDispatcher.as b/lib/starling/events/EventDispatcher.as deleted file mode 100644 index 1c0822c7..00000000 --- a/lib/starling/events/EventDispatcher.as +++ /dev/null @@ -1,19 +0,0 @@ -package starling.events { - - import starling.display.DisplayObject; - import starling.events.Event; - - /** - * @externs - */ - public class EventDispatcher { - public function EventDispatcher():void {} - public function addEventListener(type:String, listener:Function):void {} - public function dispatchEvent(event:Event):void {} - public function dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void {} - public function hasEventListener(type:String, listener:Object = null):Boolean { return false; } - public function removeEventListener(type:String, listener:Function):void {} - public function removeEventListeners(type:String = null):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/events/KeyboardEvent.as b/lib/starling/events/KeyboardEvent.as deleted file mode 100644 index e73888c8..00000000 --- a/lib/starling/events/KeyboardEvent.as +++ /dev/null @@ -1,25 +0,0 @@ -package starling.events { - - import starling.events.Event; - - /** - * @externs - */ - public class KeyboardEvent extends Event { - public function get altKey():Boolean { return false; } - public function get charCode():uint { return 0; } - public function get ctrlKey():Boolean { return false; } - public function get keyCode():uint { return 0; } - public function get keyLocation():uint { return 0; } - public function get shiftKey():Boolean { return false; } - public function KeyboardEvent(type:String, charCode:uint = 0, keyCode:uint = 0, keyLocation:uint = 0, ctrlKey:Boolean = false, altKey:Boolean = false, shiftKey:Boolean = false):void { super (null); } - public function isDefaultPrevented():Boolean { return false; } - public function preventDefault():void {} - /** Event type for a key that was released. */ - public static const KEY_UP:String = "keyUp"; - - /** Event type for a key that was pressed. */ - public static const KEY_DOWN:String = "keyDown"; - } - -} \ No newline at end of file diff --git a/lib/starling/events/ResizeEvent.as b/lib/starling/events/ResizeEvent.as deleted file mode 100644 index 61bfb282..00000000 --- a/lib/starling/events/ResizeEvent.as +++ /dev/null @@ -1,18 +0,0 @@ -package starling.events { - - import starling.events.Event; - - - - /** - * @externs - */ - public class ResizeEvent extends Event { - public function get height():int { return 0; } - public function get width():int { return 0; } - public function ResizeEvent(type:String, width:int, height:int, bubbles:Boolean = false):void { super (null); } - /** Event type for a resized Flash player. */ - public static const RESIZE:String = "resize"; - } - -} \ No newline at end of file diff --git a/lib/starling/events/Touch.as b/lib/starling/events/Touch.as deleted file mode 100644 index cb43a67b..00000000 --- a/lib/starling/events/Touch.as +++ /dev/null @@ -1,33 +0,0 @@ -package starling.events { - - import openfl.geom.Point; - import starling.display.DisplayObject; - import starling.utils.StringUtil; - - /** - * @externs - */ - public class Touch { - public var cancelled:Boolean; - public var globalX:Number; - public var globalY:Number; - public var height:Number; - public function get id():int { return 0; } - public var phase:String; - public var pressure:Number; - public function get previousGlobalX():Number { return 0; } - public function get previousGlobalY():Number { return 0; } - public var tapCount:int; - public var target:starling.display.DisplayObject; - public var timestamp:Number; - public var width:Number; - public function Touch(id:int):void {} - public function clone():Touch { return null; } - public function getLocation(space:starling.display.DisplayObject, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public function getMovement(space:starling.display.DisplayObject, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public function getPreviousLocation(space:starling.display.DisplayObject, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public function isTouching(target:starling.display.DisplayObject):Boolean { return false; } - public function toString():String { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/events/TouchData.as b/lib/starling/events/TouchData.as deleted file mode 100644 index 22e473d4..00000000 --- a/lib/starling/events/TouchData.as +++ /dev/null @@ -1,21 +0,0 @@ -package starling.events { - - /** - * @externs - */ - public class TouchData - { - public var id:int; - public var phase:String; - public var globalX:Number; - public var globalY:Number; - public var pressure:Number; - public var width:Number; - public var height:Number; - - public static function fromPool(touchID:int, phase:String, globalX:Number, globalY:Number, - pressure:Number=1.0, width:Number=1.0, height:Number=1.0):TouchData { return null; } - public static function toPool(rawTouch:TouchData):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/events/TouchEvent.as b/lib/starling/events/TouchEvent.as deleted file mode 100644 index a9576651..00000000 --- a/lib/starling/events/TouchEvent.as +++ /dev/null @@ -1,26 +0,0 @@ -package starling.events { - - import starling.display.DisplayObject; - import starling.events.Event; - import starling.events.EventDispatcher; - import starling.events.Touch; - // import openfl.Vector; - - /** - * @externs - */ - public class TouchEvent extends Event { - public function get ctrlKey():Boolean { return false; } - public function get shiftKey():Boolean { return false; } - public function get timestamp():Number { return 0; } - public function get touches():Vector. { return null; } - public function TouchEvent(type:String, touches:Vector. = null, shiftKey:Boolean = false, ctrlKey:Boolean = false, bubbles:Boolean = false):void { super (null); } - public function dispatch(chain:Vector.):void {} - public function getTouch(target:starling.display.DisplayObject, phase:String = null, id:int = 0):Touch { return null; } - public function getTouches(target:starling.display.DisplayObject, phase:String = null, out:Vector. = null):Vector. { return null; } - public function interactsWith(target:starling.display.DisplayObject):Boolean { return false; } - /** Event type for touch or mouse input. */ - public static const TOUCH:String = "touch"; - } - -} \ No newline at end of file diff --git a/lib/starling/events/TouchMarker.as b/lib/starling/events/TouchMarker.as deleted file mode 100644 index ac134ee6..00000000 --- a/lib/starling/events/TouchMarker.as +++ /dev/null @@ -1,21 +0,0 @@ -package starling.events { - - import starling.display.Sprite; - import starling.core.Starling; - import starling.textures.Texture; - import starling.display.Image; - - /** - * @externs - */ - public class TouchMarker extends starling.display.Sprite { - public function get mockX():Number { return 0; } - public function get mockY():Number { return 0; } - public function get realX():Number { return 0; } - public function get realY():Number { return 0; } - public function TouchMarker():void {} - public function moveCenter(x:Number, y:Number):void {} - public function moveMarker(x:Number, y:Number, withCenter:Boolean = false):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/events/TouchPhase.as b/lib/starling/events/TouchPhase.as deleted file mode 100644 index 503d5c77..00000000 --- a/lib/starling/events/TouchPhase.as +++ /dev/null @@ -1,27 +0,0 @@ -package starling.events { - - - - /** - * @externs - */ - public class TouchPhase { - /** Only available for mouse input: the cursor hovers over an object without a - * pressed button. */ - public static const HOVER:String = "hover"; - - /** The finger touched the screen just now, or the mouse button was pressed. */ - public static const BEGAN:String = "began"; - - /** The finger moves around on the screen, or the mouse is moved while the button is - * pressed. */ - public static const MOVED:String = "moved"; - - /** The finger or mouse (with pressed button) has not moved since the last frame. */ - public static const STATIONARY:String = "stationary"; - - /** The finger was lifted from the screen or from the mouse button. */ - public static const ENDED:String = "ended"; - } - -} \ No newline at end of file diff --git a/lib/starling/events/TouchProcessor.as b/lib/starling/events/TouchProcessor.as deleted file mode 100644 index 5bf98ae1..00000000 --- a/lib/starling/events/TouchProcessor.as +++ /dev/null @@ -1,29 +0,0 @@ -package starling.events { - - - import starling.display.Stage; - import starling.events.Touch; - import starling.utils.MathUtil; - import starling.core.Starling; - import starling.events.TouchMarker; - import starling.events.TouchEvent; - - /** - * @externs - */ - public class TouchProcessor { - public var multitapDistance:Number; - public var multitapTime:Number; - public function get numCurrentTouches():int { return 0; } - public var root:starling.display.DisplayObject; - public var simulateMultitouch:Boolean; - public function get stage():starling.display.Stage { return null; } - public function TouchProcessor(stage:starling.display.Stage):void {} - public function advanceTime(passedTime:Number):void {} - public function cancelTouches():void {} - public function dispose():void {} - public function enqueue(touchID:int, phase:String, globalX:Number, globalY:Number, pressure:Number = 0, width:Number = 0, height:Number = 0):void {} - public function enqueueMouseLeftStage():void {} - } - -} \ No newline at end of file diff --git a/lib/starling/extensions/ColorArgb.as b/lib/starling/extensions/ColorArgb.as deleted file mode 100644 index dda04311..00000000 --- a/lib/starling/extensions/ColorArgb.as +++ /dev/null @@ -1,23 +0,0 @@ -package starling.extensions { - - - - /** - * @externs - */ - public class ColorArgb { - public var alpha:Number; - public var blue:Number; - public var green:Number; - public var red:Number; - public function ColorArgb(red:Number = 0, green:Number = 0, blue:Number = 0, alpha:Number = 0):void {} - // public function _fromArgb(color:int):void {} - // public function _fromRgb(color:int):void {} - public function copyFrom(argb:ColorArgb):void {} - public function toArgb():int { return 0; } - public function toRgb():int { return 0; } - public static function fromArgb(color:int):ColorArgb { return null } - public static function fromRgb(color:int):ColorArgb { return null } - } - -} \ No newline at end of file diff --git a/lib/starling/extensions/PDParticle.as b/lib/starling/extensions/PDParticle.as deleted file mode 100644 index c1671f88..00000000 --- a/lib/starling/extensions/PDParticle.as +++ /dev/null @@ -1,27 +0,0 @@ -package starling.extensions { - - import starling.extensions.Particle; - import starling.extensions.ColorArgb; - - /** - * @externs - */ - public class PDParticle extends Particle { - public var colorArgb:ColorArgb; - public var colorArgbDelta:ColorArgb; - public var emitRadius:Number; - public var emitRadiusDelta:Number; - public var emitRotation:Number; - public var emitRotationDelta:Number; - public var radialAcceleration:Number; - public var rotationDelta:Number; - public var scaleDelta:Number; - public var startX:Number; - public var startY:Number; - public var tangentialAcceleration:Number; - public var velocityX:Number; - public var velocityY:Number; - public function PDParticle():void {} - } - -} \ No newline at end of file diff --git a/lib/starling/extensions/PDParticleSystem.as b/lib/starling/extensions/PDParticleSystem.as deleted file mode 100644 index ace99567..00000000 --- a/lib/starling/extensions/PDParticleSystem.as +++ /dev/null @@ -1,50 +0,0 @@ -package starling.extensions { - - import starling.extensions.ParticleSystem; - import starling.extensions.PDParticle; - import starling.utils.MathUtil; - import starling.extensions.ColorArgb; - import starling.textures.Texture; - - /** - * @externs - */ - public class PDParticleSystem extends ParticleSystem { - public var defaultDuration:Number; - public var emitAngle:Number; - public var emitAngleVariance:Number; - public var emitterType:int; - public var emitterXVariance:Number; - public var emitterYVariance:Number; - public var endColor:ColorArgb; - public var endColorVariance:ColorArgb; - public var endRotation:Number; - public var endRotationVariance:Number; - public var endSize:Number; - public var endSizeVariance:Number; - public var gravityX:Number; - public var gravityY:Number; - public var lifespan:Number; - public var lifespanVariance:Number; - public var maxRadius:Number; - public var maxRadiusVariance:Number; - public var minRadius:Number; - public var minRadiusVariance:Number; - public var radialAcceleration:Number; - public var radialAccelerationVariance:Number; - public var rotatePerSecond:Number; - public var rotatePerSecondVariance:Number; - public var speed:Number; - public var speedVariance:Number; - public var startColor:ColorArgb; - public var startColorVariance:ColorArgb; - public var startRotation:Number; - public var startRotationVariance:Number; - public var startSize:Number; - public var startSizeVariance:Number; - public var tangentialAcceleration:Number; - public var tangentialAccelerationVariance:Number; - public function PDParticleSystem(config:String, texture:starling.textures.Texture):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/extensions/Particle.as b/lib/starling/extensions/Particle.as deleted file mode 100644 index f82e3977..00000000 --- a/lib/starling/extensions/Particle.as +++ /dev/null @@ -1,20 +0,0 @@ -package starling.extensions { - - - - /** - * @externs - */ - public class Particle { - public var alpha:Number; - public var color:int; - public var currentTime:Number; - public var rotation:Number; - public var scale:Number; - public var totalTime:Number; - public var x:Number; - public var y:Number; - public function Particle():void {} - } - -} \ No newline at end of file diff --git a/lib/starling/extensions/ParticleSystem.as b/lib/starling/extensions/ParticleSystem.as deleted file mode 100644 index 7c05d9a1..00000000 --- a/lib/starling/extensions/ParticleSystem.as +++ /dev/null @@ -1,37 +0,0 @@ -package starling.extensions { - - import starling.animation.IAnimatable; - import starling.display.Mesh; - import starling.display.BlendMode; - import starling.extensions.Particle; - import starling.utils.MatrixUtil; - import starling.rendering.VertexData; - import starling.utils.MeshSubset; - import starling.rendering.IndexData; - import starling.textures.Texture; - - // @:meta(Event(name = "complete", type = "starling.events.Event")) - - /** - * @externs - */ - public class ParticleSystem extends starling.display.Mesh implements starling.animation.IAnimatable { - public var batchable:Boolean; - public var blendFactorDestination:String; - public var blendFactorSource:String; - public var capacity:int; - public var emissionRate:Number; - public var emitterX:Number; - public var emitterY:Number; - public function get isEmitting():Boolean { return false; } - public function get numParticles():int { return 0; } - public function ParticleSystem(texture:starling.textures.Texture = null):void { super (null, null); } - public function advanceTime(passedTime:Number):void {} - public function clear():void {} - public function populate(count:int):void {} - public function start(duration:Number = 0):void {} - public function stop(clearParticles:Boolean = false):void {} - public static function get MAX_NUM_PARTICLES():int { return 0; } - } - -} \ No newline at end of file diff --git a/lib/starling/filters/BlurFilter.as b/lib/starling/filters/BlurFilter.as deleted file mode 100644 index aa87aab1..00000000 --- a/lib/starling/filters/BlurFilter.as +++ /dev/null @@ -1,16 +0,0 @@ -package starling.filters { - - import starling.filters.FragmentFilter; - // import starling.filters.BlurEffect; - import starling.core.Starling; - - /** - * @externs - */ - public class BlurFilter extends FragmentFilter { - public var blurX:Number; - public var blurY:Number; - public function BlurFilter(blurX:Number = 0, blurY:Number = 0, resolution:Number = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/filters/ColorMatrixFilter.as b/lib/starling/filters/ColorMatrixFilter.as deleted file mode 100644 index 5ef15b39..00000000 --- a/lib/starling/filters/ColorMatrixFilter.as +++ /dev/null @@ -1,27 +0,0 @@ -package starling.filters { - - import starling.filters.FragmentFilter; - // import starling.filters.ColorMatrixEffect; - import starling.rendering.Effect; - import starling.utils.Color; - // import openfl.Vector; - - /** - * @externs - */ - public class ColorMatrixFilter extends FragmentFilter { - public function get colorEffect():starling.rendering.Effect { return null; } //ColorMatrixEffect; - public var matrix:Vector.; - public function ColorMatrixFilter(matrix:Vector. = null):void {} - public function adjustBrightness(value:Number):void {} - public function adjustContrast(value:Number):void {} - public function adjustHue(value:Number):void {} - public function adjustSaturation(sat:Number):void {} - public function concat(matrix:Vector.):void {} - public function concatValues(m0:Number, m1:Number, m2:Number, m3:Number, m4:Number, m5:Number, m6:Number, m7:Number, m8:Number, m9:Number, m10:Number, m11:Number, m12:Number, m13:Number, m14:Number, m15:Number, m16:Number, m17:Number, m18:Number, m19:Number):void {} - public function invert():void {} - public function reset():void {} - public function tint(color:uint, amount:Number = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/filters/CompositeFilter.as b/lib/starling/filters/CompositeFilter.as deleted file mode 100644 index 190ae6e1..00000000 --- a/lib/starling/filters/CompositeFilter.as +++ /dev/null @@ -1,22 +0,0 @@ -package starling.filters { - - import openfl.geom.Point; - import starling.filters.FragmentFilter; - // import starling.filters.CompositeEffect; - import starling.rendering.Effect; - - /** - * @externs - */ - public class CompositeFilter extends FragmentFilter { - public function get compositeEffect():starling.rendering.Effect { return null; } //CompositeEffect; - public function CompositeFilter():void {} - public function getAlphaAt(layerID:int):Number { return 0; } - public function getColorAt(layerID:int):uint { return 0; } - public function getOffsetAt(layerID:int, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public function setAlphaAt(layerID:int, alpha:Number):void {} - public function setColorAt(layerID:int, color:uint, replace:Boolean = false):void {} - public function setOffsetAt(layerID:int, x:Number, y:Number):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/filters/DisplacementMapFilter.as b/lib/starling/filters/DisplacementMapFilter.as deleted file mode 100644 index da9b4a11..00000000 --- a/lib/starling/filters/DisplacementMapFilter.as +++ /dev/null @@ -1,24 +0,0 @@ -package starling.filters { - - import starling.filters.FragmentFilter; - // import starling.filters.DisplacementMapEffect; - import starling.rendering.Effect; - import starling.textures.Texture; - - /** - * @externs - */ - public class DisplacementMapFilter extends FragmentFilter { - public var componentX:uint; - public var componentY:uint; - public function get dispEffect():starling.rendering.Effect { return null; } //DisplacementMapEffect; - public var mapRepeat:Boolean; - public var mapTexture:starling.textures.Texture; - public var mapX:Number; - public var mapY:Number; - public var scaleX:Number; - public var scaleY:Number; - public function DisplacementMapFilter(mapTexture:starling.textures.Texture, componentX:uint = 0, componentY:uint = 0, scaleX:Number = 0, scaleY:Number = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/filters/DropShadowFilter.as b/lib/starling/filters/DropShadowFilter.as deleted file mode 100644 index c00bfa95..00000000 --- a/lib/starling/filters/DropShadowFilter.as +++ /dev/null @@ -1,19 +0,0 @@ -package starling.filters { - - import starling.filters.FragmentFilter; - import starling.filters.CompositeFilter; - import starling.filters.BlurFilter; - - /** - * @externs - */ - public class DropShadowFilter extends FragmentFilter { - public var alpha:Number; - public var angle:Number; - public var blur:Number; - public var color:uint; - public var distance:Number; - public function DropShadowFilter(distance:Number = 0, angle:Number = 0, color:uint = 0, alpha:Number = 0, blur:Number = 0, resolution:Number = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/filters/FilterChain.as b/lib/starling/filters/FilterChain.as deleted file mode 100644 index 0f3e6ea6..00000000 --- a/lib/starling/filters/FilterChain.as +++ /dev/null @@ -1,20 +0,0 @@ -package starling.filters { - - import starling.filters.FragmentFilter; - import starling.utils.Padding; - - /** - * @externs - */ - public class FilterChain extends FragmentFilter { - public function get numFilters():int { return 0; } - public function FilterChain(args:Array):void {} - public function addFilter(filter:FragmentFilter):void {} - public function addFilterAt(filter:FragmentFilter, index:int):void {} - public function getFilterAt(index:int):FragmentFilter { return null; } - public function getFilterIndex(filter:FragmentFilter):int { return 0; } - public function removeFilter(filter:FragmentFilter, dispose:Boolean = false):FragmentFilter { return null; } - public function removeFilterAt(index:int, dispose:Boolean = false):FragmentFilter { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/filters/FilterHelper.as b/lib/starling/filters/FilterHelper.as deleted file mode 100644 index e0edd7e5..00000000 --- a/lib/starling/filters/FilterHelper.as +++ /dev/null @@ -1,37 +0,0 @@ -package starling.filters { - - import openfl.geom.Matrix3D; - import openfl.geom.Rectangle; - import starling.display.DisplayObject; - import starling.filters.IFilterHelper; - import starling.utils.Pool; - import starling.textures.Texture; - import starling.utils.MathUtil; - import starling.textures.SubTexture; - import starling.core.Starling; - - /** - * @externs - */ - public class FilterHelper implements IFilterHelper { - public var clipRect:openfl.geom.Rectangle; - public var projectionMatrix3D:openfl.geom.Matrix3D; - public var renderTarget:starling.textures.Texture; - // public var target:starling.display.DisplayObject; - // public var targetBounds:openfl.geom.Rectangle; - public var textureFormat:String; - public var textureScale:Number; - public function FilterHelper(textureFormat:String = null):void {} - public function dispose():void {} - public function getTexture(resolution:Number = 0):starling.textures.Texture { return null; } - public function purge():void {} - public function putTexture(texture:starling.textures.Texture):void {} - public function start(numPasses:int, drawLastPassToBackBuffer:Boolean):void {} - - public function get target():starling.display.DisplayObject { return null; } - public function set target(value:DisplayObject):void {} - public function get targetBounds():openfl.geom.Rectangle { return null; } - public function set targetBounds(value:Rectangle):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/filters/FragmentFilter.as b/lib/starling/filters/FragmentFilter.as deleted file mode 100644 index a2c097c3..00000000 --- a/lib/starling/filters/FragmentFilter.as +++ /dev/null @@ -1,41 +0,0 @@ -package starling.filters { - - import starling.events.EventDispatcher; - import starling.core.Starling; - import starling.filters.FilterHelper; - // import starling.filters.FilterQuad; - import starling.utils.Pool; - import starling.utils.Padding; - import starling.display.Stage; - import starling.utils.RectangleUtil; - import starling.utils.MatrixUtil; - import starling.rendering.FilterEffect; - import starling.rendering.Painter; - import starling.rendering.VertexData; - import starling.rendering.IndexData; - import starling.textures.Texture; - import starling.utils.Padding; - - // @:meta(Event(name = "change", type = "starling.events.Event")) @:meta(Event(name = "enterFrame", type = "starling.events.EnterFrameEvent")) - - /** - * @externs - */ - public class FragmentFilter extends starling.events.EventDispatcher { - public var alwaysDrawToBackBuffer:Boolean; - public var antiAliasing:int; - public function get isCached():Boolean { return false; } - public function get numPasses():int { return 0; } - public var padding:starling.utils.Padding; - public var resolution:Number; - public var textureFormat:String; - public var textureSmoothing:String; - public function FragmentFilter():void {} - public function cache():void {} - public function clearCache():void {} - public function dispose():void {} - public function process(painter:starling.rendering.Painter, helper:IFilterHelper, input0:starling.textures.Texture = null, input1:starling.textures.Texture = null, input2:starling.textures.Texture = null, input3:starling.textures.Texture = null):starling.textures.Texture { return null; } - public function render(painter:starling.rendering.Painter):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/filters/GlowFilter.as b/lib/starling/filters/GlowFilter.as deleted file mode 100644 index 5a362eb5..00000000 --- a/lib/starling/filters/GlowFilter.as +++ /dev/null @@ -1,17 +0,0 @@ -package starling.filters { - - import starling.filters.FragmentFilter; - import starling.filters.BlurFilter; - import starling.filters.CompositeFilter; - - /** - * @externs - */ - public class GlowFilter extends FragmentFilter { - public var alpha:Number; - public var blur:Number; - public var color:uint; - public function GlowFilter(color:uint = 0, alpha:Number = 0, blur:Number = 0, resolution:Number = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/filters/IFilterHelper.as b/lib/starling/filters/IFilterHelper.as deleted file mode 100644 index a5ec4432..00000000 --- a/lib/starling/filters/IFilterHelper.as +++ /dev/null @@ -1,17 +0,0 @@ -package starling.filters { - - import openfl.geom.Rectangle; - import starling.display.DisplayObject; - import starling.textures.Texture; - - /** - * @externs - */ - public interface IFilterHelper { - function get target():starling.display.DisplayObject; - function get targetBounds():openfl.geom.Rectangle; - function getTexture(resolution:Number = 0):starling.textures.Texture; - function putTexture(texture:starling.textures.Texture):void; - } - -} \ No newline at end of file diff --git a/lib/starling/geom/Polygon.as b/lib/starling/geom/Polygon.as deleted file mode 100644 index 882dbdc3..00000000 --- a/lib/starling/geom/Polygon.as +++ /dev/null @@ -1,34 +0,0 @@ -package starling.geom { - - import openfl.geom.Point; - import starling.rendering.IndexData; - import starling.rendering.VertexData; - import starling.utils.Pool; - import starling.utils.MathUtil; - - /** - * @externs - */ - public class Polygon { - public function get area():Number { return 0; } - public function get isConvex():Boolean { return false; } - public function get isSimple():Boolean { return false; } - public function get numTriangles():int { return 0; } - public var numVertices:int; - public function Polygon(vertices:Array = null):void {} - public function addVertices(args:Array):void {} - public function clone():Polygon { return null; } - public function contains(x:Number, y:Number):Boolean { return false; } - public function containsPoint(point:openfl.geom.Point):Boolean { return false; } - public function copyToVertexData(target:starling.rendering.VertexData, targetVertexID:int = 0, attrName:String = null):void {} - public function getVertex(index:int, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public function reverse():void {} - public function setVertex(index:int, x:Number, y:Number):void {} - public function toString():String { return null; } - public function triangulate(indexData:starling.rendering.IndexData = null, offset:int = 0):starling.rendering.IndexData { return null; } - public static function createCircle(x:Number, y:Number, radius:Number, numSides:int = 0):Polygon { return null; } - public static function createEllipse(x:Number, y:Number, radiusX:Number, radiusY:Number, numSides:int = 0):Polygon { return null; } - public static function createRectangle(x:Number, y:Number, width:Number, height:Number):Polygon { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/rendering/BatchProcessor.as b/lib/starling/rendering/BatchProcessor.as deleted file mode 100644 index d7307269..00000000 --- a/lib/starling/rendering/BatchProcessor.as +++ /dev/null @@ -1,25 +0,0 @@ -package starling.rendering { - - import starling.display.Mesh; - import starling.display.MeshBatch; - import starling.utils.MeshSubset; - // import starling.rendering.BatchPool; - import starling.rendering.BatchToken; - - /** - * @externs - */ - public class BatchProcessor { - public function get numBatches():int { return 0; } - public var onBatchComplete:Function; - public function BatchProcessor():void {} - public function addMesh(mesh:starling.display.Mesh, state:RenderState, subset:starling.utils.MeshSubset = null, ignoreTransformations:Boolean = false):void {} - public function clear():void {} - public function dispose():void {} - public function fillToken(token:BatchToken):BatchToken { return null; } - public function finishBatch():void {} - public function getBatchAt(batchID:int):starling.display.MeshBatch { return null; } - public function trim():void {} - } - -} \ No newline at end of file diff --git a/lib/starling/rendering/BatchToken.as b/lib/starling/rendering/BatchToken.as deleted file mode 100644 index 6cbae0ac..00000000 --- a/lib/starling/rendering/BatchToken.as +++ /dev/null @@ -1,20 +0,0 @@ -package starling.rendering { - - import starling.utils.StringUtil; - - /** - * @externs - */ - public class BatchToken { - public var batchID:int; - public var indexID:int; - public var vertexID:int; - public function BatchToken(batchID:int = 0, vertexID:int = 0, indexID:int = 0):void {} - public function copyFrom(token:BatchToken):void {} - public function equals(other:BatchToken):Boolean { return false; } - public function reset():void {} - public function setTo(batchID:int = 0, vertexID:int = 0, indexID:int = 0):void {} - public function toString():String { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/rendering/Effect.as b/lib/starling/rendering/Effect.as deleted file mode 100644 index 429a6de1..00000000 --- a/lib/starling/rendering/Effect.as +++ /dev/null @@ -1,28 +0,0 @@ -package starling.rendering { - - import openfl.geom.Matrix3D; - import starling.core.Starling; - import starling.errors.MissingContextError; - import starling.rendering.Program; - import starling.rendering.VertexDataFormat; - - /** - * @externs - */ - public class Effect { - public var mvpMatrix3D:openfl.geom.Matrix3D; - public var onRestore:Function; - public var programBaseName:String; - public function get programName():String { return null; } - public function get programVariantName():uint { return 0; } - public function get vertexFormat():VertexDataFormat { return null; } - public function Effect():void {} - public function dispose():void {} - public function purgeBuffers(vertexBuffer:Boolean = false, indexBuffer:Boolean = false):void {} - public function render(firstIndex:int = 0, numTriangles:int = 0):void {} - public function uploadIndexData(indexData:IndexData, bufferUsage:String = null):void {} - public function uploadVertexData(vertexData:VertexData, bufferUsage:String = null):void {} - public static var VERTEX_FORMAT:VertexDataFormat; - } - -} \ No newline at end of file diff --git a/lib/starling/rendering/FilterEffect.as b/lib/starling/rendering/FilterEffect.as deleted file mode 100644 index 365f9bb3..00000000 --- a/lib/starling/rendering/FilterEffect.as +++ /dev/null @@ -1,20 +0,0 @@ -package starling.rendering { - - import starling.rendering.Effect; - import starling.utils.RenderUtil; - import starling.rendering.Program; - import starling.textures.Texture; - - /** - * @externs - */ - public class FilterEffect extends Effect { - public var texture:starling.textures.Texture; - public var textureRepeat:Boolean; - public var textureSmoothing:String; - public function FilterEffect():void {} - public static var STD_VERTEX_SHADER:String; - public static var VERTEX_FORMAT:VertexDataFormat; - } - -} \ No newline at end of file diff --git a/lib/starling/rendering/IndexData.as b/lib/starling/rendering/IndexData.as deleted file mode 100644 index 98ebf6a9..00000000 --- a/lib/starling/rendering/IndexData.as +++ /dev/null @@ -1,36 +0,0 @@ -package starling.rendering { - - import openfl.display3D.IndexBuffer3D; - import openfl.utils.ByteArray; - // import openfl.Vector; - import starling.utils.StringUtil; - import starling.core.Starling; - import starling.errors.MissingContextError; - - /** - * @externs - */ - public class IndexData { - public function get indexSizeInBytes():int { return 0; } - public var numIndices:int; - public var numQuads:int; - public var numTriangles:int; - public function get rawData():openfl.utils.ByteArray { return null; } - public var useQuadLayout:Boolean; - public function IndexData(initialCapacity:int = 0):void {} - public function addQuad(a:uint, b:uint, c:uint, d:uint):void {} - public function addTriangle(a:uint, b:uint, c:uint):void {} - public function clear():void {} - public function clone():IndexData { return null; } - public function copyTo(target:IndexData, targetIndexID:int = 0, offset:int = 0, indexID:int = 0, numIndices:int = 0):void {} - public function createIndexBuffer(upload:Boolean = false, bufferUsage:String = null):openfl.display3D.IndexBuffer3D { return null; } - public function getIndex(indexID:int):int { return 0; } - public function offsetIndices(offset:int, indexID:int = 0, numIndices:int = 0):void {} - public function setIndex(indexID:int, index:uint):void {} - public function toString():String { return null; } - public function toVector(out:Vector. = null):Vector. { return null; } - public function trim():void {} - public function uploadToIndexBuffer(buffer:openfl.display3D.IndexBuffer3D, indexID:int = 0, numIndices:int = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/rendering/MeshEffect.as b/lib/starling/rendering/MeshEffect.as deleted file mode 100644 index 8d0f24d0..00000000 --- a/lib/starling/rendering/MeshEffect.as +++ /dev/null @@ -1,16 +0,0 @@ -package starling.rendering { - - import starling.rendering.FilterEffect; - import starling.rendering.Program; - - /** - * @externs - */ - public class MeshEffect extends FilterEffect { - public var alpha:Number; - public var tinted:Boolean; - public function MeshEffect():void {} - public static var VERTEX_FORMAT:VertexDataFormat; - } - -} \ No newline at end of file diff --git a/lib/starling/rendering/Painter.as b/lib/starling/rendering/Painter.as deleted file mode 100644 index 39704cf0..00000000 --- a/lib/starling/rendering/Painter.as +++ /dev/null @@ -1,71 +0,0 @@ -package starling.rendering { - - import openfl.display3D.Context3D; - import openfl.display.Stage3D; - import openfl.geom.Matrix; - import openfl.geom.Rectangle; - import starling.display.DisplayObject; - import starling.display.Mesh; - import starling.utils.RenderUtil; - import starling.utils.SystemUtil; - import starling.rendering.RenderState; - import starling.utils.MatrixUtil; - import starling.utils.RectangleUtil; - import starling.utils.Pool; - import starling.display.Quad; - import starling.utils.MathUtil; - import starling.display.BlendMode; - import starling.utils.MeshSubset; - import starling.rendering.BatchProcessor; - - /** - * @externs - */ - public class Painter { - public function get backBufferHeight():int { return 0; } - public function get backBufferScaleFactor():Number { return 0; } - public function get backBufferWidth():int { return 0; } - public var cacheEnabled:Boolean; - public function get context():openfl.display3D.Context3D { return null; } - public function get contextValid():Boolean { return false; } - public var drawCount:int; - public var enableErrorChecking:Boolean; - public var frameID:uint; - public var pixelSize:Number; - public function get profile():String { return null; } - public var shareContext:Boolean; - public function get sharedData():Object { return null; } - public function get stage3D():openfl.display.Stage3D { return null; } - public function get state():RenderState { return null; } - public var stencilReferenceValue:uint; - public function Painter(stage3D:openfl.display.Stage3D):void {} - public function batchMesh(mesh:starling.display.Mesh, subset:starling.utils.MeshSubset = null):void {} - public function clear(rgb:uint = 0, alpha:Number = 0):void {} - public function configureBackBuffer(viewPort:openfl.geom.Rectangle, contentScaleFactor:Number, antiAlias:int, enableDepthAndStencil:Boolean, supportBrowserZoom:Boolean=false):void {} - public function deleteProgram(name:String):void {} - public function dispose():void {} - public function drawFromCache(startToken:BatchToken, endToken:BatchToken):void {} - public function drawMask(mask:starling.display.DisplayObject, maskee:starling.display.DisplayObject = null):void {} - public function eraseMask(mask:starling.display.DisplayObject, maskee:starling.display.DisplayObject = null):void {} - public function excludeFromCache(object:starling.display.DisplayObject):void {} - public function fillToken(token:BatchToken):void {} - public function enableBatchTrimming(enabled:Boolean=true, interval:int=250):void {} - public function finishFrame():void {} - public function finishMeshBatch():void {} - public function getProgram(name:String):Program { return null; } - public function hasProgram(name:String):Boolean { return false; } - public function nextFrame():void {} - public function popState(token:BatchToken = null):void {} - public function prepareToDraw():void {} - public function present():void {} - public function pushState(token:BatchToken = null):void {} - public function registerProgram(name:String, program:Program):void {} - public function requestContext3D(renderMode:String, profile:Object):void {} - public function restoreState():void {} - public function setStateTo(transformationMatrix:openfl.geom.Matrix, alphaFactor:Number = 0, blendMode:String = null):void {} - public function setupContextDefaults():void {} - public function refreshBackBufferSize(scaleFactor:Number):void {} - public static function get DEFAULT_STENCIL_VALUE ():uint { return 0; } - } - -} \ No newline at end of file diff --git a/lib/starling/rendering/Program.as b/lib/starling/rendering/Program.as deleted file mode 100644 index 9ab05261..00000000 --- a/lib/starling/rendering/Program.as +++ /dev/null @@ -1,18 +0,0 @@ -package starling.rendering { - - import openfl.display3D.Context3D; - import openfl.utils.ByteArray; - import starling.core.Starling; - import starling.errors.MissingContextError; - - /** - * @externs - */ - public class Program { - public function Program(vertexShader:openfl.utils.ByteArray, fragmentShader:openfl.utils.ByteArray):void {} - public function activate(context:openfl.display3D.Context3D = null):void {} - public function dispose():void {} - public static function fromSource(vertexShader:String, fragmentShader:String, agalVersion:uint = 0):Program { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/rendering/RenderState.as b/lib/starling/rendering/RenderState.as deleted file mode 100644 index 0865949f..00000000 --- a/lib/starling/rendering/RenderState.as +++ /dev/null @@ -1,40 +0,0 @@ -package starling.rendering { - - import openfl.geom.Matrix; - import openfl.geom.Rectangle; - import starling.textures.Texture; - import starling.utils.RectangleUtil; - import starling.utils.MatrixUtil; - import starling.utils.Pool; - import starling.utils.MathUtil; - - /** - * @externs - */ - public class RenderState { - public var alpha:Number; - public var blendMode:String; - public var clipRect:openfl.geom.Rectangle; - public var culling:String; - public var depthMask:Boolean; - public var depthTest:String; - public function get is3D():Boolean { return false; } - public var modelviewMatrix:openfl.geom.Matrix; - public var modelviewMatrix3D:openfl.geom.Matrix3D; - public function get mvpMatrix3D():openfl.geom.Matrix3D { return null; } - public var projectionMatrix3D:openfl.geom.Matrix3D; - public var renderTarget:starling.textures.Texture; - public function get renderTargetAntiAlias():int { return 0; } - public function get renderTargetSupportsDepthAndStencil():Boolean { return false; } - public function RenderState():void {} - public function copyFrom(renderState:RenderState):void {} - public function reset():void {} - public function setModelviewMatricesToIdentity():void {} - public function setProjectionMatrix(x:Number, y:Number, width:Number, height:Number, stageWidth:Number = 0, stageHeight:Number = 0, cameraPos:openfl.geom.Vector3D = null):void {} - public function setProjectionMatrixChanged():void {} - public function setRenderTarget(target:starling.textures.Texture, enableDepthAndStencil:Boolean = false, antiAlias:int = 0):void {} - public function transformModelviewMatrix(matrix:openfl.geom.Matrix):void {} - public function transformModelviewMatrix3D(matrix:openfl.geom.Matrix3D):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/rendering/VertexData.as b/lib/starling/rendering/VertexData.as deleted file mode 100644 index 94adfbd7..00000000 --- a/lib/starling/rendering/VertexData.as +++ /dev/null @@ -1,68 +0,0 @@ -package starling.rendering { - - import openfl.display3D.VertexBuffer3D; - import openfl.geom.Matrix; - import openfl.geom.Matrix3D; - import openfl.utils.ByteArray; - import starling.utils.StringUtil; - import starling.utils.MatrixUtil; - import starling.utils.MathUtil; - import starling.core.Starling; - import starling.errors.MissingContextError; - import starling.styles.MeshStyle; - import starling.rendering.VertexDataFormat; - - /** - * @externs - */ - public class VertexData { - public var format:VertexDataFormat; - public function get formatString():String { return null; } - public var numVertices:int; - public var premultipliedAlpha:Boolean; - public function get rawData():openfl.utils.ByteArray { return null; } - public function get size():int { return 0; } - public function get sizeIn32Bits():int { return 0; } - public var tinted:Boolean; - public function get vertexSize():int { return 0; } - public function get vertexSizeIn32Bits():int { return 0; } - public function VertexData(format:Object = null, initialCapacity:int = 0):void {} - public function clear():void {} - public function clone():VertexData { return null; } - public function colorize(attrName:String = null, color:uint = 0, alpha:Number = 0, vertexID:int = 0, numVertices:int = 0):void {} - public function copyAttributeTo(target:VertexData, targetVertexID:int, attrName:String, matrix:openfl.geom.Matrix = null, vertexID:int = 0, numVertices:int = 0):void {} - public function copyTo(target:VertexData, targetVertexID:int = 0, matrix:openfl.geom.Matrix = null, vertexID:int = 0, numVertices:int = 0):void {} - public function createVertexBuffer(upload:Boolean = false, bufferUsage:String = null):openfl.display3D.VertexBuffer3D { return null; } - public function getAlpha(vertexID:int, attrName:String = null):Number { return 0; } - public function getBounds(attrName:String = null, matrix:openfl.geom.Matrix = null, vertexID:int = 0, numVertices:int = 0, out:openfl.geom.Rectangle = null):openfl.geom.Rectangle { return null; } - public function getBoundsProjected(attrName:String, matrix:openfl.geom.Matrix3D, camPos:openfl.geom.Vector3D, vertexID:int = 0, numVertices:int = 0, out:openfl.geom.Rectangle = null):openfl.geom.Rectangle { return null; } - public function getColor(vertexID:int, attrName:String = null):uint { return 0; } - public function getFloat(vertexID:int, attrName:String):Number { return 0; } - public function getFormat(attrName:String):String { return null; } - public function getOffset(attrName:String):int { return 0; } - public function getOffsetIn32Bits(attrName:String):int { return 0; } - public function getPoint(vertexID:int, attrName:String, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public function getPoint3D(vertexID:int, attrName:String, out:openfl.geom.Vector3D = null):openfl.geom.Vector3D { return null; } - public function getPoint4D(vertexID:int, attrName:String, out:openfl.geom.Vector3D = null):openfl.geom.Vector3D { return null; } - public function getSize(attrName:String):int { return 0; } - public function getSizeIn32Bits(attrName:String):int { return 0; } - public function getUnsignedInt(vertexID:int, attrName:String):uint { return 0; } - public function hasAttribute(attrName:String):Boolean { return false; } - public function scaleAlphas(attrName:String, factor:Number, vertexID:int = 0, numVertices:int = 0):void {} - public function setAlpha(vertexID:int, attrName:String, alpha:Number):void {} - public function setColor(vertexID:int, attrName:String, color:uint):void {} - public function setFloat(vertexID:int, attrName:String, value:Number):void {} - public function setPoint(vertexID:int, attrName:String, x:Number, y:Number):void {} - public function setPoint3D(vertexID:int, attrName:String, x:Number, y:Number, z:Number):void {} - public function setPoint4D(vertexID:int, attrName:String, x:Number, y:Number, z:Number, w:Number = 0):void {} - public function setPremultipliedAlpha(value:Boolean, updateData:Boolean):void {} - public function setUnsignedInt(vertexID:int, attrName:String, value:uint):void {} - public function toString():String { return null; } - public function transformPoints(attrName:String, matrix:openfl.geom.Matrix, vertexID:int = 0, numVertices:int = 0):void {} - public function translatePoints(attrName:String, deltaX:Number, deltaY:Number, vertexID:int = 0, numVertices:int = 0):void {} - public function trim():void {} - public function updateTinted(attrName:String = null):Boolean { return false; } - public function uploadToVertexBuffer(buffer:openfl.display3D.VertexBuffer3D, vertexID:int = 0, numVertices:int = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/rendering/VertexDataAttribute.as b/lib/starling/rendering/VertexDataAttribute.as deleted file mode 100644 index 1559fa23..00000000 --- a/lib/starling/rendering/VertexDataAttribute.as +++ /dev/null @@ -1,15 +0,0 @@ -package starling.rendering { - - /** - * @externs - */ - public class VertexDataAttribute { - public var format:String; - public var isColor:Boolean; - public var name:String; - public var offset:int; - public var size:int; - public function VertexDataAttribute(name:String, format:String, offset:int):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/rendering/VertexDataFormat.as b/lib/starling/rendering/VertexDataFormat.as deleted file mode 100644 index 1d12bb02..00000000 --- a/lib/starling/rendering/VertexDataFormat.as +++ /dev/null @@ -1,30 +0,0 @@ -package starling.rendering { - - import openfl.display3D.VertexBuffer3D; - import starling.core.Starling; - import starling.utils.StringUtil; - import starling.rendering.VertexDataAttribute; - - /** - * @externs - */ - public class VertexDataFormat { - public function get formatString():String { return null; } - public function get numAttributes():int { return 0; } - public function get vertexSize():int { return 0; } - public function get vertexSizeIn32Bits():int { return 0; } - public function VertexDataFormat():void {} - public function extend(format:String):VertexDataFormat { return null; } - public function getFormat(attrName:String):String { return null; } - public function getName(attrIndex:int):String { return null; } - public function getOffset(attrName:String):int { return 0; } - public function getOffsetIn32Bits(attrName:String):int { return 0; } - public function getSize(attrName:String):int { return 0; } - public function getSizeIn32Bits(attrName:String):int { return 0; } - public function hasAttribute(attrName:String):Boolean { return false; } - public function setVertexBufferAt(index:int, buffer:openfl.display3D.VertexBuffer3D, attrName:String):void {} - public function toString():String { return null; } - public static function fromString(format:String):VertexDataFormat { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/styles/DistanceFieldStyle.as b/lib/starling/styles/DistanceFieldStyle.as deleted file mode 100644 index 8e8aeb68..00000000 --- a/lib/starling/styles/DistanceFieldStyle.as +++ /dev/null @@ -1,43 +0,0 @@ -package starling.styles { - - import starling.rendering.VertexDataFormat; - import starling.styles.MeshStyle; - // import starling.styles.DistanceFieldEffect; - import starling.utils.Color; - import starling.utils.MathUtil; - - /** - * @externs - */ - public class DistanceFieldStyle extends MeshStyle { - public var alpha:Number; - public var mode:String; - public var multiChannel:Boolean; - public var outerAlphaEnd:Number; - public var outerAlphaStart:Number; - public var outerColor:uint; - public var outerThreshold:Number; - public var shadowOffsetX:Number; - public var shadowOffsetY:Number; - public var softness:Number; - public var threshold:Number; - public function DistanceFieldStyle(softness:Number = 0, threshold:Number = 0):void {} - public function setupBasic():void {} - public function setupDropShadow(blur:Number = 0, offsetX:Number = 0, offsetY:Number = 0, color:uint = 0, alpha:Number = 0):void {} - public function setupGlow(blur:Number = 0, color:uint = 0, alpha:Number = 0):void {} - public function setupOutline(width:Number = 0, color:uint = 0, alpha:Number = 0):void {} - /** Basic distance field rendering, without additional effects. */ - public static const MODE_BASIC:String = "basic"; - - /** Adds an outline around the edge of the shape. */ - public static const MODE_OUTLINE:String = "outline"; - - /** Adds a smooth glow effect around the shape. */ - public static const MODE_GLOW:String = "glow"; - - /** Adds a drop shadow behind the shape. */ - public static const MODE_SHADOW:String = "shadow"; - public static var VERTEX_FORMAT:starling.rendering.VertexDataFormat; - } - -} \ No newline at end of file diff --git a/lib/starling/styles/MeshStyle.as b/lib/starling/styles/MeshStyle.as deleted file mode 100644 index 5e424645..00000000 --- a/lib/starling/styles/MeshStyle.as +++ /dev/null @@ -1,48 +0,0 @@ -package starling.styles { - - import openfl.geom.Matrix; - import openfl.geom.Point; - import starling.display.Mesh; - import starling.events.EventDispatcher; - import starling.rendering.IndexData; - import starling.rendering.MeshEffect; - import starling.rendering.RenderState; - import starling.rendering.VertexData; - import starling.rendering.VertexDataFormat; - import starling.textures.Texture; - - // @:meta(Event(name = "enterFrame", type = "starling.events.EnterFrameEvent")) - - /** - * @externs - */ - public class MeshStyle extends starling.events.EventDispatcher { - public var color:uint; - public function get indexData():starling.rendering.IndexData { return null; } - public function get target():starling.display.Mesh { return null; } - public var texture:starling.textures.Texture; - public var textureRepeat:Boolean; - public var textureSmoothing:String; - public function get type():Class { return null; } - public function get vertexData():starling.rendering.VertexData { return null; } - public function get vertexFormat():starling.rendering.VertexDataFormat { return null; } - public function MeshStyle():void {} - public function batchIndexData(targetStyle:MeshStyle, targetIndexID:int = 0, offset:int = 0, indexID:int = 0, numIndices:int = 0):void {} - public function batchVertexData(targetStyle:MeshStyle, targetVertexID:int = 0, matrix:openfl.geom.Matrix = null, vertexID:int = 0, numVertices:int = 0):void {} - public function canBatchWith(meshStyle:MeshStyle):Boolean { return false; } - public function clone():MeshStyle { return null; } - public function copyFrom(meshStyle:MeshStyle):void {} - public function createEffect():starling.rendering.MeshEffect { return null; } - public function getTexCoords(vertexID:int, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public function getVertexAlpha(vertexID:int):Number { return 0; } - public function getVertexColor(vertexID:int):uint { return 0; } - public function getVertexPosition(vertexID:int, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public function setTexCoords(vertexID:int, u:Number, v:Number):void {} - public function setVertexAlpha(vertexID:int, alpha:Number):void {} - public function setVertexColor(vertexID:int, color:uint):void {} - public function setVertexPosition(vertexID:int, x:Number, y:Number):void {} - public function updateEffect(effect:starling.rendering.MeshEffect, state:starling.rendering.RenderState):void {} - public static var VERTEX_FORMAT:starling.rendering.VertexDataFormat; - } - -} \ No newline at end of file diff --git a/lib/starling/text/BitmapChar.as b/lib/starling/text/BitmapChar.as deleted file mode 100644 index 5f1e8822..00000000 --- a/lib/starling/text/BitmapChar.as +++ /dev/null @@ -1,23 +0,0 @@ -package starling.text { - - import starling.display.Image; - import starling.textures.Texture; - - /** - * @externs - */ - public class BitmapChar { - public function get charID():int { return 0; } - public function get height():Number { return 0; } - public function get texture():starling.textures.Texture { return null; } - public function get width():Number { return 0; } - public function get xAdvance():Number { return 0; } - public function get xOffset():Number { return 0; } - public function get yOffset():Number { return 0; } - public function BitmapChar(id:int, texture:starling.textures.Texture, xOffset:Number, yOffset:Number, xAdvance:Number):void {} - public function addKerning(charID:int, amount:Number):void {} - public function createImage():starling.display.Image { return null; } - public function getKerning(charID:int):Number { return 0; } - } - -} \ No newline at end of file diff --git a/lib/starling/text/BitmapFont.as b/lib/starling/text/BitmapFont.as deleted file mode 100644 index 2721e170..00000000 --- a/lib/starling/text/BitmapFont.as +++ /dev/null @@ -1,41 +0,0 @@ -package starling.text { - - // import openfl.Vector; - import starling.text.ITextCompositor; - import starling.textures.Texture; - import starling.text.BitmapChar; - import starling.display.MeshBatch; - import starling.display.Sprite; - // import starling.text.CharLocation; - // import starling.utils.ArrayUtil; - import starling.text.TextOptions; - // import starling.text.MiniBitmapFont; - import starling.textures.Texture; - import starling.display.Image; - - /** - * @externs - */ - public class BitmapFont implements ITextCompositor { - public var baseline:Number; - public function get lineHeight():Number { return 0; } - public function get name():String { return null; } - public var offsetX:Number; - public var offsetY:Number; - public var padding:Number; - public function get size():Number { return 0; } - public var smoothing:String; - public function BitmapFont(texture:starling.textures.Texture = null, fontXml:Object = null):void {} - public function addChar(charID:int, bitmapChar:BitmapChar):void {} - public function clearMeshBatch(meshBatch:starling.display.MeshBatch):void {} - public function createSprite(width:Number, height:Number, text:String, format:TextFormat, options:TextOptions = null):starling.display.Sprite { return null; } - public function dispose():void {} - public function fillMeshBatch(meshBatch:starling.display.MeshBatch, width:Number, height:Number, text:String, format:TextFormat, options:TextOptions = null):void {} - public function getChar(charID:int):BitmapChar { return null; } - public function getCharIDs(result:Vector. = null):Vector. { return null; } - public function hasChars(text:String):Boolean { return false; } - public static function get MINI ():String { return null; } - public static function get NATIVE_SIZE ():int { return 0; } - } - -} \ No newline at end of file diff --git a/lib/starling/text/ITextCompositor.as b/lib/starling/text/ITextCompositor.as deleted file mode 100644 index 3ea959c1..00000000 --- a/lib/starling/text/ITextCompositor.as +++ /dev/null @@ -1,14 +0,0 @@ -package starling.text { - - import starling.display.MeshBatch; - - /** - * @externs - */ - public interface ITextCompositor { - function clearMeshBatch(meshBatch:starling.display.MeshBatch):void; - function dispose():void; - function fillMeshBatch(meshBatch:starling.display.MeshBatch, width:Number, height:Number, text:String, format:TextFormat, options:TextOptions = null):void; - } - -} \ No newline at end of file diff --git a/lib/starling/text/TextField.as b/lib/starling/text/TextField.as deleted file mode 100644 index ccd63dd5..00000000 --- a/lib/starling/text/TextField.as +++ /dev/null @@ -1,47 +0,0 @@ -package starling.text { - - import openfl.geom.Rectangle; - import starling.display.DisplayObjectContainer; - import starling.text.BitmapFont; - import starling.core.Starling; - import starling.utils.RectangleUtil; - import starling.display.Sprite; - import starling.display.Quad; - import starling.text.TrueTypeCompositor; - import starling.utils.SystemUtil; - import starling.text.TextFormat; - import starling.text.TextOptions; - import starling.display.MeshBatch; - import starling.styles.MeshStyle; - - /** - * @externs - */ - public class TextField extends starling.display.DisplayObjectContainer { - public var autoScale:Boolean; - public var autoSize:String; - public var batchable:Boolean; - public var border:Boolean; - public var format:TextFormat; - public var isHtmlText:Boolean; - public var pixelSnapping:Boolean; - public var style:starling.styles.MeshStyle; - public var text:String; - public function get textBounds():openfl.geom.Rectangle { return null; } - public var wordWrap:Boolean; - public function TextField(width:int, height:int, text:String = null, format:TextFormat = null):void {} - // public function get_border():Boolean { return false; } - public function setRequiresRecomposition():void {} - // public function set_border(value:Boolean):Boolean { return false; } - public static var defaultCompositor:ITextCompositor; - public static var defaultTextureFormat:String; - public static function getBitmapFont(name:String):BitmapFont { return null; } - public static function getCompositor(name:String):ITextCompositor { return null; } - /*@:deprecated("replaced by `registerCompositor`")*/ public static function registerBitmapFont(bitmapFont:BitmapFont, name:String = null):String { return null; } - public static function registerCompositor(compositor:ITextCompositor, name:String):void {} - /*@:deprecated("replaced by `unregisterCompositor`")*/ public static function unregisterBitmapFont(name:String, dispose:Boolean = false):void {} - public static function unregisterCompositor(name:String, dispose:Boolean = false):void {} - public static function updateEmbeddedFonts():void {} - } - -} \ No newline at end of file diff --git a/lib/starling/text/TextFieldAutoSize.as b/lib/starling/text/TextFieldAutoSize.as deleted file mode 100644 index 803af695..00000000 --- a/lib/starling/text/TextFieldAutoSize.as +++ /dev/null @@ -1,22 +0,0 @@ -package starling.text { - - /** - * @externs - */ - public class TextFieldAutoSize { - /** No auto-sizing will happen. */ - public static const NONE:String = "none"; - - /** The text field will grow/shrink sidewards; no line-breaks will be added. - * The height of the text field remains unchanged. */ - public static const HORIZONTAL:String = "horizontal"; - - /** The text field will grow/shrink downwards, adding line-breaks when necessary. - * The width of the text field remains unchanged. */ - public static const VERTICAL:String = "vertical"; - - /** The text field will grow to the right and bottom; no line-breaks will be added. */ - public static const BOTH_DIRECTIONS:String = "bothDirections"; - } - -} \ No newline at end of file diff --git a/lib/starling/text/TextFormat.as b/lib/starling/text/TextFormat.as deleted file mode 100644 index 658b4098..00000000 --- a/lib/starling/text/TextFormat.as +++ /dev/null @@ -1,31 +0,0 @@ -package starling.text { - - import openfl.text.TextFormat; - import starling.events.EventDispatcher; - import starling.utils.Align; - - // @:meta(Event(name = "change", type = "starling.events.Event")) - - /** - * @externs - */ - public class TextFormat extends starling.events.EventDispatcher { - public var bold:Boolean; - public var color:uint; - public var font:String; - public var horizontalAlign:String; - public var italic:Boolean; - public var kerning:Boolean; - public var leading:Number; - public var letterSpacing:Number; - public var size:Number; - public var underline:Boolean; - public var verticalAlign:String; - public function TextFormat(font:String = null, size:Number = 0, color:uint = 0, horizontalAlign:String = null, verticalAlign:String = null):void {} - public function clone():starling.text.TextFormat { return null; } - public function copyFrom(format:starling.text.TextFormat):void {} - public function setTo(font:String = null, size:Number = 0, color:uint = 0, horizontalAlign:String = null, verticalAlign:String = null):void {} - public function toNativeFormat(out:openfl.text.TextFormat = null):openfl.text.TextFormat { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/text/TextOptions.as b/lib/starling/text/TextOptions.as deleted file mode 100644 index 53b8da56..00000000 --- a/lib/starling/text/TextOptions.as +++ /dev/null @@ -1,25 +0,0 @@ -package starling.text { - - import starling.events.EventDispatcher; - import starling.core.Starling; - import starling.text.TextField; - - // @:meta(Event(name = "change", type = "starling.events.Event")) - - /** - * @externs - */ - public class TextOptions extends starling.events.EventDispatcher { - public var autoScale:Boolean; - public var autoSize:String; - public var isHtmlText:Boolean; - public var padding:Number; - public var textureFormat:String; - public var textureScale:Number; - public var wordWrap:Boolean; - public function TextOptions(wordWrap:Boolean = false, autoScale:Boolean = false):void {} - public function clone():TextOptions { return null; } - public function copyFrom(options:TextOptions):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/text/TrueTypeCompositor.as b/lib/starling/text/TrueTypeCompositor.as deleted file mode 100644 index 62436068..00000000 --- a/lib/starling/text/TrueTypeCompositor.as +++ /dev/null @@ -1,21 +0,0 @@ -package starling.text { - - import starling.display.MeshBatch; - import starling.text.ITextCompositor; - import starling.textures.Texture; - import starling.utils.SystemUtil; - import starling.utils.MathUtil; - // import starling.text.BitmapDataEx; - import starling.display.Quad; - - /** - * @externs - */ - public class TrueTypeCompositor implements ITextCompositor { - public function TrueTypeCompositor():void {} - public function clearMeshBatch(meshBatch:starling.display.MeshBatch):void {} - public function dispose():void {} - public function fillMeshBatch(meshBatch:starling.display.MeshBatch, width:Number, height:Number, text:String, format:TextFormat, options:TextOptions = null):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/textures/AtfData.as b/lib/starling/textures/AtfData.as deleted file mode 100644 index f299662c..00000000 --- a/lib/starling/textures/AtfData.as +++ /dev/null @@ -1,19 +0,0 @@ -package starling.textures { - - import openfl.utils.ByteArray; - - /** - * @externs - */ - public class AtfData { - public function get data():openfl.utils.ByteArray { return null; } - public function get format():String { return null; } - public function get height():int { return 0; } - public function get isCubeMap():Boolean { return false; } - public function get numTextures():int { return 0; } - public function get width():int { return 0; } - public function AtfData(data:openfl.utils.ByteArray):void {} - public static function isAtfData(data:openfl.utils.ByteArray):Boolean { return false; } - } - -} \ No newline at end of file diff --git a/lib/starling/textures/ConcreteTexture.as b/lib/starling/textures/ConcreteTexture.as deleted file mode 100644 index 8ebd9171..00000000 --- a/lib/starling/textures/ConcreteTexture.as +++ /dev/null @@ -1,27 +0,0 @@ -package starling.textures { - - import openfl.display.Bitmap; - import openfl.display.BitmapData; - import openfl.net.NetStream; - import openfl.utils.ByteArray; - import starling.textures.Texture; - import starling.errors.NotSupportedError; - import starling.errors.AbstractMethodError; - import starling.utils.Color; - import starling.core.Starling; - - /** - * @externs - */ - public class ConcreteTexture extends Texture { - public function get isPotTexture():Boolean { return false; } - public var onRestore:Function; - public function get optimizedForRenderTexture():Boolean { return false; } - public function attachNetStream(netStream:openfl.net.NetStream, onComplete:Function = null):void {} - public function clear(color:uint = 0, alpha:Number = 0):void {} - public function uploadAtfData(data:openfl.utils.ByteArray, offset:int = 0, async:Function = null):void {} - public function uploadBitmap(bitmap:openfl.display.Bitmap, async:Function = null):void {} - public function uploadBitmapData(data:openfl.display.BitmapData, async:Function = null):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/textures/RenderTexture.as b/lib/starling/textures/RenderTexture.as deleted file mode 100644 index 6b54e570..00000000 --- a/lib/starling/textures/RenderTexture.as +++ /dev/null @@ -1,23 +0,0 @@ -package starling.textures { - - import openfl.geom.Matrix; - import openfl.geom.Vector3D; - import starling.textures.SubTexture; - import starling.core.Starling; - import starling.textures.Texture; - import starling.display.Image; - import starling.display.DisplayObject; - - /** - * @externs - */ - public class RenderTexture extends SubTexture { - public function get isPersistent():Boolean { return false; } - public function RenderTexture(width:int, height:int, persistent:Boolean = false, scale:Number = 0, format:String = null):void { super (null); } - public function clear(color:uint = 0, alpha:Number = 0):void {} - public function draw(object:starling.display.DisplayObject, matrix:openfl.geom.Matrix = null, alpha:Number = 0, antiAliasing:int = 0, cameraPos:openfl.geom.Vector3D=null):void {} - public function drawBundled(drawingBlock:Function, antiAliasing:int = 0, cameraPos:openfl.geom.Vector3D=null):void {} - public static var useDoubleBuffering:Boolean; - } - -} \ No newline at end of file diff --git a/lib/starling/textures/SubTexture.as b/lib/starling/textures/SubTexture.as deleted file mode 100644 index 3715df47..00000000 --- a/lib/starling/textures/SubTexture.as +++ /dev/null @@ -1,17 +0,0 @@ -package starling.textures { - - import openfl.geom.Rectangle; - import starling.textures.Texture; - - /** - * @externs - */ - public class SubTexture extends Texture { - public function get ownsParent():Boolean { return false; } - public function get parent():Texture { return null; } - public function get region():openfl.geom.Rectangle { return null; } - public function get rotated():Boolean { return false; } - public function SubTexture(parent:Texture, region:openfl.geom.Rectangle = null, ownsParent:Boolean = false, frame:openfl.geom.Rectangle = null, rotated:Boolean = false, scaleModifier:Number = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/textures/Texture.as b/lib/starling/textures/Texture.as deleted file mode 100644 index 34d46934..00000000 --- a/lib/starling/textures/Texture.as +++ /dev/null @@ -1,63 +0,0 @@ -package starling.textures { - - import openfl.display.Bitmap; - import openfl.display.BitmapData; - import openfl.display3D.textures.TextureBase; - import openfl.geom.Matrix; - import openfl.geom.Point; - import openfl.geom.Rectangle; - import openfl.net.NetStream; - import openfl.utils.ByteArray; - import starling.utils.MatrixUtil; - import starling.textures.TextureOptions; - import starling.core.Starling; - import starling.errors.MissingContextError; - import starling.textures.AtfData; - import starling.utils.SystemUtil; - import starling.errors.NotSupportedError; - import starling.utils.MathUtil; - import starling.rendering.VertexData; - import starling.textures.SubTexture; - - /** - * @externs - */ - public class Texture { - public function get base():openfl.display3D.textures.TextureBase { return null; } - public function get format():String { return null; } - public function get frame():openfl.geom.Rectangle { return null; } - public function get frameHeight():Number { return 0; } - public function get frameWidth():Number { return 0; } - public function get height():Number { return 0; } - public function get mipMapping():Boolean { return false; } - public function get nativeHeight():Number { return 0; } - public function get nativeWidth():Number { return 0; } - public function get premultipliedAlpha():Boolean { return false; } - public function get root():ConcreteTexture { return null; } - public function get scale():Number { return 0; } - public function get transformationMatrix():openfl.geom.Matrix { return null; } - public function get transformationMatrixToRoot():openfl.geom.Matrix { return null; } - public function get width():Number { return 0; } - public function dispose():void {} - public function getTexCoords(vertexData:starling.rendering.VertexData, vertexID:int, attrName:String = null, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public function globalToLocal(u:Number, v:Number, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public function localToGlobal(u:Number, v:Number, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public function setTexCoords(vertexData:starling.rendering.VertexData, vertexID:int, attrName:String, u:Number, v:Number):void {} - public function setupTextureCoordinates(vertexData:starling.rendering.VertexData, vertexID:int = 0, attrName:String = null):void {} - public function setupVertexPositions(vertexData:starling.rendering.VertexData, vertexID:int = 0, attrName:String = null, bounds:openfl.geom.Rectangle = null):void {} - public static var asyncBitmapUploadEnabled:Boolean; - public static function get maxSize():int { return 0; } - public static function getMaxSize(textureFormat:String = null):int { return 0; } - public static function empty(width:Number, height:Number, premultipliedAlpha:Boolean = false, mipMapping:Boolean = false, optimizeForRenderToTexture:Boolean = false, scale:Number = 0, format:String = null, forcePotTexture:Boolean = false):Texture { return null; } - public static function fromAtfData(data:openfl.utils.ByteArray, scale:Number = 0, useMipMaps:Boolean = false, async:Function = null, premultipliedAlpha:Boolean = false):Texture { return null; } - public static function fromBitmap(bitmap:openfl.display.Bitmap, generateMipMaps:Boolean = false, optimizeForRenderToTexture:Boolean = false, scale:Number = 0, format:String = null, forcePotTexture:Boolean = false, async:Function = null):Texture { return null; } - public static function fromBitmapData(data:openfl.display.BitmapData, generateMipMaps:Boolean = false, optimizeForRenderToTexture:Boolean = false, scale:Number = 0, format:String = null, forcePotTexture:Boolean = false, async:Function = null):Texture { return null; } - public static function fromColor(width:Number, height:Number, color:uint = 0, alpha:Number = 0, optimizeForRenderToTexture:Boolean = false, scale:Number = 0, format:String = null, forcePotTexture:Boolean = false):Texture { return null; } - public static function fromData(data:Object, options:TextureOptions = null):Texture { return null; } - public static function fromEmbeddedAsset(assetClass:Class, mipMapping:Boolean = false, optimizeForRenderToTexture:Boolean = false, scale:Number = 0, format:String = null, forcePotTexture:Boolean = false):Texture { return null; } - public static function fromNetStream(stream:openfl.net.NetStream, scale:Number = 0, onComplete:Function = null):Texture { return null; } - public static function fromTexture(texture:Texture, region:openfl.geom.Rectangle = null, frame:openfl.geom.Rectangle = null, rotated:Boolean = false, scaleModifier:Number = 0):Texture { return null; } - public static function fromTextureBase(base:openfl.display3D.textures.TextureBase, width:int, height:int, options:TextureOptions = null):ConcreteTexture { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/textures/TextureAtlas.as b/lib/starling/textures/TextureAtlas.as deleted file mode 100644 index 9cf028e7..00000000 --- a/lib/starling/textures/TextureAtlas.as +++ /dev/null @@ -1,23 +0,0 @@ -package starling.textures { - - import openfl.geom.Rectangle; - // import openfl.Vector; - - /** - * @externs - */ - public class TextureAtlas { - public function get texture():Texture { return null; } - public function TextureAtlas(texture:Texture, atlasXml:Object = null):void {} - public function addRegion(name:String, region:openfl.geom.Rectangle, frame:openfl.geom.Rectangle = null, rotated:Boolean = false):void {} - public function dispose():void {} - public function getFrame(name:String):openfl.geom.Rectangle { return null; } - public function getNames(prefix:String = null, result:Vector. = null):Vector. { return null; } - public function getRegion(name:String):openfl.geom.Rectangle { return null; } - public function getRotation(name:String):Boolean { return false; } - public function getTexture(name:String):Texture { return null; } - public function getTextures(prefix:String = null, result:Vector. = null):Vector. { return null; } - public function removeRegion(name:String):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/textures/TextureOptions.as b/lib/starling/textures/TextureOptions.as deleted file mode 100644 index bf40bf11..00000000 --- a/lib/starling/textures/TextureOptions.as +++ /dev/null @@ -1,20 +0,0 @@ -package starling.textures { - - import starling.core.Starling; - - /** - * @externs - */ - public class TextureOptions { - public var forcePotTexture:Boolean; - public var format:String; - public var mipMapping:Boolean; - public var onReady:Function; - public var optimizeForRenderToTexture:Boolean; - public var premultipliedAlpha:Boolean; - public var scale:Number; - public function TextureOptions(scale:Number = 0, mipMapping:Boolean = false, format:String = null, premultipliedAlpha:Boolean = false, forcePotTexture:Boolean = false):void {} - public function clone():TextureOptions { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/textures/TextureSmoothing.as b/lib/starling/textures/TextureSmoothing.as deleted file mode 100644 index bd1aeadb..00000000 --- a/lib/starling/textures/TextureSmoothing.as +++ /dev/null @@ -1,18 +0,0 @@ -package starling.textures { - - /** - * @externs - */ - public class TextureSmoothing { - /** No smoothing, also called "Nearest Neighbor". Pixels will scale up as big rectangles. */ - public static const NONE:String = "none"; - - /** Bilinear filtering. Creates smooth transitions between pixels. */ - public static const BILINEAR:String = "bilinear"; - - /** Trilinear filtering. Highest quality by taking the next mip map level into account. */ - public static const TRILINEAR:String = "trilinear"; - public static function isValid(smoothing:String):Boolean { return false; } - } - -} \ No newline at end of file diff --git a/lib/starling/utils/Align.as b/lib/starling/utils/Align.as deleted file mode 100644 index d99b47f2..00000000 --- a/lib/starling/utils/Align.as +++ /dev/null @@ -1,29 +0,0 @@ -package starling.utils { - - import starling.errors.AbstractClassError; - - /** - * @externs - */ - public class Align { - public function Align():void {} - /** Horizontal left alignment. */ - public static const LEFT:String = "left"; - - /** Horizontal right alignment. */ - public static const RIGHT:String = "right"; - - /** Vertical top alignment. */ - public static const TOP:String = "top"; - - /** Vertical bottom alignment. */ - public static const BOTTOM:String = "bottom"; - - /** Centered alignment. */ - public static const CENTER:String = "center"; - public static function isValid(align:String):Boolean { return false; } - public static function isValidHorizontal(align:String):Boolean { return false; } - public static function isValidVertical(align:String):Boolean { return false; } - } - -} \ No newline at end of file diff --git a/lib/starling/utils/AssetManager.as b/lib/starling/utils/AssetManager.as deleted file mode 100644 index 3091caef..00000000 --- a/lib/starling/utils/AssetManager.as +++ /dev/null @@ -1,70 +0,0 @@ -package starling.utils { - - import openfl.media.Sound; - import openfl.media.SoundTransform; - import openfl.utils.ByteArray; - // import openfl.Vector; - import starling.events.EventDispatcher; - // import starling.utils.ArrayUtil; - import starling.core.Starling; - import starling.textures.TextureAtlas; - import starling.text.TextField; - import starling.text.BitmapFont; - import starling.textures.Texture; - import starling.textures.TextureAtlas; - import starling.textures.AtfData; - import starling.textures.TextureOptions; - - // @:meta(Event(name = "texturesRestored", type = "starling.events.Event")) @:meta(Event(name = "ioError", type = "starling.events.Event")) @:meta(Event(name = "securityError", type = "starling.events.Event")) @:meta(Event(name = "parseError", type = "starling.events.Event")) - - /** - * @externs - */ - public class AssetManager extends starling.events.EventDispatcher { - public var checkPolicyFile:Boolean; - public var forcePotTextures:Boolean; - public function get isLoading():Boolean { return false; } - public var keepAtlasXmls:Boolean; - public var keepFontXmls:Boolean; - public function get numQueuedAssets():int { return 0; } - public var numConnections:int; - public var scaleFactor:Number; - public var textureFormat:String; - public var useMipMaps:Boolean; - public var verbose:Boolean; - public function AssetManager(scaleFactor:Number = 0, useMipmaps:Boolean = false):void {} - public function addByteArray(name:String, byteArray:openfl.utils.ByteArray):void {} - public function addObject(name:String, object:Object):void {} - public function addSound(name:String, sound:openfl.media.Sound):void {} - public function addTexture(name:String, texture:starling.textures.Texture):void {} - public function addTextureAtlas(name:String, atlas:starling.textures.TextureAtlas):void {} - public function addXml(name:String, xml:Object):void {} - public function dispose():void {} - public function enqueue(rawAssets:Array):void {} - public function enqueueWithName(asset:Object, name:String = null, options:starling.textures.TextureOptions = null):String { return null; } - public function getByteArray(name:String):openfl.utils.ByteArray { return null; } - public function getByteArrayNames(prefix:String = null, out:Vector. = null):Vector. { return null; } - public function getObject(name:String):Object { return null; } - public function getObjectNames(prefix:String = null, out:Vector. = null):Vector. { return null; } - public function getSound(name:String):openfl.media.Sound { return null; } - public function getSoundNames(prefix:String = null, out:Vector. = null):Vector. { return null; } - public function getTexture(name:String):starling.textures.Texture { return null; } - public function getTextureAtlas(name:String):starling.textures.TextureAtlas { return null; } - public function getTextureAtlasNames(prefix:String = null, out:Vector. = null):Vector. { return null; } - public function getTextureNames(prefix:String = null, out:Vector. = null):Vector. { return null; } - public function getTextures(prefix:String = null, out:Vector. = null):Vector. { return null; } - public function getXml(name:String):Object { return null; } - public function getXmlNames(prefix:String = null, out:Vector. = null):Vector. { return null; } - public function loadQueue(onProgress:Function):void {} - public function playSound(name:String, startTime:Number = 0, loops:int = 0, transform:openfl.media.SoundTransform = null):openfl.media.SoundChannel { return null; } - public function purge():void {} - public function purgeQueue():void {} - public function removeByteArray(name:String, dispose:Boolean = false):void {} - public function removeObject(name:String):void {} - public function removeSound(name:String):void {} - public function removeTexture(name:String, dispose:Boolean = false):void {} - public function removeTextureAtlas(name:String, dispose:Boolean = false):void {} - public function removeXml(name:String, dispose:Boolean = false):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/utils/ByteArrayUtil.as b/lib/starling/utils/ByteArrayUtil.as deleted file mode 100644 index 0291a182..00000000 --- a/lib/starling/utils/ByteArrayUtil.as +++ /dev/null @@ -1,33 +0,0 @@ -// ================================================================================================= -// -// Starling Framework -// Copyright Gamua GmbH. All Rights Reserved. -// -// This program is free software. You can redistribute and/or modify it -// in accordance with the terms of the accompanying license agreement. -// -// ================================================================================================= - -package starling.utils { - - import openfl.utils.ByteArray; - import openfl.errors.RangeError; - - import starling.errors.AbstractClassError; - - /** - * @externs - */ - public class ByteArrayUtil - { - /** Figures out if a byte array starts with the UTF bytes of a certain string. If the - * array starts with a 'BOM', it is ignored; so are leading zeros and whitespace. */ - public static function startsWithString(bytes:ByteArray, string:String):Boolean { return false; } - - /** Compares the range of bytes within two byte arrays. */ - public static function compareByteArrays(a:ByteArray, indexA:int, - b:ByteArray, indexB:int, - numBytes:int=-1):Boolean { return false; } - } - -} \ No newline at end of file diff --git a/lib/starling/utils/Color.as b/lib/starling/utils/Color.as deleted file mode 100644 index 533de019..00000000 --- a/lib/starling/utils/Color.as +++ /dev/null @@ -1,40 +0,0 @@ -package starling.utils { - - // import openfl.Vector; - - /** - * @externs - */ - public class Color { - public static const WHITE:uint = 0xffffff; - public static const SILVER:uint = 0xc0c0c0; - public static const GRAY:uint = 0x808080; - public static const BLACK:uint = 0x000000; - public static const RED:uint = 0xff0000; - public static const MAROON:uint = 0x800000; - public static const YELLOW:uint = 0xffff00; - public static const OLIVE:uint = 0x808000; - public static const LIME:uint = 0x00ff00; - public static const GREEN:uint = 0x008000; - public static const AQUA:uint = 0x00ffff; - public static const TEAL:uint = 0x008080; - public static const BLUE:uint = 0x0000ff; - public static const NAVY:uint = 0x000080; - public static const FUCHSIA:uint = 0xff00ff; - public static const PURPLE:uint = 0x800080; - public static function argb(alpha:int, red:int, green:int, blue:int):uint { return 0; } - public static function getAlpha(color:uint):int { return 0; } - public static function getBlue(color:uint):int { return 0; } - public static function getGreen(color:uint):int { return 0; } - public static function getRed(color:uint):int { return 0; } - public static function interpolate(startColor:uint, endColor:uint, ratio:Number):uint { return 0; } - public static function multiply(color:uint, factor:Number):uint { return 0; } - public static function rgb(red:int, green:int, blue:int):uint { return 0; } - public static function setAlpha(color:uint, alpha:int):uint { return 0; } - public static function setBlue(color:uint, blue:int):uint { return 0; } - public static function setGreen(color:uint, green:int):uint { return 0; } - public static function setRed(color:uint, red:int):uint { return 0; } - public static function toVector(color:uint, out:Vector. = null):Vector. { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/utils/Execute.as b/lib/starling/utils/Execute.as deleted file mode 100644 index 51710254..00000000 --- a/lib/starling/utils/Execute.as +++ /dev/null @@ -1,10 +0,0 @@ -package starling.utils { - - /** - * @externs - */ - public class Execute { - public static function execute(func:Function, args:Array):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/utils/MathUtil.as b/lib/starling/utils/MathUtil.as deleted file mode 100644 index 59d53f51..00000000 --- a/lib/starling/utils/MathUtil.as +++ /dev/null @@ -1,24 +0,0 @@ -package starling.utils { - - import openfl.geom.Point; - import openfl.geom.Vector3D; - - /** - * @externs - */ - public class MathUtil { - public static function clamp(value:Number, min:Number, max:Number):Number { return 0; } - public static function deg2rad(deg:Number):Number { return 0; } - public static function getNextPowerOfTwo(number:Number):int { return 0; } - public static function intersectLineWithXYPlane(pointA:openfl.geom.Vector3D, pointB:openfl.geom.Vector3D, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public static function isEquivalent(a:Number, b:Number, epsilon:Number = 0):Boolean { return false; } - public static function isPointInTriangle(p:openfl.geom.Point, a:openfl.geom.Point, b:openfl.geom.Point, c:openfl.geom.Point):Boolean { return false; } - public static function max(a:Number, b:Number):Number { return 0; } - public static function min(a:Number, b:Number):Number { return 0; } - public static function minValues(values:Array):Number { return 0; } - public static function normalizeAngle(angle:Number):Number { return 0; } - public static function rad2deg(rad:Number):Number { return 0; } - public static function toFixed(value:Number, precision:int):String { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/utils/MatrixUtil.as b/lib/starling/utils/MatrixUtil.as deleted file mode 100644 index e01646f2..00000000 --- a/lib/starling/utils/MatrixUtil.as +++ /dev/null @@ -1,34 +0,0 @@ -package starling.utils { - - import openfl.geom.Matrix; - import openfl.geom.Matrix3D; - import openfl.geom.Point; - import openfl.geom.Vector3D; - import starling.utils.MathUtil; - - /** - * @externs - */ - public class MatrixUtil { - public static function convertTo2D(matrix3D:openfl.geom.Matrix3D, out:openfl.geom.Matrix = null):openfl.geom.Matrix { return null; } - public static function convertTo3D(matrix:openfl.geom.Matrix, out:openfl.geom.Matrix3D = null):openfl.geom.Matrix3D { return null; } - public static function createOrthographicProjectionMatrix(x:Number, y:Number, width:Number, height:Number, out:openfl.geom.Matrix = null):openfl.geom.Matrix { return null; } - public static function createPerspectiveProjectionMatrix(x:Number, y:Number, width:Number, height:Number, stageWidth:Number = 0, stageHeight:Number = 0, cameraPos:openfl.geom.Vector3D = null, out:openfl.geom.Matrix3D = null):openfl.geom.Matrix3D { return null; } - public static function isIdentity(matrix:openfl.geom.Matrix):Boolean { return false; } - public static function isIdentity3D(matrix:openfl.geom.Matrix3D):Boolean { return false; } - public static function prependMatrix(base:openfl.geom.Matrix, prep:openfl.geom.Matrix):void {} - public static function prependRotation(matrix:openfl.geom.Matrix, angle:Number):void {} - public static function prependScale(matrix:openfl.geom.Matrix, sx:Number, sy:Number):void {} - public static function prependSkew(matrix:openfl.geom.Matrix, skewX:Number, skewY:Number):void {} - public static function prependTranslation(matrix:openfl.geom.Matrix, tx:Number, ty:Number):void {} - public static function skew(matrix:openfl.geom.Matrix, skewX:Number, skewY:Number):void {} - public static function snapToPixels(matrix:openfl.geom.Matrix, pixelSize:Number):void {} - public static function toString(matrix:openfl.geom.Matrix, precision:int = 0):String { return null; } - public static function toString3D(matrix:openfl.geom.Matrix3D, transpose:Boolean = false, precision:int = 0):String { return null; } - public static function transformCoords(matrix:openfl.geom.Matrix, x:Number, y:Number, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public static function transformCoords3D(matrix:openfl.geom.Matrix3D, x:Number, y:Number, z:Number, out:openfl.geom.Vector3D = null):openfl.geom.Vector3D { return null; } - public static function transformPoint(matrix:openfl.geom.Matrix, point:openfl.geom.Point, out:openfl.geom.Point = null):openfl.geom.Point { return null; } - public static function transformPoint3D(matrix:openfl.geom.Matrix3D, point:openfl.geom.Vector3D, out:openfl.geom.Vector3D = null):openfl.geom.Vector3D { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/utils/Max.as b/lib/starling/utils/Max.as deleted file mode 100644 index 04c06dec..00000000 --- a/lib/starling/utils/Max.as +++ /dev/null @@ -1,16 +0,0 @@ -package starling.utils { - - - - /** - * @externs - */ - public class Max { - public static function get INT_MAX_VALUE():int { return 0; } - public static function get INT_MIN_VALUE():int { return 0; } - public static function get MAX_VALUE():Number { return 0; } - public static function get MIN_VALUE():Number { return 0; } - public static function get UINT_MAX_VALUE():uint { return 0; } - } - -} \ No newline at end of file diff --git a/lib/starling/utils/MeshSubset.as b/lib/starling/utils/MeshSubset.as deleted file mode 100644 index 025e1143..00000000 --- a/lib/starling/utils/MeshSubset.as +++ /dev/null @@ -1,15 +0,0 @@ -package starling.utils { - - /** - * @externs - */ - public class MeshSubset { - public var indexID:int; - public var numIndices:int; - public var numVertices:int; - public var vertexID:int; - public function MeshSubset(vertexID:int = 0, numVertices:int = 0, indexID:int = 0, numIndices:int = 0):void {} - public function setTo(vertexID:int = 0, numVertices:int = 0, indexID:int = 0, numIndices:int = 0):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/utils/MeshUtil.as b/lib/starling/utils/MeshUtil.as deleted file mode 100644 index 80d2f008..00000000 --- a/lib/starling/utils/MeshUtil.as +++ /dev/null @@ -1,19 +0,0 @@ -package starling.utils { - - import openfl.geom.Rectangle; - import starling.display.DisplayObject; - import starling.errors.AbstractClassError; - import starling.rendering.VertexData; - import starling.utils.Pool; - import starling.utils.MathUtil; - - /** - * @externs - */ - public class MeshUtil { - public function MeshUtil():void {} - public static function calculateBounds(vertexData:starling.rendering.VertexData, sourceSpace:starling.display.DisplayObject, targetSpace:starling.display.DisplayObject, out:openfl.geom.Rectangle = null):openfl.geom.Rectangle { return null; } - public static function containsPoint(vertexData:starling.rendering.VertexData, indexData:starling.rendering.IndexData, point:openfl.geom.Point):Boolean { return false; } - } - -} \ No newline at end of file diff --git a/lib/starling/utils/Padding.as b/lib/starling/utils/Padding.as deleted file mode 100644 index a1757a44..00000000 --- a/lib/starling/utils/Padding.as +++ /dev/null @@ -1,23 +0,0 @@ -package starling.utils { - - import starling.events.EventDispatcher; - - // @:meta(Event(name = "change", type = "starling.events.Event")) - - /** - * @externs - */ - public class Padding extends starling.events.EventDispatcher { - public var bottom:Number; - public var left:Number; - public var right:Number; - public var top:Number; - public function Padding(left:Number = 0, right:Number = 0, top:Number = 0, bottom:Number = 0):void {} - public function clone():Padding { return null; } - public function copyFrom(padding:Padding):void {} - public function setTo(left:Number = 0, right:Number = 0, top:Number = 0, bottom:Number = 0):void {} - public function setToSymmetric(horizontal:Number, vertical:Number):void {} - public function setToUniform(value:Number):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/utils/Pool.as b/lib/starling/utils/Pool.as deleted file mode 100644 index 63387fe2..00000000 --- a/lib/starling/utils/Pool.as +++ /dev/null @@ -1,25 +0,0 @@ -package starling.utils { - - import openfl.geom.Matrix; - import openfl.geom.Matrix3D; - import openfl.geom.Point; - import openfl.geom.Rectangle; - import openfl.geom.Vector3D; - - /** - * @externs - */ - public class Pool { - public static function getMatrix(a:Number = 0, b:Number = 0, c:Number = 0, d:Number = 0, tx:Number = 0, ty:Number = 0):openfl.geom.Matrix { return null; } - public static function getMatrix3D(identity:Boolean = false):openfl.geom.Matrix3D { return null; } - public static function getPoint(x:Number = 0, y:Number = 0):openfl.geom.Point { return null; } - public static function getPoint3D(x:Number = 0, y:Number = 0, z:Number = 0):openfl.geom.Vector3D { return null; } - public static function getRectangle(x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0):openfl.geom.Rectangle { return null; } - public static function putMatrix(matrix:openfl.geom.Matrix):void {} - public static function putMatrix3D(matrix:openfl.geom.Matrix3D):void {} - public static function putPoint(point:openfl.geom.Point):void {} - public static function putPoint3D(point:openfl.geom.Vector3D):void {} - public static function putRectangle(rectangle:openfl.geom.Rectangle):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/utils/RectangleUtil.as b/lib/starling/utils/RectangleUtil.as deleted file mode 100644 index c0c0f34d..00000000 --- a/lib/starling/utils/RectangleUtil.as +++ /dev/null @@ -1,26 +0,0 @@ -package starling.utils { - - import openfl.geom.Matrix3D; - import openfl.geom.Point; - import openfl.geom.Rectangle; - // import openfl.Vector; - import starling.utils.ScaleMode; - import starling.utils.MatrixUtil; - import starling.utils.MathUtil; - - /** - * @externs - */ - public class RectangleUtil { - public static function compare(r1:openfl.geom.Rectangle, r2:openfl.geom.Rectangle, e:Number = 0):Boolean { return false; } - public static function extend(rect:openfl.geom.Rectangle, left:Number = 0, right:Number = 0, top:Number = 0, bottom:Number = 0):void {} - public static function extendToWholePixels(rect:openfl.geom.Rectangle, scaleFactor:Number = 0):void {} - public static function fit(rectangle:openfl.geom.Rectangle, into:openfl.geom.Rectangle, scaleMode:String = null, pixelPerfect:Boolean = false, out:openfl.geom.Rectangle = null):openfl.geom.Rectangle { return null; } - public static function getBounds(rectangle:openfl.geom.Rectangle, matrix:openfl.geom.Matrix, out:openfl.geom.Rectangle = null):openfl.geom.Rectangle { return null; } - public static function getBoundsProjected(rectangle:openfl.geom.Rectangle, matrix:openfl.geom.Matrix3D, camPos:openfl.geom.Vector3D, out:openfl.geom.Rectangle = null):openfl.geom.Rectangle { return null; } - public static function getPositions(rectangle:openfl.geom.Rectangle, out:Vector. = null):Vector. { return null; } - public static function intersect(rect1:openfl.geom.Rectangle, rect2:openfl.geom.Rectangle, out:openfl.geom.Rectangle = null):openfl.geom.Rectangle { return null; } - public static function normalize(rect:openfl.geom.Rectangle):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/utils/RenderUtil.as b/lib/starling/utils/RenderUtil.as deleted file mode 100644 index c4cb143c..00000000 --- a/lib/starling/utils/RenderUtil.as +++ /dev/null @@ -1,21 +0,0 @@ -package starling.utils { - - import openfl.display.Stage3D; - import starling.core.Starling; - import starling.textures.Texture; - import starling.utils.Color; - import starling.utils.Execute; - - /** - * @externs - */ - public class RenderUtil { - public static function clear(rgb:uint = 0, alpha:Number = 0, depth:Number = 0, stencil:uint = 0):void {} - public static function createAGALTexOperation(resultReg:String, uvReg:String, sampler:int, texture:starling.textures.Texture, convertToPmaIfRequired:Boolean = false, tempReg:String = null):String { return null; } - public static function getTextureLookupFlags(format:String, mipMapping:Boolean, repeat:Boolean = false, smoothing:String = null):String { return null; } - public static function getTextureVariantBits(texture:starling.textures.Texture):uint { return 0; } - public static function requestContext3D(stage3D:openfl.display.Stage3D, renderMode:String, profile:Object):void {} - public static function setSamplerStateAt(sampler:int, mipMapping:Boolean, smoothing:String = null, repeat:Boolean = false):void {} - } - -} \ No newline at end of file diff --git a/lib/starling/utils/ScaleMode.as b/lib/starling/utils/ScaleMode.as deleted file mode 100644 index 0e255305..00000000 --- a/lib/starling/utils/ScaleMode.as +++ /dev/null @@ -1,22 +0,0 @@ -package starling.utils { - - /** - * @externs - */ - public class ScaleMode { - /** Specifies that the rectangle is not scaled, but simply centered within the - * specified area. */ - public static const NONE:String = "none"; - - /** Specifies that the rectangle fills the specified area without distortion - * but possibly with some cropping, while maintaining the original aspect ratio. */ - public static const NO_BORDER:String = "noBorder"; - - /** Specifies that the entire rectangle will be scaled to fit into the specified - * area, while maintaining the original aspect ratio. This might leave empty bars at - * either the top and bottom, or left and right. */ - public static const SHOW_ALL:String = "showAll"; - public static function isValid(scaleMode:String):Boolean { return false; } - } - -} \ No newline at end of file diff --git a/lib/starling/utils/StringUtil.as b/lib/starling/utils/StringUtil.as deleted file mode 100644 index c2b774e6..00000000 --- a/lib/starling/utils/StringUtil.as +++ /dev/null @@ -1,14 +0,0 @@ -package starling.utils { - - /** - * @externs - */ - public class StringUtil { - public static function clean(string:String):String { return null; } - public static function format(format:String, args:Array):String { return null; } - public static function trim(string:String):String { return null; } - public static function trimEnd(string:String):String { return null; } - public static function trimStart(string:String):String { return null; } - } - -} \ No newline at end of file diff --git a/lib/starling/utils/SystemUtil.as b/lib/starling/utils/SystemUtil.as deleted file mode 100644 index 25636e28..00000000 --- a/lib/starling/utils/SystemUtil.as +++ /dev/null @@ -1,24 +0,0 @@ -package starling.utils { - - /** - * @externs - */ - public class SystemUtil { - public static function get isAIR():Boolean { return false; } - public static function get isAndroid():Boolean { return false; } - public static function get isApplicationActive():Boolean { return false; } - public static function get isDesktop():Boolean { return false; } - public static function get isIOS():Boolean { return false; } - public static function get isMac():Boolean { return false; } - public static function get isWindows():Boolean { return false; } - public static var platform:String; - public static function get supportsDepthAndStencil():Boolean { return false; } - public static function get supportsVideoTexture():Boolean { return false; } - public static function get version():String { return null; } - public static function executeWhenApplicationIsActive(call:Function, args:Array):void {} - public static function initialize():void {} - public static function isEmbeddedFont(fontName:String, bold:Boolean = false, italic:Boolean = false, fontType:String = null):Boolean { return false; } - public static function updateEmbeddedFonts():void {} - } - -} \ No newline at end of file diff --git a/package.json b/package.json index 89baad5a..69fb7926 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "build-dist:prod": "webpack --config webpack.prod.js", "build-docs": "typedoc --out docs scripts/importAll.ts --allowJs --entryPoint starling --mode file --target es5 --module commonjs --plugins none --exclude \"**/{node_modules,samples}/**/*.ts\" --readme none --theme default --includeDeclarations --disableOutputCheck --ignoreCompilerErrors", "build-lib": "cd scripts && haxe build.hxml", - "build-swc": "compc -load-config=node_modules/@apache-royale/royale-js/royale-asjs/frameworks/js-config.xml -keep-as3-metadata=JSModule -include-sources=lib -compiler.targets=SWF,JS -warnings=false -external-library-path+=node_modules/openfl/dist/openfl.swc -output=dist/starling.swc", + "build-swc": "compc -load-config=node_modules/@apache-royale/royale-js/royale-asjs/frameworks/js-config.xml -keep-as3-metadata=JSModule -include-sources=lib -compiler.targets=SWF,JS -warnings=false -external-library-path+=node_modules/openfl/dist/openfl.swc -allow-subclass-overrides=true -output=dist/starling.swc", "dev-link": "npm link openfl && npm link hxgenjs", "prepublishOnly": "npm run build", "serve": "http-server -c-1 --cors", diff --git a/scripts/AS3ExternsGenerator.hx b/scripts/AS3ExternsGenerator.hx new file mode 100644 index 00000000..6d98bbc5 --- /dev/null +++ b/scripts/AS3ExternsGenerator.hx @@ -0,0 +1,1264 @@ +import sys.FileSystem; +import sys.io.File; +import haxe.io.Path; +import haxe.macro.Compiler; +import haxe.macro.Type; +import haxe.macro.Type.BaseType; +import haxe.macro.Type.AbstractType; +import haxe.macro.Context; + +class AS3ExternsGenerator { + private static final ALWAYS_ALLOWED_REFERENCE_TYPES = [ + "Any", + "Array", + "Bool", + "Class", + "Date", + "Dynamic", + "Float", + "Int", + "String", + "UInt", + "Void" + ]; + private static final NON_NULLABLE_AS3_TYPES = ["Boolean", "Number", "int", "uint"]; + // AS3 in Royale allows most keywords as symbol names, unlike older SDKs + // however, these are still not allowed + private static final DISALLOWED_AS3_NAMES = ["goto", "public", "private", "protected", "internal"]; + private static final eregAccessor = ~/^(g|s)et_[\w]+$/; + + private static function rewriteQname(qname:String):String { + switch (qname) { + case "Bool": + return "Boolean"; + case "Float": + return "Number"; + case "Int": + return "int"; + case "UInt": + return "uint"; + case "Dynamic": + return "*"; + case "Any": + return "*"; + case "Void": + return "void"; + default: + return qname; + } + } + + public static function generate(?options:GeneratorOptions):Void { + var outputDirPath = Path.join([Path.directory(Compiler.getOutput()), "as3-externs"]); + if (options != null && options.outputPath != null) { + outputDirPath = options.outputPath; + } + if (!Path.isAbsolute(outputDirPath)) { + outputDirPath = Path.join([Sys.getCwd(), outputDirPath]); + } + Context.onGenerate(types -> { + var generator = new AS3ExternsGenerator(options); + generator.generateForTypes(types, outputDirPath); + }); + } + + private var options:GeneratorOptions; + + private function new(?options:GeneratorOptions) { + this.options = options; + } + + public function generateForTypes(types:Array, outputDirPath:String):Void { + for (type in types) { + switch (type) { + case TInst(t, params): + var classType = t.get(); + if (shouldSkipBaseType(classType, false)) { + continue; + } + if (classType.isInterface) { + var generated = generateInterface(classType, params); + writeGenerated(outputDirPath, classType, generated); + } else { + var generated = generateClass(classType, params); + writeGenerated(outputDirPath, classType, generated); + } + case TEnum(t, params): + var enumType = t.get(); + if (shouldSkipBaseType(enumType, false)) { + continue; + } + var generated = generateEnum(enumType, params); + writeGenerated(outputDirPath, enumType, generated); + case TAbstract(t, params): + var abstractType = t.get(); + if (shouldSkipBaseType(abstractType, false)) { + continue; + } + if (!abstractType.meta.has(":enum")) { + // ignore non-enum abstracts because they don't exist in openfl-js + continue; + } + var generated = generateAbstractEnum(abstractType, params); + writeGenerated(outputDirPath, abstractType, generated); + case TType(t, params): + // ignore typedefs because they don't exist in openfl-js + default: + trace("Unexpected type: " + type); + } + } + } + + private function isInPackage(expected:Array, actual:Array, exact:Bool):Bool { + if (expected == null) { + return true; + } + if (exact) { + if (actual.length != expected.length) { + return false; + } + } else if (actual.length < expected.length) { + return false; + } + for (i in 0...expected.length) { + var actualPart = actual[i]; + var expectedPart = expected[i]; + if (actualPart != expectedPart) { + return false; + } + } + return true; + } + + private function isInHiddenPackage(pack:Array):Bool { + for (part in pack) { + if (part.charAt(0) == "_") { + return true; + } + } + return false; + } + + private function shouldSkipMacroType(type:Type, asReference:Bool):Bool { + var baseType:BaseType = null; + while (type != null) { + switch (type) { + case TInst(t, params): + baseType = t.get(); + break; + case TEnum(t, params): + baseType = t.get(); + break; + case TAbstract(t, params): + var abstractType = t.get(); + if (abstractType.name == "Null" && abstractType.pack.length == 0) { + return shouldSkipMacroType(params[0], asReference); + } + type = abstractType.type; + switch (type) { + case TAbstract(t, params): + var result = baseTypeToQname(abstractType, params); + var compareTo = baseTypeToQname(t.get(), params); + if (result == compareTo) { + // this avoids an infinite loop + baseType = abstractType; + break; + } + default: + } + case TType(t, params): + type = t.get().type; + case TDynamic(t): + return false; + case TAnonymous(a): + return false; + case TFun(args, ret): + return false; + case TLazy(f): + type = f(); + case TMono(t): + type = t.get(); + default: + break; + } + } + if (baseType == null) { + return true; + } + return shouldSkipBaseType(baseType, asReference); + } + + private function shouldSkipBaseType(baseType:BaseType, asReference:Bool):Bool { + if (asReference && baseType.pack.length == 0 && ALWAYS_ALLOWED_REFERENCE_TYPES.indexOf(baseType.name) != -1) { + return false; + } + if (baseType.isPrivate || (baseType.isExtern && !asReference) || isInHiddenPackage(baseType.pack)) { + return true; + } + if (options != null) { + if (options.includedPackages != null) { + for (includedPackage in options.includedPackages) { + if (isInPackage(includedPackage.split("."), baseType.pack, false)) { + if (options.excludeSymbols != null) { + var qname = baseTypeToQname(baseType, []); + if (options.excludeSymbols.indexOf(qname) != -1) { + return true; + } + } + return false; + } + } + if (!asReference) { + return true; + } + } else if (options.excludeSymbols != null) { + var qname = baseTypeToQname(baseType, []); + if (options.excludeSymbols.indexOf(qname) != -1) { + return true; + } + } + if (asReference) { + if (options.allowedPackageReferences != null) { + for (allowedPackage in options.allowedPackageReferences) { + if (isInPackage(allowedPackage.split("."), baseType.pack, false)) { + return false; + } + } + return true; + } + } + } + return false; + } + + private function generateClass(classType:ClassType, params:Array):String { + var result = new StringBuf(); + result.add('package'); + var packageName:String = null; + if (classType.pack.length > 0) { + packageName = classType.pack.join("."); + result.add(' $packageName'); + } + result.add(' {\n'); + result.add(generateClassTypeImports(classType)); + result.add('/**\n * @externs\n'); + if (classType.doc != null && StringTools.trim(classType.doc).length > 0) { + var lines = ~/\r?\n/g.split(classType.doc); + var addedLine = false; + for (line in lines) { + if (!addedLine && ~/^\s*$/.match(line)) { + continue; + } + addedLine = true; + var leadingStar = ~/^(\s*\*\s*)/; + if (leadingStar.match(line)) { + line = line.substr(leadingStar.matchedPos().len); + result.add(' * $line\n'); + } else { + result.add(' * $line\n'); + } + } + } + result.add(' */\n'); + var className = baseTypeToUnqualifiedName(classType); + result.add('public class $className'); + if (classType.superClass != null) { + var superClassType = classType.superClass.t.get(); + if (!shouldSkipBaseType(superClassType, true)) { + result.add(' extends ${baseTypeToQname(superClassType, classType.superClass.params)}'); + } + } + var interfaces = classType.interfaces; + var foundFirstInterface = false; + for (i in 0...interfaces.length) { + var interfaceRef = interfaces[i]; + var implementedInterfaceType = interfaceRef.t.get(); + if (!shouldSkipBaseType(implementedInterfaceType, true)) { + if (foundFirstInterface) { + result.add(', '); + } else { + foundFirstInterface = true; + result.add(' implements '); + } + result.add(baseTypeToQname(implementedInterfaceType, interfaceRef.params)); + } + } + result.add(' {\n'); + if (classType.constructor != null) { + var constructor = classType.constructor.get(); + if (!shouldSkipField(constructor, classType)) { + result.add(generateClassField(constructor, classType, false, null)); + } + } + for (classField in classType.statics.get()) { + if (shouldSkipField(classField, classType)) { + continue; + } + result.add(generateClassField(classField, classType, true, null)); + } + for (classField in classType.fields.get()) { + if (shouldSkipField(classField, classType)) { + continue; + } + result.add(generateClassField(classField, classType, false, interfaces)); + } + result.add('}\n'); + result.add('}\n'); + return result.toString(); + } + + private function generateClassField(classField:ClassField, classType:ClassType, isStatic:Bool, + interfaces:Array<{t:Ref, params:Array}>):String { + var result = new StringBuf(); + if (classField.doc != null && StringTools.trim(classField.doc).length > 0) { + result.add("\t/**\n"); + var lines = ~/\r?\n/g.split(classField.doc); + var addedLine = false; + for (line in lines) { + if (!addedLine && ~/^\s*$/.match(line)) { + continue; + } + addedLine = true; + var leadingStar = ~/^(\s*\*\s*)/; + if (leadingStar.match(line)) { + line = line.substr(leadingStar.matchedPos().len); + result.add('\t * $line\n'); + } else { + result.add('\t * $line\n'); + } + } + result.add("\t */\n"); + } + result.add("\t"); + var superClassType:ClassType = null; + var skippedSuperClass = false; + if (classType != null && classType.superClass != null) { + superClassType = classType.superClass.t.get(); + skippedSuperClass = shouldSkipBaseType(superClassType, true); + } + switch (classField.kind) { + case FMethod(k): + if (!skippedSuperClass) { + if (classType != null) { + for (current in classType.overrides) { + if (current.get().name == classField.name) { + result.add('override '); + } + } + } + } + if (classField.isPublic) { + result.add('public '); + } + if (isStatic) { + result.add('static '); + } + result.add('function '); + if (classField.name == "new" && classType != null) { + var className = baseTypeToUnqualifiedName(classType); + result.add(className); + } else { + result.add(classField.name); + } + switch (classField.type) { + case TFun(args, ret): + var argsAndRet = {args: args, ret: ret}; + findInterfaceArgsAndRet(classField, classType, argsAndRet); + args = argsAndRet.args; + ret = argsAndRet.ret; + result.add('('); + var hadOpt = false; + for (i in 0...args.length) { + var arg = args[i]; + if (i > 0) { + result.add(', '); + } + result.add(arg.name); + result.add(':'); + if (shouldSkipMacroType(arg.t, true)) { + result.add('*'); + } else { + result.add(macroTypeToQname(arg.t)); + } + if (arg.opt || hadOpt) { + hadOpt = true; + result.add(' = undefined'); + } + } + result.add(')'); + if (classField.name != "new") { + result.add(':'); + var retQname = if (shouldSkipMacroType(ret, true)) { + '*'; + } else { + macroTypeToQname(ret); + } + result.add(retQname); + switch (retQname) { + case "void": + result.add(' {}'); + case "Number" | "int" | "uint": + result.add(" { return 0; }"); + case "Boolean": + result.add(" { return false; }"); + default: + result.add(" { return null; }"); + } + } else { + if (superClassType != null && !skippedSuperClass) { + result.add(' {\n'); + result.add('\t\tsuper('); + if (superClassType.constructor != null) { + switch (superClassType.constructor.get().type) { + case TFun(args, ret): + for (i in 0...args.length) { + if (i > 0) { + result.add(', '); + } + result.add('undefined'); + } + default: + } + } + result.add(');\n'); + result.add('\t}'); + } else { + result.add(' {}'); + } + } + default: + } + case FVar(read, write): + var isAccessor = read == AccCall || write == AccCall || mustBeAccessor(classField.name, interfaces); + var argsAndRet = {args: [], ret: classField.type}; + findInterfaceArgsAndRet(classField, classType, argsAndRet); + var ret = argsAndRet.ret; + if (isAccessor) { + var hasGetter = read == AccCall || read == AccNormal; + var hasSetter = write == AccCall || write == AccNormal; + if (hasGetter) { + if (classField.isPublic) { + result.add('public '); + } + if (isStatic) { + result.add('static '); + } + result.add('function get '); + result.add(classField.name); + result.add('():'); + var retQname = if (shouldSkipMacroType(ret, true)) { + '*'; + } else { + macroTypeToQname(ret); + } + result.add(retQname); + switch (retQname) { + case "void": + result.add(' {}'); + case "Number" | "int" | "uint": + result.add(" { return 0; }"); + case "Boolean": + result.add(" { return false; }"); + default: + result.add(" { return null; }"); + } + } + if (hasSetter) { + if (hasGetter) { + result.add('\n\t'); + } + if (classField.isPublic) { + result.add('public '); + } + if (isStatic) { + result.add('static '); + } + result.add('function set '); + result.add(classField.name); + result.add('(value:'); + if (shouldSkipMacroType(ret, true)) { + result.add('*'); + } else { + result.add(macroTypeToQname(ret)); + } + result.add('):void {}'); + } + } else { + if (classField.isPublic) { + result.add('public '); + } + if (isStatic) { + result.add('static '); + } + if (classField.isFinal || read == AccInline || write == AccInline) { + result.add('const '); + } else { + result.add('var '); + } + result.add(classField.name); + result.add(':'); + if (shouldSkipMacroType(ret, true)) { + result.add('*'); + } else { + result.add(macroTypeToQname(ret)); + } + if (classField.isFinal || read == AccInline || write == AccInline) { + var expr = classField.expr().expr; + while (true) { + switch (expr) { + case TCast(e, m): + expr = e.expr; + case TConst(TBool(b)): + result.add(' = $b'); + break; + case TConst(TFloat(f)): + result.add(' = $f'); + break; + case TConst(TInt(i)): + result.add(' = $i'); + break; + case TConst(TString(s)): + result.add(' = "$s"'); + break; + case TConst(TNull): + result.add(' = null'); + default: + break; + } + } + } + result.add(";"); + } + } + result.add('\n'); + return result.toString(); + } + + private function mustBeAccessor(fieldName:String, interfaces:Array<{t:Ref, params:Array}>):Bool { + if (interfaces == null) { + return false; + } + for (interfaceRef in interfaces) { + var implementedInterface = interfaceRef.t.get(); + for (classField in implementedInterface.fields.get()) { + if (classField.name == fieldName) { + switch (classField.kind) { + case FVar(read, write): + return true; + default: + return false; + } + } + } + if (mustBeAccessor(fieldName, implementedInterface.interfaces)) { + return true; + } + } + return false; + } + + private function generateClassTypeImports(classType:ClassType):String { + var qnames:Map = []; + if (classType.constructor != null) { + var constructor = classType.constructor.get(); + if (!shouldSkipField(constructor, classType)) { + switch (constructor.type) { + case TFun(args, ret): + for (arg in args) { + var argType = arg.t; + if (!canSkipMacroTypeImport(argType, classType.pack) && !shouldSkipMacroType(argType, true)) { + var qname = macroTypeToQname(argType, false); + qnames.set(qname, true); + } + } + default: + } + } + } + if (classType.superClass != null) { + var superClass = classType.superClass.t.get(); + if (!shouldSkipBaseType(superClass, true) && !canSkipBaseTypeImport(superClass, classType.pack)) { + var qname = baseTypeToQname(superClass, []); + qnames.set(qname, true); + } + } + for (interfaceRef in classType.interfaces) { + var interfaceType = interfaceRef.t.get(); + if (!shouldSkipBaseType(interfaceType, true) && !canSkipBaseTypeImport(interfaceType, classType.pack)) { + var qname = baseTypeToQname(interfaceType, []); + qnames.set(qname, true); + } + } + for (classField in classType.statics.get()) { + if (shouldSkipField(classField, classType)) { + continue; + } + switch (classField.type) { + case TFun(args, ret): + for (arg in args) { + var argType = arg.t; + if (!canSkipMacroTypeImport(argType, classType.pack) && !shouldSkipMacroType(argType, true)) { + var qname = macroTypeToQname(argType, false); + qnames.set(qname, true); + } + } + if (!canSkipMacroTypeImport(ret, classType.pack) && !shouldSkipMacroType(ret, true)) { + var qname = macroTypeToQname(ret, false); + qnames.set(qname, true); + } + default: + if (!canSkipMacroTypeImport(classField.type, classType.pack) && !shouldSkipMacroType(classField.type, true)) { + var qname = macroTypeToQname(classField.type, false); + qnames.set(qname, true); + } + } + } + for (classField in classType.fields.get()) { + if (shouldSkipField(classField, classType)) { + continue; + } + switch (classField.type) { + case TFun(args, ret): + for (arg in args) { + var argType = arg.t; + if (!canSkipMacroTypeImport(argType, classType.pack) && !shouldSkipMacroType(argType, true)) { + var qname = macroTypeToQname(argType, false); + qnames.set(qname, true); + } + } + if (!canSkipMacroTypeImport(ret, classType.pack) && !shouldSkipMacroType(ret, true)) { + var qname = macroTypeToQname(ret, false); + qnames.set(qname, true); + } + default: + if (!canSkipMacroTypeImport(classField.type, classType.pack) && !shouldSkipMacroType(classField.type, true)) { + var qname = macroTypeToQname(classField.type, false); + qnames.set(qname, true); + } + } + } + + var result = new StringBuf(); + for (qname in qnames.keys()) { + result.add('import $qname;\n'); + } + return result.toString(); + } + + private function generateInterface(interfaceType:ClassType, params:Array):String { + var result = new StringBuf(); + result.add('package'); + if (interfaceType.pack.length > 0) { + result.add(' ${interfaceType.pack.join(".")}'); + } + result.add(' {\n'); + result.add(generateClassTypeImports(interfaceType)); + result.add('/**\n'); + if (interfaceType.doc != null && StringTools.trim(interfaceType.doc).length > 0) { + var lines = ~/\r?\n/g.split(interfaceType.doc); + var addedLine = false; + for (line in lines) { + if (!addedLine && ~/^\s*$/.match(line)) { + continue; + } + addedLine = true; + var leadingStar = ~/^(\s*\*\s*)/; + if (leadingStar.match(line)) { + line = line.substr(leadingStar.matchedPos().len); + result.add(' * $line\n'); + } else { + result.add(' * $line\n'); + } + } + } + result.add(' * @externs\n */\n'); + result.add('public interface ${interfaceType.name}'); + var interfaces = interfaceType.interfaces; + var firstInterface = false; + for (i in 0...interfaces.length) { + var interfaceRef = interfaces[i]; + var implementedInterfaceType = interfaceRef.t.get(); + if (!shouldSkipBaseType(implementedInterfaceType, true)) { + if (firstInterface) { + result.add(', '); + } else { + firstInterface = true; + result.add(' extends '); + } + result.add(baseTypeToQname(implementedInterfaceType, interfaceRef.params)); + } + } + result.add(' {\n'); + for (interfaceField in interfaceType.fields.get()) { + if (shouldSkipField(interfaceField, interfaceType)) { + continue; + } + result.add(generateInterfaceField(interfaceField)); + } + result.add('}\n'); + result.add('}\n'); + return result.toString(); + } + + private function generateInterfaceField(interfaceField:ClassField):String { + var result = new StringBuf(); + if (interfaceField.doc != null && StringTools.trim(interfaceField.doc).length > 0) { + result.add("\t/**\n"); + var lines = ~/\r?\n/g.split(interfaceField.doc); + var addedLine = false; + for (line in lines) { + if (!addedLine && ~/^\s*$/.match(line)) { + continue; + } + addedLine = true; + var leadingStar = ~/^(\s*\*\s*)/; + if (leadingStar.match(line)) { + line = line.substr(leadingStar.matchedPos().len); + result.add('\t * $line\n'); + } else { + result.add('\t * $line\n'); + } + } + result.add("\t */\n"); + } + result.add("\t"); + switch (interfaceField.kind) { + case FMethod(k): + result.add('function '); + result.add(interfaceField.name); + switch (interfaceField.type) { + case TFun(args, ret): + result.add('('); + var hadOpt = false; + for (i in 0...args.length) { + var arg = args[i]; + if (i > 0) { + result.add(', '); + } + result.add(arg.name); + result.add(':'); + if (shouldSkipMacroType(arg.t, true)) { + result.add('*'); + } else { + result.add(macroTypeToQname(arg.t)); + } + if (arg.opt || hadOpt) { + hadOpt = true; + result.add(' = undefined'); + } + } + result.add('):'); + if (shouldSkipMacroType(ret, true)) { + result.add('*'); + } else { + result.add(macroTypeToQname(ret)); + } + default: + } + case FVar(read, write): + // skip AccNormal fields because AS3 supports get/set only + var hasGetter = read == AccCall; + var hasSetter = write == AccCall; + if (hasGetter) { + result.add('function get '); + result.add(interfaceField.name); + result.add('():'); + if (shouldSkipMacroType(interfaceField.type, true)) { + result.add('*'); + } else { + result.add(macroTypeToQname(interfaceField.type)); + } + } + if (hasSetter) { + if (hasGetter) { + result.add(';\n\t'); + } + result.add('function set '); + result.add(interfaceField.name); + result.add('(value:'); + if (shouldSkipMacroType(interfaceField.type, true)) { + result.add('*'); + } else { + result.add(macroTypeToQname(interfaceField.type)); + } + result.add('):void'); + } + } + result.add(';\n'); + return result.toString(); + } + + private function generateEnum(enumType:EnumType, params:Array):String { + var result = new StringBuf(); + result.add('package'); + if (enumType.pack.length > 0) { + result.add(' ${enumType.pack.join(".")}'); + } + result.add(' {\n'); + result.add('/**\n'); + if (enumType.doc != null && StringTools.trim(enumType.doc).length > 0) { + var lines = ~/\r?\n/g.split(enumType.doc); + var addedLine = false; + for (line in lines) { + if (!addedLine && ~/^\s*$/.match(line)) { + continue; + } + addedLine = true; + var leadingStar = ~/^(\s*\*\s*)/; + if (leadingStar.match(line)) { + line = line.substr(leadingStar.matchedPos().len); + result.add(' * $line\n'); + } else { + result.add(' * $line\n'); + } + } + } + result.add(' * @externs\n */\n'); + result.add('public class ${enumType.name}'); + result.add(' {\n'); + for (enumField in enumType.constructs) { + result.add(generateEnumField(enumField, enumType, params)); + } + result.add('}\n'); + result.add('}\n'); + return result.toString(); + } + + private function generateEnumField(enumField:EnumField, enumType:EnumType, enumTypeParams:Array):String { + var result = new StringBuf(); + if (enumField.doc != null && StringTools.trim(enumField.doc).length > 0) { + result.add("\t/**\n"); + var lines = ~/\r?\n/g.split(enumField.doc); + var addedLine = false; + for (line in lines) { + if (!addedLine && ~/^\s*$/.match(line)) { + continue; + } + addedLine = true; + var leadingStar = ~/^(\s*\*\s*)/; + if (leadingStar.match(line)) { + line = line.substr(leadingStar.matchedPos().len); + result.add('\t * $line\n'); + } else { + result.add('\t * $line\n'); + } + } + result.add("\t */\n"); + } + result.add("\t"); + result.add('public static '); + // if (enumField.args.length == 0) { + result.add('const '); + result.add(enumField.name); + result.add(':'); + result.add(baseTypeToQname(enumType, enumTypeParams)); + result.add(';'); + /*} else { + result.add('function '); + result.add(enumField.name); + result.add('('); + var args = enumField.args; + var hadOpt = false; + for (i in 0...args.length) { + var arg = args[i]; + if (i > 0) { + result.add(', '); + } + result.add(arg.name); + result.add(':'); + if (shouldSkipMacroType(arg.t, true)) { + result.add('*'); + } else { + result.add(macroTypeToQname(arg.t)); + } + if (arg.opt || hadOpt) { + hadOpt = true; + result.add(' = undefined'); + } + } + result.add(')'); + result.add(':'); + result.add(baseTypeToQname(enumType, enumTypeParams)); + result.add(' { return null; }'); + }*/ + result.add('\n'); + return result.toString(); + } + + private function generateAbstractEnum(abstractType:AbstractType, params:Array):String { + var result = new StringBuf(); + result.add('package'); + if (abstractType.pack.length > 0) { + result.add(' ${abstractType.pack.join(".")}'); + } + result.add(' {\n'); + result.add('/**\n'); + if (abstractType.doc != null && StringTools.trim(abstractType.doc).length > 0) { + var lines = ~/\r?\n/g.split(abstractType.doc); + var addedLine = false; + for (line in lines) { + if (!addedLine && ~/^\s*$/.match(line)) { + continue; + } + addedLine = true; + var leadingStar = ~/^(\s*\*\s*)/; + if (leadingStar.match(line)) { + line = line.substr(leadingStar.matchedPos().len); + result.add(' * $line\n'); + } else { + result.add(' * $line\n'); + } + } + } + result.add(' * @externs\n */\n'); + result.add('public class ${abstractType.name}'); + result.add(' {\n'); + if (abstractType.impl != null) { + var classType = abstractType.impl.get(); + for (classField in classType.statics.get()) { + if (shouldSkipField(classField, classType)) { + continue; + } + result.add(generateClassField(classField, null, true, [])); + } + } + result.add('}\n'); + result.add('}\n'); + return result.toString(); + } + + private function shouldSkipField(classField:ClassField, classType:ClassType):Bool { + if (classField.name != "new") { + if (!classField.isPublic + || classField.isExtern + || classField.meta.has(":noCompletion") + || DISALLOWED_AS3_NAMES.indexOf(classField.name) != -1) { + return true; + } + } + + if (classType != null && classType.isInterface) { + if (classField.kind.equals(FieldKind.FMethod(MethNormal)) && eregAccessor.match(classField.name)) { + return true; + } + } + return false; + } + + private function canSkipMacroTypeImport(type:Type, currentPackage:Array):Bool { + var baseType:BaseType = null; + while (type != null) { + switch (type) { + case TInst(t, params): + var classType = t.get(); + switch (classType.kind) { + case KTypeParameter(constraints): + return true; + default: + } + baseType = classType; + break; + case TEnum(t, params): + baseType = t.get(); + break; + case TAbstract(t, params): + var abstractType = t.get(); + return canSkipAbstractTypeImport(abstractType, params, currentPackage); + case TType(t, params): + var typedefType = t.get(); + type = typedefType.type; + case TDynamic(t): + break; + case TAnonymous(a): + break; + case TFun(args, ret): + break; + case TLazy(f): + type = f(); + case TMono(t): + type = t.get(); + default: + break; + } + } + if (baseType == null) { + return true; + } + return canSkipBaseTypeImport(baseType, currentPackage); + } + + private function canSkipAbstractTypeImport(abstractType:AbstractType, params:Array, currentPackage:Array):Bool { + var pack = abstractType.pack; + if (abstractType.name == "Null" && pack.length == 0) { + return canSkipMacroTypeImport(params[0], currentPackage); + } + var underlyingType = abstractType.type; + switch (underlyingType) { + case TAbstract(t, params): + var result = baseTypeToQname(abstractType, params); + var compareTo = baseTypeToQname(t.get(), params); + if (result == compareTo) { + // this avoids an infinite loop + return canSkipBaseTypeImport(abstractType, currentPackage); + } + default: + } + return canSkipMacroTypeImport(underlyingType, currentPackage); + } + + private function canSkipBaseTypeImport(baseType:BaseType, currentPackage:Array):Bool { + if (baseType == null) { + return true; + } + var qname = baseTypeToQname(baseType, []); + if (qname.indexOf(".") == -1) { + return true; + } + if (isInPackage(currentPackage, baseType.pack, true)) { + return true; + } + return false; + } + + private function macroTypeToQname(type:Type, includeParams:Bool = true):String { + while (type != null) { + switch (type) { + case TInst(t, params): + var classType = t.get(); + switch (classType.kind) { + case KTypeParameter(constraints): + return "*"; + default: + } + return baseTypeToQname(classType, includeParams ? params : []); + case TEnum(t, params): + return baseTypeToQname(t.get(), includeParams ? params : []); + case TAbstract(t, params): + return abstractTypeToQname(t.get(), params); + case TType(t, params): + var defType = t.get(); + if (options != null && options.renameSymbols != null) { + var buffer = new StringBuf(); + if (defType.pack.length > 0) { + buffer.add(defType.pack.join(".")); + buffer.add("."); + } + buffer.add(defType.name); + var qname = buffer.toString(); + var renameSymbols = options.renameSymbols; + var i = 0; + while (i < renameSymbols.length) { + var originalName = renameSymbols[i]; + i++; + var newName = renameSymbols[i]; + i++; + if (originalName == qname) { + return newName; + } + } + } + type = t.get().type; + case TDynamic(t): + return "*"; + case TAnonymous(a): + return "Object"; + case TFun(args, ret): + return "Function"; + case TLazy(f): + type = f(); + case TMono(t): + type = t.get(); + default: + return "*"; + } + } + return "*"; + } + + private function baseTypeToUnqualifiedName(baseType:BaseType):String { + var qname = baseTypeToQname(baseType, []); + var index = qname.lastIndexOf("."); + if (index != -1) { + return qname.substr(index + 1); + } + return qname; + } + + private function baseTypeToQname(baseType:BaseType, params:Array):String { + if (baseType == null) { + return "*"; + } + var buffer = new StringBuf(); + if (baseType.pack.length > 0) { + buffer.add(baseType.pack.join(".")); + buffer.add("."); + } + buffer.add(baseType.name); + var qname = buffer.toString(); + if (options != null && options.renameSymbols != null) { + var renameSymbols = options.renameSymbols; + var i = 0; + while (i < renameSymbols.length) { + var originalName = renameSymbols[i]; + i++; + var newName = renameSymbols[i]; + i++; + if (originalName == qname) { + return newName; + } + } + } + + // ignore type params in AS3 + + // remap some types + return rewriteQname(qname); + } + + private function baseTypeToUnqualifiedNname(baseType:BaseType, params:Array):String { + if (baseType == null) { + return "*"; + } + var buffer = new StringBuf(); + if (baseType.pack.length > 0) { + buffer.add(baseType.pack.join(".")); + buffer.add("."); + } + buffer.add(baseType.name); + var qname = buffer.toString(); + if (options != null && options.renameSymbols != null) { + var renameSymbols = options.renameSymbols; + var i = 0; + while (i < renameSymbols.length) { + var originalName = renameSymbols[i]; + i++; + var newName = renameSymbols[i]; + i++; + if (originalName == qname) { + return newName; + } + } + } + // ignore type params in AS3 + return rewriteQname(qname); + } + + private function abstractTypeToQname(abstractType:AbstractType, params:Array):String { + var pack = abstractType.pack; + if (abstractType.name == "Null" && pack.length == 0) { + var result = macroTypeToQname(params[0]); + if (NON_NULLABLE_AS3_TYPES.indexOf(result) != -1) { + // the following types can't be simplified by removing Null<> + // so return Object instead: + // Null, Null, Null, Null + return "Object"; + } + return result; + } + if (abstractType.name == "Function" && abstractType.pack.length == 1 && abstractType.pack[0] == "haxe") { + return "Function"; + } + var underlyingType = abstractType.type; + switch (underlyingType) { + case TAbstract(t, params): + var result = baseTypeToQname(abstractType, params); + var compareTo = baseTypeToQname(t.get(), params); + if (result == compareTo) { + // this avoids an infinite loop + return result; + } + default: + } + return macroTypeToQname(underlyingType); + } + + private function writeGenerated(outputDirPath:String, baseType:BaseType, generated:String):Void { + var outputFilePath = getFileOutputPath(outputDirPath, baseType); + FileSystem.createDirectory(Path.directory(outputFilePath)); + var fileOutput = File.write(outputFilePath); + fileOutput.writeString(generated); + fileOutput.close(); + } + + private function getFileOutputPath(dirPath:String, baseType:BaseType):String { + var qname = baseTypeToQname(baseType, []); + var relativePath = qname.split(".").join("/") + ".as"; + return Path.join([dirPath, relativePath]); + } + + /** + Haxe allows classes to implement methods from interfaces with more + specific types, but AS3 does not. This method finds the original types + from the interface that are required to match. + **/ + private function findInterfaceArgsAndRet(classField:ClassField, classType:ClassType, + argsAndRet:{args:Array<{name:String, opt:Bool, t:Type}>, ret:Type}):Void { + var currentClassType = classType; + while (currentClassType != null) { + for (currentInterface in currentClassType.interfaces) { + for (interfaceField in currentInterface.t.get().fields.get()) { + if (interfaceField.name == classField.name) { + switch (interfaceField.kind) { + case FMethod(k): + switch (interfaceField.type) { + case TFun(interfaceArgs, interfaceRet): + argsAndRet.args = interfaceArgs; + argsAndRet.ret = interfaceRet; + return; + default: + } + case FVar(read, write): + argsAndRet.ret = interfaceField.type; + default: + } + } + } + } + + if (currentClassType.superClass != null) { + currentClassType = currentClassType.superClass.t.get(); + } else { + currentClassType = null; + } + } + } +} + +typedef GeneratorOptions = { + /** + Externs will be generated for symbols in the specified packages only, + and no externs will be generated for symbols in other packages. + + Types from other packages may still be referenced by fields or method + signatures. Use `allowedPackageReferences` to restrict those too. + **/ + ?includedPackages:Array, + + /** + When `includedPackages` is not empty, `allowedPackageReferences` may + be used to allow types from other packages to be used for field types, + method parameter types, and method return types. Otherwise, the types + will be replaced with AS3's `*` type. + + All package references are allowed by default. If in doubt, pass an + empty array to restrict all types that don't appear in + `includedPackages`. + **/ + ?allowedPackageReferences:Array, + + /** + Gives specific symbols new names. Alternates between the original symbol + name and its new name. + **/ + ?renameSymbols:Array, + + /** + Optionally exclude specific symbols. + **/ + ?excludeSymbols:Array, + + /** + The target directory where externs files will be generated. + **/ + ?outputPath:String +} diff --git a/scripts/build.hxml b/scripts/build.hxml index 3131377f..e42e47b8 100644 --- a/scripts/build.hxml +++ b/scripts/build.hxml @@ -14,5 +14,6 @@ -D openfl -D commonjs --remap flash:openfl +--macro AS3ExternsGenerator.generate({outputPath: "../lib", includedPackages: ["starling"], allowedPackageReferences: ["openfl"], renameSymbols: ["openfl.VectorData", "openfl.Vector", "openfl.utils.ByteArrayData", "openfl.utils.ByteArray"]}) --no-inline -dce no \ No newline at end of file