diff --git a/bin/flash/.files b/bin/flash/.files index 765bf98..4220bcb 100644 --- a/bin/flash/.files +++ b/bin/flash/.files @@ -1,2 +1,5 @@ -bin/flash/bin/assets/fonts/Montserrat/MontserratSemiBold600.ttf +bin/flash/bin/assets/fonts/Montserrat/MontserratLight300.ttf +bin/flash/bin/assets/fonts/Montserrat/MontserratRegular400.ttf +bin/flash/bin/assets/fonts/Montserrat/MontserratMedium500.ttf +bin/flash/bin/assets/fonts/Montserrat/MontserratBold700.ttf bin/flash/bin/manifest/default.json \ No newline at end of file diff --git a/bin/flash/bin/LPTCManager2026.swf b/bin/flash/bin/LPTCManager2026.swf index 9585c98..7f9184c 100644 Binary files a/bin/flash/bin/LPTCManager2026.swf and b/bin/flash/bin/LPTCManager2026.swf differ diff --git a/bin/flash/haxe/ApplicationMain.hx b/bin/flash/haxe/ApplicationMain.hx index 2d025d8..4992fb4 100644 --- a/bin/flash/haxe/ApplicationMain.hx +++ b/bin/flash/haxe/ApplicationMain.hx @@ -35,7 +35,7 @@ class ApplicationMain ManifestResources.init(config); #end - app.meta["build"] = "5"; + app.meta["build"] = "6"; app.meta["company"] = "Nekotoro"; app.meta["file"] = "LPTCManager2026"; app.meta["name"] = "LPTCManager2026"; diff --git a/bin/flash/haxe/ManifestResources.hx b/bin/flash/haxe/ManifestResources.hx index 10f9901..1e245ce 100644 --- a/bin/flash/haxe/ManifestResources.hx +++ b/bin/flash/haxe/ManifestResources.hx @@ -68,13 +68,16 @@ import sys.FileSystem; } #if (openfl && !flash && !display) - openfl.text.Font.registerFont (__ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf); + openfl.text.Font.registerFont (__ASSET__OPENFL__assets_fonts_montserrat_montserratlight300_ttf); + openfl.text.Font.registerFont (__ASSET__OPENFL__assets_fonts_montserrat_montserratregular400_ttf); + openfl.text.Font.registerFont (__ASSET__OPENFL__assets_fonts_montserrat_montserratmedium500_ttf); + openfl.text.Font.registerFont (__ASSET__OPENFL__assets_fonts_montserrat_montserratbold700_ttf); #end var data, manifest, library, bundle; - data = '{"name":null,"assets":"aoy4:sizei260936y4:typey4:FONTy9:classNamey58:__ASSET__assets_fonts_montserrat_montserratsemibold600_ttfy2:idy21:MontserratSemiBold600gh","rootPath":null,"version":2,"libraryArgs":[],"libraryType":null}'; + data = '{"name":null,"assets":"aoy4:sizei259416y4:typey4:FONTy9:classNamey55:__ASSET__assets_fonts_montserrat_montserratlight300_ttfy2:idy18:MontserratLight300goR0i263192R1R2R3y57:__ASSET__assets_fonts_montserrat_montserratregular400_ttfR5y20:MontserratRegular400goR0i260236R1R2R3y56:__ASSET__assets_fonts_montserrat_montserratmedium500_ttfR5y19:MontserratMedium500goR0i261588R1R2R3y54:__ASSET__assets_fonts_montserrat_montserratbold700_ttfR5y17:MontserratBold700gh","rootPath":null,"version":2,"libraryArgs":[],"libraryType":null}'; manifest = AssetManifest.parse (data, rootPath); library = AssetLibrary.fromManifest (manifest); Assets.registerLibrary ("default", library); @@ -93,20 +96,29 @@ import sys.FileSystem; #if !display #if flash -@:keep @:bind @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratsemibold600_ttf extends flash.text.Font { } +@:keep @:bind @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratlight300_ttf extends flash.text.Font { } +@:keep @:bind @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratregular400_ttf extends flash.text.Font { } +@:keep @:bind @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratmedium500_ttf extends flash.text.Font { } +@:keep @:bind @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratbold700_ttf extends flash.text.Font { } @:keep @:bind @:noCompletion #if display private #end class __ASSET__manifest_default_json extends flash.utils.ByteArray { } #elseif (desktop || cpp) -@:keep @:font("assets/fonts/Montserrat/MontserratSemiBold600.ttf") @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratsemibold600_ttf extends lime.text.Font {} +@:keep @:font("assets/fonts/Montserrat/MontserratLight300.ttf") @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratlight300_ttf extends lime.text.Font {} +@:keep @:font("assets/fonts/Montserrat/MontserratRegular400.ttf") @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratregular400_ttf extends lime.text.Font {} +@:keep @:font("assets/fonts/Montserrat/MontserratMedium500.ttf") @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratmedium500_ttf extends lime.text.Font {} +@:keep @:font("assets/fonts/Montserrat/MontserratBold700.ttf") @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratbold700_ttf extends lime.text.Font {} @:keep @:file("") @:noCompletion #if display private #end class __ASSET__manifest_default_json extends haxe.io.Bytes {} #else -@:keep @:expose('__ASSET__assets_fonts_montserrat_montserratsemibold600_ttf') @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratsemibold600_ttf extends lime.text.Font { public function new () { #if !html5 __fontPath = "assets/fonts/Montserrat/MontserratSemiBold600.ttf"; #else ascender = null; descender = null; height = null; numGlyphs = null; underlinePosition = null; underlineThickness = null; unitsPerEM = null; #end name = "Montserrat SemiBold"; super (); }} +@:keep @:expose('__ASSET__assets_fonts_montserrat_montserratlight300_ttf') @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratlight300_ttf extends lime.text.Font { public function new () { #if !html5 __fontPath = "assets/fonts/Montserrat/MontserratLight300.ttf"; #else ascender = null; descender = null; height = null; numGlyphs = null; underlinePosition = null; underlineThickness = null; unitsPerEM = null; #end name = "Montserrat Light"; super (); }} +@:keep @:expose('__ASSET__assets_fonts_montserrat_montserratregular400_ttf') @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratregular400_ttf extends lime.text.Font { public function new () { #if !html5 __fontPath = "assets/fonts/Montserrat/MontserratRegular400.ttf"; #else ascender = null; descender = null; height = null; numGlyphs = null; underlinePosition = null; underlineThickness = null; unitsPerEM = null; #end name = "Montserrat Regular"; super (); }} +@:keep @:expose('__ASSET__assets_fonts_montserrat_montserratmedium500_ttf') @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratmedium500_ttf extends lime.text.Font { public function new () { #if !html5 __fontPath = "assets/fonts/Montserrat/MontserratMedium500.ttf"; #else ascender = null; descender = null; height = null; numGlyphs = null; underlinePosition = null; underlineThickness = null; unitsPerEM = null; #end name = "Montserrat Medium"; super (); }} +@:keep @:expose('__ASSET__assets_fonts_montserrat_montserratbold700_ttf') @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratbold700_ttf extends lime.text.Font { public function new () { #if !html5 __fontPath = "assets/fonts/Montserrat/MontserratBold700.ttf"; #else ascender = null; descender = null; height = null; numGlyphs = null; underlinePosition = null; underlineThickness = null; unitsPerEM = null; #end name = "Montserrat Bold"; super (); }} #end @@ -114,10 +126,16 @@ import sys.FileSystem; #if (openfl && !flash) #if html5 -@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratsemibold600_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratlight300_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratlight300_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratlight300_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratregular400_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratregular400_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratregular400_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratmedium500_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratmedium500_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratmedium500_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratbold700_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratbold700_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratbold700_ttf ()); super (); }} #else -@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratsemibold600_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratlight300_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratlight300_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratlight300_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratregular400_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratregular400_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratregular400_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratmedium500_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratmedium500_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratmedium500_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratbold700_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratbold700_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratbold700_ttf ()); super (); }} #end diff --git a/bin/flash/haxe/debug.hxml b/bin/flash/haxe/debug.hxml index d6cf101..9344405 100644 --- a/bin/flash/haxe/debug.hxml +++ b/bin/flash/haxe/debug.hxml @@ -1,24 +1,25 @@ -main ApplicationMain --macro lime._internal.macros.DefineMacro.run() --cp /home/chatmurai/haxelib/lime/8,2,3/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/lime/8,2,3/src -D lime=8.2.3 --cp /home/chatmurai/haxelib/feathersui-cairngorm/1,0,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui-cairngorm/1,0,0/src -D feathersui-cairngorm=1.0.0 --cp /home/chatmurai/haxelib/feathersui/1,3,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui/1,3,0/src -D feathersui=1.3.0 --cp /home/chatmurai/haxelib/actuate/1,9,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/actuate/1,9,0/src -D actuate=1.9.0 --cp /home/chatmurai/haxelib/hxargs/4,0,0 +-cp /Users/chatmurai/Documents/code/Haxe/lib/hxargs/4,0,0 -D hxargs=4.0.0 --macro openfl.utils._internal.ExtraParamsMacro.include() --cp /home/chatmurai/haxelib/openfl/9,4,2/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/openfl/9,4,2/src -D openfl=9.4.2 --cp /home/chatmurai/haxelib/feathersui-rpc-services/1,0,3/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui-rpc-services/1,0,3/src -D feathersui-rpc-services=1.0.3 --cp /home/chatmurai/haxelib/amfio/1,0,2/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/amfio/1,0,2/src -D amfio=1.0.2 -cp src --cp /home/chatmurai/haxelib/openfl/9,4,2/lib/flash-externs/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/openfl/9,4,2/lib/flash-externs/src +-D AIR_SDK=/Users/chatmurai/Documents/code/AS3/SDKs/AIR_SDK_32.0 -D native-trace -D tools=8.2.3 -D flash-use-stage diff --git a/bin/flash/haxe/final.hxml b/bin/flash/haxe/final.hxml index a8af12f..af20bec 100644 --- a/bin/flash/haxe/final.hxml +++ b/bin/flash/haxe/final.hxml @@ -1,24 +1,25 @@ -main ApplicationMain --macro lime._internal.macros.DefineMacro.run() --cp /home/chatmurai/haxelib/lime/8,2,3/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/lime/8,2,3/src -D lime=8.2.3 --cp /home/chatmurai/haxelib/feathersui-cairngorm/1,0,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui-cairngorm/1,0,0/src -D feathersui-cairngorm=1.0.0 --cp /home/chatmurai/haxelib/feathersui/1,3,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui/1,3,0/src -D feathersui=1.3.0 --cp /home/chatmurai/haxelib/actuate/1,9,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/actuate/1,9,0/src -D actuate=1.9.0 --cp /home/chatmurai/haxelib/hxargs/4,0,0 +-cp /Users/chatmurai/Documents/code/Haxe/lib/hxargs/4,0,0 -D hxargs=4.0.0 --macro openfl.utils._internal.ExtraParamsMacro.include() --cp /home/chatmurai/haxelib/openfl/9,4,2/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/openfl/9,4,2/src -D openfl=9.4.2 --cp /home/chatmurai/haxelib/feathersui-rpc-services/1,0,3/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui-rpc-services/1,0,3/src -D feathersui-rpc-services=1.0.3 --cp /home/chatmurai/haxelib/amfio/1,0,2/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/amfio/1,0,2/src -D amfio=1.0.2 -cp src --cp /home/chatmurai/haxelib/openfl/9,4,2/lib/flash-externs/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/openfl/9,4,2/lib/flash-externs/src +-D AIR_SDK=/Users/chatmurai/Documents/code/AS3/SDKs/AIR_SDK_32.0 -D native-trace -D tools=8.2.3 -D flash-use-stage diff --git a/bin/flash/haxe/release.hxml b/bin/flash/haxe/release.hxml index 2dd9c69..4537c2c 100644 --- a/bin/flash/haxe/release.hxml +++ b/bin/flash/haxe/release.hxml @@ -1,24 +1,25 @@ -main ApplicationMain --macro lime._internal.macros.DefineMacro.run() --cp /home/chatmurai/haxelib/lime/8,2,3/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/lime/8,2,3/src -D lime=8.2.3 --cp /home/chatmurai/haxelib/feathersui-cairngorm/1,0,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui-cairngorm/1,0,0/src -D feathersui-cairngorm=1.0.0 --cp /home/chatmurai/haxelib/feathersui/1,3,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui/1,3,0/src -D feathersui=1.3.0 --cp /home/chatmurai/haxelib/actuate/1,9,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/actuate/1,9,0/src -D actuate=1.9.0 --cp /home/chatmurai/haxelib/hxargs/4,0,0 +-cp /Users/chatmurai/Documents/code/Haxe/lib/hxargs/4,0,0 -D hxargs=4.0.0 --macro openfl.utils._internal.ExtraParamsMacro.include() --cp /home/chatmurai/haxelib/openfl/9,4,2/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/openfl/9,4,2/src -D openfl=9.4.2 --cp /home/chatmurai/haxelib/feathersui-rpc-services/1,0,3/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui-rpc-services/1,0,3/src -D feathersui-rpc-services=1.0.3 --cp /home/chatmurai/haxelib/amfio/1,0,2/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/amfio/1,0,2/src -D amfio=1.0.2 -cp src --cp /home/chatmurai/haxelib/openfl/9,4,2/lib/flash-externs/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/openfl/9,4,2/lib/flash-externs/src +-D AIR_SDK=/Users/chatmurai/Documents/code/AS3/SDKs/AIR_SDK_32.0 -D native-trace -D tools=8.2.3 -D flash-use-stage diff --git a/bin/flash/obj/assets.swf b/bin/flash/obj/assets.swf index aed8e10..c4b9b0d 100644 Binary files a/bin/flash/obj/assets.swf and b/bin/flash/obj/assets.swf differ diff --git a/bin/html5/.files b/bin/html5/.files index 34cbb9a..af86537 100644 --- a/bin/html5/.files +++ b/bin/html5/.files @@ -1,2 +1,5 @@ -bin/html5/bin/assets/fonts/Montserrat/MontserratSemiBold600 +bin/html5/bin/assets/fonts/Montserrat/MontserratLight300 +bin/html5/bin/assets/fonts/Montserrat/MontserratRegular400 +bin/html5/bin/assets/fonts/Montserrat/MontserratMedium500 +bin/html5/bin/assets/fonts/Montserrat/MontserratBold700 bin/html5/bin/manifest/default.json \ No newline at end of file diff --git a/bin/html5/bin/LPTCManager2026.js b/bin/html5/bin/LPTCManager2026.js new file mode 100644 index 0000000..65a33a0 --- /dev/null +++ b/bin/html5/bin/LPTCManager2026.js @@ -0,0 +1,102569 @@ +var $lime_init = (function ($hx_exports, $global) { "use strict"; var $hx_script = (function (exports, global) { // Generated by Haxe 4.3.7 +(function ($hx_exports, $global) { "use strict"; +$hx_exports["lime"] = $hx_exports["lime"] || {}; +var $hxClasses = {},$estr = function() { return js_Boot.__string_rec(this,''); },$hxEnums = $hxEnums || {},$_; +function $extend(from, fields) { + var proto = Object.create(from); + for (var name in fields) proto[name] = fields[name]; + if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString; + return proto; +} +var lime_app_IModule = function() { }; +$hxClasses["lime.app.IModule"] = lime_app_IModule; +lime_app_IModule.__name__ = "lime.app.IModule"; +lime_app_IModule.__isInterface__ = true; +lime_app_IModule.prototype = { + __class__: lime_app_IModule +}; +var lime_app_Module = function() { + this.onExit = new lime_app__$Event_$Int_$Void(); +}; +$hxClasses["lime.app.Module"] = lime_app_Module; +lime_app_Module.__name__ = "lime.app.Module"; +lime_app_Module.__interfaces__ = [lime_app_IModule]; +lime_app_Module.prototype = { + __registerLimeModule: function(application) { + } + ,__unregisterLimeModule: function(application) { + } + ,__class__: lime_app_Module +}; +var lime__$internal_backend_html5_HTML5Application = function(parent) { + this.gameDeviceCache = new haxe_ds_IntMap(); + this.parent = parent; + this.currentUpdate = 0; + this.lastUpdate = 0; + this.nextUpdate = 0; + this.framePeriod = -1; + lime_media_AudioManager.init(); + this.accelerometer = lime_system_Sensor.registerSensor(lime_system_SensorType.ACCELEROMETER,0); +}; +$hxClasses["lime._internal.backend.html5.HTML5Application"] = lime__$internal_backend_html5_HTML5Application; +lime__$internal_backend_html5_HTML5Application.__name__ = "lime._internal.backend.html5.HTML5Application"; +lime__$internal_backend_html5_HTML5Application.prototype = { + convertKeyCode: function(keyCode) { + if(keyCode >= 65 && keyCode <= 90) { + return keyCode + 32; + } + switch(keyCode) { + case 12: + return 1073741980; + case 16: + return 1073742049; + case 17: + return 1073742048; + case 18: + return 1073742050; + case 19: + return 1073741896; + case 20: + return 1073741881; + case 33: + return 1073741899; + case 34: + return 1073741902; + case 35: + return 1073741901; + case 36: + return 1073741898; + case 37: + return 1073741904; + case 38: + return 1073741906; + case 39: + return 1073741903; + case 40: + return 1073741905; + case 41: + return 1073741943; + case 43: + return 1073741940; + case 44: + return 1073741894; + case 45: + return 1073741897; + case 46: + return 127; + case 91: + return 1073742051; + case 92: + return 1073742055; + case 93: + return 1073742055; + case 95: + return 1073742106; + case 96: + return 1073741922; + case 97: + return 1073741913; + case 98: + return 1073741914; + case 99: + return 1073741915; + case 100: + return 1073741916; + case 101: + return 1073741917; + case 102: + return 1073741918; + case 103: + return 1073741919; + case 104: + return 1073741920; + case 105: + return 1073741921; + case 106: + return 1073741909; + case 107: + return 1073741911; + case 108: + return 1073741923; + case 109: + return 1073741910; + case 110: + return 1073741923; + case 111: + return 1073741908; + case 112: + return 1073741882; + case 113: + return 1073741883; + case 114: + return 1073741884; + case 115: + return 1073741885; + case 116: + return 1073741886; + case 117: + return 1073741887; + case 118: + return 1073741888; + case 119: + return 1073741889; + case 120: + return 1073741890; + case 121: + return 1073741891; + case 122: + return 1073741892; + case 123: + return 1073741893; + case 124: + return 1073741928; + case 125: + return 1073741929; + case 126: + return 1073741930; + case 127: + return 1073741931; + case 128: + return 1073741932; + case 129: + return 1073741933; + case 130: + return 1073741934; + case 131: + return 1073741935; + case 132: + return 1073741936; + case 133: + return 1073741937; + case 134: + return 1073741938; + case 135: + return 1073741939; + case 144: + return 1073741907; + case 145: + return 1073741895; + case 160: + return 94; + case 161: + return 33; + case 163: + return 35; + case 164: + return 36; + case 166: + return 1073742094; + case 167: + return 1073742095; + case 168: + return 1073742097; + case 169: + return 41; + case 170: + return 42; + case 171: + return 96; + case 172: + return 1073741898; + case 173: + return 45; + case 174: + return 1073741953; + case 175: + return 1073741952; + case 176: + return 1073742082; + case 177: + return 1073742083; + case 178: + return 1073742084; + case 179: + return 1073742085; + case 180: + return 1073742089; + case 181: + return 1073742086; + case 182: + return 1073741953; + case 183: + return 1073741952; + case 186: + return 59; + case 187: + return 61; + case 188: + return 44; + case 189: + return 45; + case 190: + return 46; + case 191: + return 47; + case 192: + return 96; + case 193: + return 63; + case 194: + return 1073741923; + case 219: + return 91; + case 220: + return 92; + case 221: + return 93; + case 222: + return 39; + case 223: + return 96; + case 224: + return 1073742051; + case 226: + return 92; + } + return keyCode; + } + ,exec: function() { + window.addEventListener("keydown",$bind(this,this.handleKeyEvent),false); + window.addEventListener("keyup",$bind(this,this.handleKeyEvent),false); + window.addEventListener("focus",$bind(this,this.handleWindowEvent),false); + window.addEventListener("blur",$bind(this,this.handleWindowEvent),false); + window.addEventListener("resize",$bind(this,this.handleWindowEvent),false); + window.addEventListener("beforeunload",$bind(this,this.handleWindowEvent),false); + var o = window; + if(Object.prototype.hasOwnProperty.call(o,"Accelerometer")) { + window.addEventListener("devicemotion",$bind(this,this.handleSensorEvent),false); + } + + if (!CanvasRenderingContext2D.prototype.isPointInStroke) { + CanvasRenderingContext2D.prototype.isPointInStroke = function (path, x, y) { + return false; + }; + } + if (!CanvasRenderingContext2D.prototype.isPointInPath) { + CanvasRenderingContext2D.prototype.isPointInPath = function (path, x, y) { + return false; + }; + } + + if ('performance' in window == false) { + window.performance = {}; + } + + if ('now' in window.performance == false) { + var offset = Date.now(); + if (performance.timing && performance.timing.navigationStart) { + offset = performance.timing.navigationStart + } + window.performance.now = function now() { + return Date.now() - offset; + } + } + + var lastTime = 0; + var vendors = ['ms', 'moz', 'webkit', 'o']; + for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { + window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; + window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; + } + + if (!window.requestAnimationFrame) + window.requestAnimationFrame = function(callback, element) { + var currTime = window.performance.now(); + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); + var id = window.setTimeout(function() { callback(currTime + timeToCall); }, + timeToCall); + lastTime = currTime + timeToCall; + return id; + }; + + if (!window.cancelAnimationFrame) + window.cancelAnimationFrame = function(id) { + clearTimeout(id); + }; + + window.requestAnimFrame = window.requestAnimationFrame; + ; + this.lastUpdate = window.performance.now(); + this.handleApplicationEvent(); + return 0; + } + ,exit: function() { + } + ,handleApplicationEvent: function(__) { + var _g = 0; + var _g1 = this.parent.__windows; + while(_g < _g1.length) { + var $window = _g1[_g]; + ++_g; + $window.__backend.updateSize(); + } + this.updateGameDevices(); + this.currentUpdate = window.performance.now(); + if(this.currentUpdate >= this.nextUpdate) { + this.deltaTime = this.currentUpdate - this.lastUpdate; + var _g = 0; + var _g1 = this.parent.__windows; + while(_g < _g1.length) { + var $window = _g1[_g]; + ++_g; + this.parent.onUpdate.dispatch(this.deltaTime | 0); + if($window.context != null) { + $window.onRender.dispatch($window.context); + } + } + if(this.framePeriod < 0) { + this.nextUpdate = this.currentUpdate; + } else { + this.nextUpdate = this.currentUpdate - this.currentUpdate % this.framePeriod + this.framePeriod; + } + this.lastUpdate = this.currentUpdate; + } + window.requestAnimationFrame($bind(this,this.handleApplicationEvent)); + } + ,handleKeyEvent: function(event) { + if(this.parent.__window != null) { + var keyCode = this.convertKeyCode(event.keyCode != null ? event.keyCode : event.which); + var modifier = (event.shiftKey ? 3 : 0) | (event.ctrlKey ? 192 : 0) | (event.altKey ? 768 : 0) | (event.metaKey ? 3072 : 0); + if(event.type == "keydown") { + this.parent.__window.onKeyDown.dispatch(keyCode,modifier); + if(this.parent.__window.onKeyDown.canceled && event.cancelable) { + event.preventDefault(); + } + } else { + this.parent.__window.onKeyUp.dispatch(keyCode,modifier); + if(this.parent.__window.onKeyUp.canceled && event.cancelable) { + event.preventDefault(); + } + } + } + } + ,handleSensorEvent: function(event) { + this.accelerometer.onUpdate.dispatch(event.accelerationIncludingGravity.x,event.accelerationIncludingGravity.y,event.accelerationIncludingGravity.z); + } + ,handleWindowEvent: function(event) { + if(this.parent.__window != null) { + switch(event.type) { + case "beforeunload": + break; + case "blur": + if(!this.hidden) { + this.parent.__window.onFocusOut.dispatch(); + this.parent.__window.onDeactivate.dispatch(); + this.hidden = true; + } + break; + case "focus": + if(this.hidden) { + this.parent.__window.onFocusIn.dispatch(); + this.parent.__window.onActivate.dispatch(); + this.hidden = false; + } + break; + case "resize": + this.parent.__window.__backend.handleResizeEvent(event); + break; + case "visibilitychange": + if(window.document.hidden) { + if(!this.hidden) { + this.parent.__window.onFocusOut.dispatch(); + this.parent.__window.onDeactivate.dispatch(); + this.hidden = true; + } + } else if(this.hidden) { + this.parent.__window.onFocusIn.dispatch(); + this.parent.__window.onActivate.dispatch(); + this.hidden = false; + } + break; + } + } + } + ,updateGameDevices: function() { + var devices = lime_ui_Joystick.__getDeviceData(); + if(devices == null) { + return; + } + var id; + var gamepad; + var joystick; + var data; + var cache; + var _g = 0; + var _g1 = devices.length; + while(_g < _g1) { + var i = _g++; + id = i; + data = devices[id]; + if(data == null) { + continue; + } + if(!this.gameDeviceCache.h.hasOwnProperty(id)) { + cache = new lime__$internal_backend_html5_GameDeviceData(); + cache.id = id; + cache.connected = data.connected; + var _g2 = 0; + var _g3 = data.buttons.length; + while(_g2 < _g3) { + var i1 = _g2++; + cache.buttons.push(data.buttons[i1].value); + } + var _g4 = 0; + var _g5 = data.axes.length; + while(_g4 < _g5) { + var i2 = _g4++; + cache.axes.push(data.axes[i2]); + } + if(data.mapping == "standard") { + cache.isGamepad = true; + } + this.gameDeviceCache.h[id] = cache; + if(data.connected) { + lime_ui_Joystick.__connect(id); + if(cache.isGamepad) { + lime_ui_Gamepad.__connect(id); + } + } + } + cache = this.gameDeviceCache.h[id]; + joystick = lime_ui_Joystick.devices.h[id]; + gamepad = lime_ui_Gamepad.devices.h[id]; + if(data.connected) { + var button; + var value; + var _g6 = 0; + var _g7 = data.buttons.length; + while(_g6 < _g7) { + var i3 = _g6++; + value = data.buttons[i3].value; + if(value != cache.buttons[i3]) { + if(i3 == 6) { + joystick.onAxisMove.dispatch(data.axes.length,value); + if(gamepad != null) { + gamepad.onAxisMove.dispatch(4,value); + } + } else if(i3 == 7) { + joystick.onAxisMove.dispatch(data.axes.length + 1,value); + if(gamepad != null) { + gamepad.onAxisMove.dispatch(5,value); + } + } else { + if(value > 0) { + joystick.onButtonDown.dispatch(i3); + } else { + joystick.onButtonUp.dispatch(i3); + } + if(gamepad != null) { + switch(i3) { + case 0: + button = 0; + break; + case 1: + button = 1; + break; + case 2: + button = 2; + break; + case 3: + button = 3; + break; + case 4: + button = 9; + break; + case 5: + button = 10; + break; + case 8: + button = 4; + break; + case 9: + button = 6; + break; + case 10: + button = 7; + break; + case 11: + button = 8; + break; + case 12: + button = 11; + break; + case 13: + button = 12; + break; + case 14: + button = 13; + break; + case 15: + button = 14; + break; + case 16: + button = 5; + break; + default: + continue; + } + if(value > 0) { + gamepad.onButtonDown.dispatch(button); + } else { + gamepad.onButtonUp.dispatch(button); + } + } + } + cache.buttons[i3] = value; + } + } + var _g8 = 0; + var _g9 = data.axes.length; + while(_g8 < _g9) { + var i4 = _g8++; + if(data.axes[i4] != cache.axes[i4]) { + joystick.onAxisMove.dispatch(i4,data.axes[i4]); + if(gamepad != null) { + gamepad.onAxisMove.dispatch(i4,data.axes[i4]); + } + cache.axes[i4] = data.axes[i4]; + } + } + } else if(cache.connected) { + cache.connected = false; + lime_ui_Joystick.__disconnect(id); + lime_ui_Gamepad.__disconnect(id); + } + } + } + ,__class__: lime__$internal_backend_html5_HTML5Application +}; +var lime_app_Application = function() { + this.onCreateWindow = new lime_app__$Event_$lime_$ui_$Window_$Void(); + this.onUpdate = new lime_app__$Event_$Int_$Void(); + lime_app_Module.call(this); + if(lime_app_Application.current == null) { + lime_app_Application.current = this; + } + this.meta = new haxe_ds_StringMap(); + this.modules = []; + this.__windowByID = new haxe_ds_IntMap(); + this.__windows = []; + this.__backend = new lime__$internal_backend_html5_HTML5Application(this); + this.__registerLimeModule(this); + this.__preloader = new lime_utils_Preloader(); + this.__preloader.onProgress.add($bind(this,this.onPreloadProgress)); + this.__preloader.onComplete.add($bind(this,this.onPreloadComplete)); +}; +$hxClasses["lime.app.Application"] = lime_app_Application; +lime_app_Application.__name__ = "lime.app.Application"; +lime_app_Application.__super__ = lime_app_Module; +lime_app_Application.prototype = $extend(lime_app_Module.prototype,{ + addModule: function(module) { + module.__registerLimeModule(this); + this.modules.push(module); + } + ,createWindow: function(attributes) { + var $window = this.__createWindow(attributes); + this.__addWindow($window); + return $window; + } + ,exec: function() { + lime_app_Application.current = this; + return this.__backend.exec(); + } + ,onGamepadAxisMove: function(gamepad,axis,value) { + } + ,onGamepadButtonDown: function(gamepad,button) { + } + ,onGamepadButtonUp: function(gamepad,button) { + } + ,onGamepadConnect: function(gamepad) { + } + ,onGamepadDisconnect: function(gamepad) { + } + ,onJoystickAxisMove: function(joystick,axis,value) { + } + ,onJoystickButtonDown: function(joystick,button) { + } + ,onJoystickButtonUp: function(joystick,button) { + } + ,onJoystickConnect: function(joystick) { + } + ,onJoystickDisconnect: function(joystick) { + } + ,onJoystickHatMove: function(joystick,hat,position) { + } + ,onKeyDown: function(keyCode,modifier) { + } + ,onKeyUp: function(keyCode,modifier) { + } + ,onModuleExit: function(code) { + } + ,onMouseDown: function(x,y,button) { + } + ,onMouseMove: function(x,y) { + } + ,onMouseMoveRelative: function(x,y) { + } + ,onMouseUp: function(x,y,button) { + } + ,onMouseWheel: function(deltaX,deltaY,deltaMode) { + } + ,onPreloadComplete: function() { + } + ,onPreloadProgress: function(loaded,total) { + } + ,onRenderContextLost: function() { + } + ,onRenderContextRestored: function(context) { + } + ,onTextEdit: function(text,start,length) { + } + ,onTextInput: function(text) { + } + ,onTouchCancel: function(touch) { + } + ,onTouchEnd: function(touch) { + } + ,onTouchMove: function(touch) { + } + ,onTouchStart: function(touch) { + } + ,onWindowActivate: function() { + } + ,onWindowClose: function() { + } + ,onWindowCreate: function() { + } + ,onWindowDeactivate: function() { + } + ,onWindowDropFile: function(file) { + } + ,onWindowEnter: function() { + } + ,onWindowExpose: function() { + } + ,onWindowFocusIn: function() { + } + ,onWindowFocusOut: function() { + } + ,onWindowFullscreen: function() { + } + ,onWindowLeave: function() { + } + ,onWindowMove: function(x,y) { + } + ,onWindowMinimize: function() { + } + ,onWindowResize: function(width,height) { + } + ,onWindowRestore: function() { + } + ,removeModule: function(module) { + if(module != null) { + module.__unregisterLimeModule(this); + HxOverrides.remove(this.modules,module); + } + } + ,render: function(context) { + } + ,update: function(deltaTime) { + } + ,__addWindow: function($window) { + if($window != null) { + this.__windows.push($window); + this.__windowByID.h[$window.id] = $window; + var _g = this; + var window1 = $window; + var tmp = function() { + _g.__onWindowClose(window1); + }; + $window.onClose.add(tmp,false,-10000); + if(this.__window == null) { + this.__window = $window; + $window.onActivate.add($bind(this,this.onWindowActivate)); + $window.onRenderContextLost.add($bind(this,this.onRenderContextLost)); + $window.onRenderContextRestored.add($bind(this,this.onRenderContextRestored)); + $window.onDeactivate.add($bind(this,this.onWindowDeactivate)); + $window.onDropFile.add($bind(this,this.onWindowDropFile)); + $window.onEnter.add($bind(this,this.onWindowEnter)); + $window.onExpose.add($bind(this,this.onWindowExpose)); + $window.onFocusIn.add($bind(this,this.onWindowFocusIn)); + $window.onFocusOut.add($bind(this,this.onWindowFocusOut)); + $window.onFullscreen.add($bind(this,this.onWindowFullscreen)); + $window.onKeyDown.add($bind(this,this.onKeyDown)); + $window.onKeyUp.add($bind(this,this.onKeyUp)); + $window.onLeave.add($bind(this,this.onWindowLeave)); + $window.onMinimize.add($bind(this,this.onWindowMinimize)); + $window.onMouseDown.add($bind(this,this.onMouseDown)); + $window.onMouseMove.add($bind(this,this.onMouseMove)); + $window.onMouseMoveRelative.add($bind(this,this.onMouseMoveRelative)); + $window.onMouseUp.add($bind(this,this.onMouseUp)); + $window.onMouseWheel.add($bind(this,this.onMouseWheel)); + $window.onMove.add($bind(this,this.onWindowMove)); + $window.onRender.add($bind(this,this.render)); + $window.onResize.add($bind(this,this.onWindowResize)); + $window.onRestore.add($bind(this,this.onWindowRestore)); + $window.onTextEdit.add($bind(this,this.onTextEdit)); + $window.onTextInput.add($bind(this,this.onTextInput)); + this.onWindowCreate(); + } + this.onCreateWindow.dispatch($window); + } + } + ,__createWindow: function(attributes) { + var $window = new lime_ui_Window(this,attributes); + if($window.id == -1) { + return null; + } + return $window; + } + ,__registerLimeModule: function(application) { + application.onUpdate.add($bind(this,this.update)); + application.onExit.add($bind(this,this.onModuleExit),false,0); + application.onExit.add($bind(this,this.__onModuleExit),false,-1000); + var gamepad = lime_ui_Gamepad.devices.iterator(); + while(gamepad.hasNext()) { + var gamepad1 = gamepad.next(); + this.__onGamepadConnect(gamepad1); + } + lime_ui_Gamepad.onConnect.add($bind(this,this.__onGamepadConnect)); + var joystick = lime_ui_Joystick.devices.iterator(); + while(joystick.hasNext()) { + var joystick1 = joystick.next(); + this.__onJoystickConnect(joystick1); + } + lime_ui_Joystick.onConnect.add($bind(this,this.__onJoystickConnect)); + lime_ui_Touch.onCancel.add($bind(this,this.onTouchCancel)); + lime_ui_Touch.onStart.add($bind(this,this.onTouchStart)); + lime_ui_Touch.onMove.add($bind(this,this.onTouchMove)); + lime_ui_Touch.onEnd.add($bind(this,this.onTouchEnd)); + } + ,__removeWindow: function($window) { + if($window != null && this.__windowByID.h.hasOwnProperty($window.id)) { + if(this.__window == $window) { + this.__window = null; + } + HxOverrides.remove(this.__windows,$window); + this.__windowByID.remove($window.id); + $window.close(); + this.__checkForAllWindowsClosed(); + } + } + ,__checkForAllWindowsClosed: function() { + if(this.__windows.length == 0) { + lime_system_System.exit(0); + } + } + ,__onGamepadConnect: function(gamepad) { + this.onGamepadConnect(gamepad); + var _g = this; + var gamepad1 = gamepad; + var tmp = function(axis,value) { + _g.onGamepadAxisMove(gamepad1,axis,value); + }; + gamepad.onAxisMove.add(tmp); + var _g1 = this; + var gamepad2 = gamepad; + var tmp = function(button) { + _g1.onGamepadButtonDown(gamepad2,button); + }; + gamepad.onButtonDown.add(tmp); + var _g2 = this; + var gamepad3 = gamepad; + var tmp = function(button) { + _g2.onGamepadButtonUp(gamepad3,button); + }; + gamepad.onButtonUp.add(tmp); + var _g3 = this; + var gamepad4 = gamepad; + var tmp = function() { + _g3.onGamepadDisconnect(gamepad4); + }; + gamepad.onDisconnect.add(tmp); + } + ,__onJoystickConnect: function(joystick) { + this.onJoystickConnect(joystick); + var _g = this; + var joystick1 = joystick; + var tmp = function(axis,value) { + _g.onJoystickAxisMove(joystick1,axis,value); + }; + joystick.onAxisMove.add(tmp); + var _g1 = this; + var joystick2 = joystick; + var tmp = function(button) { + _g1.onJoystickButtonDown(joystick2,button); + }; + joystick.onButtonDown.add(tmp); + var _g2 = this; + var joystick3 = joystick; + var tmp = function(button) { + _g2.onJoystickButtonUp(joystick3,button); + }; + joystick.onButtonUp.add(tmp); + var _g3 = this; + var joystick4 = joystick; + var tmp = function() { + _g3.onJoystickDisconnect(joystick4); + }; + joystick.onDisconnect.add(tmp); + var _g4 = this; + var joystick5 = joystick; + var tmp = function(hat,position) { + _g4.onJoystickHatMove(joystick5,hat,position); + }; + joystick.onHatMove.add(tmp); + } + ,__onModuleExit: function(code) { + if(this.onExit.canceled) { + return; + } + this.__unregisterLimeModule(this); + this.__backend.exit(); + if(lime_app_Application.current == this) { + lime_app_Application.current = null; + } + } + ,__onWindowClose: function($window) { + if(this.__window == $window) { + this.onWindowClose(); + } + this.__removeWindow($window); + } + ,__unregisterLimeModule: function(application) { + application.onUpdate.remove($bind(this,this.update)); + application.onExit.remove($bind(this,this.__onModuleExit)); + application.onExit.remove($bind(this,this.onModuleExit)); + lime_ui_Gamepad.onConnect.remove($bind(this,this.__onGamepadConnect)); + lime_ui_Joystick.onConnect.remove($bind(this,this.__onJoystickConnect)); + lime_ui_Touch.onCancel.remove($bind(this,this.onTouchCancel)); + lime_ui_Touch.onStart.remove($bind(this,this.onTouchStart)); + lime_ui_Touch.onMove.remove($bind(this,this.onTouchMove)); + lime_ui_Touch.onEnd.remove($bind(this,this.onTouchEnd)); + } + ,get_preloader: function() { + return this.__preloader; + } + ,get_window: function() { + return this.__window; + } + ,get_windows: function() { + return this.__windows; + } + ,__class__: lime_app_Application + ,__properties__: {get_windows:"get_windows",get_window:"get_window",get_preloader:"get_preloader"} +}); +var ApplicationMain = function() { }; +$hxClasses["ApplicationMain"] = ApplicationMain; +ApplicationMain.__name__ = "ApplicationMain"; +ApplicationMain.main = function() { + lime_system_System.__registerEntryPoint("LPTCManager2026",ApplicationMain.create); +}; +ApplicationMain.create = function(config) { + var app = new openfl_display_Application(); + ManifestResources.init(config); + app.meta.h["build"] = "6"; + app.meta.h["company"] = "Nekotoro"; + app.meta.h["file"] = "LPTCManager2026"; + app.meta.h["name"] = "lepetittrot.com - manager"; + app.meta.h["packageName"] = "com.nekotoro.LPTCManager2026"; + app.meta.h["version"] = "1.0.0"; + var attributes = { allowHighDPI : true, alwaysOnTop : false, borderless : false, element : null, frameRate : 0, height : 800, hidden : false, maximized : false, minimized : false, parameters : { }, resizable : true, title : "lepetittrot.com - manager", width : 500, x : null, y : null}; + attributes.context = { antialiasing : 0, background : 13156797, colorDepth : 32, depth : true, hardware : true, stencil : true, type : null, vsync : false}; + if(app.__window == null) { + if(config != null) { + var _g = 0; + var _g1 = Reflect.fields(config); + while(_g < _g1.length) { + var field = _g1[_g]; + ++_g; + if(Object.prototype.hasOwnProperty.call(attributes,field)) { + attributes[field] = Reflect.field(config,field); + } else if(Object.prototype.hasOwnProperty.call(attributes.context,field)) { + attributes.context[field] = Reflect.field(config,field); + } + } + } + } + app.createWindow(attributes); + var preloader = new openfl_display_Preloader(new openfl_display_DefaultPreloader()); + app.__preloader.onProgress.add(function(loaded,total) { + preloader.update(loaded,total); + }); + app.__preloader.onComplete.add(function() { + preloader.start(); + }); + var stage = app.__window.stage; + var tmp = function() { + ApplicationMain.start(stage); + }; + preloader.onComplete.add(tmp); + var _g = 0; + var _g1 = ManifestResources.preloadLibraries; + while(_g < _g1.length) { + var library = _g1[_g]; + ++_g; + app.__preloader.addLibrary(library); + } + var _g = 0; + var _g1 = ManifestResources.preloadLibraryNames; + while(_g < _g1.length) { + var name = _g1[_g]; + ++_g; + app.__preloader.addLibraryName(name); + } + app.__preloader.load(); + var result = app.exec(); +}; +ApplicationMain.start = function(stage) { + if(stage.__uncaughtErrorEvents.__enabled) { + try { + var current = stage.getChildAt(0); + if(current == null || !((current) instanceof openfl_display_DisplayObjectContainer)) { + current = new openfl_display_MovieClip(); + stage.addChild(current); + } + new DocumentClass(current); + stage.dispatchEvent(new openfl_events_Event("resize",false,false)); + if(stage.window.__fullscreen) { + stage.dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,true,true)); + } + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + stage.__handleError(e); + } + } else { + var current = stage.getChildAt(0); + if(current == null || !((current) instanceof openfl_display_DisplayObjectContainer)) { + current = new openfl_display_MovieClip(); + stage.addChild(current); + } + new DocumentClass(current); + stage.dispatchEvent(new openfl_events_Event("resize",false,false)); + if(stage.window.__fullscreen) { + stage.dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,true,true)); + } + } +}; +var openfl_events_IEventDispatcher = function() { }; +$hxClasses["openfl.events.IEventDispatcher"] = openfl_events_IEventDispatcher; +openfl_events_IEventDispatcher.__name__ = "openfl.events.IEventDispatcher"; +openfl_events_IEventDispatcher.__isInterface__ = true; +openfl_events_IEventDispatcher.prototype = { + __class__: openfl_events_IEventDispatcher +}; +var openfl_events_EventDispatcher = function(target) { + if(target != null) { + this.__targetDispatcher = target; + } +}; +$hxClasses["openfl.events.EventDispatcher"] = openfl_events_EventDispatcher; +openfl_events_EventDispatcher.__name__ = "openfl.events.EventDispatcher"; +openfl_events_EventDispatcher.__interfaces__ = [openfl_events_IEventDispatcher]; +openfl_events_EventDispatcher.prototype = { + addEventListener: function(type,listener,useCapture,priority,useWeakReference) { + if(useWeakReference == null) { + useWeakReference = false; + } + if(priority == null) { + priority = 0; + } + if(useCapture == null) { + useCapture = false; + } + if(listener == null) { + return; + } + if(this.__eventMap == null) { + this.__eventMap = new haxe_ds_StringMap(); + this.__iterators = new haxe_ds_StringMap(); + } + if(!Object.prototype.hasOwnProperty.call(this.__eventMap.h,type)) { + var list = []; + list.push(new openfl_events__$EventDispatcher_Listener(listener,useCapture,priority,useWeakReference)); + var iterator = new openfl_events__$EventDispatcher_DispatchIterator(list); + this.__eventMap.h[type] = list; + this.__iterators.h[type] = [iterator]; + } else { + var list = this.__eventMap.h[type]; + var _g = 0; + var _g1 = list.length; + while(_g < _g1) { + var i = _g++; + if(list[i].match(listener,useCapture)) { + return; + } + } + var iterators = this.__iterators.h[type]; + var _g = 0; + while(_g < iterators.length) { + var iterator = iterators[_g]; + ++_g; + if(iterator.active) { + iterator.copy(); + } + } + this.__addListenerByPriority(list,new openfl_events__$EventDispatcher_Listener(listener,useCapture,priority,useWeakReference)); + } + } + ,dispatchEvent: function(event) { + if(this.__targetDispatcher != null) { + event.target = this.__targetDispatcher; + } else { + event.target = this; + } + return this.__dispatchEvent(event); + } + ,hasEventListener: function(type) { + if(this.__eventMap == null) { + return false; + } + return Object.prototype.hasOwnProperty.call(this.__eventMap.h,type); + } + ,removeEventListener: function(type,listener,useCapture) { + if(useCapture == null) { + useCapture = false; + } + if(this.__eventMap == null || listener == null) { + return; + } + var list = this.__eventMap.h[type]; + if(list == null) { + return; + } + var iterators = this.__iterators.h[type]; + var _g = 0; + var _g1 = list.length; + while(_g < _g1) { + var i = _g++; + if(list[i].match(listener,useCapture)) { + var _g2 = 0; + while(_g2 < iterators.length) { + var iterator = iterators[_g2]; + ++_g2; + iterator.remove(list[i],i); + } + list.splice(i,1); + break; + } + } + if(list.length == 0) { + var _this = this.__eventMap; + var key = type; + if(Object.prototype.hasOwnProperty.call(_this.h,key)) { + delete(_this.h[key]); + } + var _this = this.__iterators; + var key = type; + if(Object.prototype.hasOwnProperty.call(_this.h,key)) { + delete(_this.h[key]); + } + } + var h = this.__eventMap.h; + var inlStringMapValueIterator_h = h; + var inlStringMapValueIterator_keys = Object.keys(h); + var inlStringMapValueIterator_length = inlStringMapValueIterator_keys.length; + var inlStringMapValueIterator_current = 0; + if(inlStringMapValueIterator_current >= inlStringMapValueIterator_length) { + this.__eventMap = null; + this.__iterators = null; + } + } + ,toString: function() { + var c = js_Boot.getClass(this); + var full = c.__name__; + var short = full.split(".").pop(); + return "[object " + short + "]"; + } + ,willTrigger: function(type) { + return this.hasEventListener(type); + } + ,__dispatchEvent: function(event) { + if(this.__eventMap == null || event == null) { + return true; + } + var type = event.type; + var list = this.__eventMap.h[type]; + if(list == null) { + return true; + } + if(event.target == null) { + if(this.__targetDispatcher != null) { + event.target = this.__targetDispatcher; + } else { + event.target = this; + } + } + event.currentTarget = this; + var capture = event.eventPhase == 1; + var iterators = this.__iterators.h[type]; + var iterator = iterators[0]; + if(iterator.active) { + iterator = new openfl_events__$EventDispatcher_DispatchIterator(list); + iterators.push(iterator); + } + iterator.start(); + var listener = iterator; + while(listener.hasNext()) { + var listener1 = listener.next(); + if(listener1 == null) { + continue; + } + if(listener1.useCapture == capture) { + if(listener1.useWeakReference && listener1.weakRefCallback != null) { + var weakCallback = listener1.weakRefCallback.deref(); + if(weakCallback == null) { + var indexToRemove = iterator.index - 1; + list.splice(indexToRemove,1); + iterator.remove(listener1,indexToRemove); + } else if(openfl_Lib.get_current() != null && openfl_Lib.get_current().stage != null && openfl_Lib.get_current().stage.__uncaughtErrorEvents.__enabled) { + try { + weakCallback(event); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + if(!((event) instanceof openfl_events_UncaughtErrorEvent)) { + openfl_Lib.get_current().stage.__handleError(e); + } + } + } else { + weakCallback(event); + } + } else if(openfl_Lib.get_current() != null && openfl_Lib.get_current().stage != null && openfl_Lib.get_current().stage.__uncaughtErrorEvents.__enabled) { + try { + listener1.callback(event); + } catch( _g1 ) { + haxe_NativeStackTrace.lastError = _g1; + var e1 = haxe_Exception.caught(_g1).unwrap(); + if(!((event) instanceof openfl_events_UncaughtErrorEvent)) { + openfl_Lib.get_current().stage.__handleError(e1); + } + } + } else { + listener1.callback(event); + } + if(event.__isCanceledNow) { + break; + } + } + } + iterator.stop(); + if(iterator != iterators[0]) { + HxOverrides.remove(iterators,iterator); + } else { + iterator.reset(list); + } + return !event.isDefaultPrevented(); + } + ,__removeAllListeners: function() { + this.__eventMap = null; + this.__iterators = null; + } + ,__addListenerByPriority: function(list,listener) { + var numElements = list.length; + var addAtPosition = numElements; + var _g = 0; + var _g1 = numElements; + while(_g < _g1) { + var i = _g++; + if(list[i].priority < listener.priority) { + addAtPosition = i; + break; + } + } + list.splice(addAtPosition,0,listener); + } + ,__class__: openfl_events_EventDispatcher +}; +var openfl_display_IBitmapDrawable = function() { }; +$hxClasses["openfl.display.IBitmapDrawable"] = openfl_display_IBitmapDrawable; +openfl_display_IBitmapDrawable.__name__ = "openfl.display.IBitmapDrawable"; +openfl_display_IBitmapDrawable.__isInterface__ = true; +openfl_display_IBitmapDrawable.prototype = { + __class__: openfl_display_IBitmapDrawable +}; +var openfl_Vector = {}; +openfl_Vector.__properties__ = {set_length:"set_length",get_length:"get_length",set_fixed:"set_fixed",get_fixed:"get_fixed"}; +openfl_Vector.concat = function(this1,vec) { + return this1.concat(vec); +}; +openfl_Vector.copy = function(this1) { + return this1.copy(); +}; +openfl_Vector.every = function(this1,callback,thisObject) { + var _g = 0; + var _g1 = this1.get_length(); + while(_g < _g1) { + var i = _g++; + this1.__tempIndex = i; + if(thisObject != null) { + if(callback.apply(thisObject,[this1.get(i),i,this1]) == false) { + break; + } + } else if(callback(this1.get(i),i,this1) == false) { + break; + } + } + return this1.__tempIndex == this1.get_length() - 1; +}; +openfl_Vector.filter = function(this1,callback) { + return this1.filter(callback); +}; +openfl_Vector.get = function(this1,index) { + return this1.get(index); +}; +openfl_Vector.indexOf = function(this1,searchElement,fromIndex) { + if(fromIndex == null) { + fromIndex = 0; + } + return this1.indexOf(searchElement,fromIndex); +}; +openfl_Vector.insertAt = function(this1,index,element) { + this1.insertAt(index,element); +}; +openfl_Vector.iterator = function(this1) { + return this1.iterator(); +}; +openfl_Vector.join = function(this1,sep) { + if(sep == null) { + sep = ","; + } + return this1.join(sep); +}; +openfl_Vector.lastIndexOf = function(this1,searchElement,fromIndex) { + return this1.lastIndexOf(searchElement,fromIndex); +}; +openfl_Vector.pop = function(this1) { + return this1.pop(); +}; +openfl_Vector.push = function(this1,value) { + return this1.push(value); +}; +openfl_Vector.removeAt = function(this1,index) { + return this1.removeAt(index); +}; +openfl_Vector.reverse = function(this1) { + return this1.reverse(); +}; +openfl_Vector.set = function(this1,index,value) { + return this1.set(index,value); +}; +openfl_Vector.shift = function(this1) { + return this1.shift(); +}; +openfl_Vector.slice = function(this1,startIndex,endIndex) { + if(startIndex == null) { + startIndex = 0; + } + return this1.slice(startIndex,endIndex); +}; +openfl_Vector.some = function(this1,callback,thisObject) { + var _g = 0; + var _g1 = this1.get_length(); + while(_g < _g1) { + var i = _g++; + this1.__tempIndex = i; + if(thisObject != null) { + if(callback.apply(thisObject,[this1.get(i),i,this1]) == true) { + break; + } + } else if(callback(this1.get(i),i,this1)) { + break; + } + if(i == this1.get_length() - 1) { + this1.__tempIndex++; + } + } + return this1.__tempIndex < this1.get_length() - 1; +}; +openfl_Vector.sort = function(this1,sortBehavior) { + this1.sort(sortBehavior); +}; +openfl_Vector.splice = function(this1,startIndex,deleteCount) { + var $l=arguments.length; + var items = new Array($l>3?$l-3:0); + for(var $i=3;$i<$l;++$i){items[$i-3]=arguments[$i];} + this1.__tempIndex = startIndex; + var _g_current = 0; + var _g_args = items; + while(_g_current < _g_args.length) { + var item = _g_args[_g_current++]; + this1.insertAt(this1.__tempIndex,item); + this1.__tempIndex++; + } + return this1.splice(this1.__tempIndex,deleteCount); +}; +openfl_Vector.toString = function(this1) { + if(this1 != null) { + return this1.toString(); + } else { + return null; + } +}; +openfl_Vector.unshift = function(this1,value) { + this1.unshift(value); +}; +openfl_Vector.convert = function(vec) { + return vec; +}; +openfl_Vector.toBoolVector = function(t,length,fixed,array) { + return new openfl__$Vector_BoolVector(length,fixed,array); +}; +openfl_Vector.toIntVector = function(t,length,fixed,array) { + return new openfl__$Vector_IntVector(length,fixed,array); +}; +openfl_Vector.toFloatVector = function(t,length,fixed,array) { + return new openfl__$Vector_FloatVector(length,fixed,array,true); +}; +openfl_Vector.toFunctionVector = function(t,length,fixed,array) { + return new openfl__$Vector_FunctionVector(length,fixed,array); +}; +openfl_Vector.toObjectVector = function(t,length,fixed,array) { + return new openfl__$Vector_ObjectVector(length,fixed,array,true); +}; +openfl_Vector.toNullVector = function(t,length,fixed,array) { + return new openfl__$Vector_ObjectVector(length,fixed,array,true); +}; +openfl_Vector.fromBoolVector = function(vector) { + return vector; +}; +openfl_Vector.fromIntVector = function(vector) { + return vector; +}; +openfl_Vector.fromFloatVector = function(vector) { + return vector; +}; +openfl_Vector.fromFunctionVector = function(vector) { + return vector; +}; +openfl_Vector.fromObjectVector = function(vector) { + return vector; +}; +openfl_Vector.get_fixed = function(this1) { + return this1.fixed; +}; +openfl_Vector.set_fixed = function(this1,value) { + return this1.fixed = value; +}; +openfl_Vector.get_length = function(this1) { + return this1.get_length(); +}; +openfl_Vector.set_length = function(this1,value) { + return this1.set_length(value); +}; +var lime_utils_ObjectPool = function(create,clean,size) { + this.__pool = new haxe_ds_ObjectMap(); + this.activeObjects = 0; + this.inactiveObjects = 0; + this.__inactiveObject0 = null; + this.__inactiveObject1 = null; + this.__inactiveObjectList = new haxe_ds_List(); + if(create != null) { + this.create = create; + } + if(clean != null) { + this.clean = clean; + } + if(size != null) { + this.set_size(size); + } +}; +$hxClasses["lime.utils.ObjectPool"] = lime_utils_ObjectPool; +lime_utils_ObjectPool.__name__ = "lime.utils.ObjectPool"; +lime_utils_ObjectPool.prototype = { + add: function(object) { + if(object != null && !this.__pool.exists(object)) { + this.__pool.set(object,false); + this.clean(object); + if(this.__inactiveObject0 == null) { + this.__inactiveObject0 = object; + } else if(this.__inactiveObject1 == null) { + this.__inactiveObject1 = object; + } else { + this.__inactiveObjectList.add(object); + } + this.inactiveObjects++; + } + } + ,clean: function(object) { + } + ,clear: function() { + this.__pool = new haxe_ds_ObjectMap(); + this.activeObjects = 0; + this.inactiveObjects = 0; + this.__inactiveObject0 = null; + this.__inactiveObject1 = null; + this.__inactiveObjectList.clear(); + } + ,create: function() { + return null; + } + ,get: function() { + var object = null; + if(this.inactiveObjects > 0) { + var object1 = null; + if(this.__inactiveObject0 != null) { + object1 = this.__inactiveObject0; + this.__inactiveObject0 = null; + } else if(this.__inactiveObject1 != null) { + object1 = this.__inactiveObject1; + this.__inactiveObject1 = null; + } else { + object1 = this.__inactiveObjectList.pop(); + if(this.__inactiveObjectList.length > 0) { + this.__inactiveObject0 = this.__inactiveObjectList.pop(); + } + if(this.__inactiveObjectList.length > 0) { + this.__inactiveObject1 = this.__inactiveObjectList.pop(); + } + } + this.inactiveObjects--; + this.activeObjects++; + object = object1; + } else if(this.__size == null || this.activeObjects < this.__size) { + object = this.create(); + if(object != null) { + this.__pool.set(object,true); + this.activeObjects++; + } + } + return object; + } + ,release: function(object) { + this.activeObjects--; + if(this.__size == null || this.activeObjects + this.inactiveObjects < this.__size) { + this.clean(object); + if(this.__inactiveObject0 == null) { + this.__inactiveObject0 = object; + } else if(this.__inactiveObject1 == null) { + this.__inactiveObject1 = object; + } else { + this.__inactiveObjectList.add(object); + } + this.inactiveObjects++; + } else { + this.__pool.remove(object); + } + } + ,remove: function(object) { + if(object != null && this.__pool.exists(object)) { + this.__pool.remove(object); + if(this.__inactiveObject0 == object) { + this.__inactiveObject0 = null; + this.inactiveObjects--; + } else if(this.__inactiveObject1 == object) { + this.__inactiveObject1 = null; + this.inactiveObjects--; + } else if(this.__inactiveObjectList.remove(object)) { + this.inactiveObjects--; + } else { + this.activeObjects--; + } + } + } + ,__addInactive: function(object) { + if(this.__inactiveObject0 == null) { + this.__inactiveObject0 = object; + } else if(this.__inactiveObject1 == null) { + this.__inactiveObject1 = object; + } else { + this.__inactiveObjectList.add(object); + } + this.inactiveObjects++; + } + ,__getInactive: function() { + var object = null; + if(this.__inactiveObject0 != null) { + object = this.__inactiveObject0; + this.__inactiveObject0 = null; + } else if(this.__inactiveObject1 != null) { + object = this.__inactiveObject1; + this.__inactiveObject1 = null; + } else { + object = this.__inactiveObjectList.pop(); + if(this.__inactiveObjectList.length > 0) { + this.__inactiveObject0 = this.__inactiveObjectList.pop(); + } + if(this.__inactiveObjectList.length > 0) { + this.__inactiveObject1 = this.__inactiveObjectList.pop(); + } + } + this.inactiveObjects--; + this.activeObjects++; + return object; + } + ,__removeInactive: function(count) { + if(count <= 0 || this.inactiveObjects == 0) { + return; + } + if(this.__inactiveObject0 != null) { + this.__pool.remove(this.__inactiveObject0); + this.__inactiveObject0 = null; + this.inactiveObjects--; + --count; + } + if(count == 0 || this.inactiveObjects == 0) { + return; + } + if(this.__inactiveObject1 != null) { + this.__pool.remove(this.__inactiveObject1); + this.__inactiveObject1 = null; + this.inactiveObjects--; + --count; + } + if(count == 0 || this.inactiveObjects == 0) { + return; + } + var _g_head = this.__inactiveObjectList.h; + while(_g_head != null) { + var val = _g_head.item; + _g_head = _g_head.next; + var object = val; + this.__pool.remove(object); + this.__inactiveObjectList.remove(object); + this.inactiveObjects--; + --count; + if(count == 0 || this.inactiveObjects == 0) { + return; + } + } + } + ,get_size: function() { + return this.__size; + } + ,set_size: function(value) { + if(value == null) { + this.__size = null; + } else { + var current = this.inactiveObjects + this.activeObjects; + this.__size = value; + if(current > value) { + this.__removeInactive(current - value); + } else if(value > current) { + var object; + var _g = 0; + var _g1 = value - current; + while(_g < _g1) { + var i = _g++; + object = this.create(); + if(object != null) { + this.__pool.set(object,false); + this.__inactiveObjectList.add(object); + this.inactiveObjects++; + } else { + break; + } + } + } + } + return value; + } + ,__class__: lime_utils_ObjectPool + ,__properties__: {set_size:"set_size",get_size:"get_size"} +}; +var haxe_IMap = function() { }; +$hxClasses["haxe.IMap"] = haxe_IMap; +haxe_IMap.__name__ = "haxe.IMap"; +haxe_IMap.__isInterface__ = true; +haxe_IMap.prototype = { + __class__: haxe_IMap +}; +var haxe_ds_ObjectMap = function() { + this.h = { __keys__ : { }}; +}; +$hxClasses["haxe.ds.ObjectMap"] = haxe_ds_ObjectMap; +haxe_ds_ObjectMap.__name__ = "haxe.ds.ObjectMap"; +haxe_ds_ObjectMap.__interfaces__ = [haxe_IMap]; +haxe_ds_ObjectMap.prototype = { + set: function(key,value) { + var id = key.__id__; + if(id == null) { + id = (key.__id__ = $global.$haxeUID++); + } + this.h[id] = value; + this.h.__keys__[id] = key; + } + ,get: function(key) { + return this.h[key.__id__]; + } + ,exists: function(key) { + return this.h.__keys__[key.__id__] != null; + } + ,remove: function(key) { + var id = key.__id__; + if(this.h.__keys__[id] == null) { + return false; + } + delete(this.h[id]); + delete(this.h.__keys__[id]); + return true; + } + ,keys: function() { + var a = []; + for( var key in this.h.__keys__ ) { + if(this.h.hasOwnProperty(key)) { + a.push(this.h.__keys__[key]); + } + } + return new haxe_iterators_ArrayIterator(a); + } + ,iterator: function() { + return { ref : this.h, it : this.keys(), hasNext : function() { + return this.it.hasNext(); + }, next : function() { + var i = this.it.next(); + return this.ref[i.__id__]; + }}; + } + ,keyValueIterator: function() { + return new haxe_iterators_MapKeyValueIterator(this); + } + ,toString: function() { + var s_b = ""; + s_b += "["; + var it = this.keys(); + var i = it; + while(i.hasNext()) { + var i1 = i.next(); + s_b += Std.string(Std.string(i1)); + s_b += " => "; + s_b += Std.string(Std.string(this.h[i1.__id__])); + if(it.hasNext()) { + s_b += ", "; + } + } + s_b += "]"; + return s_b; + } + ,__class__: haxe_ds_ObjectMap +}; +var haxe_ds_List = function() { + this.length = 0; +}; +$hxClasses["haxe.ds.List"] = haxe_ds_List; +haxe_ds_List.__name__ = "haxe.ds.List"; +haxe_ds_List.prototype = { + add: function(item) { + var x = new haxe_ds__$List_ListNode(item,null); + if(this.h == null) { + this.h = x; + } else { + this.q.next = x; + } + this.q = x; + this.length++; + } + ,push: function(item) { + var x = new haxe_ds__$List_ListNode(item,this.h); + this.h = x; + if(this.q == null) { + this.q = x; + } + this.length++; + } + ,pop: function() { + if(this.h == null) { + return null; + } + var x = this.h.item; + this.h = this.h.next; + if(this.h == null) { + this.q = null; + } + this.length--; + return x; + } + ,isEmpty: function() { + return this.h == null; + } + ,clear: function() { + this.h = null; + this.q = null; + this.length = 0; + } + ,remove: function(v) { + var prev = null; + var l = this.h; + while(l != null) { + if(l.item == v) { + if(prev == null) { + this.h = l.next; + } else { + prev.next = l.next; + } + if(this.q == l) { + this.q = prev; + } + this.length--; + return true; + } + prev = l; + l = l.next; + } + return false; + } + ,iterator: function() { + return new haxe_ds__$List_ListIterator(this.h); + } + ,__class__: haxe_ds_List +}; +var openfl_display_DisplayObject = function() { + openfl_events_EventDispatcher.call(this); + this.__drawableType = 1; + this.__alpha = 1; + this.__blendMode = 10; + this.__cacheAsBitmap = false; + this.__transform = new openfl_geom_Matrix(); + this.__visible = true; + this.__rotation = 0; + this.__rotationSine = 0; + this.__rotationCosine = 1; + this.__scaleX = 1; + this.__scaleY = 1; + this.__worldAlpha = 1; + this.__worldBlendMode = 10; + this.__worldTransform = new openfl_geom_Matrix(); + this.__worldColorTransform = new openfl_geom_ColorTransform(); + this.__renderTransform = new openfl_geom_Matrix(); + this.__worldVisible = true; + this.set_name("instance" + ++openfl_display_DisplayObject.__instanceCount); + if(openfl_display_DisplayObject.__initStage != null) { + this.stage = openfl_display_DisplayObject.__initStage; + openfl_display_DisplayObject.__initStage = null; + this.stage.addChild(this); + } +}; +$hxClasses["openfl.display.DisplayObject"] = openfl_display_DisplayObject; +openfl_display_DisplayObject.__name__ = "openfl.display.DisplayObject"; +openfl_display_DisplayObject.__interfaces__ = [openfl_display_IBitmapDrawable]; +openfl_display_DisplayObject.__calculateAbsoluteTransform = function(local,parentTransform,target) { + target.a = local.a * parentTransform.a + local.b * parentTransform.c; + target.b = local.a * parentTransform.b + local.b * parentTransform.d; + target.c = local.c * parentTransform.a + local.d * parentTransform.c; + target.d = local.c * parentTransform.b + local.d * parentTransform.d; + target.tx = local.tx * parentTransform.a + local.ty * parentTransform.c + parentTransform.tx; + target.ty = local.tx * parentTransform.b + local.ty * parentTransform.d + parentTransform.ty; +}; +openfl_display_DisplayObject.__super__ = openfl_events_EventDispatcher; +openfl_display_DisplayObject.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + addEventListener: function(type,listener,useCapture,priority,useWeakReference) { + if(useWeakReference == null) { + useWeakReference = false; + } + if(priority == null) { + priority = 0; + } + if(useCapture == null) { + useCapture = false; + } + switch(type) { + case "activate":case "deactivate":case "enterFrame":case "exitFrame":case "frameConstructed":case "render": + if(!Object.prototype.hasOwnProperty.call(openfl_display_DisplayObject.__broadcastEvents.h,type)) { + openfl_display_DisplayObject.__broadcastEvents.h[type] = []; + } + var dispatchers = openfl_display_DisplayObject.__broadcastEvents.h[type]; + if(dispatchers.indexOf(this) == -1) { + dispatchers.push(this); + } + break; + case "clearDOM":case "renderCairo":case "renderCanvas":case "renderDOM":case "renderOpenGL": + if(this.__customRenderEvent == null) { + this.__customRenderEvent = new openfl_events_RenderEvent(null); + this.__customRenderEvent.objectColorTransform = new openfl_geom_ColorTransform(); + this.__customRenderEvent.objectMatrix = new openfl_geom_Matrix(); + this.__customRenderClear = true; + } + break; + default: + } + openfl_events_EventDispatcher.prototype.addEventListener.call(this,type,listener,useCapture,priority,useWeakReference); + } + ,dispatchEvent: function(event) { + if(((event) instanceof openfl_events_MouseEvent)) { + var mouseEvent = event; + var _this = this.__getRenderTransform(); + mouseEvent.stageX = mouseEvent.localX * _this.a + mouseEvent.localY * _this.c + _this.tx; + var _this = this.__getRenderTransform(); + mouseEvent.stageY = mouseEvent.localX * _this.b + mouseEvent.localY * _this.d + _this.ty; + } else if(((event) instanceof openfl_events_TouchEvent)) { + var touchEvent = event; + var _this = this.__getRenderTransform(); + touchEvent.stageX = touchEvent.localX * _this.a + touchEvent.localY * _this.c + _this.tx; + var _this = this.__getRenderTransform(); + touchEvent.stageY = touchEvent.localX * _this.b + touchEvent.localY * _this.d + _this.ty; + } + event.target = this; + return this.__dispatchWithCapture(event); + } + ,getBounds: function(targetCoordinateSpace) { + var matrix = openfl_geom_Matrix.__pool.get(); + if(targetCoordinateSpace != null && targetCoordinateSpace != this) { + matrix.copyFrom(this.__getWorldTransform()); + var targetMatrix = openfl_geom_Matrix.__pool.get(); + targetMatrix.copyFrom(targetCoordinateSpace.__getWorldTransform()); + targetMatrix.invert(); + matrix.concat(targetMatrix); + openfl_geom_Matrix.__pool.release(targetMatrix); + } else { + matrix.identity(); + } + var bounds = new openfl_geom_Rectangle(); + this.__getBounds(bounds,matrix); + openfl_geom_Matrix.__pool.release(matrix); + return bounds; + } + ,getRect: function(targetCoordinateSpace) { + return this.getBounds(targetCoordinateSpace); + } + ,globalToLocal: function(pos) { + return this.__globalToLocal(pos,new openfl_geom_Point()); + } + ,hitTestObject: function(obj) { + if(obj != null && obj.parent != null && this.parent != null) { + var currentBounds = this.getBounds(this); + var targetBounds = obj.getBounds(this); + return currentBounds.intersects(targetBounds); + } + return false; + } + ,hitTestPoint: function(x,y,shapeFlag) { + if(shapeFlag == null) { + shapeFlag = false; + } + if(this.stage != null) { + return this.__hitTest(x,y,shapeFlag,null,false,this); + } else { + return false; + } + } + ,invalidate: function() { + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + ,localToGlobal: function(point) { + return this.__getRenderTransform().transformPoint(point); + } + ,removeEventListener: function(type,listener,useCapture) { + if(useCapture == null) { + useCapture = false; + } + openfl_events_EventDispatcher.prototype.removeEventListener.call(this,type,listener,useCapture); + switch(type) { + case "activate":case "deactivate":case "enterFrame":case "exitFrame":case "frameConstructed":case "render": + if(!this.hasEventListener(type)) { + if(Object.prototype.hasOwnProperty.call(openfl_display_DisplayObject.__broadcastEvents.h,type)) { + HxOverrides.remove(openfl_display_DisplayObject.__broadcastEvents.h[type],this); + } + } + break; + case "clearDOM":case "renderCairo":case "renderCanvas":case "renderDOM":case "renderOpenGL": + if(!this.hasEventListener("clearDOM") && !this.hasEventListener("renderCairo") && !this.hasEventListener("renderCanvas") && !this.hasEventListener("renderDOM") && !this.hasEventListener("renderOpenGL")) { + this.__customRenderEvent = null; + } + break; + default: + } + } + ,__cleanup: function() { + this.__cairo = null; + if(this.__canvas != null) { + this.__canvas.width = 0; + this.__canvas.height = 0; + this.__canvas = null; + } + if(this.__context != null) { + this.__context.clearRect(0,0,0,0); + this.__context = null; + } + if(this.__graphics != null) { + this.__graphics.__cleanup(); + } + if(this.__cacheBitmap != null) { + this.__cacheBitmap.__cleanup(); + this.__cacheBitmap = null; + } + if(this.__cacheBitmapData != null) { + this.__cacheBitmapData.dispose(); + this.__cacheBitmapData = null; + } + } + ,__dispatch: function(event) { + if(this.__eventMap != null && this.hasEventListener(event.type)) { + var result = openfl_events_EventDispatcher.prototype.__dispatchEvent.call(this,event); + if(event.__isCanceled) { + return true; + } + return result; + } + return true; + } + ,__dispatchChildren: function(event) { + } + ,__dispatchEvent: function(event) { + var parent = event.bubbles ? this.parent : null; + var result = openfl_events_EventDispatcher.prototype.__dispatchEvent.call(this,event); + if(event.__isCanceled) { + return true; + } + if(parent != null && parent != this) { + event.eventPhase = 3; + if(event.target == null) { + event.target = this; + } + parent.__dispatchEvent(event); + } + return result; + } + ,__dispatchWithCapture: function(event) { + if(event.target == null) { + event.target = this; + } + if(this.parent != null) { + event.eventPhase = 1; + if(this.parent == this.stage) { + this.parent.__dispatch(event); + } else { + var stack = openfl_display_DisplayObject.__tempStack.get(); + var parent = this.parent; + var i = 0; + while(parent != null) { + stack.set(i,parent); + parent = parent.parent; + ++i; + } + var _g = 0; + var _g1 = i; + while(_g < _g1) { + var j = _g++; + stack.get(i - j - 1).__dispatch(event); + } + openfl_display_DisplayObject.__tempStack.release(stack); + } + } + event.eventPhase = 2; + return this.__dispatchEvent(event); + } + ,__enterFrame: function(deltaTime) { + } + ,__getBounds: function(rect,matrix) { + if(this.__graphics != null) { + this.__graphics.__getBounds(rect,matrix); + } + } + ,__getCursor: function() { + return null; + } + ,__getFilterBounds: function(rect,matrix) { + this.__getRenderBounds(rect,matrix); + if(this.__filters != null) { + var extension = openfl_geom_Rectangle.__pool.get(); + var _g = 0; + var _g1 = this.__filters; + while(_g < _g1.length) { + var filter = _g1[_g]; + ++_g; + extension.__expand(-filter.__leftExtension,-filter.__topExtension,filter.__leftExtension + filter.__rightExtension,filter.__topExtension + filter.__bottomExtension); + } + rect.width += extension.width; + rect.height += extension.height; + rect.x += extension.x; + rect.y += extension.y; + openfl_geom_Rectangle.__pool.release(extension); + } + } + ,__getInteractive: function(stack) { + return false; + } + ,__getLocalBounds: function(rect) { + this.__getBounds(rect,this.__transform); + rect.x -= this.__transform.tx; + rect.y -= this.__transform.ty; + } + ,__getRenderBounds: function(rect,matrix) { + if(this.__scrollRect == null) { + this.__getBounds(rect,matrix); + } else { + var r = openfl_geom_Rectangle.__pool.get(); + r.copyFrom(this.__scrollRect); + r.__transform(r,matrix); + rect.__expand(r.x,r.y,r.width,r.height); + openfl_geom_Rectangle.__pool.release(r); + } + } + ,__getRenderTransform: function() { + this.__getWorldTransform(); + return this.__renderTransform; + } + ,__getWorldTransform: function() { + var transformDirty = this.__transformDirty || this.__worldTransformInvalid; + if(transformDirty) { + var list = []; + var current = this; + if(this.parent == null) { + this.__update(true,false); + } else { + while(current != this.stage) { + list.push(current); + current = current.parent; + if(current == null) { + break; + } + } + } + var i = list.length; + while(--i >= 0) { + current = list[i]; + current.__update(true,false); + } + } + return this.__worldTransform; + } + ,__globalToLocal: function(global,local) { + this.__getRenderTransform(); + if(global == local) { + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + if(norm == 0) { + global.x = -_this.tx; + global.y = -_this.ty; + } else { + var px = 1.0 / norm * (_this.c * (_this.ty - global.y) + _this.d * (global.x - _this.tx)); + global.y = 1.0 / norm * (_this.a * (global.y - _this.ty) + _this.b * (_this.tx - global.x)); + global.x = px; + } + } else { + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + local.x = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - global.y) + _this.d * (global.x - _this.tx)); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + local.y = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (global.y - _this.ty) + _this.b * (_this.tx - global.x)); + } + return local; + } + ,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { + if(this.__graphics != null) { + if(!hitObject.__visible || this.__isMask) { + return false; + } + if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) { + return false; + } + if(this.__graphics.__hitTest(x,y,shapeFlag,this.__getRenderTransform())) { + if(stack != null && !interactiveOnly) { + stack.push(hitObject); + } + return true; + } + } + return false; + } + ,__hitTestMask: function(x,y) { + if(this.__graphics != null) { + if(this.__graphics.__hitTest(x,y,true,this.__getRenderTransform())) { + return true; + } + } + return false; + } + ,__readGraphicsData: function(graphicsData,recurse) { + if(this.__graphics != null) { + this.__graphics.__readGraphicsData(graphicsData); + } + } + ,__setParentRenderDirty: function() { + var renderParent = this.__renderParent != null ? this.__renderParent : this.parent; + if(renderParent != null && !renderParent.__renderDirty) { + renderParent.__renderDirty = true; + renderParent.__setParentRenderDirty(); + } + } + ,__setRenderDirty: function() { + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + ,__setStageReference: function(stage) { + this.stage = stage; + } + ,__setTransformDirty: function() { + if(!this.__transformDirty) { + this.__transformDirty = true; + this.__setWorldTransformInvalid(); + this.__setParentRenderDirty(); + } + } + ,__setWorldTransformInvalid: function() { + this.__worldTransformInvalid = true; + } + ,__stopAllMovieClips: function() { + } + ,__update: function(transformOnly,updateChildren) { + var renderParent = this.__renderParent != null ? this.__renderParent : this.parent; + if(this.__isMask && renderParent == null) { + renderParent = this.__maskTarget; + } + this.__renderable = this.__visible && this.__scaleX != 0 && this.__scaleY != 0 && !this.__isMask && (renderParent == null || !renderParent.__isMask); + this.__updateTransforms(); + this.__transformDirty = false; + this.__worldTransformInvalid = false; + if(!transformOnly) { + if(openfl_display_DisplayObject.__supportDOM) { + this.__renderTransformChanged = !this.__renderTransform.equals(this.__renderTransformCache); + if(this.__renderTransformCache == null) { + this.__renderTransformCache = this.__renderTransform.clone(); + } else { + this.__renderTransformCache.copyFrom(this.__renderTransform); + } + } + if(renderParent != null) { + if(openfl_display_DisplayObject.__supportDOM) { + var worldVisible = renderParent.__worldVisible && this.__visible; + this.__worldVisibleChanged = this.__worldVisible != worldVisible; + this.__worldVisible = worldVisible; + } + var worldAlpha = this.get_alpha() * renderParent.__worldAlpha; + this.__worldAlphaChanged = this.__worldAlpha != worldAlpha; + this.__worldAlpha = worldAlpha; + if(this.__objectTransform != null) { + this.__worldColorTransform.__copyFrom(this.__objectTransform.__colorTransform); + this.__worldColorTransform.__combine(renderParent.__worldColorTransform); + } else { + this.__worldColorTransform.__copyFrom(renderParent.__worldColorTransform); + } + if(this.__blendMode == null || this.__blendMode == 10) { + this.__worldBlendMode = renderParent.__worldBlendMode; + } else { + this.__worldBlendMode = this.__blendMode; + } + if(this.__shader == null) { + this.__worldShader = renderParent.__shader; + } else { + this.__worldShader = this.__shader; + } + if(this.__scale9Grid == null) { + this.__worldScale9Grid = renderParent.__scale9Grid; + } else { + this.__worldScale9Grid = this.__scale9Grid; + } + } else { + this.__worldAlpha = this.get_alpha(); + if(openfl_display_DisplayObject.__supportDOM) { + this.__worldVisibleChanged = this.__worldVisible != this.__visible; + this.__worldVisible = this.__visible; + } + this.__worldAlphaChanged = this.__worldAlpha != this.get_alpha(); + if(this.__objectTransform != null) { + this.__worldColorTransform.__copyFrom(this.__objectTransform.__colorTransform); + } else { + this.__worldColorTransform.__identity(); + } + this.__worldBlendMode = this.__blendMode; + this.__worldShader = this.__shader; + this.__worldScale9Grid = this.__scale9Grid; + } + } + if(updateChildren && this.get_mask() != null) { + this.get_mask().__update(transformOnly,true); + } + } + ,__updateTransforms: function(overrideTransform) { + var overrided = overrideTransform != null; + var local = overrided ? overrideTransform : this.__transform; + if(this.__worldTransform == null) { + this.__worldTransform = new openfl_geom_Matrix(); + } + if(this.__renderTransform == null) { + this.__renderTransform = new openfl_geom_Matrix(); + } + var renderParent = this.__renderParent != null ? this.__renderParent : this.parent; + if(!overrided && this.parent != null) { + var parentTransform = this.parent.__worldTransform; + var target = this.__worldTransform; + target.a = local.a * parentTransform.a + local.b * parentTransform.c; + target.b = local.a * parentTransform.b + local.b * parentTransform.d; + target.c = local.c * parentTransform.a + local.d * parentTransform.c; + target.d = local.c * parentTransform.b + local.d * parentTransform.d; + target.tx = local.tx * parentTransform.a + local.ty * parentTransform.c + parentTransform.tx; + target.ty = local.tx * parentTransform.b + local.ty * parentTransform.d + parentTransform.ty; + } else { + this.__worldTransform.copyFrom(local); + } + if(!overrided && renderParent != null) { + var parentTransform = renderParent.__renderTransform; + var target = this.__renderTransform; + target.a = local.a * parentTransform.a + local.b * parentTransform.c; + target.b = local.a * parentTransform.b + local.b * parentTransform.d; + target.c = local.c * parentTransform.a + local.d * parentTransform.c; + target.d = local.c * parentTransform.b + local.d * parentTransform.d; + target.tx = local.tx * parentTransform.a + local.ty * parentTransform.c + parentTransform.tx; + target.ty = local.tx * parentTransform.b + local.ty * parentTransform.d + parentTransform.ty; + } else { + this.__renderTransform.copyFrom(local); + } + if(this.__scrollRect != null) { + var _this = this.__renderTransform; + var px = -this.__scrollRect.x; + var py = -this.__scrollRect.y; + _this.tx = px * _this.a + py * _this.c + _this.tx; + _this.ty = px * _this.b + py * _this.d + _this.ty; + } + } + ,get_alpha: function() { + return this.__alpha; + } + ,set_alpha: function(value) { + if(value != value) { + value = 0.0; + } else if(value > 1.0) { + value = 1.0; + } else if(value < 0.0) { + value = 0.0; + } + if(value != this.__alpha && !this.get_cacheAsBitmap()) { + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__alpha = value; + } + ,get_blendMode: function() { + return this.__blendMode; + } + ,set_blendMode: function(value) { + if(value == null) { + value = 10; + } + if(value != this.__blendMode) { + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__blendMode = value; + } + ,get_cacheAsBitmap: function() { + if(this.__filters == null) { + return this.__cacheAsBitmap; + } else { + return true; + } + } + ,set_cacheAsBitmap: function(value) { + if(value != this.__cacheAsBitmap) { + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__cacheAsBitmap = value; + } + ,get_cacheAsBitmapMatrix: function() { + return this.__cacheAsBitmapMatrix; + } + ,set_cacheAsBitmapMatrix: function(value) { + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + return this.__cacheAsBitmapMatrix = value != null ? value.clone() : value; + } + ,get_filters: function() { + if(this.__filters == null) { + return []; + } else { + return this.__filters.slice(); + } + } + ,set_filters: function(value) { + if(value != null && value.length > 0) { + var clonedFilters = []; + var _g = 0; + while(_g < value.length) { + var filter = value[_g]; + ++_g; + var clonedFilter = filter.clone(); + clonedFilter.__renderDirty = true; + clonedFilters.push(clonedFilter); + } + this.__filters = clonedFilters; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } else if(this.__filters != null) { + this.__filters = null; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return value; + } + ,get_height: function() { + var rect = openfl_geom_Rectangle.__pool.get(); + this.__getLocalBounds(rect); + var height = rect.height; + openfl_geom_Rectangle.__pool.release(rect); + return height; + } + ,set_height: function(value) { + var rect = openfl_geom_Rectangle.__pool.get(); + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.identity(); + this.__getBounds(rect,matrix); + if(value != rect.height) { + this.set_scaleY(value / rect.height); + } else { + this.set_scaleY(1); + } + openfl_geom_Rectangle.__pool.release(rect); + openfl_geom_Matrix.__pool.release(matrix); + return value; + } + ,get_loaderInfo: function() { + if(this.stage != null) { + return openfl_utils__$internal_Lib.current.__loaderInfo; + } + return null; + } + ,get_mask: function() { + return this.__mask; + } + ,set_mask: function(value) { + if(value == this.__mask) { + return value; + } + if(value != null && value.__maskTarget != null) { + value.__maskTarget.set_mask(null); + } + if(value != this.__mask) { + this.__setTransformDirty(); + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + if(this.__mask != null) { + this.__mask.__isMask = false; + this.__mask.__maskTarget = null; + this.__mask.__setTransformDirty(); + var _this = this.__mask; + if(!_this.__renderDirty) { + _this.__renderDirty = true; + _this.__setParentRenderDirty(); + } + } + if(value != null) { + value.__isMask = true; + value.__maskTarget = this; + value.__setWorldTransformInvalid(); + } + if(this.__cacheBitmap != null && this.__cacheBitmap.get_mask() != value) { + this.__cacheBitmap.set_mask(value); + } + return this.__mask = value; + } + ,get_mouseX: function() { + var mouseX = this.stage != null ? this.stage.__mouseX : openfl_utils__$internal_Lib.current.stage.__mouseX; + var mouseY = this.stage != null ? this.stage.__mouseY : openfl_utils__$internal_Lib.current.stage.__mouseY; + var _this = this.__getRenderTransform(); + var norm = _this.a * _this.d - _this.b * _this.c; + if(norm == 0) { + return -_this.tx; + } else { + return 1.0 / norm * (_this.c * (_this.ty - mouseY) + _this.d * (mouseX - _this.tx)); + } + } + ,get_mouseY: function() { + var mouseX = this.stage != null ? this.stage.__mouseX : openfl_utils__$internal_Lib.current.stage.__mouseX; + var mouseY = this.stage != null ? this.stage.__mouseY : openfl_utils__$internal_Lib.current.stage.__mouseY; + var _this = this.__getRenderTransform(); + var norm = _this.a * _this.d - _this.b * _this.c; + if(norm == 0) { + return -_this.ty; + } else { + return 1.0 / norm * (_this.a * (mouseY - _this.ty) + _this.b * (_this.tx - mouseX)); + } + } + ,get_name: function() { + return this.__name; + } + ,set_name: function(value) { + return this.__name = value; + } + ,get_root: function() { + if(this.stage != null) { + return openfl_utils__$internal_Lib.current; + } + return null; + } + ,get_rotation: function() { + return this.__rotation; + } + ,set_rotation: function(value) { + if(value != this.__rotation) { + value %= 360.0; + if(value > 180.0) { + value -= 360.0; + } else if(value < -180.0) { + value += 360.0; + } + this.__rotation = value; + var radians = this.__rotation * (Math.PI / 180); + this.__rotationSine = Math.sin(radians); + this.__rotationCosine = Math.cos(radians); + this.__transform.a = this.__rotationCosine * this.__scaleX; + this.__transform.b = this.__rotationSine * this.__scaleX; + this.__transform.c = -this.__rotationSine * this.__scaleY; + this.__transform.d = this.__rotationCosine * this.__scaleY; + this.__setTransformDirty(); + } + return value; + } + ,get_scale9Grid: function() { + if(this.__scale9Grid == null) { + return null; + } + return this.__scale9Grid.clone(); + } + ,set_scale9Grid: function(value) { + if(value == null && this.__scale9Grid == null) { + return value; + } + if(value != null && this.__scale9Grid != null && this.__scale9Grid.equals(value)) { + return value; + } + if(value != null) { + if(this.__scale9Grid == null) { + this.__scale9Grid = new openfl_geom_Rectangle(); + } + this.__scale9Grid.copyFrom(value); + } else { + this.__scale9Grid = null; + } + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + return value; + } + ,get_scaleX: function() { + return this.__scaleX; + } + ,set_scaleX: function(value) { + if(value != this.__scaleX) { + this.__scaleX = value; + if(this.__transform.b == 0) { + if(value != this.__transform.a) { + this.__setTransformDirty(); + } + this.__transform.a = value; + } else { + var a = this.__rotationCosine * value; + var b = this.__rotationSine * value; + if(this.__transform.a != a || this.__transform.b != b) { + this.__setTransformDirty(); + } + this.__transform.a = a; + this.__transform.b = b; + } + } + return value; + } + ,get_scaleY: function() { + return this.__scaleY; + } + ,set_scaleY: function(value) { + if(value != this.__scaleY) { + this.__scaleY = value; + if(this.__transform.c == 0) { + if(value != this.__transform.d) { + this.__setTransformDirty(); + } + this.__transform.d = value; + } else { + var c = -this.__rotationSine * value; + var d = this.__rotationCosine * value; + if(this.__transform.d != d || this.__transform.c != c) { + this.__setTransformDirty(); + } + this.__transform.c = c; + this.__transform.d = d; + } + } + return value; + } + ,get_scrollRect: function() { + if(this.__scrollRect == null) { + return null; + } + return this.__scrollRect.clone(); + } + ,set_scrollRect: function(value) { + if(value == null && this.__scrollRect == null) { + return value; + } + if(value != null && this.__scrollRect != null && this.__scrollRect.equals(value)) { + return value; + } + if(value != null) { + if(this.__scrollRect == null) { + this.__scrollRect = new openfl_geom_Rectangle(); + } + this.__scrollRect.copyFrom(value); + if(this.__scrollRect.width < 0.0) { + this.__scrollRect.width = 0.0; + } + if(this.__scrollRect.height < 0.0) { + this.__scrollRect.height = 0.0; + } + } else { + this.__scrollRect = null; + } + this.__setTransformDirty(); + if(openfl_display_DisplayObject.__supportDOM) { + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__scrollRect; + } + ,get_shader: function() { + return this.__shader; + } + ,set_shader: function(value) { + this.__shader = value; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + return value; + } + ,get_transform: function() { + if(this.__objectTransform == null) { + this.__objectTransform = new openfl_geom_Transform(this); + } + return this.__objectTransform; + } + ,set_transform: function(value) { + if(value == null) { + throw new openfl_errors_TypeError("Parameter transform must be non-null."); + } + if(this.__objectTransform == null) { + this.__objectTransform = new openfl_geom_Transform(this); + } + this.__setTransformDirty(); + if(value.__hasMatrix) { + var other = value.__displayObject.__transform; + this.__objectTransform.__setTransform(other.a,other.b,other.c,other.d,other.tx,other.ty); + } else { + this.__objectTransform.__hasMatrix = false; + } + if(!this.__objectTransform.__colorTransform.__equals(value.__colorTransform,true) || !this.get_cacheAsBitmap() && this.__objectTransform.__colorTransform.alphaMultiplier != value.__colorTransform.alphaMultiplier) { + this.__objectTransform.__colorTransform.__copyFrom(value.get_colorTransform()); + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__objectTransform; + } + ,get_visible: function() { + return this.__visible; + } + ,set_visible: function(value) { + if(value != this.__visible) { + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__visible = value; + } + ,get_width: function() { + var rect = openfl_geom_Rectangle.__pool.get(); + this.__getLocalBounds(rect); + var width = rect.width; + openfl_geom_Rectangle.__pool.release(rect); + return width; + } + ,set_width: function(value) { + var rect = openfl_geom_Rectangle.__pool.get(); + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.identity(); + this.__getBounds(rect,matrix); + if(value != rect.width) { + this.set_scaleX(value / rect.width); + } else { + this.set_scaleX(1); + } + openfl_geom_Rectangle.__pool.release(rect); + openfl_geom_Matrix.__pool.release(matrix); + return value; + } + ,get_x: function() { + return this.__transform.tx; + } + ,set_x: function(value) { + if(value != value) { + value = 0.0; + } + if(value != this.__transform.tx) { + this.__setTransformDirty(); + } + return this.__transform.tx = value; + } + ,get_y: function() { + return this.__transform.ty; + } + ,set_y: function(value) { + if(value != value) { + value = 0.0; + } + if(value != this.__transform.ty) { + this.__setTransformDirty(); + } + return this.__transform.ty = value; + } + ,__class__: openfl_display_DisplayObject + ,__properties__: {set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x",set_width:"set_width",get_width:"get_width",set_visible:"set_visible",get_visible:"get_visible",set_transform:"set_transform",get_transform:"get_transform",set_shader:"set_shader",get_shader:"get_shader",set_scrollRect:"set_scrollRect",get_scrollRect:"get_scrollRect",set_scaleY:"set_scaleY",get_scaleY:"get_scaleY",set_scaleX:"set_scaleX",get_scaleX:"get_scaleX",set_scale9Grid:"set_scale9Grid",get_scale9Grid:"get_scale9Grid",set_rotation:"set_rotation",get_rotation:"get_rotation",get_root:"get_root",set_name:"set_name",get_name:"get_name",get_mouseY:"get_mouseY",get_mouseX:"get_mouseX",set_mask:"set_mask",get_mask:"get_mask",get_loaderInfo:"get_loaderInfo",set_height:"set_height",get_height:"get_height",set_filters:"set_filters",get_filters:"get_filters",set_cacheAsBitmapMatrix:"set_cacheAsBitmapMatrix",get_cacheAsBitmapMatrix:"get_cacheAsBitmapMatrix",set_cacheAsBitmap:"set_cacheAsBitmap",get_cacheAsBitmap:"get_cacheAsBitmap",set_blendMode:"set_blendMode",get_blendMode:"get_blendMode",set_alpha:"set_alpha",get_alpha:"get_alpha"} +}); +var openfl_display_InteractiveObject = function() { + openfl_display_DisplayObject.call(this); + this.doubleClickEnabled = false; + this.mouseEnabled = true; + this.needsSoftKeyboard = false; + this.__tabEnabled = null; + this.__tabIndex = -1; +}; +$hxClasses["openfl.display.InteractiveObject"] = openfl_display_InteractiveObject; +openfl_display_InteractiveObject.__name__ = "openfl.display.InteractiveObject"; +openfl_display_InteractiveObject.__super__ = openfl_display_DisplayObject; +openfl_display_InteractiveObject.prototype = $extend(openfl_display_DisplayObject.prototype,{ + requestSoftKeyboard: function() { + openfl_utils__$internal_Lib.notImplemented({ fileName : "openfl/display/InteractiveObject.hx", lineNumber : 1255, className : "openfl.display.InteractiveObject", methodName : "requestSoftKeyboard"}); + return false; + } + ,__allowMouseFocus: function() { + if(this.mouseEnabled) { + return this.get_tabEnabled(); + } else { + return false; + } + } + ,__getInteractive: function(stack) { + if(stack != null) { + stack.push(this); + if(this.parent != null) { + this.parent.__getInteractive(stack); + } + } + return true; + } + ,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { + if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled) { + return false; + } + return openfl_display_DisplayObject.prototype.__hitTest.call(this,x,y,shapeFlag,stack,interactiveOnly,hitObject); + } + ,__tabTest: function(stack) { + if(this.get_tabEnabled()) { + stack.push(this); + } + } + ,get_tabEnabled: function() { + if(this.__tabEnabled == true) { + return true; + } else { + return false; + } + } + ,set_tabEnabled: function(value) { + if(this.__tabEnabled != value) { + this.__tabEnabled = value; + this.dispatchEvent(new openfl_events_Event("tabEnabledChange",true,false)); + } + return this.__tabEnabled; + } + ,get_tabIndex: function() { + return this.__tabIndex; + } + ,set_tabIndex: function(value) { + if(this.__tabIndex != value) { + if(value < -1) { + throw new openfl_errors_RangeError("Parameter tabIndex must be a non-negative number; got " + value); + } + this.__tabIndex = value; + this.dispatchEvent(new openfl_events_Event("tabIndexChange",true,false)); + } + return this.__tabIndex; + } + ,__class__: openfl_display_InteractiveObject + ,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{set_tabIndex:"set_tabIndex",get_tabIndex:"get_tabIndex",set_tabEnabled:"set_tabEnabled",get_tabEnabled:"get_tabEnabled"}) +}); +var openfl_display_DisplayObjectContainer = function() { + openfl_display_InteractiveObject.call(this); + this.mouseChildren = true; + this.__tabChildren = true; + this.__children = []; + this.__removedChildren = openfl_Vector.toObjectVector(null); +}; +$hxClasses["openfl.display.DisplayObjectContainer"] = openfl_display_DisplayObjectContainer; +openfl_display_DisplayObjectContainer.__name__ = "openfl.display.DisplayObjectContainer"; +openfl_display_DisplayObjectContainer.__super__ = openfl_display_InteractiveObject; +openfl_display_DisplayObjectContainer.prototype = $extend(openfl_display_InteractiveObject.prototype,{ + addChild: function(child) { + return this.addChildAt(child,this.get_numChildren()); + } + ,addChildAt: function(child,index) { + if(child == null) { + var error = new openfl_errors_TypeError("Error #2007: Parameter child must be non-null."); + error.errorID = 2007; + throw error; + } else if(child == this) { + var error = new openfl_errors_ArgumentError("Error #2024: An object cannot be added as a child of itself."); + error.errorID = 2024; + throw error; + } else if(child.stage == child) { + var error = new openfl_errors_ArgumentError("Error #3783: A Stage object cannot be added as the child of another object."); + error.errorID = 3783; + throw error; + } + if(index > this.__children.length || index < 0) { + throw haxe_Exception.thrown("Invalid index position " + index); + } + if(child.parent == this) { + if(this.__children[index] != child) { + HxOverrides.remove(this.__children,child); + this.__children.splice(index,0,child); + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + } else { + if(child.parent != null) { + child.parent.removeChild(child); + } + this.__children.splice(index,0,child); + child.parent = this; + var addedToStage = this.stage != null && child.stage == null; + if(addedToStage) { + child.__setStageReference(this.stage); + } + child.__setTransformDirty(); + if(!child.__renderDirty) { + child.__renderDirty = true; + child.__setParentRenderDirty(); + } + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + var event = new openfl_events_Event("added"); + event.bubbles = true; + event.target = child; + child.__dispatchWithCapture(event); + if(addedToStage) { + event = new openfl_events_Event("addedToStage",false,false); + child.__dispatchWithCapture(event); + child.__dispatchChildren(event); + } + } + return child; + } + ,areInaccessibleObjectsUnderPoint: function(point) { + return false; + } + ,contains: function(child) { + while(child != this && child != null) child = child.parent; + return child == this; + } + ,getChildAt: function(index) { + if(index >= 0 && index < this.__children.length) { + return this.__children[index]; + } + return null; + } + ,getChildByName: function(name) { + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + if(child.get_name() == name) { + return child; + } + } + return null; + } + ,getChildIndex: function(child) { + var _g = 0; + var _g1 = this.__children.length; + while(_g < _g1) { + var i = _g++; + if(this.__children[i] == child) { + return i; + } + } + return -1; + } + ,getObjectsUnderPoint: function(point) { + var stack = []; + this.__hitTest(point.x,point.y,false,stack,false,this); + stack.reverse(); + return stack; + } + ,removeChild: function(child) { + if(child != null && child.parent == this) { + child.__setTransformDirty(); + if(!child.__renderDirty) { + child.__renderDirty = true; + child.__setParentRenderDirty(); + } + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + var event = new openfl_events_Event("removed",true); + child.__dispatchWithCapture(event); + if(this.stage != null) { + if(child.stage != null && this.stage.get_focus() == child) { + this.stage.set_focus(null); + } + var event = new openfl_events_Event("removedFromStage",false,false); + child.__dispatchWithCapture(event); + child.__dispatchChildren(event); + child.__setStageReference(null); + } + child.parent = null; + HxOverrides.remove(this.__children,child); + this.__removedChildren.push(child); + child.__setTransformDirty(); + } + return child; + } + ,removeChildAt: function(index) { + if(index >= 0 && index < this.__children.length) { + return this.removeChild(this.__children[index]); + } + return null; + } + ,removeChildren: function(beginIndex,endIndex) { + if(endIndex == null) { + endIndex = 2147483647; + } + if(beginIndex == null) { + beginIndex = 0; + } + if(endIndex == 2147483647) { + endIndex = this.__children.length - 1; + if(endIndex < 0) { + return; + } + } + if(beginIndex > this.__children.length - 1) { + return; + } else if(endIndex < beginIndex || beginIndex < 0 || endIndex > this.__children.length) { + throw new openfl_errors_RangeError("The supplied index is out of bounds."); + } + var numRemovals = endIndex - beginIndex; + while(numRemovals >= 0) { + this.removeChildAt(beginIndex); + --numRemovals; + } + } + ,resolve: function(fieldName) { + if(this.__children == null) { + return null; + } + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + if(child.get_name() == fieldName) { + return child; + } + } + return null; + } + ,setChildIndex: function(child,index) { + if(index >= 0 && index <= this.__children.length && child.parent == this) { + HxOverrides.remove(this.__children,child); + this.__children.splice(index,0,child); + } + } + ,stopAllMovieClips: function() { + this.__stopAllMovieClips(); + } + ,swapChildren: function(child1,child2) { + if(child1.parent == this && child2.parent == this) { + var index1 = this.__children.indexOf(child1); + var index2 = this.__children.indexOf(child2); + this.__children[index1] = child2; + this.__children[index2] = child1; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + } + ,swapChildrenAt: function(index1,index2) { + var swap = this.__children[index1]; + this.__children[index1] = this.__children[index2]; + this.__children[index2] = swap; + swap = null; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + ,__cleanup: function() { + openfl_display_InteractiveObject.prototype.__cleanup.call(this); + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + child.__cleanup(); + } + var orphan = this.__removedChildren.iterator(); + while(orphan.hasNext()) { + var orphan1 = orphan.next(); + if(orphan1.stage == null) { + orphan1.__cleanup(); + } + } + this.__removedChildren.set_length(0); + } + ,__cleanupRemovedChildren: function() { + var orphan = this.__removedChildren.iterator(); + while(orphan.hasNext()) { + var orphan1 = orphan.next(); + if(orphan1.stage == null) { + orphan1.__cleanup(); + } + } + this.__removedChildren.set_length(0); + } + ,__dispatchChildren: function(event) { + if(this.__children != null) { + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + event.target = child; + if(!child.__dispatchWithCapture(event)) { + break; + } + child.__dispatchChildren(event); + } + } + } + ,__enterFrame: function(deltaTime) { + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + child.__enterFrame(deltaTime); + } + } + ,__getBounds: function(rect,matrix) { + openfl_display_InteractiveObject.prototype.__getBounds.call(this,rect,matrix); + if(this.__children.length == 0) { + return; + } + var childWorldTransform = openfl_geom_Matrix.__pool.get(); + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + if(child.__scaleX == 0 || child.__scaleY == 0) { + continue; + } + var local = child.__transform; + childWorldTransform.a = local.a * matrix.a + local.b * matrix.c; + childWorldTransform.b = local.a * matrix.b + local.b * matrix.d; + childWorldTransform.c = local.c * matrix.a + local.d * matrix.c; + childWorldTransform.d = local.c * matrix.b + local.d * matrix.d; + childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx; + childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty; + child.__getBounds(rect,childWorldTransform); + } + openfl_geom_Matrix.__pool.release(childWorldTransform); + } + ,__getFilterBounds: function(rect,matrix) { + openfl_display_InteractiveObject.prototype.__getFilterBounds.call(this,rect,matrix); + if(this.__scrollRect != null) { + return; + } + if(this.__children.length == 0) { + return; + } + var childWorldTransform = openfl_geom_Matrix.__pool.get(); + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + if(child.__scaleX == 0 || child.__scaleY == 0 || child.__isMask) { + continue; + } + var local = child.__transform; + childWorldTransform.a = local.a * matrix.a + local.b * matrix.c; + childWorldTransform.b = local.a * matrix.b + local.b * matrix.d; + childWorldTransform.c = local.c * matrix.a + local.d * matrix.c; + childWorldTransform.d = local.c * matrix.b + local.d * matrix.d; + childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx; + childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty; + var childRect = openfl_geom_Rectangle.__pool.get(); + child.__getFilterBounds(childRect,childWorldTransform); + rect.__expand(childRect.x,childRect.y,childRect.width,childRect.height); + openfl_geom_Rectangle.__pool.release(childRect); + } + openfl_geom_Matrix.__pool.release(childWorldTransform); + } + ,__getRenderBounds: function(rect,matrix) { + if(this.__scrollRect != null) { + openfl_display_InteractiveObject.prototype.__getRenderBounds.call(this,rect,matrix); + return; + } else { + openfl_display_InteractiveObject.prototype.__getBounds.call(this,rect,matrix); + } + if(this.__children.length == 0) { + return; + } + var childWorldTransform = openfl_geom_Matrix.__pool.get(); + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + if(child.__scaleX == 0 || child.__scaleY == 0 || child.__isMask) { + continue; + } + var local = child.__transform; + childWorldTransform.a = local.a * matrix.a + local.b * matrix.c; + childWorldTransform.b = local.a * matrix.b + local.b * matrix.d; + childWorldTransform.c = local.c * matrix.a + local.d * matrix.c; + childWorldTransform.d = local.c * matrix.b + local.d * matrix.d; + childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx; + childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty; + child.__getRenderBounds(rect,childWorldTransform); + } + openfl_geom_Matrix.__pool.release(childWorldTransform); + } + ,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { + if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled && !this.mouseChildren) { + return false; + } + if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) { + return false; + } + if(this.__scrollRect != null) { + var point = openfl_geom_Point.__pool.get(); + point.setTo(x,y); + var _this = this.__getRenderTransform(); + var norm = _this.a * _this.d - _this.b * _this.c; + if(norm == 0) { + point.x = -_this.tx; + point.y = -_this.ty; + } else { + var px = 1.0 / norm * (_this.c * (_this.ty - point.y) + _this.d * (point.x - _this.tx)); + point.y = 1.0 / norm * (_this.a * (point.y - _this.ty) + _this.b * (_this.tx - point.x)); + point.x = px; + } + if(!this.__scrollRect.containsPoint(point)) { + openfl_geom_Point.__pool.release(point); + return false; + } + openfl_geom_Point.__pool.release(point); + } + var i = this.__children.length; + if(interactiveOnly) { + if(stack == null || !this.mouseChildren) { + while(--i >= 0) if(this.__children[i].__hitTest(x,y,shapeFlag,null,true,this.__children[i])) { + if(stack != null) { + stack.push(hitObject); + } + return true; + } + } else if(stack != null) { + var length = stack.length; + var interactive = false; + var hitTest = false; + while(--i >= 0) { + interactive = this.__children[i].__getInteractive(null); + if(interactive || this.mouseEnabled && !hitTest) { + if(this.__children[i].__hitTest(x,y,shapeFlag,stack,true,this.__children[i])) { + hitTest = true; + if(interactive && stack.length > length) { + break; + } + } + } + } + if(hitTest) { + stack.splice(length,0,hitObject); + return true; + } + } + } else { + var hitTest = false; + while(--i >= 0) if(this.__children[i].__hitTest(x,y,shapeFlag,stack,false,this.__children[i])) { + hitTest = true; + if(stack == null) { + break; + } + } + return hitTest; + } + return false; + } + ,__hitTestMask: function(x,y) { + var i = this.__children.length; + while(--i >= 0) if(this.__children[i].__hitTestMask(x,y)) { + return true; + } + return false; + } + ,__readGraphicsData: function(graphicsData,recurse) { + openfl_display_InteractiveObject.prototype.__readGraphicsData.call(this,graphicsData,recurse); + if(recurse) { + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + child.__readGraphicsData(graphicsData,recurse); + } + } + } + ,__setStageReference: function(stage) { + openfl_display_InteractiveObject.prototype.__setStageReference.call(this,stage); + if(this.__children != null) { + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + child.__setStageReference(stage); + } + } + } + ,__setWorldTransformInvalid: function() { + if(!this.__worldTransformInvalid) { + this.__worldTransformInvalid = true; + if(this.__children != null) { + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + child.__setWorldTransformInvalid(); + } + } + } + } + ,__stopAllMovieClips: function() { + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + child.__stopAllMovieClips(); + } + } + ,__tabTest: function(stack) { + openfl_display_InteractiveObject.prototype.__tabTest.call(this,stack); + if(!this.get_tabChildren()) { + return; + } + var interactive = false; + var interactiveObject = null; + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + interactive = child.__getInteractive(null); + if(interactive) { + interactiveObject = child; + interactiveObject.__tabTest(stack); + } + } + } + ,__update: function(transformOnly,updateChildren) { + openfl_display_InteractiveObject.prototype.__update.call(this,transformOnly,updateChildren); + if(updateChildren) { + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + child.__update(transformOnly,true); + } + } + } + ,get_numChildren: function() { + return this.__children.length; + } + ,get_tabChildren: function() { + return this.__tabChildren; + } + ,set_tabChildren: function(value) { + if(this.__tabChildren != value) { + this.__tabChildren = value; + this.dispatchEvent(new openfl_events_Event("tabChildrenChange",true,false)); + } + return this.__tabChildren; + } + ,__class__: openfl_display_DisplayObjectContainer + ,__properties__: $extend(openfl_display_InteractiveObject.prototype.__properties__,{set_tabChildren:"set_tabChildren",get_tabChildren:"get_tabChildren",get_numChildren:"get_numChildren"}) +}); +var openfl_display_Sprite = function() { + openfl_display_DisplayObjectContainer.call(this); + this.__drawableType = 4; + this.__buttonMode = false; + this.useHandCursor = true; + if(this.__pendingBindLibrary != null) { + var library = this.__pendingBindLibrary; + var className = this.__pendingBindClassName; + this.__pendingBindLibrary = null; + this.__pendingBindClassName = null; + library.bind(className,this); + } else if(openfl_display_Sprite.__constructor != null) { + var method = openfl_display_Sprite.__constructor; + openfl_display_Sprite.__constructor = null; + method(this); + } +}; +$hxClasses["openfl.display.Sprite"] = openfl_display_Sprite; +openfl_display_Sprite.__name__ = "openfl.display.Sprite"; +openfl_display_Sprite.fromTimeline = function(timeline) { + var sprite = new openfl_display_Sprite(); + timeline.initializeSprite(sprite); + return sprite; +}; +openfl_display_Sprite.__super__ = openfl_display_DisplayObjectContainer; +openfl_display_Sprite.prototype = $extend(openfl_display_DisplayObjectContainer.prototype,{ + startDrag: function(lockCenter,bounds) { + if(lockCenter == null) { + lockCenter = false; + } + if(this.stage != null) { + this.stage.__startDrag(this,lockCenter,bounds); + } + } + ,stopDrag: function() { + if(this.stage != null) { + this.stage.__stopDrag(this); + } + } + ,__setStageReference: function(stage) { + if(this.stage != stage && this.stage != null && this.stage.__dragObject == this) { + this.stopDrag(); + } + openfl_display_DisplayObjectContainer.prototype.__setStageReference.call(this,stage); + } + ,__bind: function(library,className) { + if(this.__worldTransform == null) { + this.__pendingBindLibrary = library; + this.__pendingBindClassName = className; + } else if(library == null || className == null || !library.bind(className,this)) { + lime_utils_Log.error("Cannot bind class name \"" + className + "\"",{ fileName : "openfl/display/Sprite.hx", lineNumber : 297, className : "openfl.display.Sprite", methodName : "__bind"}); + } + } + ,__getCursor: function() { + if(this.__buttonMode && this.useHandCursor) { + return "button"; + } else { + return null; + } + } + ,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { + if(interactiveOnly && !this.mouseEnabled && !this.mouseChildren) { + return false; + } + if(!hitObject.get_visible() || this.__isMask) { + return this.__hitTestHitArea(x,y,shapeFlag,stack,interactiveOnly,hitObject); + } + if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) { + return this.__hitTestHitArea(x,y,shapeFlag,stack,interactiveOnly,hitObject); + } + if(this.__scrollRect != null) { + var point = openfl_geom_Point.__pool.get(); + point.setTo(x,y); + var _this = this.__getRenderTransform(); + var norm = _this.a * _this.d - _this.b * _this.c; + if(norm == 0) { + point.x = -_this.tx; + point.y = -_this.ty; + } else { + var px = 1.0 / norm * (_this.c * (_this.ty - point.y) + _this.d * (point.x - _this.tx)); + point.y = 1.0 / norm * (_this.a * (point.y - _this.ty) + _this.b * (_this.tx - point.x)); + point.x = px; + } + if(!this.__scrollRect.containsPoint(point)) { + openfl_geom_Point.__pool.release(point); + return this.__hitTestHitArea(x,y,shapeFlag,stack,true,hitObject); + } + openfl_geom_Point.__pool.release(point); + } + if(openfl_display_DisplayObjectContainer.prototype.__hitTest.call(this,x,y,shapeFlag,stack,interactiveOnly,hitObject)) { + if(stack != null) { + return interactiveOnly; + } else { + return true; + } + } else if(this.hitArea == null && this.__graphics != null && this.__graphics.__hitTest(x,y,shapeFlag,this.__getRenderTransform())) { + if(stack != null && (!interactiveOnly || this.mouseEnabled)) { + stack.push(hitObject); + } + return true; + } + return this.__hitTestHitArea(x,y,shapeFlag,stack,interactiveOnly,hitObject); + } + ,__hitTestHitArea: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { + if(this.hitArea != null) { + if(!this.hitArea.mouseEnabled) { + this.hitArea.mouseEnabled = true; + var hitTest = this.hitArea.__hitTest(x,y,shapeFlag,null,true,hitObject); + this.hitArea.mouseEnabled = false; + if(stack != null && hitTest) { + stack[stack.length] = hitObject; + } + return hitTest; + } + } + return false; + } + ,__hitTestMask: function(x,y) { + if(openfl_display_DisplayObjectContainer.prototype.__hitTestMask.call(this,x,y)) { + return true; + } else if(this.__graphics != null && this.__graphics.__hitTest(x,y,true,this.__getRenderTransform())) { + return true; + } + return false; + } + ,get_graphics: function() { + if(this.__graphics == null) { + this.__graphics = new openfl_display_Graphics(this); + } + return this.__graphics; + } + ,get_tabEnabled: function() { + if(this.__tabEnabled == null) { + return this.__buttonMode; + } else { + return this.__tabEnabled; + } + } + ,get_buttonMode: function() { + return this.__buttonMode; + } + ,set_buttonMode: function(value) { + return this.__buttonMode = value; + } + ,__class__: openfl_display_Sprite + ,__properties__: $extend(openfl_display_DisplayObjectContainer.prototype.__properties__,{get_graphics:"get_graphics",set_buttonMode:"set_buttonMode",get_buttonMode:"get_buttonMode"}) +}); +var feathers_core_IValidating = function() { }; +$hxClasses["feathers.core.IValidating"] = feathers_core_IValidating; +feathers_core_IValidating.__name__ = "feathers.core.IValidating"; +feathers_core_IValidating.__isInterface__ = true; +feathers_core_IValidating.prototype = { + __class__: feathers_core_IValidating + ,__properties__: {get_depth:"get_depth"} +}; +var feathers_core_ValidatingSprite = function() { + this._setInvalidationFlagsOnly = false; + this._ignoreInvalidationFlags = false; + this._depth = -1; + this._validationQueue = null; + this._setInvalidCount = 0; + this._delayedInvalidationFlags = new haxe_ds_EnumValueMap(); + this._invalidationFlags = new haxe_ds_EnumValueMap(); + this._allInvalidDelayed = false; + this._allInvalid = false; + this._validating = false; + openfl_display_Sprite.call(this); + this.addEventListener("addedToStage",$bind(this,this.validatingSprite_addedToStageHandler)); + this.addEventListener("removedFromStage",$bind(this,this.validatingSprite_removedFromStageHandler)); +}; +$hxClasses["feathers.core.ValidatingSprite"] = feathers_core_ValidatingSprite; +feathers_core_ValidatingSprite.__name__ = "feathers.core.ValidatingSprite"; +feathers_core_ValidatingSprite.__interfaces__ = [feathers_core_IValidating]; +feathers_core_ValidatingSprite.__super__ = openfl_display_Sprite; +feathers_core_ValidatingSprite.prototype = $extend(openfl_display_Sprite.prototype,{ + get_validating: function() { + return this._validating; + } + ,get_depth: function() { + return this._depth; + } + ,isInvalid: function(flag) { + if(this._allInvalid) { + return true; + } + if(flag == null) { + return this._invalidationFlags.keys().hasNext(); + } + return this._invalidationFlags.exists(flag); + } + ,runWithoutInvalidation: function(callback) { + var oldIgnoreValidation = this._ignoreInvalidationFlags; + this._ignoreInvalidationFlags = true; + callback(); + this._ignoreInvalidationFlags = oldIgnoreValidation; + } + ,runWithInvalidationFlagsOnly: function(callback) { + var oldValue = this._setInvalidationFlagsOnly; + this._setInvalidationFlagsOnly = true; + callback(); + this._setInvalidationFlagsOnly = oldValue; + } + ,setInvalid: function(flag) { + if(this._ignoreInvalidationFlags) { + return; + } + if(this._setInvalidationFlagsOnly) { + if(flag == null) { + this._allInvalid = true; + } else { + this.setInvalidationFlag(flag); + } + return; + } + var alreadyInvalid = this.isInvalid(); + var alreadyDelayedInvalid = false; + if(this._validating) { + alreadyDelayedInvalid = this._delayedInvalidationFlags.keys().hasNext(); + } + if(flag == null) { + if(this._validating) { + this._allInvalidDelayed = true; + } else { + this._allInvalid = true; + } + } else if(this._validating) { + this._delayedInvalidationFlags.set(flag,true); + } else if(flag != null && !this._invalidationFlags.exists(flag)) { + this._invalidationFlags.set(flag,true); + } + if(this._validationQueue == null) { + return; + } + if(this._validating) { + if(alreadyDelayedInvalid) { + return; + } + this._setInvalidCount++; + if(this._setInvalidCount >= 10) { + var c = js_Boot.getClass(this); + throw new openfl_errors_IllegalOperationError(c.__name__ + " returned to validation queue too many times during validation. This may be an infinite loop. Try to avoid doing anything that calls setInvalid() during validation."); + } + this._validationQueue.addControl(this); + return; + } + if(alreadyInvalid) { + return; + } + this._setInvalidCount = 0; + this._validationQueue.addControl(this); + } + ,validateNow: function() { + if(!this.isInvalid()) { + return; + } + if(this._validating) { + return; + } + this._validating = true; + this.update(); + this._allInvalid = this._allInvalidDelayed; + this._allInvalidDelayed = false; + this._invalidationFlags.clear(); + var flag = this._delayedInvalidationFlags.keys(); + while(flag.hasNext()) { + var flag1 = flag.next(); + this._invalidationFlags.set(flag1,true); + } + this._delayedInvalidationFlags.clear(); + this._validating = false; + } + ,setInvalidationFlag: function(flag) { + if(this._ignoreInvalidationFlags) { + return; + } + if(this._invalidationFlags.exists(flag)) { + return; + } + this._invalidationFlags.set(flag,true); + } + ,update: function() { + } + ,validatingSprite_addedToStageHandler: function(event) { + this._depth = feathers_utils_DisplayUtil.getDisplayObjectDepthFromStage(this); + this._validationQueue = feathers_core_ValidationQueue.forStage(this.stage); + if(this._validationQueue != null && this.isInvalid()) { + this._setInvalidCount = 0; + this._validationQueue.addControl(this); + } + } + ,validatingSprite_removedFromStageHandler: function(event) { + this._depth = -1; + this._validationQueue = null; + } + ,__class__: feathers_core_ValidatingSprite + ,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{get_depth:"get_depth",get_validating:"get_validating"}) +}); +var feathers_core_IDisplayObject = function() { }; +$hxClasses["feathers.core.IDisplayObject"] = feathers_core_IDisplayObject; +feathers_core_IDisplayObject.__name__ = "feathers.core.IDisplayObject"; +feathers_core_IDisplayObject.__isInterface__ = true; +feathers_core_IDisplayObject.__interfaces__ = [openfl_events_IEventDispatcher]; +feathers_core_IDisplayObject.prototype = { + __class__: feathers_core_IDisplayObject + ,__properties__: {set_visible:"set_visible",get_visible:"get_visible",set_scaleY:"set_scaleY",get_scaleY:"get_scaleY",set_scaleX:"set_scaleX",get_scaleX:"get_scaleX",set_height:"set_height",get_height:"get_height",set_width:"set_width",get_width:"get_width",set_alpha:"set_alpha",get_alpha:"get_alpha",set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x"} +}; +var feathers_core_IMeasureObject = function() { }; +$hxClasses["feathers.core.IMeasureObject"] = feathers_core_IMeasureObject; +feathers_core_IMeasureObject.__name__ = "feathers.core.IMeasureObject"; +feathers_core_IMeasureObject.__isInterface__ = true; +feathers_core_IMeasureObject.__interfaces__ = [feathers_core_IDisplayObject]; +feathers_core_IMeasureObject.prototype = { + __class__: feathers_core_IMeasureObject + ,__properties__: {set_maxHeight:"set_maxHeight",get_maxHeight:"get_maxHeight",set_maxWidth:"set_maxWidth",get_maxWidth:"get_maxWidth",set_minHeight:"set_minHeight",get_minHeight:"get_minHeight",set_minWidth:"set_minWidth",get_minWidth:"get_minWidth",get_explicitMaxHeight:"get_explicitMaxHeight",get_explicitMaxWidth:"get_explicitMaxWidth",get_explicitMinHeight:"get_explicitMinHeight",get_explicitMinWidth:"get_explicitMinWidth",get_explicitHeight:"get_explicitHeight",get_explicitWidth:"get_explicitWidth"} +}; +var feathers_core_MeasureSprite = function() { + this._explicitMaxHeight = null; + this._explicitMaxWidth = null; + this._explicitMinHeight = null; + this._explicitMinWidth = null; + this._explicitHeight = null; + this._explicitWidth = null; + this.scaledActualMaxHeight = 1.0 / 0.0; + this.scaledActualMaxWidth = 1.0 / 0.0; + this.scaledActualMinHeight = 0.0; + this.scaledActualMinWidth = 0.0; + this.scaledActualHeight = 0.0; + this.scaledActualWidth = 0.0; + this.actualMaxHeight = 1.0 / 0.0; + this.actualMaxWidth = 1.0 / 0.0; + this.actualMinHeight = 0.0; + this.actualMinWidth = 0.0; + this.actualHeight = 0.0; + this.actualWidth = 0.0; + feathers_core_ValidatingSprite.call(this); +}; +$hxClasses["feathers.core.MeasureSprite"] = feathers_core_MeasureSprite; +feathers_core_MeasureSprite.__name__ = "feathers.core.MeasureSprite"; +feathers_core_MeasureSprite.__interfaces__ = [feathers_core_IMeasureObject]; +feathers_core_MeasureSprite.__super__ = feathers_core_ValidatingSprite; +feathers_core_MeasureSprite.prototype = $extend(feathers_core_ValidatingSprite.prototype,{ + get_width: function() { + return this.scaledActualWidth; + } + ,set_width: function(value) { + if(this.get_scaleX() != 1.0) { + value /= this.get_scaleX(); + } + this.set_explicitWidth(value); + return this.scaledActualWidth; + } + ,get_height: function() { + return this.scaledActualHeight; + } + ,set_height: function(value) { + if(this.get_scaleY() != 1.0) { + value /= this.get_scaleY(); + } + this.set_explicitHeight(value); + return this.scaledActualHeight; + } + ,set_scaleX: function(value) { + feathers_core_ValidatingSprite.prototype.set_scaleX.call(this,value); + this.saveMeasurements(this.actualWidth,this.actualHeight,this.actualMinWidth,this.actualMinHeight,this.actualMaxWidth,this.actualMaxHeight); + return this.get_scaleX(); + } + ,set_scaleY: function(value) { + feathers_core_ValidatingSprite.prototype.set_scaleY.call(this,value); + this.saveMeasurements(this.actualWidth,this.actualHeight,this.actualMinWidth,this.actualMinHeight,this.actualMaxWidth,this.actualMaxHeight); + return this.get_scaleY(); + } + ,get_explicitWidth: function() { + return this._explicitWidth; + } + ,set_explicitWidth: function(value) { + if(this._explicitWidth == value) { + return this._explicitWidth; + } + this._explicitWidth = value; + if(value == null) { + this.actualWidth = 0.0; + this.scaledActualWidth = 0.0; + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } else { + var result = this.saveMeasurements(value,this.actualHeight,this.actualMinWidth,this.actualMinHeight,this.actualMaxWidth,this.actualMaxHeight); + if(result) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + } + return this._explicitWidth; + } + ,get_explicitHeight: function() { + return this._explicitHeight; + } + ,set_explicitHeight: function(value) { + if(this._explicitHeight == value) { + return this._explicitHeight; + } + this._explicitHeight = value; + if(value == null) { + this.actualHeight = 0.0; + this.scaledActualHeight = 0.0; + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } else { + var result = this.saveMeasurements(this.actualWidth,value,this.actualMinWidth,this.actualMinHeight,this.actualMaxWidth,this.actualMaxHeight); + if(result) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + } + return this._explicitHeight; + } + ,get_explicitMinWidth: function() { + return this._explicitMinWidth; + } + ,set_explicitMinWidth: function(value) { + if(this._explicitMinWidth == value) { + return this._explicitMinWidth; + } + var oldValue = this._explicitMinWidth; + this._explicitMinWidth = value; + if(value == null) { + this.actualMinWidth = 0.0; + this.scaledActualMinWidth = 0.0; + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } else { + var actualWidth = this.actualWidth; + this.saveMeasurements(this.actualWidth,this.actualHeight,value,this.actualMinHeight,this.actualMaxWidth,this.actualMaxHeight); + if(this._explicitWidth == null && (actualWidth < value || actualWidth == oldValue)) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + } + return this._explicitMinWidth; + } + ,get_explicitMinHeight: function() { + return this._explicitMinHeight; + } + ,set_explicitMinHeight: function(value) { + if(this._explicitMinHeight == value) { + return this._explicitMinHeight; + } + var oldValue = this._explicitMinHeight; + this._explicitMinHeight = value; + if(value == null) { + this.actualMinHeight = 0.0; + this.scaledActualMinHeight = 0.0; + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } else { + var actualHeight = this.actualHeight; + this.saveMeasurements(this.actualWidth,this.actualHeight,this.actualMinWidth,value,this.actualMaxWidth,this.actualMaxHeight); + if(this._explicitHeight == null && (actualHeight < value || actualHeight == oldValue)) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + } + return this._explicitMinHeight; + } + ,get_minWidth: function() { + return this.scaledActualMinWidth; + } + ,set_minWidth: function(value) { + if(this.get_scaleX() != 1) { + value /= this.get_scaleX(); + } + this.set_explicitMinWidth(value); + return this.scaledActualMinWidth; + } + ,get_minHeight: function() { + return this.scaledActualMinHeight; + } + ,set_minHeight: function(value) { + if(this.get_scaleY() != 1) { + value /= this.get_scaleY(); + } + this.set_explicitMinHeight(value); + return this.scaledActualMinHeight; + } + ,get_explicitMaxWidth: function() { + return this._explicitMaxWidth; + } + ,set_explicitMaxWidth: function(value) { + if(this._explicitMaxWidth == value) { + return this._explicitMaxWidth; + } + var oldValue = this._explicitMaxWidth; + this._explicitMaxWidth = value; + if(value == null) { + this.actualMaxWidth = 1.0 / 0.0; + this.scaledActualMaxWidth = 1.0 / 0.0; + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } else { + var actualWidth = this.actualWidth; + this.saveMeasurements(this.actualWidth,this.actualHeight,this.actualMinWidth,this.actualMinHeight,value,this.actualMaxHeight); + if(this._explicitWidth == null && (actualWidth > value || actualWidth == oldValue)) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + } + return this._explicitMaxWidth; + } + ,get_explicitMaxHeight: function() { + return this._explicitMaxHeight; + } + ,set_explicitMaxHeight: function(value) { + if(this._explicitMaxHeight == value) { + return this._explicitMaxHeight; + } + var oldValue = this._explicitMaxHeight; + this._explicitMaxHeight = value; + if(value == null) { + this.actualMaxHeight = 1.0 / 0.0; + this.scaledActualMaxHeight = 1.0 / 0.0; + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } else { + var actualHeight = this.actualHeight; + this.saveMeasurements(this.actualWidth,this.actualHeight,this.actualMinWidth,this.actualMinHeight,this.actualMaxWidth,value); + if(this._explicitHeight == null && (actualHeight > value || actualHeight == oldValue)) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + } + return this._explicitMaxHeight; + } + ,get_maxWidth: function() { + return this.scaledActualMaxWidth; + } + ,set_maxWidth: function(value) { + if(this.get_scaleX() != 1) { + value /= this.get_scaleX(); + } + this.set_explicitMaxWidth(value); + return this.scaledActualMaxWidth; + } + ,get_maxHeight: function() { + return this.scaledActualMaxHeight; + } + ,set_maxHeight: function(value) { + if(this.get_scaleY() != 1) { + value /= this.get_scaleY(); + } + this.set_explicitMaxHeight(value); + return this.scaledActualMaxHeight; + } + ,resetWidth: function() { + this.set_explicitWidth(null); + } + ,resetHeight: function() { + this.set_explicitHeight(null); + } + ,resetMinWidth: function() { + this.set_explicitMinWidth(null); + } + ,resetMinHeight: function() { + this.set_explicitMinHeight(null); + } + ,resetMaxWidth: function() { + this.set_explicitMaxWidth(null); + } + ,resetMaxHeight: function() { + this.set_explicitMaxHeight(null); + } + ,getBounds: function(targetCoordinateSpace) { + if(this.__getBoundsHelperMatrix1 == null) { + this.__getBoundsHelperMatrix1 = new openfl_geom_Matrix(); + } else { + this.__getBoundsHelperMatrix1.identity(); + } + if(targetCoordinateSpace != null && targetCoordinateSpace != this) { + if(this.__getBoundsHelperMatrix2 == null) { + this.__getBoundsHelperMatrix2 = new openfl_geom_Matrix(); + } + var worldTransform1 = this.__getWorldTransform(); + this.__getBoundsHelperMatrix1.copyFrom(worldTransform1); + var worldTransform2 = targetCoordinateSpace.__getWorldTransform(); + this.__getBoundsHelperMatrix2.copyFrom(worldTransform2); + this.__getBoundsHelperMatrix2.invert(); + this.__getBoundsHelperMatrix1.concat(this.__getBoundsHelperMatrix2); + this.__getBoundsHelperMatrix2.identity(); + } + var x = this.__getBoundsHelperMatrix1.tx; + var y = this.__getBoundsHelperMatrix1.ty; + var w = this.actualWidth * this.__getBoundsHelperMatrix1.a + this.actualHeight * this.__getBoundsHelperMatrix1.c + this.__getBoundsHelperMatrix1.tx - x; + var h = this.actualWidth * this.__getBoundsHelperMatrix1.b + this.actualHeight * this.__getBoundsHelperMatrix1.d + this.__getBoundsHelperMatrix1.ty - y; + this.__getBoundsHelperMatrix1.identity(); + return new openfl_geom_Rectangle(x,y,w,h); + } + ,saveMeasurements: function(width,height,minWidth,minHeight,maxWidth,maxHeight) { + if(minHeight == null) { + minHeight = 0.0; + } + if(minWidth == null) { + minWidth = 0.0; + } + if(maxWidth == null) { + maxWidth = 1.0 / 0.0; + } + if(maxHeight == null) { + maxHeight = 1.0 / 0.0; + } + if(this._explicitMinWidth != null) { + minWidth = this._explicitMinWidth; + } + if(this._explicitMinHeight != null) { + minHeight = this._explicitMinHeight; + } + if(this._explicitMaxWidth != null) { + maxWidth = this._explicitMaxWidth; + } else if(maxWidth == null) { + maxWidth = 1.0 / 0.0; + } + if(this._explicitMaxHeight != null) { + maxHeight = this._explicitMaxHeight; + } else if(maxHeight == null) { + maxHeight = 1.0 / 0.0; + } + if(this._explicitMaxWidth == null && maxWidth < minWidth) { + maxWidth = minWidth; + } + if(this._explicitMinWidth == null && minWidth > maxWidth) { + minWidth = maxWidth; + } + if(this._explicitMaxHeight == null && maxHeight < minHeight) { + maxHeight = minHeight; + } + if(this._explicitMinHeight == null && minHeight > maxHeight) { + minHeight = maxHeight; + } + if(this._explicitWidth != null) { + width = this._explicitWidth; + } else if(width < minWidth) { + width = minWidth; + } else if(width > maxWidth) { + width = maxWidth; + } + if(this._explicitHeight != null) { + height = this._explicitHeight; + } else if(height < minHeight) { + height = minHeight; + } else if(height > maxHeight) { + height = maxHeight; + } + var scaleX = this.get_scaleX(); + if(scaleX < 0.0) { + scaleX = -scaleX; + } + var scaleY = this.get_scaleY(); + if(scaleY < 0.0) { + scaleY = -scaleY; + } + var resized = false; + if(this.actualWidth != width) { + this.actualWidth = width; + resized = true; + } + if(this.actualHeight != height) { + this.actualHeight = height; + resized = true; + } + if(this.actualMinWidth != minWidth) { + this.actualMinWidth = minWidth; + resized = true; + } + if(this.actualMinHeight != minHeight) { + this.actualMinHeight = minHeight; + resized = true; + } + if(this.actualMaxWidth != maxWidth) { + this.actualMaxWidth = maxWidth; + resized = true; + } + if(this.actualMaxHeight != maxHeight) { + this.actualMaxHeight = maxHeight; + resized = true; + } + width = this.scaledActualWidth; + height = this.scaledActualHeight; + this.scaledActualWidth = this.actualWidth * scaleX; + this.scaledActualHeight = this.actualHeight * scaleY; + this.scaledActualMinWidth = this.actualMinWidth * scaleX; + this.scaledActualMinHeight = this.actualMinHeight * scaleY; + this.scaledActualMaxWidth = this.actualMaxWidth * scaleX; + this.scaledActualMaxHeight = this.actualMaxHeight * scaleY; + if(width != this.scaledActualWidth || height != this.scaledActualHeight) { + resized = true; + feathers_events_FeathersEvent.dispatch(this,"resize"); + } + return resized; + } + ,__class__: feathers_core_MeasureSprite + ,__properties__: $extend(feathers_core_ValidatingSprite.prototype.__properties__,{set_maxHeight:"set_maxHeight",get_maxHeight:"get_maxHeight",set_maxWidth:"set_maxWidth",get_maxWidth:"get_maxWidth",set_explicitMaxHeight:"set_explicitMaxHeight",get_explicitMaxHeight:"get_explicitMaxHeight",set_explicitMaxWidth:"set_explicitMaxWidth",get_explicitMaxWidth:"get_explicitMaxWidth",set_minHeight:"set_minHeight",get_minHeight:"get_minHeight",set_minWidth:"set_minWidth",get_minWidth:"get_minWidth",set_explicitMinHeight:"set_explicitMinHeight",get_explicitMinHeight:"get_explicitMinHeight",set_explicitMinWidth:"set_explicitMinWidth",get_explicitMinWidth:"get_explicitMinWidth",set_explicitHeight:"set_explicitHeight",get_explicitHeight:"get_explicitHeight",set_explicitWidth:"set_explicitWidth",get_explicitWidth:"get_explicitWidth"}) +}); +var feathers_layout_ILayoutObject = function() { }; +$hxClasses["feathers.layout.ILayoutObject"] = feathers_layout_ILayoutObject; +feathers_layout_ILayoutObject.__name__ = "feathers.layout.ILayoutObject"; +feathers_layout_ILayoutObject.__isInterface__ = true; +feathers_layout_ILayoutObject.__interfaces__ = [openfl_events_IEventDispatcher]; +feathers_layout_ILayoutObject.prototype = { + __class__: feathers_layout_ILayoutObject + ,__properties__: {set_layoutData:"set_layoutData",get_layoutData:"get_layoutData",set_includeInLayout:"set_includeInLayout",get_includeInLayout:"get_includeInLayout"} +}; +var feathers_style_IStyleObject = function() { }; +$hxClasses["feathers.style.IStyleObject"] = feathers_style_IStyleObject; +feathers_style_IStyleObject.__name__ = "feathers.style.IStyleObject"; +feathers_style_IStyleObject.__isInterface__ = true; +feathers_style_IStyleObject.prototype = { + __class__: feathers_style_IStyleObject + ,__properties__: {set_themeEnabled:"set_themeEnabled",get_themeEnabled:"get_themeEnabled"} +}; +var feathers_style_IVariantStyleObject = function() { }; +$hxClasses["feathers.style.IVariantStyleObject"] = feathers_style_IVariantStyleObject; +feathers_style_IVariantStyleObject.__name__ = "feathers.style.IVariantStyleObject"; +feathers_style_IVariantStyleObject.__isInterface__ = true; +feathers_style_IVariantStyleObject.__interfaces__ = [feathers_style_IStyleObject]; +feathers_style_IVariantStyleObject.prototype = { + __class__: feathers_style_IVariantStyleObject + ,__properties__: {set_variant:"set_variant",get_variant:"get_variant",get_styleContext:"get_styleContext"} +}; +var feathers_core_IUIControl = function() { }; +$hxClasses["feathers.core.IUIControl"] = feathers_core_IUIControl; +feathers_core_IUIControl.__name__ = "feathers.core.IUIControl"; +feathers_core_IUIControl.__isInterface__ = true; +feathers_core_IUIControl.__interfaces__ = [feathers_core_IDisplayObject]; +feathers_core_IUIControl.prototype = { + __class__: feathers_core_IUIControl + ,__properties__: {set_toolTip:"set_toolTip",get_toolTip:"get_toolTip",set_enabled:"set_enabled",get_enabled:"get_enabled"} +}; +var feathers_core_FeathersControl = function() { + this._restrictedStyles = []; + this._styleProviderStyles = []; + this._clearingStyles = false; + this._applyingStyles = false; + this._focusPaddingLeft = 0.0; + this._focusPaddingBottom = 0.0; + this._focusPaddingRight = 0.0; + this._focusPaddingTop = 0.0; + this._focusRectSkin = null; + this._alwaysShowFocus = false; + this._currentFocusRectSkin = null; + this._focusEnabled = true; + this._focusManager = null; + this._disabledAlpha = null; + this._explicitAlpha = 1.0; + this._includeInLayout = true; + this._customStyleProvider = null; + this._currentStyleProvider = null; + this._themeEnabled = true; + this._toolTip = null; + this._enabled = true; + this._created = false; + this._initialized = false; + this._initializing = false; + this._waitingToApplyStyles = false; + feathers_core_MeasureSprite.call(this); + this.set_tabEnabled(js_Boot.__implements(this,feathers_core_IFocusObject)); + this.addEventListener("addedToStage",$bind(this,this.feathersControl_addedToStageHandler)); + this.addEventListener("removedFromStage",$bind(this,this.feathersControl_removedFromStageHandler)); + this.addEventListener("focusIn",$bind(this,this.feathersControl_focusInHandler)); + this.addEventListener("focusOut",$bind(this,this.feathersControl_focusOutHandler)); +}; +$hxClasses["feathers.core.FeathersControl"] = feathers_core_FeathersControl; +feathers_core_FeathersControl.__name__ = "feathers.core.FeathersControl"; +feathers_core_FeathersControl.__interfaces__ = [feathers_layout_ILayoutObject,feathers_style_IVariantStyleObject,feathers_core_IUIControl]; +feathers_core_FeathersControl.__super__ = feathers_core_MeasureSprite; +feathers_core_FeathersControl.prototype = $extend(feathers_core_MeasureSprite.prototype,{ + get_initialized: function() { + return this._initialized; + } + ,get_created: function() { + return this._created; + } + ,get_enabled: function() { + return this._enabled; + } + ,set_enabled: function(value) { + if(this._enabled == value) { + return this._enabled; + } + this._enabled = value; + if(this._enabled || this._disabledAlpha == null) { + feathers_core_MeasureSprite.prototype.set_alpha.call(this,this._explicitAlpha); + } else if(!this._enabled && this._disabledAlpha != null) { + feathers_core_MeasureSprite.prototype.set_alpha.call(this,this._disabledAlpha); + } + this.setInvalid(feathers_core_InvalidationFlag.STATE); + if(this._enabled) { + feathers_events_FeathersEvent.dispatch(this,"enable"); + } else { + feathers_events_FeathersEvent.dispatch(this,"disable"); + } + return this._enabled; + } + ,get_toolTip: function() { + return this._toolTip; + } + ,set_toolTip: function(value) { + if(this._toolTip == value) { + return this._toolTip; + } + this._toolTip = value; + return this._toolTip; + } + ,get_themeEnabled: function() { + return this._themeEnabled; + } + ,set_themeEnabled: function(value) { + if(this._themeEnabled == value) { + return this._themeEnabled; + } + this._themeEnabled = value; + if(this._initialized && this.stage != null) { + this.applyStyles(); + } else { + this._waitingToApplyStyles = true; + } + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._themeEnabled; + } + ,get_styleProvider: function() { + if(this._customStyleProvider != null) { + return this._customStyleProvider; + } + return this._currentStyleProvider; + } + ,set_styleProvider: function(value) { + if(this._customStyleProvider == value) { + return this._customStyleProvider; + } + if(this._customStyleProvider != null) { + this._customStyleProvider.removeEventListener("clear",$bind(this,this.feathersControl_customStyleProvider_clearHandler)); + } + this._customStyleProvider = value; + if(this._customStyleProvider != null) { + this._customStyleProvider.addEventListener("clear",$bind(this,this.feathersControl_customStyleProvider_clearHandler),false,0,true); + } + if(this._initialized && this.stage != null) { + this.applyStyles(); + } else { + this._waitingToApplyStyles = true; + } + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._customStyleProvider; + } + ,get_styleContext: function() { + return null; + } + ,get_includeInLayout: function() { + return this._includeInLayout; + } + ,set_includeInLayout: function(value) { + if(this._includeInLayout == value) { + return this._includeInLayout; + } + this._includeInLayout = value; + feathers_events_FeathersEvent.dispatch(this,"layoutDataChange"); + return this._includeInLayout; + } + ,get_layoutData: function() { + return this._layoutData; + } + ,set_layoutData: function(value) { + if(!this.setStyle("layoutData")) { + return this._layoutData; + } + this._previousClearStyle = $bind(this,this.clearStyle_layoutData); + return this.setLayoutDataInternal(value); + } + ,set_alpha: function(value) { + this._explicitAlpha = value; + if(this._enabled || this._disabledAlpha == null) { + feathers_core_MeasureSprite.prototype.set_alpha.call(this,value); + } + return this._explicitAlpha; + } + ,get_disabledAlpha: function() { + return this._disabledAlpha; + } + ,set_disabledAlpha: function(value) { + if(!this.setStyle("disabledAlpha")) { + return this._disabledAlpha; + } + this._previousClearStyle = $bind(this,this.clearStyle_disabledAlpha); + this._disabledAlpha = value; + if(this._enabled || this._disabledAlpha == null) { + feathers_core_MeasureSprite.prototype.set_alpha.call(this,this._explicitAlpha); + } else if(!this._enabled && this._disabledAlpha != null) { + feathers_core_MeasureSprite.prototype.set_alpha.call(this,this._disabledAlpha); + } + return this._disabledAlpha; + } + ,get_focusManager: function() { + return this._focusManager; + } + ,set_focusManager: function(value) { + if(this._focusManager == value) { + return this._focusManager; + } + if(this._focusManager != null) { + this.showFocus(false); + } + this._focusManager = value; + return this._focusManager; + } + ,get_focusOwner: function() { + return this._focusOwner; + } + ,set_focusOwner: function(value) { + if(this._focusOwner == value) { + return this._focusOwner; + } + this._focusOwner = value; + return this._focusOwner; + } + ,get_rawTabEnabled: function() { + return feathers_core_MeasureSprite.prototype.get_tabEnabled.call(this); + } + ,get_focusEnabled: function() { + if(this._enabled) { + return this._focusEnabled; + } else { + return false; + } + } + ,set_focusEnabled: function(value) { + if(this._focusEnabled == value) { + return this._focusEnabled; + } + this._focusEnabled = value; + return this._focusEnabled; + } + ,get_tabEnabled: function() { + if(this._enabled) { + return feathers_core_MeasureSprite.prototype.get_tabEnabled.call(this); + } else { + return false; + } + } + ,get_alwaysShowFocus: function() { + return this._alwaysShowFocus; + } + ,set_alwaysShowFocus: function(value) { + if(!this.setStyle("alwaysShowFocus")) { + return this._alwaysShowFocus; + } + var wasFocused = this._focusManager != null && js_Boot.__implements(this,feathers_core_IFocusObject) && this._focusManager.get_focus() == this || this._focusRectSkin.parent != null; + if(wasFocused) { + this.showFocus(false); + } + this._alwaysShowFocus = value; + if(wasFocused) { + this.showFocus(true); + } + return this._alwaysShowFocus; + } + ,get_focusRectSkin: function() { + return this._focusRectSkin; + } + ,set_focusRectSkin: function(value) { + if(!this.setStyle("focusRectSkin")) { + return this._focusRectSkin; + } + this.showFocus(false); + this._previousClearStyle = $bind(this,this.clearStyle_focusRectSkin); + this._focusRectSkin = value; + return this._focusRectSkin; + } + ,get_focusPaddingTop: function() { + return this._focusPaddingTop; + } + ,set_focusPaddingTop: function(value) { + if(!this.setStyle("focusPaddingTop")) { + return this._focusPaddingTop; + } + this._previousClearStyle = $bind(this,this.clearStyle_focusPaddingTop); + this._focusPaddingTop = value; + return this._focusPaddingTop; + } + ,get_focusPaddingRight: function() { + return this._focusPaddingRight; + } + ,set_focusPaddingRight: function(value) { + if(!this.setStyle("focusPaddingRight")) { + return this._focusPaddingRight; + } + this._previousClearStyle = $bind(this,this.clearStyle_focusPaddingRight); + this._focusPaddingRight = value; + return this._focusPaddingRight; + } + ,get_focusPaddingBottom: function() { + return this._focusPaddingBottom; + } + ,set_focusPaddingBottom: function(value) { + if(!this.setStyle("focusPaddingBottom")) { + return this._focusPaddingBottom; + } + this._previousClearStyle = $bind(this,this.clearStyle_focusPaddingBottom); + this._focusPaddingBottom = value; + return this._focusPaddingBottom; + } + ,get_focusPaddingLeft: function() { + return this._focusPaddingLeft; + } + ,set_focusPaddingLeft: function(value) { + if(!this.setStyle("focusPaddingLeft")) { + return this._focusPaddingLeft; + } + this._previousClearStyle = $bind(this,this.clearStyle_focusPaddingLeft); + this._focusPaddingLeft = value; + return this._focusPaddingLeft; + } + ,setFocusPadding: function(value) { + this.set_focusPaddingTop(value); + this.set_focusPaddingRight(value); + this.set_focusPaddingBottom(value); + this.set_focusPaddingLeft(value); + } + ,showFocus: function(show) { + this._currentFocusRectSkin = this.getCurrentFocusRectSkin(); + if(this._focusManager == null || this._currentFocusRectSkin == null) { + return; + } + if(show) { + this._focusManager.get_focusPane().addChild(this._currentFocusRectSkin); + this.addEventListener("enterFrame",$bind(this,this.feathersControl_focusRect_enterFrameHandler)); + this.positionFocusRect(); + } else if(this._currentFocusRectSkin.parent != null) { + this.removeEventListener("enterFrame",$bind(this,this.feathersControl_focusRect_enterFrameHandler)); + this._currentFocusRectSkin.parent.removeChild(this._currentFocusRectSkin); + } + } + ,getCurrentFocusRectSkin: function() { + return this._focusRectSkin; + } + ,clearStyle_layoutData: function() { + return this.setLayoutDataInternal(null); + } + ,clearStyle_focusRectSkin: function() { + this.showFocus(false); + this._focusRectSkin = null; + return this._focusRectSkin; + } + ,clearStyle_disabledAlpha: function() { + this._disabledAlpha = null; + feathers_core_MeasureSprite.prototype.set_alpha.call(this,this._explicitAlpha); + return this._disabledAlpha; + } + ,clearStyle_focusPaddingTop: function() { + this._focusPaddingTop = 0.0; + return this._focusPaddingTop; + } + ,clearStyle_focusPaddingRight: function() { + this._focusPaddingRight = 0.0; + return this._focusPaddingRight; + } + ,clearStyle_focusPaddingBottom: function() { + this._focusPaddingBottom = 0.0; + return this._focusPaddingBottom; + } + ,clearStyle_focusPaddingLeft: function() { + this._focusPaddingLeft = 0.0; + return this._focusPaddingLeft; + } + ,positionFocusRect: function() { + if(this._focusManager == null || this._currentFocusRectSkin == null || this._currentFocusRectSkin.parent == null) { + return; + } + var point = new openfl_geom_Point(-this._focusPaddingLeft,-this._focusPaddingTop); + point = this.localToGlobal(point); + point = this._focusManager.get_focusPane().globalToLocal(point); + this._currentFocusRectSkin.set_x(point.x); + this._currentFocusRectSkin.set_y(point.y); + point.setTo(this.actualWidth + this._focusPaddingRight,this.actualHeight + this._focusPaddingBottom); + point = this.localToGlobal(point); + point = this._focusManager.get_focusPane().globalToLocal(point); + this._currentFocusRectSkin.set_width(point.x - this._currentFocusRectSkin.get_x()); + this._currentFocusRectSkin.set_height(point.y - this._currentFocusRectSkin.get_y()); + } + ,setLayoutDataInternal: function(value) { + if(this._layoutData == value) { + return this._layoutData; + } + if(this._layoutData != null) { + this._layoutData.removeEventListener("change",$bind(this,this.feathersControl_layoutData_changeHandler)); + } + this._layoutData = value; + if(this._layoutData != null) { + this._layoutData.addEventListener("change",$bind(this,this.feathersControl_layoutData_changeHandler),false,0,true); + } + feathers_events_FeathersEvent.dispatch(this,"layoutDataChange"); + return this._layoutData; + } + ,get_variant: function() { + return this._variant; + } + ,set_variant: function(value) { + if(this._variant == value) { + return this._variant; + } + this._variant = value; + if(this._initialized && this.stage != null) { + this.applyStyles(); + } else { + this._waitingToApplyStyles = true; + } + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._variant; + } + ,validateNow: function() { + if(!this._initialized) { + if(this._initializing) { + throw new openfl_errors_IllegalOperationError("A component cannot validate until after it has finished initializing."); + } + this.initializeNow(); + } + if(this._waitingToApplyStyles) { + this.applyStyles(); + } + feathers_core_MeasureSprite.prototype.validateNow.call(this); + if(!this._created) { + this._created = true; + feathers_events_FeathersEvent.dispatch(this,"creationComplete"); + } + } + ,initializeNow: function() { + if(this._initialized || this._initializing) { + return; + } + this._waitingToApplyStyles = true; + this._initializing = true; + this.initialize(); + this.setInvalid(); + this._initializing = false; + this._initialized = true; + feathers_events_FeathersEvent.dispatch(this,"initialize"); + } + ,move: function(x,y) { + this.set_x(x); + this.set_y(y); + } + ,setSize: function(width,height) { + this.set_width(width); + this.set_height(height); + } + ,dispose: function() { + this.clearStyles(); + var _g = 0; + var _g1 = this.get_numChildren(); + while(_g < _g1) { + var i = _g++; + var child = this.getChildAt(i); + if(js_Boot.__implements(child,feathers_core_IUIControl)) { + child.dispose(); + } + } + } + ,initialize: function() { + } + ,setStyle: function(styleName,state) { + var styleDef = state == null ? feathers_core__$FeathersControl_StyleDefinition.Name(styleName) : feathers_core__$FeathersControl_StyleDefinition.NameAndState(styleName,state); + var restricted = this.containsStyleDef(this._restrictedStyles,styleDef); + if(this._applyingStyles && restricted) { + return false; + } + if(this._applyingStyles) { + if(!this._clearingStyles && !this.containsStyleDef(this._styleProviderStyles,styleDef)) { + this._styleProviderStyles.push(styleDef); + } + } else if(!restricted) { + if(!this._clearingStyles && this.containsStyleDef(this._styleProviderStyles,styleDef)) { + HxOverrides.remove(this._styleProviderStyles,styleDef); + } + this._restrictedStyles.push(styleDef); + } + return true; + } + ,isStyleRestricted: function(styleName,state) { + var styleDef = state == null ? feathers_core__$FeathersControl_StyleDefinition.Name(styleName) : feathers_core__$FeathersControl_StyleDefinition.NameAndState(styleName,state); + return this.containsStyleDef(this._restrictedStyles,styleDef); + } + ,containsStyleDef: function(target,styleDef) { + var _g = 0; + while(_g < target.length) { + var other = target[_g]; + ++_g; + if(Type.enumEq(styleDef,other)) { + return true; + } + } + return false; + } + ,applyStyles: function() { + if(!this._initialized) { + throw new openfl_errors_IllegalOperationError("Cannot apply styles until after a Feathers UI component has initialized."); + } + this._waitingToApplyStyles = false; + var styleProvider = this._customStyleProvider; + if(styleProvider == null) { + var theme = feathers_style_Theme.getTheme(this); + if(theme != null) { + styleProvider = theme.getStyleProvider(this); + } + } + if(this._themeEnabled && styleProvider == null) { + var theme = feathers_style_Theme.get_fallbackTheme(); + if(theme != null) { + styleProvider = theme.getStyleProvider(this); + } + } + if(styleProvider == null) { + styleProvider = this._currentStyleProvider; + } + if(this._currentStyleProvider != styleProvider) { + if(this._currentStyleProvider != null) { + this._currentStyleProvider.removeEventListener("stylesChange",$bind(this,this.feathersControl_styleProvider_stylesChangeHandler)); + this._currentStyleProvider.removeEventListener("clear",$bind(this,this.feathersControl_styleProvider_clearHandler)); + } + this._currentStyleProvider = styleProvider; + if(this._currentStyleProvider != null) { + this._currentStyleProvider.addEventListener("stylesChange",$bind(this,this.feathersControl_styleProvider_stylesChangeHandler),false,0,true); + this._currentStyleProvider.addEventListener("clear",$bind(this,this.feathersControl_styleProvider_clearHandler),false,0,true); + } + } + var oldApplyingStyles = this._applyingStyles; + this._applyingStyles = true; + this.clearStyles(); + if(this._currentStyleProvider != null) { + this._currentStyleProvider.applyStyles(this); + } + this._applyingStyles = oldApplyingStyles; + } + ,clearStyles: function() { + var oldClearingStyles = this._clearingStyles; + this._clearingStyles = true; + var _g = 0; + var _g1 = this._styleProviderStyles; + while(_g < _g1.length) { + var styleDef = _g1[_g]; + ++_g; + switch(styleDef._hx_index) { + case 0: + var name = styleDef.name; + var clearMethodName = "clearStyle_" + name; + var clearMethod = Reflect.field(this,clearMethodName); + if(clearMethod == null) { + throw new openfl_errors_ArgumentError("Missing @style method: '" + clearMethodName + "'"); + } + clearMethod.apply(this,[]); + break; + case 1: + var name1 = styleDef.name; + var state = styleDef.state; + var method = Reflect.field(this,name1); + method.apply(this,[state,null]); + break; + } + } + this._styleProviderStyles = []; + this._clearingStyles = oldClearingStyles; + } + ,clearStyleProvider: function() { + if(this._currentStyleProvider == null) { + return; + } + this._currentStyleProvider.removeEventListener("stylesChange",$bind(this,this.feathersControl_styleProvider_stylesChangeHandler)); + this._currentStyleProvider.removeEventListener("clear",$bind(this,this.feathersControl_styleProvider_clearHandler)); + this._currentStyleProvider = null; + this._waitingToApplyStyles = true; + } + ,feathersControl_addedToStageHandler: function(event) { + if(!this._initialized) { + this.initializeNow(); + } + if(this._waitingToApplyStyles) { + this.applyStyles(); + } + } + ,feathersControl_removedFromStageHandler: function(event) { + this.showFocus(false); + this.clearStyleProvider(); + } + ,feathersControl_focusInHandler: function(event) { + var focusThis = null; + if(js_Boot.__implements(this,feathers_core_IFocusObject)) { + focusThis = this; + } + if(this._focusManager == null || !this._focusManager.get_showFocusIndicator() && !this.get_alwaysShowFocus() || this._focusManager.get_focus() != focusThis) { + return; + } + this.showFocus(true); + } + ,feathersControl_focusOutHandler: function(event) { + if(this._focusManager == null) { + return; + } + this.showFocus(false); + } + ,feathersControl_styleProvider_stylesChangeHandler: function(event) { + if(!event.affectsTarget(this)) { + return; + } + if(this.stage != null) { + this.applyStyles(); + } else { + this._waitingToApplyStyles = true; + } + } + ,feathersControl_customStyleProvider_clearHandler: function(event) { + this._customStyleProvider.removeEventListener("clear",$bind(this,this.feathersControl_customStyleProvider_clearHandler)); + this._customStyleProvider = null; + } + ,feathersControl_styleProvider_clearHandler: function(event) { + this.clearStyleProvider(); + if(this.stage != null) { + this.applyStyles(); + } + } + ,feathersControl_layoutData_changeHandler: function(event) { + feathers_events_FeathersEvent.dispatch(this,"layoutDataChange"); + } + ,feathersControl_focusRect_enterFrameHandler: function(event) { + this.positionFocusRect(); + } + ,__class__: feathers_core_FeathersControl + ,__properties__: $extend(feathers_core_MeasureSprite.prototype.__properties__,{set_variant:"set_variant",get_variant:"get_variant",set_focusPaddingLeft:"set_focusPaddingLeft",get_focusPaddingLeft:"get_focusPaddingLeft",set_focusPaddingBottom:"set_focusPaddingBottom",get_focusPaddingBottom:"get_focusPaddingBottom",set_focusPaddingRight:"set_focusPaddingRight",get_focusPaddingRight:"get_focusPaddingRight",set_focusPaddingTop:"set_focusPaddingTop",get_focusPaddingTop:"get_focusPaddingTop",set_focusRectSkin:"set_focusRectSkin",get_focusRectSkin:"get_focusRectSkin",set_alwaysShowFocus:"set_alwaysShowFocus",get_alwaysShowFocus:"get_alwaysShowFocus",set_focusEnabled:"set_focusEnabled",get_focusEnabled:"get_focusEnabled",get_rawTabEnabled:"get_rawTabEnabled",set_focusOwner:"set_focusOwner",get_focusOwner:"get_focusOwner",set_focusManager:"set_focusManager",get_focusManager:"get_focusManager",set_disabledAlpha:"set_disabledAlpha",get_disabledAlpha:"get_disabledAlpha",set_layoutData:"set_layoutData",get_layoutData:"get_layoutData",set_includeInLayout:"set_includeInLayout",get_includeInLayout:"get_includeInLayout",get_styleContext:"get_styleContext",set_styleProvider:"set_styleProvider",get_styleProvider:"get_styleProvider",set_themeEnabled:"set_themeEnabled",get_themeEnabled:"get_themeEnabled",set_toolTip:"set_toolTip",get_toolTip:"get_toolTip",set_enabled:"set_enabled",get_enabled:"get_enabled",get_created:"get_created",get_initialized:"get_initialized"}) +}); +var feathers_controls_LayoutGroup = function() { + this.__maskSkin = null; + this.__disabledBackgroundSkin = null; + this.__backgroundSkin = null; + this.__layout = null; + this._layoutChanged = false; + this._layoutActive = false; + this._xmlContent = null; + this._autoSizeMode = feathers_layout_AutoSizeMode.CONTENT; + this._currentMaskSkin = null; + this._backgroundSkinMeasurements = null; + this._currentBackgroundSkin = null; + this._ignoreLayoutChanges = false; + this._ignoreChangesButSetFlags = false; + this._ignoreChildChanges = false; + this._layoutMeasurements = new feathers_layout_Measurements(); + this._layoutResult = new feathers_layout_LayoutBoundsResult(); + this.items = []; + this.initializeLayoutGroupTheme(); + feathers_core_FeathersControl.call(this); + this.addEventListener("addedToStage",$bind(this,this.layoutGroup_addedToStageHandler)); +}; +$hxClasses["feathers.controls.LayoutGroup"] = feathers_controls_LayoutGroup; +feathers_controls_LayoutGroup.__name__ = "feathers.controls.LayoutGroup"; +feathers_controls_LayoutGroup.__super__ = feathers_core_FeathersControl; +feathers_controls_LayoutGroup.prototype = $extend(feathers_core_FeathersControl.prototype,{ + get_autoSizeMode: function() { + return this._autoSizeMode; + } + ,set_autoSizeMode: function(value) { + if(this._autoSizeMode == value) { + return this._autoSizeMode; + } + this._autoSizeMode = value; + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + if(this.stage != null) { + if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) { + this.stage.addEventListener("resize",$bind(this,this.layoutGroup_stage_resizeHandler),false,0,true); + this.addEventListener("removedFromStage",$bind(this,this.layoutGroup_removedFromStageHandler)); + } else { + this.stage.removeEventListener("resize",$bind(this,this.layoutGroup_stage_resizeHandler)); + this.removeEventListener("removedFromStage",$bind(this,this.layoutGroup_removedFromStageHandler)); + } + } + return this._autoSizeMode; + } + ,get_numChildren: function() { + return this.items.length; + } + ,get__numChildren: function() { + return feathers_core_FeathersControl.prototype.get_numChildren.call(this); + } + ,addChildAt: function(child,index) { + var oldIndex = this.items.indexOf(child); + if(oldIndex == index) { + return child; + } + var privateIndex = this.getPrivateIndexForPublicIndex(index); + if(oldIndex >= 0) { + this.items.splice(oldIndex,1); + } + this.items.splice(index,0,child); + var result = this._addChildAt(child,privateIndex); + child.addEventListener("resize",$bind(this,this.layoutGroup_child_resizeHandler)); + if(js_Boot.__implements(child,feathers_layout_ILayoutObject)) { + child.addEventListener("layoutDataChange",$bind(this,this.layoutGroup_child_layoutDataChangeHandler),false,0,true); + } + if(this._ignoreChangesButSetFlags) { + this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT); + } else { + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + return result; + } + ,_addChild: function(child) { + return feathers_core_FeathersControl.prototype.addChildAt.call(this,child,this.get__numChildren()); + } + ,_addChildAt: function(child,index) { + return feathers_core_FeathersControl.prototype.addChildAt.call(this,child,index); + } + ,removeChild: function(child) { + if(child == null || child.parent != this) { + return child; + } + HxOverrides.remove(this.items,child); + var result = this._removeChild(child); + child.removeEventListener("resize",$bind(this,this.layoutGroup_child_resizeHandler)); + if(js_Boot.__implements(child,feathers_layout_ILayoutObject)) { + child.removeEventListener("layoutDataChange",$bind(this,this.layoutGroup_child_layoutDataChangeHandler)); + } + if(this._ignoreChangesButSetFlags) { + this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT); + } else { + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + return result; + } + ,_removeChild: function(child) { + return feathers_core_FeathersControl.prototype.removeChild.call(this,child); + } + ,removeChildAt: function(index) { + if(index >= 0 && index < this.items.length) { + return this.removeChild(this.items[index]); + } + return null; + } + ,_removeChildAt: function(index) { + return feathers_core_FeathersControl.prototype.removeChildAt.call(this,index); + } + ,getChildIndex: function(child) { + return this.items.indexOf(child); + } + ,_getChildIndex: function(child) { + return feathers_core_FeathersControl.prototype.getChildIndex.call(this,child); + } + ,getChildByName: function(name) { + var _g = 0; + var _g1 = this.items; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + if(child.get_name() == name) { + return child; + } + } + return null; + } + ,_getChildByName: function(name) { + return feathers_core_FeathersControl.prototype.getChildByName.call(this,name); + } + ,removeChildren: function(beginIndex,endIndex) { + if(endIndex == null) { + endIndex = 2147483647; + } + if(beginIndex == null) { + beginIndex = 0; + } + if(endIndex == 2147483647) { + endIndex = this.items.length - 1; + if(endIndex < 0) { + return; + } + } + if(beginIndex > this.items.length - 1) { + return; + } else if(endIndex < beginIndex || beginIndex < 0 || endIndex > this.items.length) { + throw new openfl_errors_RangeError("The supplied index is out of bounds."); + } + var numRemovals = endIndex - beginIndex; + while(numRemovals >= 0) { + this.removeChildAt(beginIndex); + --numRemovals; + } + } + ,_removeChildren: function(beginIndex,endIndex) { + if(endIndex == null) { + endIndex = 2147483647; + } + if(beginIndex == null) { + beginIndex = 0; + } + feathers_core_FeathersControl.prototype.removeChildren.call(this,beginIndex,endIndex); + } + ,setChildIndex: function(child,index) { + var oldIndex = this.getChildIndex(child); + if(oldIndex == index) { + return; + } + this._setChildIndex(child,this.getPrivateIndexForPublicIndex(index)); + HxOverrides.remove(this.items,child); + this.items.splice(index,0,child); + if(this._ignoreChangesButSetFlags) { + this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT); + } else { + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + } + ,_setChildIndex: function(child,index) { + feathers_core_FeathersControl.prototype.setChildIndex.call(this,child,index); + } + ,getChildAt: function(index) { + return this.items[index]; + } + ,_getChildAt: function(index) { + return feathers_core_FeathersControl.prototype.getChildAt.call(this,index); + } + ,readjustLayout: function() { + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + ,initializeLayoutGroupTheme: function() { + feathers_themes_steel_components_SteelLayoutGroupStyles.initialize(); + } + ,getPrivateIndexForPublicIndex: function(publicIndex) { + if(this.items.length > 0) { + return publicIndex + this._getChildIndex(this.items[0]); + } else if(this.get__numChildren() > 0) { + return publicIndex + this.get__numChildren(); + } + return publicIndex; + } + ,get_xmlContent: function() { + return this._xmlContent; + } + ,set_xmlContent: function(value) { + if(this._xmlContent == value) { + return this._xmlContent; + } + if(this._xmlContent != null) { + var _g = 0; + var _g1 = this._xmlContent; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + this.removeChild(child); + } + } + this._xmlContent = value; + if(this._xmlContent != null) { + var _g = 0; + var _g1 = this._xmlContent; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + this.addChild(child); + } + } + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._xmlContent; + } + ,collectChildren: function(result) { + if(result == null) { + return this.items.slice(); + } + var _g = 0; + var _g1 = this.items; + while(_g < _g1.length) { + var item = _g1[_g]; + ++_g; + result.push(item); + } + return result; + } + ,validateNow: function() { + var oldIgnoreChildChanges = this._ignoreChangesButSetFlags; + this._ignoreChangesButSetFlags = true; + feathers_core_FeathersControl.prototype.validateNow.call(this); + this._ignoreChangesButSetFlags = oldIgnoreChildChanges; + } + ,update: function() { + var _gthis = this; + this._ignoreChangesButSetFlags = false; + var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT); + var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE); + var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES); + var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE); + if(stylesInvalid || stateInvalid) { + this.refreshBackgroundSkin(); + } + if(stylesInvalid) { + this.refreshMaskSkin(); + this.refreshLayout(); + } + if(sizeInvalid || layoutInvalid || stylesInvalid || stateInvalid) { + this.refreshViewPortBounds(); + this.runWithInvalidationFlagsOnly(function() { + _gthis._layoutActive = true; + var loopCount = 0; + do { + _gthis._layoutChanged = false; + _gthis.handleLayout(); + ++loopCount; + if(loopCount >= 10) { + _gthis._layoutActive = false; + var c = js_Boot.getClass(_gthis); + var className = c.__name__; + var layoutClassName; + if(_gthis.get_layout() != null) { + var c1 = js_Boot.getClass(_gthis.get_layout()); + layoutClassName = c1.__name__; + } else { + layoutClassName = "The layout"; + } + throw new openfl_errors_IllegalOperationError("" + className + " is stuck in an infinite loop during layout. " + layoutClassName + " may be dispatching Event.CHANGE too frequently."); + } + } while(_gthis._layoutChanged); + _gthis._layoutActive = false; + }); + this.refreshBackgroundLayout(); + this.refreshDisabledOverlay(); + this.refreshMaskLayout(); + this.validateChildren(); + } + } + ,refreshDisabledOverlay: function() { + if(!this._enabled) { + if(this._disabledOverlay == null) { + this._disabledOverlay = new openfl_display_Sprite(); + this._disabledOverlay.get_graphics().beginFill(16711935,0.0); + this._disabledOverlay.get_graphics().drawRect(0.0,0.0,1.0,1.0); + this._disabledOverlay.get_graphics().endFill(); + this._addChild(this._disabledOverlay); + } else { + this._setChildIndex(this._disabledOverlay,this.get__numChildren() - 1); + } + } + if(this._disabledOverlay != null) { + this._disabledOverlay.set_visible(!this._enabled); + this._disabledOverlay.set_x(0.0); + this._disabledOverlay.set_y(0.0); + this._disabledOverlay.set_width(this.actualWidth); + this._disabledOverlay.set_height(this.actualHeight); + } + } + ,refreshLayout: function() { + var newLayout = this.get_layout(); + if(this._currentLayout == newLayout) { + return; + } + if(this._currentLayout != null) { + this._currentLayout.removeEventListener("change",$bind(this,this.layoutGroup_layout_changeHandler)); + } + this._currentLayout = newLayout; + if(this._currentLayout != null) { + this._currentLayout.addEventListener("change",$bind(this,this.layoutGroup_layout_changeHandler)); + } + } + ,refreshBackgroundSkin: function() { + var oldSkin = this._currentBackgroundSkin; + this._currentBackgroundSkin = this.getCurrentBackgroundSkin(); + if(this._currentBackgroundSkin == oldSkin) { + return; + } + this.removeCurrentBackgroundSkin(oldSkin); + this.addCurrentBackgroundSkin(this._currentBackgroundSkin); + } + ,getCurrentBackgroundSkin: function() { + if(!this._enabled && this.get_disabledBackgroundSkin() != null) { + return this.get_disabledBackgroundSkin(); + } + return this.get_backgroundSkin(); + } + ,addCurrentBackgroundSkin: function(skin) { + if(skin == null) { + this._backgroundSkinMeasurements = null; + return; + } + if(js_Boot.__implements(skin,feathers_core_IUIControl)) { + skin.initializeNow(); + } + if(this._backgroundSkinMeasurements == null) { + this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin); + } else { + this._backgroundSkinMeasurements.save(skin); + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(this); + } + this._addChildAt(skin,0); + } + ,removeCurrentBackgroundSkin: function(skin) { + if(skin == null) { + return; + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(null); + } + this._backgroundSkinMeasurements.restore(skin); + if(skin.parent == this) { + this._removeChild(skin); + } + } + ,refreshMaskSkin: function() { + var oldSkin = this._currentMaskSkin; + this._currentMaskSkin = this.getCurrentMaskSkin(); + if(this._currentMaskSkin == oldSkin) { + return; + } + this.removeCurrentMaskSkin(oldSkin); + this.addCurrentMaskSkin(this._currentMaskSkin); + } + ,getCurrentMaskSkin: function() { + return this.get_maskSkin(); + } + ,addCurrentMaskSkin: function(skin) { + if(skin == null) { + return; + } + if(js_Boot.__implements(skin,feathers_core_IUIControl)) { + skin.initializeNow(); + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(this); + } + this._addChild(skin); + this.set_mask(skin); + } + ,removeCurrentMaskSkin: function(skin) { + if(skin == null) { + return; + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(null); + } + if(skin.parent == this) { + this._removeChild(skin); + } + this.set_mask(null); + } + ,refreshViewPortBounds: function() { + var needsWidth = this.get_explicitWidth() == null; + var needsHeight = this.get_explicitHeight() == null; + var needsMinWidth = this.get_explicitMinWidth() == null; + var needsMinHeight = this.get_explicitMinHeight() == null; + var needsMaxWidth = this.get_explicitMaxWidth() == null; + var needsMaxHeight = this.get_explicitMaxHeight() == null; + if(this._currentBackgroundSkin != null) { + feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this); + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) { + this._currentBackgroundSkin.validateNow(); + } + } + var needsToMeasureContent = this._autoSizeMode == feathers_layout_AutoSizeMode.CONTENT || this.stage == null; + var stageWidth = 0.0; + var stageHeight = 0.0; + if(!needsToMeasureContent) { + var topLeft = this.globalToLocal(new openfl_geom_Point()); + var bottomRight = this.globalToLocal(new openfl_geom_Point(this.stage.stageWidth,this.stage.stageHeight)); + stageWidth = bottomRight.x - topLeft.x; + stageHeight = bottomRight.y - topLeft.y; + } + if(needsWidth && !needsToMeasureContent) { + this._layoutMeasurements.width = stageWidth; + } else { + this._layoutMeasurements.width = this.get_explicitWidth(); + } + if(needsHeight && !needsToMeasureContent) { + this._layoutMeasurements.height = stageHeight; + } else { + this._layoutMeasurements.height = this.get_explicitHeight(); + } + var viewPortMinWidth = this.get_explicitMinWidth(); + if(needsMinWidth) { + viewPortMinWidth = 0.0; + } + var viewPortMinHeight = this.get_explicitMinHeight(); + if(needsMinHeight) { + viewPortMinHeight = 0.0; + } + var viewPortMaxWidth = this.get_explicitMaxWidth(); + if(needsMaxWidth) { + viewPortMaxWidth = 1.0 / 0.0; + } + var viewPortMaxHeight = this.get_explicitMaxHeight(); + if(needsMaxHeight) { + viewPortMaxHeight = 1.0 / 0.0; + } + if(this._backgroundSkinMeasurements != null) { + if(this._backgroundSkinMeasurements.width != null) { + if(this._backgroundSkinMeasurements.width > viewPortMinWidth) { + viewPortMinWidth = this._backgroundSkinMeasurements.width; + } + } else if(this._backgroundSkinMeasurements.minWidth != null) { + if(this._backgroundSkinMeasurements.minWidth > viewPortMinWidth) { + viewPortMinWidth = this._backgroundSkinMeasurements.minWidth; + } + } + if(this._backgroundSkinMeasurements.height != null) { + if(this._backgroundSkinMeasurements.height > viewPortMinHeight) { + viewPortMinHeight = this._backgroundSkinMeasurements.height; + } + } else if(this._backgroundSkinMeasurements.minHeight != null) { + if(this._backgroundSkinMeasurements.minHeight > viewPortMinHeight) { + viewPortMinHeight = this._backgroundSkinMeasurements.minHeight; + } + } + } + this._layoutMeasurements.minWidth = viewPortMinWidth; + this._layoutMeasurements.minHeight = viewPortMinHeight; + this._layoutMeasurements.maxWidth = viewPortMaxWidth; + this._layoutMeasurements.maxHeight = viewPortMaxHeight; + } + ,handleLayout: function() { + if(this._currentLayout != null) { + this.handleCustomLayout(); + } else { + this.handleManualLayout(); + } + this.handleLayoutResult(); + } + ,handleCustomLayout: function() { + var oldIgnoreChildChanges = this._ignoreChildChanges; + this._ignoreChildChanges = true; + this._layoutResult.reset(); + this._currentLayout.layout(this.items,this._layoutMeasurements,this._layoutResult); + this._ignoreChildChanges = oldIgnoreChildChanges; + } + ,handleManualLayout: function() { + var maxX = this._layoutMeasurements.width; + if(maxX == null) { + maxX = 0.0; + } + var maxY = this._layoutMeasurements.height; + if(maxY == null) { + maxY = 0.0; + } + var oldIgnoreChildChanges = this._ignoreChildChanges; + this._ignoreChildChanges = true; + var _g = 0; + var _g1 = this.items; + while(_g < _g1.length) { + var item = _g1[_g]; + ++_g; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject) && !item.get_includeInLayout()) { + continue; + } + if(js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + } + var itemMaxX = item.get_x() + item.get_width(); + var itemMaxY = item.get_y() + item.get_height(); + if(maxX < itemMaxX) { + maxX = itemMaxX; + } + if(maxY < itemMaxY) { + maxY = itemMaxY; + } + } + this._ignoreChildChanges = oldIgnoreChildChanges; + this._layoutResult.contentX = 0.0; + this._layoutResult.contentY = 0.0; + this._layoutResult.contentWidth = maxX; + this._layoutResult.contentHeight = maxY; + if(this._layoutMeasurements.width != null) { + this._layoutResult.viewPortWidth = this._layoutMeasurements.width; + } else { + if(this._layoutMeasurements.minWidth != null && maxX < this._layoutMeasurements.minWidth) { + maxX = this._layoutMeasurements.minWidth; + } else if(this._layoutMeasurements.maxWidth != null && maxX > this._layoutMeasurements.maxWidth) { + maxX = this._layoutMeasurements.maxWidth; + } + this._layoutResult.viewPortWidth = maxX; + } + if(this._layoutMeasurements.height != null) { + this._layoutResult.viewPortHeight = this._layoutMeasurements.height; + } else { + if(this._layoutMeasurements.minHeight != null && maxY < this._layoutMeasurements.minHeight) { + maxY = this._layoutMeasurements.minHeight; + } else if(this._layoutMeasurements.maxHeight != null && maxY > this._layoutMeasurements.maxHeight) { + maxY = this._layoutMeasurements.maxHeight; + } + this._layoutResult.viewPortHeight = maxY; + } + } + ,handleLayoutResult: function() { + var viewPortWidth = this._layoutResult.viewPortWidth; + var viewPortHeight = this._layoutResult.viewPortHeight; + this.saveMeasurements(viewPortWidth,viewPortHeight,viewPortWidth,viewPortHeight); + } + ,refreshMaskLayout: function() { + if(this._currentMaskSkin == null) { + return; + } + this._currentMaskSkin.set_x(0.0); + this._currentMaskSkin.set_y(0.0); + this._currentMaskSkin.set_width(this.actualWidth); + this._currentMaskSkin.set_height(this.actualHeight); + if(js_Boot.__implements(this._currentMaskSkin,feathers_core_IValidating)) { + this._currentMaskSkin.validateNow(); + } + } + ,refreshBackgroundLayout: function() { + if(this._currentBackgroundSkin == null) { + return; + } + this._currentBackgroundSkin.set_x(0.0); + this._currentBackgroundSkin.set_y(0.0); + if(this._currentBackgroundSkin.get_width() != this.actualWidth) { + this._currentBackgroundSkin.set_width(this.actualWidth); + } + if(this._currentBackgroundSkin.get_height() != this.actualHeight) { + this._currentBackgroundSkin.set_height(this.actualHeight); + } + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) { + this._currentBackgroundSkin.validateNow(); + } + } + ,validateChildren: function() { + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) { + this._currentBackgroundSkin.validateNow(); + } + var _g = 0; + var _g1 = this.items; + while(_g < _g1.length) { + var item = _g1[_g]; + ++_g; + if(js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + } + } + } + ,layoutGroup_addedToStageHandler: function(event) { + if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + this.addEventListener("removedFromStage",$bind(this,this.layoutGroup_removedFromStageHandler)); + this.stage.addEventListener("resize",$bind(this,this.layoutGroup_stage_resizeHandler),false,0,true); + } + } + ,layoutGroup_removedFromStageHandler: function(event) { + this.removeEventListener("removedFromStage",$bind(this,this.layoutGroup_removedFromStageHandler)); + this.stage.removeEventListener("resize",$bind(this,this.layoutGroup_stage_resizeHandler)); + } + ,layoutGroup_stage_resizeHandler: function(event) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + ,layoutGroup_child_resizeHandler: function(event) { + if(this._ignoreChildChanges) { + return; + } + if(this._ignoreChangesButSetFlags) { + this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT); + return; + } + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + ,layoutGroup_child_layoutDataChangeHandler: function(event) { + if(this._ignoreChildChanges) { + return; + } + if(this._ignoreChangesButSetFlags) { + this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT); + return; + } + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + ,layoutGroup_layout_changeHandler: function(event) { + if(this._ignoreLayoutChanges) { + return; + } + if(this._layoutActive) { + this._layoutChanged = true; + return; + } + if(this._ignoreChangesButSetFlags) { + this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT); + return; + } + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + ,get_layout: function() { + return this.__layout; + } + ,set_layout: function(value) { + if(!this.setStyle("layout")) { + return this.__layout; + } + if(this.__layout == value) { + return this.__layout; + } + this._previousClearStyle = $bind(this,this.clearStyle_layout); + this.__layout = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__layout; + } + ,clearStyle_layout: function() { + this.set_layout(null); + return this.get_layout(); + } + ,get_backgroundSkin: function() { + return this.__backgroundSkin; + } + ,set_backgroundSkin: function(value) { + if(!this.setStyle("backgroundSkin")) { + return this.__backgroundSkin; + } + if(this.__backgroundSkin == value) { + return this.__backgroundSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin); + this.__backgroundSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__backgroundSkin; + } + ,clearStyle_backgroundSkin: function() { + this.set_backgroundSkin(null); + return this.get_backgroundSkin(); + } + ,get_disabledBackgroundSkin: function() { + return this.__disabledBackgroundSkin; + } + ,set_disabledBackgroundSkin: function(value) { + if(!this.setStyle("disabledBackgroundSkin")) { + return this.__disabledBackgroundSkin; + } + if(this.__disabledBackgroundSkin == value) { + return this.__disabledBackgroundSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin); + this.__disabledBackgroundSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__disabledBackgroundSkin; + } + ,clearStyle_disabledBackgroundSkin: function() { + this.set_disabledBackgroundSkin(null); + return this.get_disabledBackgroundSkin(); + } + ,get_maskSkin: function() { + return this.__maskSkin; + } + ,set_maskSkin: function(value) { + if(!this.setStyle("maskSkin")) { + return this.__maskSkin; + } + if(this.__maskSkin == value) { + return this.__maskSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_maskSkin); + this.__maskSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__maskSkin; + } + ,clearStyle_maskSkin: function() { + this.set_maskSkin(null); + return this.get_maskSkin(); + } + ,get_styleContext: function() { + return feathers_controls_LayoutGroup; + } + ,__class__: feathers_controls_LayoutGroup + ,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_xmlContent:"set_xmlContent",get_xmlContent:"get_xmlContent",get__numChildren:"get__numChildren",set_autoSizeMode:"set_autoSizeMode",get_autoSizeMode:"get_autoSizeMode",set_maskSkin:"set_maskSkin",get_maskSkin:"get_maskSkin",set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_layout:"set_layout",get_layout:"get_layout"}) +}); +var feathers_core_IFocusManagerAware = function() { }; +$hxClasses["feathers.core.IFocusManagerAware"] = feathers_core_IFocusManagerAware; +feathers_core_IFocusManagerAware.__name__ = "feathers.core.IFocusManagerAware"; +feathers_core_IFocusManagerAware.__isInterface__ = true; +feathers_core_IFocusManagerAware.prototype = { + __class__: feathers_core_IFocusManagerAware + ,__properties__: {set_focusManager:"set_focusManager",get_focusManager:"get_focusManager"} +}; +var feathers_controls_Application = function() { + this.__scaleManager = null; + this._scaleFactor = 1.0; + if(feathers_controls_Application._topLevelApplication == null) { + feathers_controls_Application._topLevelApplication = this; + } + this.initializeApplicationTheme(); + feathers_controls_LayoutGroup.call(this); + this.addEventListener("addedToStage",$bind(this,this.application_addedToStageHandler),false,100); +}; +$hxClasses["feathers.controls.Application"] = feathers_controls_Application; +feathers_controls_Application.__name__ = "feathers.controls.Application"; +feathers_controls_Application.__interfaces__ = [feathers_core_IFocusManagerAware]; +feathers_controls_Application.__properties__ = {get_topLevelApplication:"get_topLevelApplication"}; +feathers_controls_Application.get_topLevelApplication = function() { + return feathers_controls_Application._topLevelApplication; +}; +feathers_controls_Application.defaultPopUpContainerFactory = function() { + return new openfl_display_Sprite(); +}; +feathers_controls_Application.__super__ = feathers_controls_LayoutGroup; +feathers_controls_Application.prototype = $extend(feathers_controls_LayoutGroup.prototype,{ + get_scaleFactor: function() { + return this._scaleFactor; + } + ,initializeApplicationTheme: function() { + feathers_themes_steel_components_SteelApplicationStyles.initialize(); + } + ,update: function() { + var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE); + var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES); + if(sizeInvalid || stylesInvalid) { + this.refreshScaleManager(); + } + feathers_controls_LayoutGroup.prototype.update.call(this); + } + ,refreshScaleManager: function() { + var _gthis = this; + var oldScaleManager = this._currentScaleManager; + this._currentScaleManager = this.get_scaleManager(); + if(this._currentScaleManager == oldScaleManager) { + return; + } + if(oldScaleManager != null) { + oldScaleManager.removeEventListener("change",$bind(this,this.application_scaleManager_changeHandler)); + oldScaleManager.set_target(null); + } + if(this._currentScaleManager != null) { + this._currentScaleManager.addEventListener("change",$bind(this,this.application_scaleManager_changeHandler),false,0,true); + this.runWithInvalidationFlagsOnly(function() { + _gthis._currentScaleManager.set_target(_gthis); + }); + } + } + ,refreshDimensions: function() { + if(this._currentScaleManager == null) { + return; + } + this._scaleFactor = this._currentScaleManager.getScale(); + this.set_scaleX(this._scaleFactor); + this.set_scaleY(this._scaleFactor); + var bounds = this._currentScaleManager.getBounds(); + this.set_x(bounds.x); + this.set_y(bounds.y); + this.set_width(bounds.width); + this.set_height(bounds.height); + if(this._applicationPopUpContainer != null) { + this._applicationPopUpContainer.set_scaleX(this._scaleFactor); + this._applicationPopUpContainer.set_scaleY(this._scaleFactor); + } + } + ,preparePopUpManager: function() { + if(this._applicationPopUpContainer == null) { + var factory = this.popUpContainerFactory; + if(factory == null) { + factory = feathers_controls_Application.defaultPopUpContainerFactory; + } + this._applicationPopUpContainer = factory(); + } + this._applicationPopUpContainer.set_scaleX(this._scaleFactor); + this._applicationPopUpContainer.set_scaleY(this._scaleFactor); + this.stage.addChild(this._applicationPopUpContainer); + var popUpManager = feathers_core_PopUpManager.forStage(this.stage); + popUpManager.set_root(this._applicationPopUpContainer); + } + ,cleanupPopUpManager: function() { + var popUpManager = feathers_core_PopUpManager.forStage(this.stage); + if(popUpManager.get_root() == this._applicationPopUpContainer) { + popUpManager.set_root(this.stage); + } + this.stage.removeChild(this._applicationPopUpContainer); + this._applicationPopUpContainer = null; + } + ,prepareFocusManager: function() { + if(!feathers_core_FocusManager.hasRoot(this.stage)) { + this._applicationFocusManager = feathers_core_FocusManager.addRoot(this.stage); + } + } + ,cleanupFocusManager: function() { + if(this._applicationFocusManager != null) { + this._applicationFocusManager = null; + feathers_core_FocusManager.removeRoot(this.stage); + } + } + ,prepareToolTipManager: function() { + if(!feathers_core_ToolTipManager.hasRoot(this.stage)) { + this._applicationToolTipManager = feathers_core_ToolTipManager.addRoot(this.stage); + } + } + ,cleanupToolTipManager: function() { + if(this._applicationToolTipManager != null) { + this._applicationToolTipManager = null; + feathers_core_ToolTipManager.removeRoot(this.stage); + } + } + ,application_addedToStageHandler: function(event) { + this.addEventListener("removedFromStage",$bind(this,this.application_removedFromStageHandler)); + this.prepareFocusManager(); + this.preparePopUpManager(); + this.prepareToolTipManager(); + } + ,application_removedFromStageHandler: function(event) { + this.removeEventListener("removedFromStage",$bind(this,this.application_removedFromStageHandler)); + this.cleanupToolTipManager(); + this.cleanupPopUpManager(); + this.cleanupFocusManager(); + } + ,application_scaleManager_changeHandler: function(event) { + this.refreshDimensions(); + } + ,get_styleContext: function() { + return feathers_controls_Application; + } + ,get_scaleManager: function() { + return this.__scaleManager; + } + ,set_scaleManager: function(value) { + if(!this.setStyle("scaleManager")) { + return this.__scaleManager; + } + if(this.__scaleManager == value) { + return this.__scaleManager; + } + this._previousClearStyle = $bind(this,this.clearStyle_scaleManager); + this.__scaleManager = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__scaleManager; + } + ,clearStyle_scaleManager: function() { + this.set_scaleManager(null); + return this.get_scaleManager(); + } + ,__class__: feathers_controls_Application + ,__properties__: $extend(feathers_controls_LayoutGroup.prototype.__properties__,{set_scaleManager:"set_scaleManager",get_scaleManager:"get_scaleManager",get_scaleFactor:"get_scaleFactor"}) +}); +var LPTCManager2026 = function() { + feathers_controls_Application.call(this); +}; +$hxClasses["LPTCManager2026"] = LPTCManager2026; +LPTCManager2026.__name__ = "LPTCManager2026"; +LPTCManager2026.__super__ = feathers_controls_Application; +LPTCManager2026.prototype = $extend(feathers_controls_Application.prototype,{ + initialize: function() { + feathers_controls_Application.prototype.initialize.call(this); + this.stage.set_displayState(2); + this.stage.set_scaleMode(2); + this.mainPanel = new feathers_controls_Panel(); + this.mainPanel.set_autoSizeMode(feathers_layout_AutoSizeMode.STAGE); + this.mainPanel.set_backgroundSkin(new components_NekoRectangle(model_Constants.MAIN_COLOR3)); + var header = new feathers_controls_LayoutGroup(); + header.set_autoSizeMode(feathers_layout_AutoSizeMode.CONTENT); + header.set_backgroundSkin(new components_NekoRectangle(model_Constants.HERO_COLOR,0,0,this.stage.stageWidth,this.stage.stageHeight * 8 / 100 | 0)); + header.set_variant(feathers_controls_LayoutGroup.VARIANT_TOOL_BAR); + header.set_layout(new feathers_layout_AnchorLayout()); + var title = new feathers_controls_Label(); + title.set_text("Header"); + var fnt = openfl_utils_Assets.getFont(model_Constants.MONTSERRAT_SEMIBOLD_600); + title.set_textFormat(new feathers_text_TextFormat(fnt.name,20,model_Constants.MAIN_COLOR3)); + title.set_variant(feathers_controls_Label.VARIANT_HEADING); + title.set_layoutData(feathers_layout_AnchorLayoutData.center()); + header.addChild(title); + this.mainPanel.set_header(header); + var footer = new feathers_controls_LayoutGroup(); + footer.set_autoSizeMode(feathers_layout_AutoSizeMode.CONTENT); + footer.set_backgroundSkin(new components_NekoRectangle(model_Constants.MAIN_COLOR2,0,0,this.stage.stageWidth,this.stage.stageHeight * 10 / 100 | 0)); + footer.set_variant(feathers_controls_LayoutGroup.VARIANT_TOOL_BAR); + footer.set_layout(new feathers_layout_AnchorLayout()); + var title = new feathers_controls_Label(); + title.set_text("Footer"); + title.set_variant(feathers_controls_Label.VARIANT_HEADING); + title.set_layoutData(feathers_layout_AnchorLayoutData.center()); + footer.addChild(title); + this.mainPanel.set_footer(footer); + this.addChild(this.mainPanel); + haxe_Log.trace(this,{ fileName : "src/LPTCManager2026.hx", lineNumber : 73, className : "LPTCManager2026", methodName : "initialize", customParams : ["--> initialize()"]}); + } + ,__class__: LPTCManager2026 +}); +var DocumentClass = function(current) { + current.addChild(this); + LPTCManager2026.call(this); + this.dispatchEvent(new openfl_events_Event("addedToStage",false,false)); +}; +$hxClasses["DocumentClass"] = DocumentClass; +DocumentClass.__name__ = "DocumentClass"; +DocumentClass.__super__ = LPTCManager2026; +DocumentClass.prototype = $extend(LPTCManager2026.prototype,{ + __class__: DocumentClass +}); +var EReg = function(r,opt) { + this.r = new RegExp(r,opt.split("u").join("")); +}; +$hxClasses["EReg"] = EReg; +EReg.__name__ = "EReg"; +EReg.prototype = { + match: function(s) { + if(this.r.global) { + this.r.lastIndex = 0; + } + this.r.m = this.r.exec(s); + this.r.s = s; + return this.r.m != null; + } + ,matched: function(n) { + if(this.r.m != null && n >= 0 && n < this.r.m.length) { + return this.r.m[n]; + } else { + throw haxe_Exception.thrown("EReg::matched"); + } + } + ,matchedRight: function() { + if(this.r.m == null) { + throw haxe_Exception.thrown("No string matched"); + } + var sz = this.r.m.index + this.r.m[0].length; + return HxOverrides.substr(this.r.s,sz,this.r.s.length - sz); + } + ,matchedPos: function() { + if(this.r.m == null) { + throw haxe_Exception.thrown("No string matched"); + } + return { pos : this.r.m.index, len : this.r.m[0].length}; + } + ,matchSub: function(s,pos,len) { + if(len == null) { + len = -1; + } + if(this.r.global) { + this.r.lastIndex = pos; + this.r.m = this.r.exec(len < 0 ? s : HxOverrides.substr(s,0,pos + len)); + var b = this.r.m != null; + if(b) { + this.r.s = s; + } + return b; + } else { + var b = this.match(len < 0 ? HxOverrides.substr(s,pos,null) : HxOverrides.substr(s,pos,len)); + if(b) { + this.r.s = s; + this.r.m.index += pos; + } + return b; + } + } + ,split: function(s) { + var d = "#__delim__#"; + return s.replace(this.r,d).split(d); + } + ,map: function(s,f) { + var offset = 0; + var buf_b = ""; + do { + if(offset >= s.length) { + break; + } else if(!this.matchSub(s,offset)) { + buf_b += Std.string(HxOverrides.substr(s,offset,null)); + break; + } + var p = this.matchedPos(); + buf_b += Std.string(HxOverrides.substr(s,offset,p.pos - offset)); + buf_b += Std.string(f(this)); + if(p.len == 0) { + buf_b += Std.string(HxOverrides.substr(s,p.pos,1)); + offset = p.pos + 1; + } else { + offset = p.pos + p.len; + } + } while(this.r.global); + if(!this.r.global && offset > 0 && offset < s.length) { + buf_b += Std.string(HxOverrides.substr(s,offset,null)); + } + return buf_b; + } + ,__class__: EReg +}; +var HxOverrides = function() { }; +$hxClasses["HxOverrides"] = HxOverrides; +HxOverrides.__name__ = "HxOverrides"; +HxOverrides.strDate = function(s) { + switch(s.length) { + case 8: + var k = s.split(":"); + var d = new Date(); + d["setTime"](0); + d["setUTCHours"](k[0]); + d["setUTCMinutes"](k[1]); + d["setUTCSeconds"](k[2]); + return d; + case 10: + var k = s.split("-"); + return new Date(k[0],k[1] - 1,k[2],0,0,0); + case 19: + var k = s.split(" "); + var y = k[0].split("-"); + var t = k[1].split(":"); + return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]); + default: + throw haxe_Exception.thrown("Invalid date format : " + s); + } +}; +HxOverrides.cca = function(s,index) { + var x = s.charCodeAt(index); + if(x != x) { + return undefined; + } + return x; +}; +HxOverrides.substr = function(s,pos,len) { + if(len == null) { + len = s.length; + } else if(len < 0) { + if(pos == 0) { + len = s.length + len; + } else { + return ""; + } + } + return s.substr(pos,len); +}; +HxOverrides.remove = function(a,obj) { + var i = a.indexOf(obj); + if(i == -1) { + return false; + } + a.splice(i,1); + return true; +}; +HxOverrides.now = function() { + return Date.now(); +}; +var Lambda = function() { }; +$hxClasses["Lambda"] = Lambda; +Lambda.__name__ = "Lambda"; +Lambda.array = function(it) { + var a = []; + var i = $getIterator(it); + while(i.hasNext()) { + var i1 = i.next(); + a.push(i1); + } + return a; +}; +Lambda.count = function(it,pred) { + var n = 0; + if(pred == null) { + var _ = $getIterator(it); + while(_.hasNext()) { + var _1 = _.next(); + ++n; + } + } else { + var x = $getIterator(it); + while(x.hasNext()) { + var x1 = x.next(); + if(pred(x1)) { + ++n; + } + } + } + return n; +}; +var ManifestResources = function() { }; +$hxClasses["ManifestResources"] = ManifestResources; +ManifestResources.__name__ = "ManifestResources"; +ManifestResources.init = function(config) { + ManifestResources.preloadLibraries = []; + ManifestResources.preloadLibraryNames = []; + ManifestResources.rootPath = null; + if(config != null && Object.prototype.hasOwnProperty.call(config,"rootPath")) { + ManifestResources.rootPath = Reflect.field(config,"rootPath"); + if(!StringTools.endsWith(ManifestResources.rootPath,"/")) { + ManifestResources.rootPath += "/"; + } + } + if(ManifestResources.rootPath == null) { + ManifestResources.rootPath = "./"; + } + openfl_text_Font.registerFont(_$_$ASSET_$_$OPENFL_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf); + var bundle; + var data = "{\"name\":null,\"assets\":\"aoy4:sizei260936y4:typey4:FONTy9:classNamey58:__ASSET__assets_fonts_montserrat_montserratsemibold600_ttfy2:idy21:MontserratSemiBold600y7:preloadtgh\",\"rootPath\":null,\"version\":2,\"libraryArgs\":[],\"libraryType\":null}"; + var manifest = lime_utils_AssetManifest.parse(data,ManifestResources.rootPath); + var library = lime_utils_AssetLibrary.fromManifest(manifest); + lime_utils_Assets.registerLibrary("default",library); + library = lime_utils_Assets.getLibrary("default"); + if(library != null) { + ManifestResources.preloadLibraries.push(library); + } else { + ManifestResources.preloadLibraryNames.push("default"); + } +}; +var lime_text_Font = function(name) { + if(name != null) { + this.name = name; + } + if(!this.__init) { + if(this.ascender == undefined) { + this.ascender = 0; + } + if(this.descender == undefined) { + this.descender = 0; + } + if(this.height == undefined) { + this.height = 0; + } + if(this.numGlyphs == undefined) { + this.numGlyphs = 0; + } + if(this.underlinePosition == undefined) { + this.underlinePosition = 0; + } + if(this.underlineThickness == undefined) { + this.underlineThickness = 0; + } + if(this.unitsPerEM == undefined) { + this.unitsPerEM = 0; + } + if(this.__fontID != null) { + if(lime_utils_Assets.isLocal(this.__fontID)) { + this.__fromBytes(lime_utils_Assets.getBytes(this.__fontID)); + } + } else if(this.__fontPath != null) { + this.__fromFile(this.__fontPath); + } + } +}; +$hxClasses["lime.text.Font"] = lime_text_Font; +lime_text_Font.__name__ = "lime.text.Font"; +lime_text_Font.fromBytes = function(bytes) { + if(bytes == null) { + return null; + } + var font = new lime_text_Font(); + font.__fromBytes(bytes); + return font; +}; +lime_text_Font.fromFile = function(path) { + if(path == null) { + return null; + } + var font = new lime_text_Font(); + font.__fromFile(path); + return font; +}; +lime_text_Font.loadFromBytes = function(bytes) { + return lime_app_Future.withValue(lime_text_Font.fromBytes(bytes)); +}; +lime_text_Font.loadFromFile = function(path) { + var request = new lime_net__$HTTPRequest_$lime_$text_$Font(); + return request.load(path).then(function(font) { + if(font != null) { + return lime_app_Future.withValue(font); + } else { + return lime_app_Future.withError(""); + } + }); +}; +lime_text_Font.loadFromName = function(path) { + var font = new lime_text_Font(); + return font.__loadFromName(path); +}; +lime_text_Font.__measureFontNode = function(fontFamily) { + var node = window.document.createElement("span"); + node.setAttribute("aria-hidden","true"); + var text = window.document.createTextNode("BESbswy"); + node.appendChild(text); + var style = node.style; + style.display = "block"; + style.position = "absolute"; + style.top = "-9999px"; + style.left = "-9999px"; + style.fontSize = "300px"; + style.width = "auto"; + style.height = "auto"; + style.lineHeight = "normal"; + style.margin = "0"; + style.padding = "0"; + style.fontVariant = "normal"; + style.whiteSpace = "nowrap"; + style.fontFamily = fontFamily; + window.document.body.appendChild(node); + return node; +}; +lime_text_Font.prototype = { + decompose: function() { + return null; + } + ,getGlyph: function(character) { + return -1; + } + ,getGlyphs: function(characters) { + if(characters == null) { + characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^`'\"/\\&*()[]{}<>|:;_-+=?,. "; + } + return null; + } + ,getGlyphMetrics: function(glyph) { + return null; + } + ,renderGlyph: function(glyph,fontSize) { + return null; + } + ,renderGlyphs: function(glyphs,fontSize) { + return null; + } + ,__copyFrom: function(other) { + if(other != null) { + this.ascender = other.ascender; + this.descender = other.descender; + this.height = other.height; + this.name = other.name; + this.numGlyphs = other.numGlyphs; + this.src = other.src; + this.underlinePosition = other.underlinePosition; + this.underlineThickness = other.underlineThickness; + this.unitsPerEM = other.unitsPerEM; + this.__fontID = other.__fontID; + this.__fontPath = other.__fontPath; + this.__init = true; + } + } + ,__fromBytes: function(bytes) { + this.__fontPath = null; + } + ,__fromFile: function(path) { + this.__fontPath = path; + } + ,__initializeSource: function() { + this.__init = true; + } + ,__loadFromName: function(name) { + var _gthis = this; + var promise = new lime_app_Promise(); + this.name = name; + var userAgent = $global.navigator.userAgent.toLowerCase(); + var isSafari = userAgent.indexOf(" safari/") >= 0 && userAgent.indexOf(" chrome/") < 0; + var isUIWebView = new EReg("(iPhone|iPod|iPad).*AppleWebKit(?!.*Version)","i").match(userAgent); + if(!isSafari && !isUIWebView && (window.document.fonts && ($_=window.document.fonts,$bind($_,$_.load)))) { + window.document.fonts.load("1em '" + name + "'").then(function(_) { + promise.complete(_gthis); + },function(_) { + lime_utils_Log.warn("Could not load web font \"" + name + "\"",{ fileName : "lime/text/Font.hx", lineNumber : 640, className : "lime.text.Font", methodName : "__loadFromName"}); + promise.complete(_gthis); + }); + } else { + var node1 = lime_text_Font.__measureFontNode("'" + name + "', sans-serif"); + var node2 = lime_text_Font.__measureFontNode("'" + name + "', serif"); + var width1 = node1.offsetWidth; + var width2 = node2.offsetWidth; + var interval = -1; + var timeout = 3000; + var intervalLength = 50; + var intervalCount = 0; + var loaded; + var timeExpired; + var checkFont = function() { + intervalCount += 1; + loaded = node1.offsetWidth != width1 || node2.offsetWidth != width2; + timeExpired = intervalCount * intervalLength >= timeout; + if(loaded || timeExpired) { + window.clearInterval(interval); + node1.parentNode.removeChild(node1); + node2.parentNode.removeChild(node2); + node1 = null; + node2 = null; + if(timeExpired) { + lime_utils_Log.warn("Could not load web font \"" + name + "\"",{ fileName : "lime/text/Font.hx", lineNumber : 675, className : "lime.text.Font", methodName : "__loadFromName"}); + } + promise.complete(_gthis); + } + }; + interval = window.setInterval(checkFont,intervalLength); + } + return promise.future; + } + ,__setSize: function(size,dpi) { + if(dpi == null) { + dpi = 72; + } + } + ,__class__: lime_text_Font +}; +var _$_$ASSET_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf = $hx_exports["__ASSET__assets_fonts_montserrat_montserratsemibold600_ttf"] = function() { + this.ascender = 968; + this.descender = -251; + this.height = 1219; + this.numGlyphs = 1943; + this.underlinePosition = -100; + this.underlineThickness = 50; + this.unitsPerEM = 1000; + this.name = "Montserrat SemiBold"; + lime_text_Font.call(this); +}; +$hxClasses["__ASSET__assets_fonts_montserrat_montserratsemibold600_ttf"] = _$_$ASSET_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf; +_$_$ASSET_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf.__name__ = "__ASSET__assets_fonts_montserrat_montserratsemibold600_ttf"; +_$_$ASSET_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf.__super__ = lime_text_Font; +_$_$ASSET_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf.prototype = $extend(lime_text_Font.prototype,{ + __class__: _$_$ASSET_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf +}); +var openfl_text_Font = function(name) { + lime_text_Font.call(this,name); +}; +$hxClasses["openfl.text.Font"] = openfl_text_Font; +openfl_text_Font.__name__ = "openfl.text.Font"; +openfl_text_Font.enumerateFonts = function(enumerateDeviceFonts) { + if(enumerateDeviceFonts == null) { + enumerateDeviceFonts = false; + } + return openfl_text_Font.__registeredFonts; +}; +openfl_text_Font.fromBytes = function(bytes) { + var font = new openfl_text_Font(); + font.__fromBytes(openfl_utils_ByteArray.toBytes(bytes)); + return font; +}; +openfl_text_Font.fromFile = function(path) { + if(path == null) { + return null; + } + var font = new openfl_text_Font(); + font.__fromFile(path); + return font; +}; +openfl_text_Font.loadFromBytes = function(bytes) { + return lime_text_Font.loadFromBytes(openfl_utils_ByteArray.toBytes(bytes)).then(function(limeFont) { + var font = new openfl_text_Font(); + font.__fromLimeFont(limeFont); + return lime_app_Future.withValue(font); + }); +}; +openfl_text_Font.loadFromFile = function(path) { + return lime_text_Font.loadFromFile(path).then(function(limeFont) { + var font = new openfl_text_Font(); + font.__fromLimeFont(limeFont); + return lime_app_Future.withValue(font); + }); +}; +openfl_text_Font.loadFromName = function(path) { + return lime_text_Font.loadFromName(path).then(function(limeFont) { + var font = new openfl_text_Font(); + font.__fromLimeFont(limeFont); + return lime_app_Future.withValue(font); + }); +}; +openfl_text_Font.registerFont = function(font) { + var instance = null; + if(js_Boot.getClass(font) == null) { + instance = js_Boot.__cast(Type.createInstance(font,[]) , openfl_text_Font); + } else { + instance = js_Boot.__cast(font , openfl_text_Font); + } + if(instance != null) { + openfl_text_Font.__registeredFonts.push(instance); + openfl_text_Font.__fontByName.h[instance.name] = instance; + } +}; +openfl_text_Font.__super__ = lime_text_Font; +openfl_text_Font.prototype = $extend(lime_text_Font.prototype,{ + __fromLimeFont: function(font) { + this.__copyFrom(font); + } + ,__initialize: function() { + return this.__initialized; + } + ,get_fontName: function() { + return this.name; + } + ,set_fontName: function(value) { + return this.name = value; + } + ,__class__: openfl_text_Font + ,__properties__: {set_fontName:"set_fontName",get_fontName:"get_fontName"} +}); +var _$_$ASSET_$_$OPENFL_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf = $hx_exports["__ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf"] = function() { + this.__fromLimeFont(new _$_$ASSET_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf()); + openfl_text_Font.call(this); +}; +$hxClasses["__ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf"] = _$_$ASSET_$_$OPENFL_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf; +_$_$ASSET_$_$OPENFL_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf.__name__ = "__ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf"; +_$_$ASSET_$_$OPENFL_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf.__super__ = openfl_text_Font; +_$_$ASSET_$_$OPENFL_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf.prototype = $extend(openfl_text_Font.prototype,{ + __class__: _$_$ASSET_$_$OPENFL_$_$assets_$fonts_$montserrat_$montserratsemibold600_$ttf +}); +Math.__name__ = "Math"; +var Reflect = function() { }; +$hxClasses["Reflect"] = Reflect; +Reflect.__name__ = "Reflect"; +Reflect.field = function(o,field) { + try { + return o[field]; + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + return null; + } +}; +Reflect.getProperty = function(o,field) { + var tmp; + if(o == null) { + return null; + } else { + var tmp1; + if(o.__properties__) { + tmp = o.__properties__["get_" + field]; + tmp1 = tmp; + } else { + tmp1 = false; + } + if(tmp1) { + return o[tmp](); + } else { + return o[field]; + } + } +}; +Reflect.setProperty = function(o,field,value) { + var tmp; + var tmp1; + if(o.__properties__) { + tmp = o.__properties__["set_" + field]; + tmp1 = tmp; + } else { + tmp1 = false; + } + if(tmp1) { + o[tmp](value); + } else { + o[field] = value; + } +}; +Reflect.fields = function(o) { + var a = []; + if(o != null) { + var hasOwnProperty = Object.prototype.hasOwnProperty; + for( var f in o ) { + if(f != "__id__" && f != "hx__closures__" && hasOwnProperty.call(o,f)) { + a.push(f); + } + } + } + return a; +}; +Reflect.isFunction = function(f) { + if(typeof(f) == "function") { + return !(f.__name__ || f.__ename__); + } else { + return false; + } +}; +Reflect.compare = function(a,b) { + if(a == b) { + return 0; + } else if(a > b) { + return 1; + } else { + return -1; + } +}; +Reflect.isEnumValue = function(v) { + if(v != null) { + return v.__enum__ != null; + } else { + return false; + } +}; +Reflect.deleteField = function(o,field) { + if(!Object.prototype.hasOwnProperty.call(o,field)) { + return false; + } + delete(o[field]); + return true; +}; +Reflect.makeVarArgs = function(f) { + return function() { + var a = Array.prototype.slice; + var a1 = arguments; + var a2 = a.call(a1); + return f(a2); + }; +}; +var Std = function() { }; +$hxClasses["Std"] = Std; +Std.__name__ = "Std"; +Std.string = function(s) { + return js_Boot.__string_rec(s,""); +}; +Std.parseInt = function(x) { + var v = parseInt(x); + if(isNaN(v)) { + return null; + } + return v; +}; +var _$String_String_$Impl_$ = function() { }; +$hxClasses["_String.String_Impl_"] = _$String_String_$Impl_$; +_$String_String_$Impl_$.__name__ = "_String.String_Impl_"; +_$String_String_$Impl_$.fromCharCode = function(code) { + return String.fromCodePoint(code); +}; +var StringBuf = function() { + this.b = ""; +}; +$hxClasses["StringBuf"] = StringBuf; +StringBuf.__name__ = "StringBuf"; +StringBuf.prototype = { + __class__: StringBuf +}; +var StringTools = function() { }; +$hxClasses["StringTools"] = StringTools; +StringTools.__name__ = "StringTools"; +StringTools.htmlEscape = function(s,quotes) { + var buf_b = ""; + var _g_offset = 0; + var _g_s = s; + while(_g_offset < _g_s.length) { + var s = _g_s; + var index = _g_offset++; + var c = s.charCodeAt(index); + if(c >= 55296 && c <= 56319) { + c = c - 55232 << 10 | s.charCodeAt(index + 1) & 1023; + } + var c1 = c; + if(c1 >= 65536) { + ++_g_offset; + } + var code = c1; + switch(code) { + case 34: + if(quotes) { + buf_b += """; + } else { + buf_b += String.fromCodePoint(code); + } + break; + case 38: + buf_b += "&"; + break; + case 39: + if(quotes) { + buf_b += "'"; + } else { + buf_b += String.fromCodePoint(code); + } + break; + case 60: + buf_b += "<"; + break; + case 62: + buf_b += ">"; + break; + default: + buf_b += String.fromCodePoint(code); + } + } + return buf_b; +}; +StringTools.htmlUnescape = function(s) { + return s.split(">").join(">").split("<").join("<").split(""").join("\"").split("'").join("'").split("&").join("&"); +}; +StringTools.startsWith = function(s,start) { + if(s.length >= start.length) { + return s.lastIndexOf(start,0) == 0; + } else { + return false; + } +}; +StringTools.endsWith = function(s,end) { + var elen = end.length; + var slen = s.length; + if(slen >= elen) { + return s.indexOf(end,slen - elen) == slen - elen; + } else { + return false; + } +}; +StringTools.isSpace = function(s,pos) { + var c = HxOverrides.cca(s,pos); + if(!(c > 8 && c < 14)) { + return c == 32; + } else { + return true; + } +}; +StringTools.ltrim = function(s) { + var l = s.length; + var r = 0; + while(r < l && StringTools.isSpace(s,r)) ++r; + if(r > 0) { + return HxOverrides.substr(s,r,l - r); + } else { + return s; + } +}; +StringTools.rtrim = function(s) { + var l = s.length; + var r = 0; + while(r < l && StringTools.isSpace(s,l - r - 1)) ++r; + if(r > 0) { + return HxOverrides.substr(s,0,l - r); + } else { + return s; + } +}; +StringTools.trim = function(s) { + return StringTools.ltrim(StringTools.rtrim(s)); +}; +StringTools.replace = function(s,sub,by) { + return s.split(sub).join(by); +}; +StringTools.hex = function(n,digits) { + var s = ""; + var hexChars = "0123456789ABCDEF"; + do { + s = hexChars.charAt(n & 15) + s; + n >>>= 4; + } while(n > 0); + if(digits != null) { + while(s.length < digits) s = "0" + s; + } + return s; +}; +var ValueType = $hxEnums["ValueType"] = { __ename__:"ValueType",__constructs__:null + ,TNull: {_hx_name:"TNull",_hx_index:0,__enum__:"ValueType",toString:$estr} + ,TInt: {_hx_name:"TInt",_hx_index:1,__enum__:"ValueType",toString:$estr} + ,TFloat: {_hx_name:"TFloat",_hx_index:2,__enum__:"ValueType",toString:$estr} + ,TBool: {_hx_name:"TBool",_hx_index:3,__enum__:"ValueType",toString:$estr} + ,TObject: {_hx_name:"TObject",_hx_index:4,__enum__:"ValueType",toString:$estr} + ,TFunction: {_hx_name:"TFunction",_hx_index:5,__enum__:"ValueType",toString:$estr} + ,TClass: ($_=function(c) { return {_hx_index:6,c:c,__enum__:"ValueType",toString:$estr}; },$_._hx_name="TClass",$_.__params__ = ["c"],$_) + ,TEnum: ($_=function(e) { return {_hx_index:7,e:e,__enum__:"ValueType",toString:$estr}; },$_._hx_name="TEnum",$_.__params__ = ["e"],$_) + ,TUnknown: {_hx_name:"TUnknown",_hx_index:8,__enum__:"ValueType",toString:$estr} +}; +ValueType.__constructs__ = [ValueType.TNull,ValueType.TInt,ValueType.TFloat,ValueType.TBool,ValueType.TObject,ValueType.TFunction,ValueType.TClass,ValueType.TEnum,ValueType.TUnknown]; +var Type = function() { }; +$hxClasses["Type"] = Type; +Type.__name__ = "Type"; +Type.createInstance = function(cl,args) { + var ctor = Function.prototype.bind.apply(cl,[null].concat(args)); + return new (ctor); +}; +Type.createEnum = function(e,constr,params) { + var f = Reflect.field(e,constr); + if(f == null) { + throw haxe_Exception.thrown("No such constructor " + constr); + } + if(Reflect.isFunction(f)) { + if(params == null) { + throw haxe_Exception.thrown("Constructor " + constr + " need parameters"); + } + return f.apply(e,params); + } + if(params != null && params.length != 0) { + throw haxe_Exception.thrown("Constructor " + constr + " does not need parameters"); + } + return f; +}; +Type.typeof = function(v) { + switch(typeof(v)) { + case "boolean": + return ValueType.TBool; + case "function": + if(v.__name__ || v.__ename__) { + return ValueType.TObject; + } + return ValueType.TFunction; + case "number": + if(Math.ceil(v) == v % 2147483648.0) { + return ValueType.TInt; + } + return ValueType.TFloat; + case "object": + if(v == null) { + return ValueType.TNull; + } + var e = v.__enum__; + if(e != null) { + return ValueType.TEnum($hxEnums[e]); + } + var c = js_Boot.getClass(v); + if(c != null) { + return ValueType.TClass(c); + } + return ValueType.TObject; + case "string": + return ValueType.TClass(String); + case "undefined": + return ValueType.TNull; + default: + return ValueType.TUnknown; + } +}; +Type.enumEq = function(a,b) { + if(a == b) { + return true; + } + try { + var e = a.__enum__; + if(e == null || e != b.__enum__) { + return false; + } + if(a._hx_index != b._hx_index) { + return false; + } + var enm = $hxEnums[e]; + var params = enm.__constructs__[a._hx_index].__params__; + var _g = 0; + while(_g < params.length) { + var f = params[_g]; + ++_g; + if(!Type.enumEq(a[f],b[f])) { + return false; + } + } + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + return false; + } + return true; +}; +Type.enumParameters = function(e) { + var enm = $hxEnums[e.__enum__]; + var params = enm.__constructs__[e._hx_index].__params__; + if(params != null) { + var _g = []; + var _g1 = 0; + while(_g1 < params.length) { + var p = params[_g1]; + ++_g1; + _g.push(e[p]); + } + return _g; + } else { + return []; + } +}; +var UInt = {}; +UInt.gt = function(a,b) { + var aNeg = a < 0; + var bNeg = b < 0; + if(aNeg != bNeg) { + return aNeg; + } else { + return a > b; + } +}; +UInt.toFloat = function(this1) { + var int = this1; + if(int < 0) { + return 4294967296.0 + int; + } else { + return int + 0.0; + } +}; +var XmlType = {}; +XmlType.toString = function(this1) { + switch(this1) { + case 0: + return "Element"; + case 1: + return "PCData"; + case 2: + return "CData"; + case 3: + return "Comment"; + case 4: + return "DocType"; + case 5: + return "ProcessingInstruction"; + case 6: + return "Document"; + } +}; +var Xml = function(nodeType) { + this.nodeType = nodeType; + this.children = []; + this.attributeMap = new haxe_ds_StringMap(); +}; +$hxClasses["Xml"] = Xml; +Xml.__name__ = "Xml"; +Xml.parse = function(str) { + return haxe_xml_Parser.parse(str); +}; +Xml.createElement = function(name) { + var xml = new Xml(Xml.Element); + if(xml.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element but found " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType))); + } + xml.nodeName = name; + return xml; +}; +Xml.createPCData = function(data) { + var xml = new Xml(Xml.PCData); + if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { + throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType))); + } + xml.nodeValue = data; + return xml; +}; +Xml.createCData = function(data) { + var xml = new Xml(Xml.CData); + if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { + throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType))); + } + xml.nodeValue = data; + return xml; +}; +Xml.createComment = function(data) { + var xml = new Xml(Xml.Comment); + if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { + throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType))); + } + xml.nodeValue = data; + return xml; +}; +Xml.createDocType = function(data) { + var xml = new Xml(Xml.DocType); + if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { + throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType))); + } + xml.nodeValue = data; + return xml; +}; +Xml.createProcessingInstruction = function(data) { + var xml = new Xml(Xml.ProcessingInstruction); + if(xml.nodeType == Xml.Document || xml.nodeType == Xml.Element) { + throw haxe_Exception.thrown("Bad node type, unexpected " + (xml.nodeType == null ? "null" : XmlType.toString(xml.nodeType))); + } + xml.nodeValue = data; + return xml; +}; +Xml.createDocument = function() { + return new Xml(Xml.Document); +}; +Xml.prototype = { + get: function(att) { + if(this.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType))); + } + return this.attributeMap.h[att]; + } + ,set: function(att,value) { + if(this.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType))); + } + this.attributeMap.h[att] = value; + } + ,exists: function(att) { + if(this.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType))); + } + return Object.prototype.hasOwnProperty.call(this.attributeMap.h,att); + } + ,attributes: function() { + if(this.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType))); + } + return new haxe_ds__$StringMap_StringMapKeyIterator(this.attributeMap.h); + } + ,addChild: function(x) { + if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType))); + } + if(x.parent != null) { + x.parent.removeChild(x); + } + this.children.push(x); + x.parent = this; + } + ,removeChild: function(x) { + if(this.nodeType != Xml.Document && this.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (this.nodeType == null ? "null" : XmlType.toString(this.nodeType))); + } + if(HxOverrides.remove(this.children,x)) { + x.parent = null; + return true; + } + return false; + } + ,toString: function() { + return haxe_xml_Printer.print(this); + } + ,__class__: Xml +}; +var openfl_display_Shape = function() { + openfl_display_DisplayObject.call(this); + this.__drawableType = 3; +}; +$hxClasses["openfl.display.Shape"] = openfl_display_Shape; +openfl_display_Shape.__name__ = "openfl.display.Shape"; +openfl_display_Shape.__super__ = openfl_display_DisplayObject; +openfl_display_Shape.prototype = $extend(openfl_display_DisplayObject.prototype,{ + get_graphics: function() { + if(this.__graphics == null) { + this.__graphics = new openfl_display_Graphics(this); + } + return this.__graphics; + } + ,__class__: openfl_display_Shape + ,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{get_graphics:"get_graphics"}) +}); +var components_NekoRectangle = function(pColor,pX,pY,pWidth,pHeight) { + if(pHeight == null) { + pHeight = 100; + } + if(pWidth == null) { + pWidth = 100; + } + if(pY == null) { + pY = 0; + } + if(pX == null) { + pX = 0; + } + if(pColor == null) { + pColor = 16711680; + } + openfl_display_Shape.call(this); + this.get_graphics().beginFill(pColor); + this.get_graphics().drawRect(pX,pY,pWidth,pHeight); + this.get_graphics().endFill(); +}; +$hxClasses["components.NekoRectangle"] = components_NekoRectangle; +components_NekoRectangle.__name__ = "components.NekoRectangle"; +components_NekoRectangle.__super__ = openfl_display_Shape; +components_NekoRectangle.prototype = $extend(openfl_display_Shape.prototype,{ + __class__: components_NekoRectangle +}); +var feathers_core_IStateContext = function() { }; +$hxClasses["feathers.core.IStateContext"] = feathers_core_IStateContext; +feathers_core_IStateContext.__name__ = "feathers.core.IStateContext"; +feathers_core_IStateContext.__isInterface__ = true; +feathers_core_IStateContext.__interfaces__ = [openfl_events_IEventDispatcher]; +feathers_core_IStateContext.prototype = { + __class__: feathers_core_IStateContext + ,__properties__: {get_currentState:"get_currentState"} +}; +var feathers_controls_ITriggerView = function() { }; +$hxClasses["feathers.controls.ITriggerView"] = feathers_controls_ITriggerView; +feathers_controls_ITriggerView.__name__ = "feathers.controls.ITriggerView"; +feathers_controls_ITriggerView.__isInterface__ = true; +feathers_controls_ITriggerView.__interfaces__ = [feathers_core_IUIControl]; +var feathers_controls_BasicButton = function(triggerListener) { + this.__backgroundSkin = null; + this.__keepDownStateOnRollOut = false; + this._stateToSkin = new haxe_ds_EnumValueMap(); + this._currentBackgroundSkin = null; + this._backgroundSkinMeasurements = null; + this._pointerTrigger = null; + this._keyToState = null; + this._pointerToState = null; + this._currentState = feathers_controls_ButtonState.UP; + feathers_core_FeathersControl.call(this); + this.mouseChildren = false; + this.set_buttonMode(true); + this.useHandCursor = false; + this.addEventListener("click",$bind(this,this.basicButton_clickHandler)); + this.addEventListener("touchTap",$bind(this,this.basicButton_touchTapHandler)); + if(triggerListener != null) { + this.addEventListener("trigger",triggerListener); + } +}; +$hxClasses["feathers.controls.BasicButton"] = feathers_controls_BasicButton; +feathers_controls_BasicButton.__name__ = "feathers.controls.BasicButton"; +feathers_controls_BasicButton.__interfaces__ = [feathers_core_IStateContext,feathers_controls_ITriggerView]; +feathers_controls_BasicButton.__super__ = feathers_core_FeathersControl; +feathers_controls_BasicButton.prototype = $extend(feathers_core_FeathersControl.prototype,{ + get_currentState: function() { + return this._currentState; + } + ,set_enabled: function(value) { + feathers_core_FeathersControl.prototype.set_enabled.call(this,value); + if(this._enabled) { + if(this._currentState == feathers_controls_ButtonState.DISABLED) { + this.changeState(feathers_controls_ButtonState.UP); + } + } else { + this.changeState(feathers_controls_ButtonState.DISABLED); + } + return this._enabled; + } + ,getSkinForState: function(state) { + return this._stateToSkin.get(state); + } + ,setSkinForState: function(state,skin) { + if(!this.setStyle("setSkinForState",state)) { + return; + } + var oldSkin = this._stateToSkin.get(state); + if(oldSkin != null && oldSkin == this._currentBackgroundSkin) { + this.removeCurrentBackgroundSkin(oldSkin); + this._currentBackgroundSkin = null; + } + if(skin == null) { + this._stateToSkin.remove(state); + } else { + this._stateToSkin.set(state,skin); + } + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + } + ,initialize: function() { + feathers_core_FeathersControl.prototype.initialize.call(this); + if(this._pointerToState == null) { + this._pointerToState = new feathers_utils_PointerToState(this,$bind(this,this.changeState),feathers_controls_ButtonState.UP,feathers_controls_ButtonState.DOWN,feathers_controls_ButtonState.HOVER); + } + if(this._keyToState == null) { + this._keyToState = new feathers_utils_KeyToState(this,$bind(this,this.changeState),feathers_controls_ButtonState.UP,feathers_controls_ButtonState.DOWN); + } + if(this._pointerTrigger == null) { + this._pointerTrigger = new feathers_utils_PointerTrigger(this); + } + } + ,update: function() { + this.commitChanges(); + this.measure(); + this.layoutContent(); + } + ,commitChanges: function() { + var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES); + var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE); + if(stylesInvalid || stateInvalid) { + this.refreshBackgroundSkin(); + } + if(stylesInvalid) { + this.refreshInteractivity(); + } + } + ,layoutContent: function() { + this.layoutBackgroundSkin(); + } + ,refreshInteractivity: function() { + this._pointerToState.set_keepDownStateOnRollOut(this.get_keepDownStateOnRollOut()); + } + ,refreshBackgroundSkin: function() { + var oldSkin = this._currentBackgroundSkin; + this._currentBackgroundSkin = this.getCurrentBackgroundSkin(); + if(this._currentBackgroundSkin == oldSkin) { + return; + } + this.removeCurrentBackgroundSkin(oldSkin); + this.addCurrentBackgroundSkin(this._currentBackgroundSkin); + } + ,getCurrentBackgroundSkin: function() { + var result = this._stateToSkin.get(this._currentState); + if(result != null) { + return result; + } + return this.get_backgroundSkin(); + } + ,addCurrentBackgroundSkin: function(skin) { + if(skin == null) { + this._backgroundSkinMeasurements = null; + return; + } + if(js_Boot.__implements(skin,feathers_core_IUIControl)) { + skin.initializeNow(); + } + if(this._backgroundSkinMeasurements == null) { + this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin); + } else { + this._backgroundSkinMeasurements.save(skin); + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(this); + } + if(js_Boot.__implements(skin,feathers_core_IStateObserver)) { + skin.set_stateContext(this); + } + this.addChildAt(skin,0); + } + ,removeCurrentBackgroundSkin: function(skin) { + if(skin == null) { + return; + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(null); + } + if(js_Boot.__implements(skin,feathers_core_IStateObserver)) { + skin.set_stateContext(null); + } + this._backgroundSkinMeasurements.restore(skin); + if(skin.parent == this) { + this.removeChild(skin); + } + } + ,measure: function() { + var needsWidth = this.get_explicitWidth() == null; + var needsHeight = this.get_explicitHeight() == null; + var needsMinWidth = this.get_explicitMinWidth() == null; + var needsMinHeight = this.get_explicitMinHeight() == null; + var needsMaxWidth = this.get_explicitMaxWidth() == null; + var needsMaxHeight = this.get_explicitMaxHeight() == null; + if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) { + return false; + } + if(this._currentBackgroundSkin != null) { + feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this); + } + var measureSkin = null; + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) { + measureSkin = this._currentBackgroundSkin; + } + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) { + this._currentBackgroundSkin.validateNow(); + } + var newWidth = this.get_explicitWidth(); + if(needsWidth) { + if(this._currentBackgroundSkin != null) { + newWidth = this._currentBackgroundSkin.get_width(); + } else { + newWidth = 0.0; + } + } + var newHeight = this.get_explicitHeight(); + if(needsHeight) { + if(this._currentBackgroundSkin != null) { + newHeight = this._currentBackgroundSkin.get_height(); + } else { + newHeight = 0.0; + } + } + var newMinWidth = this.get_explicitMinWidth(); + if(needsMinWidth) { + if(measureSkin != null) { + newMinWidth = measureSkin.get_minWidth(); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) { + newMinWidth = this._backgroundSkinMeasurements.minWidth; + } else { + newMinWidth = 0.0; + } + } + var newMinHeight = this.get_explicitMinHeight(); + if(needsMinHeight) { + if(measureSkin != null) { + newMinHeight = measureSkin.get_minHeight(); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) { + newMinHeight = this._backgroundSkinMeasurements.minHeight; + } else { + newMinHeight = 0.0; + } + } + var newMaxWidth = this.get_explicitMaxWidth(); + if(needsMaxWidth) { + if(measureSkin != null) { + newMaxWidth = measureSkin.get_maxWidth(); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) { + newMaxWidth = this._backgroundSkinMeasurements.maxWidth; + } else { + newMaxWidth = 1.0 / 0.0; + } + } + var newMaxHeight = this.get_explicitMaxHeight(); + if(needsMaxHeight) { + if(measureSkin != null) { + newMaxHeight = measureSkin.get_maxHeight(); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) { + newMaxHeight = this._backgroundSkinMeasurements.maxHeight; + } else { + newMaxHeight = 1.0 / 0.0; + } + } + return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight); + } + ,layoutBackgroundSkin: function() { + if(this._currentBackgroundSkin == null) { + return; + } + this._currentBackgroundSkin.set_x(0.0); + this._currentBackgroundSkin.set_y(0.0); + if(this._currentBackgroundSkin.get_width() != this.actualWidth) { + this._currentBackgroundSkin.set_width(this.actualWidth); + } + if(this._currentBackgroundSkin.get_height() != this.actualHeight) { + this._currentBackgroundSkin.set_height(this.actualHeight); + } + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) { + this._currentBackgroundSkin.validateNow(); + } + } + ,changeState: function(state) { + if(!this._enabled) { + state = feathers_controls_ButtonState.DISABLED; + } + if(this._currentState == state) { + return; + } + this._currentState = state; + this.setInvalid(feathers_core_InvalidationFlag.STATE); + feathers_events_FeathersEvent.dispatch(this,"stateChange"); + } + ,basicButton_clickHandler: function(event) { + if(!this._enabled) { + event.stopImmediatePropagation(); + return; + } + } + ,basicButton_touchTapHandler: function(event) { + if(!this._enabled) { + event.stopImmediatePropagation(); + return; + } + } + ,get_keepDownStateOnRollOut: function() { + return this.__keepDownStateOnRollOut; + } + ,set_keepDownStateOnRollOut: function(value) { + if(!this.setStyle("keepDownStateOnRollOut")) { + return this.__keepDownStateOnRollOut; + } + if(this.__keepDownStateOnRollOut == value) { + return this.__keepDownStateOnRollOut; + } + this._previousClearStyle = $bind(this,this.clearStyle_keepDownStateOnRollOut); + this.__keepDownStateOnRollOut = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__keepDownStateOnRollOut; + } + ,clearStyle_keepDownStateOnRollOut: function() { + this.set_keepDownStateOnRollOut(false); + return this.get_keepDownStateOnRollOut(); + } + ,get_backgroundSkin: function() { + return this.__backgroundSkin; + } + ,set_backgroundSkin: function(value) { + if(!this.setStyle("backgroundSkin")) { + return this.__backgroundSkin; + } + if(this.__backgroundSkin == value) { + return this.__backgroundSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin); + this.__backgroundSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__backgroundSkin; + } + ,clearStyle_backgroundSkin: function() { + this.set_backgroundSkin(null); + return this.get_backgroundSkin(); + } + ,__class__: feathers_controls_BasicButton + ,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_keepDownStateOnRollOut:"set_keepDownStateOnRollOut",get_keepDownStateOnRollOut:"get_keepDownStateOnRollOut",get_currentState:"get_currentState"}) +}); +var feathers_core_IFocusObject = function() { }; +$hxClasses["feathers.core.IFocusObject"] = feathers_core_IFocusObject; +feathers_core_IFocusObject.__name__ = "feathers.core.IFocusObject"; +feathers_core_IFocusObject.__isInterface__ = true; +feathers_core_IFocusObject.__interfaces__ = [feathers_core_IDisplayObject,feathers_core_IFocusManagerAware]; +feathers_core_IFocusObject.prototype = { + __class__: feathers_core_IFocusObject + ,__properties__: {set_focusOwner:"set_focusOwner",get_focusOwner:"get_focusOwner",set_focusEnabled:"set_focusEnabled",get_focusEnabled:"get_focusEnabled"} +}; +var feathers_core_IHTMLTextControl = function() { }; +$hxClasses["feathers.core.IHTMLTextControl"] = feathers_core_IHTMLTextControl; +feathers_core_IHTMLTextControl.__name__ = "feathers.core.IHTMLTextControl"; +feathers_core_IHTMLTextControl.__isInterface__ = true; +feathers_core_IHTMLTextControl.__interfaces__ = [feathers_core_IUIControl]; +feathers_core_IHTMLTextControl.prototype = { + __class__: feathers_core_IHTMLTextControl + ,__properties__: {set_htmlText:"set_htmlText",get_htmlText:"get_htmlText"} +}; +var feathers_core_ITextControl = function() { }; +$hxClasses["feathers.core.ITextControl"] = feathers_core_ITextControl; +feathers_core_ITextControl.__name__ = "feathers.core.ITextControl"; +feathers_core_ITextControl.__isInterface__ = true; +feathers_core_ITextControl.__interfaces__ = [feathers_core_IUIControl]; +feathers_core_ITextControl.prototype = { + __class__: feathers_core_ITextControl + ,__properties__: {get_baseline:"get_baseline",set_text:"set_text",get_text:"get_text"} +}; +var feathers_controls_Button = function(text,triggerListener) { + this.__showText = true; + this.__textOffsetY = 0.0; + this.__textOffsetX = 0.0; + this.__iconOffsetY = 0.0; + this.__iconOffsetX = 0.0; + this.__minGap = 0.0; + this.__gap = 0.0; + this.__iconPosition = feathers_layout_RelativePosition.LEFT; + this.__verticalAlign = feathers_layout_VerticalAlign.MIDDLE; + this.__horizontalAlign = feathers_layout_HorizontalAlign.CENTER; + this.__paddingLeft = 0.0; + this.__paddingBottom = 0.0; + this.__paddingRight = 0.0; + this.__paddingTop = 0.0; + this.__icon = null; + this.__wordWrap = false; + this.__embedFonts = false; + this.__disabledTextFormat = null; + this.__styleSheet = null; + this.__textFormat = null; + this._stateToTextFormat = new haxe_ds_EnumValueMap(); + this._wrappedOnMeasure = false; + this._ignoreIconResizes = false; + this._currentIcon = null; + this._iconMeasurements = null; + this._stateToIcon = new haxe_ds_EnumValueMap(); + this._htmlText = null; + this._updatedTextStyles = false; + this._previousSimpleTextFormat = null; + this._previousTextFormat = null; + this._previousHTMLText = null; + this._previousText = null; + this.initializeButtonTheme(); + feathers_controls_BasicButton.call(this,triggerListener); + this.set_text(text); + this.set_tabEnabled(true); + this.set_tabChildren(false); + this.focusRect = false; + this.addEventListener("keyDown",$bind(this,this.button_keyDownHandler)); + this.addEventListener("focusIn",$bind(this,this.button_focusInHandler)); + this.addEventListener("focusOut",$bind(this,this.button_focusOutHandler)); +}; +$hxClasses["feathers.controls.Button"] = feathers_controls_Button; +feathers_controls_Button.__name__ = "feathers.controls.Button"; +feathers_controls_Button.__interfaces__ = [feathers_core_IFocusObject,feathers_core_IHTMLTextControl,feathers_core_ITextControl]; +feathers_controls_Button.__super__ = feathers_controls_BasicButton; +feathers_controls_Button.prototype = $extend(feathers_controls_BasicButton.prototype,{ + get_text: function() { + return this._text; + } + ,set_text: function(value) { + if(this._text == value) { + return this._text; + } + this._text = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._text; + } + ,get_htmlText: function() { + return this._htmlText; + } + ,set_htmlText: function(value) { + if(this._htmlText == value) { + return this._htmlText; + } + this._htmlText = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._htmlText; + } + ,get_baseline: function() { + if(this.textField == null) { + return 0.0; + } + var hasText = this._text != null && this._text.length > 0; + var hasHTMLText = this._htmlText != null && this._htmlText.length > 0; + if(!this.get_showText() || !hasText && !hasHTMLText) { + var textFieldY = this.textField.get_y(); + if(!this.get_showText() || this._text == null && this._htmlText == null) { + if(this._currentIcon != null) { + textFieldY = this._currentIcon.get_y() + (this._currentIcon.get_height() - this._textMeasuredHeight) / 2.0; + } else if(this._currentBackgroundSkin != null) { + textFieldY = (this._currentBackgroundSkin.get_height() - this._textMeasuredHeight) / 2.0; + } else { + return 0.0; + } + } + this.textField.set_text("​"); + var textFieldBaseline = textFieldY + this.textField.getLineMetrics(0).ascent; + this.textField.set_text(""); + return textFieldBaseline; + } + return this.textField.get_y() + this.textField.getLineMetrics(0).ascent; + } + ,getTextFormatForState: function(state) { + return this._stateToTextFormat.get(state); + } + ,setTextFormatForState: function(state,textFormat) { + if(!this.setStyle("setTextFormatForState",state)) { + return; + } + if(textFormat == null) { + this._stateToTextFormat.remove(state); + } else { + this._stateToTextFormat.set(state,textFormat); + } + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + } + ,getIconForState: function(state) { + return this._stateToIcon.get(state); + } + ,setIconForState: function(state,icon) { + if(!this.setStyle("setIconForState",state)) { + return; + } + var oldIcon = this._stateToIcon.get(state); + if(oldIcon != null && oldIcon == this._currentIcon) { + this.removeCurrentIcon(oldIcon); + this._currentIcon = null; + } + if(icon == null) { + this._stateToIcon.remove(state); + } else { + this._stateToIcon.set(state,icon); + } + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + } + ,setPadding: function(value) { + this.set_paddingTop(value); + this.set_paddingRight(value); + this.set_paddingBottom(value); + this.set_paddingLeft(value); + } + ,initializeButtonTheme: function() { + feathers_themes_steel_components_SteelButtonStyles.initialize(); + } + ,initialize: function() { + feathers_controls_BasicButton.prototype.initialize.call(this); + if(this.textField == null) { + this.textField = new openfl_text_TextField(); + this.textField.set_selectable(false); + this.textField.set_multiline(true); + this.addChild(this.textField); + } + } + ,commitChanges: function() { + feathers_controls_BasicButton.prototype.commitChanges.call(this); + var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA); + var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE); + var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE); + var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES); + this._updatedTextStyles = false; + if(stylesInvalid || stateInvalid) { + this.refreshIcon(); + } + if(stylesInvalid || stateInvalid) { + this.refreshTextStyles(); + } + if(dataInvalid || stylesInvalid || stateInvalid || sizeInvalid) { + this.refreshText(sizeInvalid); + } + } + ,measure: function() { + var needsWidth = this.get_explicitWidth() == null; + var needsHeight = this.get_explicitHeight() == null; + var needsMinWidth = this.get_explicitMinWidth() == null; + var needsMinHeight = this.get_explicitMinHeight() == null; + var needsMaxWidth = this.get_explicitMaxWidth() == null; + var needsMaxHeight = this.get_explicitMaxHeight() == null; + if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) { + return false; + } + var hasText = this.get_showText() && this._text != null; + var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0; + if(hasText || hasHTMLText) { + this.refreshTextFieldDimensions(true); + } + if(this._currentBackgroundSkin != null) { + feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this); + } + var measureSkin = null; + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) { + measureSkin = this._currentBackgroundSkin; + } + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) { + this._currentBackgroundSkin.validateNow(); + } + if(js_Boot.__implements(this._currentIcon,feathers_core_IValidating)) { + var oldIgnoreIconResizes = this._ignoreIconResizes; + this._ignoreIconResizes = true; + this._currentIcon.validateNow(); + this._ignoreIconResizes = oldIgnoreIconResizes; + } + var newWidth = this.get_explicitWidth(); + if(needsWidth) { + newWidth = this.measureContentWidth(); + newWidth += this.get_paddingLeft() + this.get_paddingRight(); + if(this._currentBackgroundSkin != null) { + newWidth = Math.max(this._currentBackgroundSkin.get_width(),newWidth); + } + } + var newHeight = this.get_explicitHeight(); + if(needsHeight) { + newHeight = this.measureContentHeight(); + newHeight += this.get_paddingTop() + this.get_paddingBottom(); + if(this._currentBackgroundSkin != null) { + newHeight = Math.max(this._currentBackgroundSkin.get_height(),newHeight); + } + } + var newMinWidth = this.get_explicitMinWidth(); + if(needsMinWidth) { + newMinWidth = this.measureContentMinWidth(); + newMinWidth += this.get_paddingLeft() + this.get_paddingRight(); + if(measureSkin != null) { + newMinWidth = Math.max(measureSkin.get_minWidth(),newMinWidth); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) { + newMinWidth = Math.max(this._backgroundSkinMeasurements.minWidth,newMinWidth); + } + } + var newMinHeight = this.get_explicitMinHeight(); + if(needsMinHeight) { + newMinHeight = this.measureContentMinHeight(); + newMinHeight += this.get_paddingTop() + this.get_paddingBottom(); + if(measureSkin != null) { + newMinHeight = Math.max(measureSkin.get_minHeight(),newMinHeight); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) { + newMinHeight = Math.max(this._backgroundSkinMeasurements.minHeight,newMinHeight); + } + } + var newMaxWidth = this.get_explicitMaxWidth(); + if(needsMaxWidth) { + if(measureSkin != null) { + newMaxWidth = measureSkin.get_maxWidth(); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) { + newMaxWidth = this._backgroundSkinMeasurements.maxWidth; + } else { + newMaxWidth = 1.0 / 0.0; + } + } + var newMaxHeight = this.get_explicitMaxHeight(); + if(needsMaxHeight) { + if(measureSkin != null) { + newMaxHeight = measureSkin.get_maxHeight(); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) { + newMaxHeight = this._backgroundSkinMeasurements.maxHeight; + } else { + newMaxHeight = 1.0 / 0.0; + } + } + return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight); + } + ,calculateExplicitWidthForTextMeasurement: function() { + var textFieldExplicitWidth = null; + if(this.get_explicitWidth() != null) { + textFieldExplicitWidth = this.get_explicitWidth(); + } else if(this.get_explicitMaxWidth() != null) { + textFieldExplicitWidth = this.get_explicitMaxWidth(); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) { + textFieldExplicitWidth = this._backgroundSkinMeasurements.maxWidth; + } + if(textFieldExplicitWidth == null) { + return textFieldExplicitWidth; + } + textFieldExplicitWidth -= this.get_paddingLeft() + this.get_paddingRight(); + var adjustedGap = this.get_gap(); + if(adjustedGap == 1.0 / 0.0) { + adjustedGap = this.get_minGap(); + } + if(this._currentIcon != null) { + if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) { + if(js_Boot.__implements(this._currentIcon,feathers_core_IValidating)) { + this._currentIcon.validateNow(); + } + textFieldExplicitWidth -= this._currentIcon.get_width() + adjustedGap; + } + } + if(textFieldExplicitWidth < 0.0) { + textFieldExplicitWidth = 0.0; + } + return textFieldExplicitWidth; + } + ,measureContentWidth: function() { + var adjustedGap = this.get_gap(); + if(adjustedGap == 1.0 / 0.0) { + adjustedGap = this.get_minGap(); + } + var hasText = this.get_showText() && this._text != null; + var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0; + var contentWidth = hasText || hasHTMLText ? this._textMeasuredWidth : 0.0; + if(this._currentIcon != null) { + if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) { + if(hasText || hasHTMLText) { + contentWidth += adjustedGap; + } + contentWidth += this._currentIcon.get_width(); + } else if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) { + contentWidth = Math.max(contentWidth,this._currentIcon.get_width()); + } + } + return contentWidth; + } + ,measureContentHeight: function() { + var adjustedGap = this.get_gap(); + if(adjustedGap == 1.0 / 0.0) { + adjustedGap = this.get_minGap(); + } + var hasText = this.get_showText() && this._text != null; + var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0; + var contentHeight = hasText || hasHTMLText ? this._textMeasuredHeight : 0.0; + if(this._currentIcon != null) { + if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) { + if(hasText || hasHTMLText) { + contentHeight += adjustedGap; + } + contentHeight += this._currentIcon.get_height(); + } else if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) { + contentHeight = Math.max(contentHeight,this._currentIcon.get_height()); + } + } + return contentHeight; + } + ,measureContentMinWidth: function() { + var adjustedGap = this.get_gap(); + if(adjustedGap == 1.0 / 0.0) { + adjustedGap = this.get_minGap(); + } + var hasText = this.get_showText() && this._text != null; + var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0; + var contentMinWidth = hasText || hasHTMLText ? this._textMeasuredWidth : 0.0; + if(this._currentIcon != null) { + if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) { + if(hasText || hasHTMLText) { + contentMinWidth += adjustedGap; + } + contentMinWidth += this._currentIcon.get_width(); + } else if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) { + contentMinWidth = Math.max(contentMinWidth,this._currentIcon.get_width()); + } + } + return contentMinWidth; + } + ,measureContentMinHeight: function() { + var adjustedGap = this.get_gap(); + if(adjustedGap == 1.0 / 0.0) { + adjustedGap = this.get_minGap(); + } + var hasText = this.get_showText() && this._text != null; + var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0; + var contentMinHeight = hasText || hasHTMLText ? this._textMeasuredHeight : 0.0; + if(this._currentIcon != null) { + if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) { + if(hasText || hasHTMLText) { + contentMinHeight += adjustedGap; + } + contentMinHeight += this._currentIcon.get_height(); + } else if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) { + contentMinHeight = Math.max(contentMinHeight,this._currentIcon.get_height()); + } + } + return contentMinHeight; + } + ,refreshTextStyles: function() { + if(this.textField.get_wordWrap() != this.get_wordWrap()) { + this.textField.set_wordWrap(this.get_wordWrap()); + this._updatedTextStyles = true; + } + if(this.textField.get_embedFonts() != this.get_embedFonts()) { + this.textField.set_embedFonts(this.get_embedFonts()); + this._updatedTextStyles = true; + } + if(this.textField.get_styleSheet() != this.get_styleSheet()) { + this.textField.set_styleSheet(this.get_styleSheet()); + this._updatedTextStyles = true; + } + var textFormat = this.getCurrentTextFormat(); + var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null; + if(simpleTextFormat == this._previousSimpleTextFormat) { + return; + } + if(this._previousTextFormat != null) { + this._previousTextFormat.removeEventListener("change",$bind(this,this.button_textFormat_changeHandler)); + } + if(textFormat != null) { + textFormat.addEventListener("change",$bind(this,this.button_textFormat_changeHandler),false,0,true); + this.textField.set_defaultTextFormat(simpleTextFormat); + this._updatedTextStyles = true; + } + this._previousTextFormat = textFormat; + this._previousSimpleTextFormat = simpleTextFormat; + } + ,refreshText: function(forceMeasurement) { + var hasText = this.get_showText() && this._text != null && this._text.length > 0; + var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0; + this.textField.set_visible(hasText || hasHTMLText); + if(this._text == this._previousText && this._htmlText == this._previousHTMLText && !this._updatedTextStyles && !forceMeasurement) { + return; + } + this.textField.set_autoSize(1); + if(hasHTMLText) { + this.textField.set_htmlText(this._htmlText); + } else if(hasText) { + this.textField.set_text(this._text); + } else { + this.textField.set_text("​"); + } + if(this.get_wordWrap()) { + this.textField.set_wordWrap(false); + } + this._textMeasuredWidth = this.textField.get_textWidth() + 4; + this._wrappedOnMeasure = false; + if(this.get_wordWrap()) { + var textFieldExplicitWidth = this.calculateExplicitWidthForTextMeasurement(); + if(textFieldExplicitWidth != null && this._textMeasuredWidth > textFieldExplicitWidth) { + this.textField.set_wordWrap(true); + this.textField.set_width(textFieldExplicitWidth); + this._textMeasuredWidth = this.textField.get_width(); + this._wrappedOnMeasure = true; + } + } + this._textMeasuredHeight = this.textField.get_height(); + this.textField.set_autoSize(2); + if(this.textField.get_wordWrap() != this.get_wordWrap()) { + this.textField.set_wordWrap(this.get_wordWrap()); + } + if(!hasText && !hasHTMLText) { + this.textField.set_text(""); + } + this._previousText = this._text; + this._previousHTMLText = this._htmlText; + } + ,getCurrentTextFormat: function() { + if(this.get_styleSheet() != null) { + return null; + } + var result = this._stateToTextFormat.get(this._currentState); + if(result != null) { + return result; + } + if(!this._enabled && this.get_disabledTextFormat() != null) { + return this.get_disabledTextFormat(); + } + return this.get_textFormat(); + } + ,layoutContent: function() { + feathers_controls_BasicButton.prototype.layoutContent.call(this); + this.layoutChildren(); + } + ,layoutChildren: function() { + this.refreshTextFieldDimensions(false); + var hasText = this.get_showText() && this._text != null; + var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0; + var iconIsInLayout = this._currentIcon != null && this.get_iconPosition() != feathers_layout_RelativePosition.MANUAL; + if((hasText || hasHTMLText) && iconIsInLayout) { + this.positionSingleChild(this.textField); + this.positionTextAndIcon(); + } else if(hasText || hasHTMLText) { + this.positionSingleChild(this.textField); + } else if(iconIsInLayout) { + this.positionSingleChild(this._currentIcon); + } + if(this._currentIcon != null) { + if(this.get_iconPosition() == feathers_layout_RelativePosition.MANUAL) { + this._currentIcon.set_x(this.get_paddingLeft()); + this._currentIcon.set_y(this.get_paddingTop()); + } + var fh = this._currentIcon; + fh.set_x(fh.get_x() + this.get_iconOffsetX()); + var fh = this._currentIcon; + fh.set_y(fh.get_y() + this.get_iconOffsetY()); + } + if(hasText || hasHTMLText) { + var fh = this.textField; + fh.set_x(fh.get_x() + this.get_textOffsetX()); + var fh = this.textField; + fh.set_y(fh.get_y() + this.get_textOffsetY()); + } + } + ,refreshTextFieldDimensions: function(forMeasurement) { + var oldIgnoreIconResizes = this._ignoreIconResizes; + this._ignoreIconResizes = true; + if(js_Boot.__implements(this._currentIcon,feathers_core_IValidating)) { + this._currentIcon.validateNow(); + } + this._ignoreIconResizes = oldIgnoreIconResizes; + var hasText = this.get_showText() && this._text != null; + var hasHTMLText = this.get_showText() && this._htmlText != null && this._htmlText.length > 0; + if(!hasText && !hasHTMLText) { + return; + } + var calculatedWidth = this.actualWidth; + var calculatedHeight = this.actualHeight; + if(forMeasurement) { + calculatedWidth = 0.0; + var explicitCalculatedWidth = this.get_explicitWidth(); + if(explicitCalculatedWidth == null) { + explicitCalculatedWidth = this.get_explicitMaxWidth(); + } + if(explicitCalculatedWidth != null) { + calculatedWidth = explicitCalculatedWidth; + } + calculatedHeight = 0.0; + var explicitCalculatedHeight = this.get_explicitHeight(); + if(explicitCalculatedHeight == null) { + explicitCalculatedHeight = this.get_explicitMaxHeight(); + } + if(explicitCalculatedHeight != null) { + calculatedHeight = explicitCalculatedHeight; + } + } + calculatedWidth -= this.get_paddingLeft() + this.get_paddingRight(); + calculatedHeight -= this.get_paddingTop() + this.get_paddingBottom(); + if(this._currentIcon != null) { + var adjustedGap = this.get_gap(); + if(adjustedGap == 1.0 / 0.0) { + adjustedGap = this.get_minGap(); + } + if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) { + calculatedWidth -= this._currentIcon.get_width() + adjustedGap; + } + if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP || this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) { + calculatedHeight -= this._currentIcon.get_height() + adjustedGap; + } + } + if(calculatedWidth > this._textMeasuredWidth) { + calculatedWidth = this._textMeasuredWidth; + } + if(calculatedHeight > this._textMeasuredHeight) { + calculatedHeight = this._textMeasuredHeight; + } + if(calculatedWidth < 0.0) { + calculatedWidth = 0.0; + } + if(calculatedHeight < 0.0) { + calculatedHeight = 0.0; + } + this.textField.set_width(calculatedWidth); + var wordWrap = this.get_wordWrap(); + if(wordWrap && !this._wrappedOnMeasure && calculatedWidth >= this._textMeasuredWidth) { + wordWrap = false; + } + if(this.textField.get_wordWrap() != wordWrap) { + this.textField.set_wordWrap(wordWrap); + } + this.textField.set_height(calculatedHeight); + } + ,positionSingleChild: function(displayObject) { + if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.LEFT) { + displayObject.set_x(this.get_paddingLeft()); + } else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.RIGHT) { + displayObject.set_x(this.actualWidth - this.get_paddingRight() - displayObject.get_width()); + } else { + displayObject.set_x(this.get_paddingLeft() + (this.actualWidth - this.get_paddingLeft() - this.get_paddingRight() - displayObject.get_width()) / 2.0); + } + if(this.get_verticalAlign() == feathers_layout_VerticalAlign.TOP) { + displayObject.set_y(this.get_paddingTop()); + } else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.BOTTOM) { + displayObject.set_y(this.actualHeight - this.get_paddingBottom() - displayObject.get_height()); + } else { + displayObject.set_y(this.get_paddingTop() + (this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - displayObject.get_height()) / 2.0); + } + } + ,positionTextAndIcon: function() { + if(this.get_iconPosition() == feathers_layout_RelativePosition.TOP) { + if(this.get_gap() == 1.0 / 0.0) { + this._currentIcon.set_y(this.get_paddingTop()); + this.textField.set_y(this.actualHeight - this.get_paddingBottom() - this.textField.get_height()); + } else { + if(this.get_verticalAlign() == feathers_layout_VerticalAlign.TOP) { + var fh = this.textField; + fh.set_y(fh.get_y() + (this._currentIcon.get_height() + this.get_gap())); + } else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.MIDDLE) { + var fh = this.textField; + fh.set_y(fh.get_y() + (this._currentIcon.get_height() + this.get_gap()) / 2.0); + } + this._currentIcon.set_y(this.textField.get_y() - this._currentIcon.get_height() - this.get_gap()); + } + } else if(this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) { + if(this.get_gap() == 1.0 / 0.0) { + this.textField.set_x(this.get_paddingLeft()); + this._currentIcon.set_x(this.actualWidth - this.get_paddingRight() - this._currentIcon.get_width()); + } else { + if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.RIGHT) { + var fh = this.textField; + fh.set_x(fh.get_x() - (this._currentIcon.get_width() + this.get_gap())); + } else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.CENTER) { + var fh = this.textField; + fh.set_x(fh.get_x() - (this._currentIcon.get_width() + this.get_gap()) / 2.0); + } + this._currentIcon.set_x(this.textField.get_x() + this.textField.get_width() + this.get_gap()); + } + } else if(this.get_iconPosition() == feathers_layout_RelativePosition.BOTTOM) { + if(this.get_gap() == 1.0 / 0.0) { + this.textField.set_y(this.get_paddingTop()); + this._currentIcon.set_y(this.actualHeight - this.get_paddingBottom() - this._currentIcon.get_height()); + } else { + if(this.get_verticalAlign() == feathers_layout_VerticalAlign.BOTTOM) { + var fh = this.textField; + fh.set_y(fh.get_y() - (this._currentIcon.get_height() + this.get_gap())); + } else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.MIDDLE) { + var fh = this.textField; + fh.set_y(fh.get_y() - (this._currentIcon.get_height() + this.get_gap()) / 2.0); + } + this._currentIcon.set_y(this.textField.get_y() + this.textField.get_height() + this.get_gap()); + } + } else if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT) { + if(this.get_gap() == 1.0 / 0.0) { + this._currentIcon.set_x(this.get_paddingLeft()); + this.textField.set_x(this.actualWidth - this.get_paddingRight() - this.textField.get_width()); + } else { + if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.LEFT) { + var fh = this.textField; + fh.set_x(fh.get_x() + (this.get_gap() + this._currentIcon.get_width())); + } else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.CENTER) { + var fh = this.textField; + fh.set_x(fh.get_x() + (this.get_gap() + this._currentIcon.get_width()) / 2.0); + } + this._currentIcon.set_x(this.textField.get_x() - this.get_gap() - this._currentIcon.get_width()); + } + } + if(this.get_iconPosition() == feathers_layout_RelativePosition.LEFT || this.get_iconPosition() == feathers_layout_RelativePosition.RIGHT) { + if(this.get_verticalAlign() == feathers_layout_VerticalAlign.TOP) { + this._currentIcon.set_y(this.get_paddingTop()); + } else if(this.get_verticalAlign() == feathers_layout_VerticalAlign.BOTTOM) { + this._currentIcon.set_y(this.actualHeight - this.get_paddingBottom() - this._currentIcon.get_height()); + } else { + this._currentIcon.set_y(this.get_paddingTop() + (this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this._currentIcon.get_height()) / 2.0); + } + } else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.LEFT) { + this._currentIcon.set_x(this.get_paddingLeft()); + } else if(this.get_horizontalAlign() == feathers_layout_HorizontalAlign.RIGHT) { + this._currentIcon.set_x(this.actualWidth - this.get_paddingRight() - this._currentIcon.get_width()); + } else { + this._currentIcon.set_x(this.get_paddingLeft() + (this.actualWidth - this.get_paddingLeft() - this.get_paddingRight() - this._currentIcon.get_width()) / 2.0); + } + } + ,refreshIcon: function() { + var oldIcon = this._currentIcon; + this._currentIcon = this.getCurrentIcon(); + if(this._currentIcon == oldIcon) { + return; + } + this.removeCurrentIcon(oldIcon); + this.addCurrentIcon(this._currentIcon); + } + ,addCurrentIcon: function(icon) { + if(icon == null) { + this._iconMeasurements = null; + return; + } + if(js_Boot.__implements(icon,feathers_core_IUIControl)) { + icon.initializeNow(); + } + if(this._iconMeasurements == null) { + this._iconMeasurements = new feathers_layout_Measurements(icon); + } else { + this._iconMeasurements.save(icon); + } + if(js_Boot.__implements(icon,feathers_skins_IProgrammaticSkin)) { + icon.set_uiContext(this); + } + if(js_Boot.__implements(icon,feathers_core_IStateObserver)) { + icon.set_stateContext(this); + } + icon.addEventListener("resize",$bind(this,this.button_icon_resizeHandler),false,0,true); + var index = this.getChildIndex(this.textField); + this.addChildAt(icon,index); + } + ,getCurrentIcon: function() { + var result = this._stateToIcon.get(this._currentState); + if(result != null) { + return result; + } + return this.get_icon(); + } + ,removeCurrentIcon: function(icon) { + if(icon == null) { + return; + } + icon.removeEventListener("resize",$bind(this,this.button_icon_resizeHandler)); + if(js_Boot.__implements(icon,feathers_skins_IProgrammaticSkin)) { + icon.set_uiContext(null); + } + if(js_Boot.__implements(icon,feathers_core_IStateObserver)) { + icon.set_stateContext(null); + } + this._iconMeasurements.restore(icon); + if(icon.parent == this) { + this.removeChild(icon); + } + } + ,button_keyDownHandler: function(event) { + if(!this._enabled || this.get_buttonMode() && this.focusRect == true) { + return; + } + if(this._focusManager != null && this._focusManager.get_focus() != this) { + return; + } + if(event.keyCode != 32 && event.keyCode != 13) { + return; + } + event.preventDefault(); + this.dispatchEvent(new openfl_events_MouseEvent("click")); + } + ,button_focusInHandler: function(event) { + this._keyToState.set_enabled(this._enabled); + } + ,button_focusOutHandler: function(event) { + this._keyToState.set_enabled(false); + } + ,button_textFormat_changeHandler: function(event) { + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + } + ,button_icon_resizeHandler: function(event) { + if(this._ignoreIconResizes) { + return; + } + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + } + ,get_styleContext: function() { + return feathers_controls_Button; + } + ,get_textFormat: function() { + return this.__textFormat; + } + ,set_textFormat: function(value) { + if(!this.setStyle("textFormat")) { + return this.__textFormat; + } + if(this.__textFormat == value) { + return this.__textFormat; + } + this._previousClearStyle = $bind(this,this.clearStyle_textFormat); + this.__textFormat = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__textFormat; + } + ,clearStyle_textFormat: function() { + this.set_textFormat(null); + return this.get_textFormat(); + } + ,get_styleSheet: function() { + return this.__styleSheet; + } + ,set_styleSheet: function(value) { + if(!this.setStyle("styleSheet")) { + return this.__styleSheet; + } + if(this.__styleSheet == value) { + return this.__styleSheet; + } + this._previousClearStyle = $bind(this,this.clearStyle_styleSheet); + this.__styleSheet = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__styleSheet; + } + ,clearStyle_styleSheet: function() { + this.set_styleSheet(null); + return this.get_styleSheet(); + } + ,get_disabledTextFormat: function() { + return this.__disabledTextFormat; + } + ,set_disabledTextFormat: function(value) { + if(!this.setStyle("disabledTextFormat")) { + return this.__disabledTextFormat; + } + if(this.__disabledTextFormat == value) { + return this.__disabledTextFormat; + } + this._previousClearStyle = $bind(this,this.clearStyle_disabledTextFormat); + this.__disabledTextFormat = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__disabledTextFormat; + } + ,clearStyle_disabledTextFormat: function() { + this.set_disabledTextFormat(null); + return this.get_disabledTextFormat(); + } + ,get_embedFonts: function() { + return this.__embedFonts; + } + ,set_embedFonts: function(value) { + if(!this.setStyle("embedFonts")) { + return this.__embedFonts; + } + if(this.__embedFonts == value) { + return this.__embedFonts; + } + this._previousClearStyle = $bind(this,this.clearStyle_embedFonts); + this.__embedFonts = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__embedFonts; + } + ,clearStyle_embedFonts: function() { + this.set_embedFonts(false); + return this.get_embedFonts(); + } + ,get_wordWrap: function() { + return this.__wordWrap; + } + ,set_wordWrap: function(value) { + if(!this.setStyle("wordWrap")) { + return this.__wordWrap; + } + if(this.__wordWrap == value) { + return this.__wordWrap; + } + this._previousClearStyle = $bind(this,this.clearStyle_wordWrap); + this.__wordWrap = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__wordWrap; + } + ,clearStyle_wordWrap: function() { + this.set_wordWrap(false); + return this.get_wordWrap(); + } + ,get_icon: function() { + return this.__icon; + } + ,set_icon: function(value) { + if(!this.setStyle("icon")) { + return this.__icon; + } + if(this.__icon == value) { + return this.__icon; + } + this._previousClearStyle = $bind(this,this.clearStyle_icon); + this.__icon = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__icon; + } + ,clearStyle_icon: function() { + this.set_icon(null); + return this.get_icon(); + } + ,get_paddingTop: function() { + return this.__paddingTop; + } + ,set_paddingTop: function(value) { + if(!this.setStyle("paddingTop")) { + return this.__paddingTop; + } + if(this.__paddingTop == value) { + return this.__paddingTop; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingTop); + this.__paddingTop = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingTop; + } + ,clearStyle_paddingTop: function() { + this.set_paddingTop(0.0); + return this.get_paddingTop(); + } + ,get_paddingRight: function() { + return this.__paddingRight; + } + ,set_paddingRight: function(value) { + if(!this.setStyle("paddingRight")) { + return this.__paddingRight; + } + if(this.__paddingRight == value) { + return this.__paddingRight; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingRight); + this.__paddingRight = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingRight; + } + ,clearStyle_paddingRight: function() { + this.set_paddingRight(0.0); + return this.get_paddingRight(); + } + ,get_paddingBottom: function() { + return this.__paddingBottom; + } + ,set_paddingBottom: function(value) { + if(!this.setStyle("paddingBottom")) { + return this.__paddingBottom; + } + if(this.__paddingBottom == value) { + return this.__paddingBottom; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom); + this.__paddingBottom = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingBottom; + } + ,clearStyle_paddingBottom: function() { + this.set_paddingBottom(0.0); + return this.get_paddingBottom(); + } + ,get_paddingLeft: function() { + return this.__paddingLeft; + } + ,set_paddingLeft: function(value) { + if(!this.setStyle("paddingLeft")) { + return this.__paddingLeft; + } + if(this.__paddingLeft == value) { + return this.__paddingLeft; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft); + this.__paddingLeft = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingLeft; + } + ,clearStyle_paddingLeft: function() { + this.set_paddingLeft(0.0); + return this.get_paddingLeft(); + } + ,get_horizontalAlign: function() { + return this.__horizontalAlign; + } + ,set_horizontalAlign: function(value) { + if(!this.setStyle("horizontalAlign")) { + return this.__horizontalAlign; + } + if(this.__horizontalAlign == value) { + return this.__horizontalAlign; + } + this._previousClearStyle = $bind(this,this.clearStyle_horizontalAlign); + this.__horizontalAlign = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__horizontalAlign; + } + ,clearStyle_horizontalAlign: function() { + this.set_horizontalAlign(feathers_layout_HorizontalAlign.CENTER); + return this.get_horizontalAlign(); + } + ,get_verticalAlign: function() { + return this.__verticalAlign; + } + ,set_verticalAlign: function(value) { + if(!this.setStyle("verticalAlign")) { + return this.__verticalAlign; + } + if(this.__verticalAlign == value) { + return this.__verticalAlign; + } + this._previousClearStyle = $bind(this,this.clearStyle_verticalAlign); + this.__verticalAlign = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__verticalAlign; + } + ,clearStyle_verticalAlign: function() { + this.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE); + return this.get_verticalAlign(); + } + ,get_iconPosition: function() { + return this.__iconPosition; + } + ,set_iconPosition: function(value) { + if(!this.setStyle("iconPosition")) { + return this.__iconPosition; + } + if(this.__iconPosition == value) { + return this.__iconPosition; + } + this._previousClearStyle = $bind(this,this.clearStyle_iconPosition); + this.__iconPosition = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__iconPosition; + } + ,clearStyle_iconPosition: function() { + this.set_iconPosition(feathers_layout_RelativePosition.LEFT); + return this.get_iconPosition(); + } + ,get_gap: function() { + return this.__gap; + } + ,set_gap: function(value) { + if(!this.setStyle("gap")) { + return this.__gap; + } + if(this.__gap == value) { + return this.__gap; + } + this._previousClearStyle = $bind(this,this.clearStyle_gap); + this.__gap = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__gap; + } + ,clearStyle_gap: function() { + this.set_gap(0.0); + return this.get_gap(); + } + ,get_minGap: function() { + return this.__minGap; + } + ,set_minGap: function(value) { + if(!this.setStyle("minGap")) { + return this.__minGap; + } + if(this.__minGap == value) { + return this.__minGap; + } + this._previousClearStyle = $bind(this,this.clearStyle_minGap); + this.__minGap = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__minGap; + } + ,clearStyle_minGap: function() { + this.set_minGap(0.0); + return this.get_minGap(); + } + ,get_iconOffsetX: function() { + return this.__iconOffsetX; + } + ,set_iconOffsetX: function(value) { + if(!this.setStyle("iconOffsetX")) { + return this.__iconOffsetX; + } + if(this.__iconOffsetX == value) { + return this.__iconOffsetX; + } + this._previousClearStyle = $bind(this,this.clearStyle_iconOffsetX); + this.__iconOffsetX = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__iconOffsetX; + } + ,clearStyle_iconOffsetX: function() { + this.set_iconOffsetX(0.0); + return this.get_iconOffsetX(); + } + ,get_iconOffsetY: function() { + return this.__iconOffsetY; + } + ,set_iconOffsetY: function(value) { + if(!this.setStyle("iconOffsetY")) { + return this.__iconOffsetY; + } + if(this.__iconOffsetY == value) { + return this.__iconOffsetY; + } + this._previousClearStyle = $bind(this,this.clearStyle_iconOffsetY); + this.__iconOffsetY = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__iconOffsetY; + } + ,clearStyle_iconOffsetY: function() { + this.set_iconOffsetY(0.0); + return this.get_iconOffsetY(); + } + ,get_textOffsetX: function() { + return this.__textOffsetX; + } + ,set_textOffsetX: function(value) { + if(!this.setStyle("textOffsetX")) { + return this.__textOffsetX; + } + if(this.__textOffsetX == value) { + return this.__textOffsetX; + } + this._previousClearStyle = $bind(this,this.clearStyle_textOffsetX); + this.__textOffsetX = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__textOffsetX; + } + ,clearStyle_textOffsetX: function() { + this.set_textOffsetX(0.0); + return this.get_textOffsetX(); + } + ,get_textOffsetY: function() { + return this.__textOffsetY; + } + ,set_textOffsetY: function(value) { + if(!this.setStyle("textOffsetY")) { + return this.__textOffsetY; + } + if(this.__textOffsetY == value) { + return this.__textOffsetY; + } + this._previousClearStyle = $bind(this,this.clearStyle_textOffsetY); + this.__textOffsetY = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__textOffsetY; + } + ,clearStyle_textOffsetY: function() { + this.set_textOffsetY(0.0); + return this.get_textOffsetY(); + } + ,get_showText: function() { + return this.__showText; + } + ,set_showText: function(value) { + if(!this.setStyle("showText")) { + return this.__showText; + } + if(this.__showText == value) { + return this.__showText; + } + this._previousClearStyle = $bind(this,this.clearStyle_showText); + this.__showText = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__showText; + } + ,clearStyle_showText: function() { + this.set_showText(true); + return this.get_showText(); + } + ,__class__: feathers_controls_Button + ,__properties__: $extend(feathers_controls_BasicButton.prototype.__properties__,{set_showText:"set_showText",get_showText:"get_showText",set_textOffsetY:"set_textOffsetY",get_textOffsetY:"get_textOffsetY",set_textOffsetX:"set_textOffsetX",get_textOffsetX:"get_textOffsetX",set_iconOffsetY:"set_iconOffsetY",get_iconOffsetY:"get_iconOffsetY",set_iconOffsetX:"set_iconOffsetX",get_iconOffsetX:"get_iconOffsetX",set_minGap:"set_minGap",get_minGap:"get_minGap",set_gap:"set_gap",get_gap:"get_gap",set_iconPosition:"set_iconPosition",get_iconPosition:"get_iconPosition",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_horizontalAlign:"set_horizontalAlign",get_horizontalAlign:"get_horizontalAlign",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_icon:"set_icon",get_icon:"get_icon",set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_disabledTextFormat:"set_disabledTextFormat",get_disabledTextFormat:"get_disabledTextFormat",set_styleSheet:"set_styleSheet",get_styleSheet:"get_styleSheet",set_textFormat:"set_textFormat",get_textFormat:"get_textFormat",get_baseline:"get_baseline",set_htmlText:"set_htmlText",get_htmlText:"get_htmlText",set_text:"set_text",get_text:"get_text"}) +}); +var feathers_controls_ButtonState = $hxEnums["feathers.controls.ButtonState"] = { __ename__:"feathers.controls.ButtonState",__constructs__:null + ,UP: {_hx_name:"UP",_hx_index:0,__enum__:"feathers.controls.ButtonState",toString:$estr} + ,HOVER: {_hx_name:"HOVER",_hx_index:1,__enum__:"feathers.controls.ButtonState",toString:$estr} + ,DOWN: {_hx_name:"DOWN",_hx_index:2,__enum__:"feathers.controls.ButtonState",toString:$estr} + ,DISABLED: {_hx_name:"DISABLED",_hx_index:3,__enum__:"feathers.controls.ButtonState",toString:$estr} +}; +feathers_controls_ButtonState.__constructs__ = [feathers_controls_ButtonState.UP,feathers_controls_ButtonState.HOVER,feathers_controls_ButtonState.DOWN,feathers_controls_ButtonState.DISABLED]; +var feathers_controls_IRange = function() { }; +$hxClasses["feathers.controls.IRange"] = feathers_controls_IRange; +feathers_controls_IRange.__name__ = "feathers.controls.IRange"; +feathers_controls_IRange.__isInterface__ = true; +feathers_controls_IRange.__interfaces__ = [feathers_core_IUIControl]; +feathers_controls_IRange.prototype = { + __class__: feathers_controls_IRange + ,__properties__: {set_maximum:"set_maximum",get_maximum:"get_maximum",set_minimum:"set_minimum",get_minimum:"get_minimum",set_value:"set_value",get_value:"get_value"} +}; +var feathers_controls_IScrollBar = function() { }; +$hxClasses["feathers.controls.IScrollBar"] = feathers_controls_IScrollBar; +feathers_controls_IScrollBar.__name__ = "feathers.controls.IScrollBar"; +feathers_controls_IScrollBar.__isInterface__ = true; +feathers_controls_IScrollBar.__interfaces__ = [feathers_controls_IRange]; +feathers_controls_IScrollBar.prototype = { + __class__: feathers_controls_IScrollBar + ,__properties__: {set_page:"set_page",get_page:"get_page",set_step:"set_step",get_step:"get_step"} +}; +var feathers_core_InvalidationFlag = $hxEnums["feathers.core.InvalidationFlag"] = { __ename__:"feathers.core.InvalidationFlag",__constructs__:null + ,STATE: {_hx_name:"STATE",_hx_index:0,__enum__:"feathers.core.InvalidationFlag",toString:$estr} + ,SIZE: {_hx_name:"SIZE",_hx_index:1,__enum__:"feathers.core.InvalidationFlag",toString:$estr} + ,STYLES: {_hx_name:"STYLES",_hx_index:2,__enum__:"feathers.core.InvalidationFlag",toString:$estr} + ,SKIN: {_hx_name:"SKIN",_hx_index:3,__enum__:"feathers.core.InvalidationFlag",toString:$estr} + ,LAYOUT: {_hx_name:"LAYOUT",_hx_index:4,__enum__:"feathers.core.InvalidationFlag",toString:$estr} + ,DATA: {_hx_name:"DATA",_hx_index:5,__enum__:"feathers.core.InvalidationFlag",toString:$estr} + ,SCROLL: {_hx_name:"SCROLL",_hx_index:6,__enum__:"feathers.core.InvalidationFlag",toString:$estr} + ,SELECTION: {_hx_name:"SELECTION",_hx_index:7,__enum__:"feathers.core.InvalidationFlag",toString:$estr} + ,FOCUS: {_hx_name:"FOCUS",_hx_index:8,__enum__:"feathers.core.InvalidationFlag",toString:$estr} + ,SORT: {_hx_name:"SORT",_hx_index:9,__enum__:"feathers.core.InvalidationFlag",toString:$estr} + ,CUSTOM: ($_=function(value) { return {_hx_index:10,value:value,__enum__:"feathers.core.InvalidationFlag",toString:$estr}; },$_._hx_name="CUSTOM",$_.__params__ = ["value"],$_) +}; +feathers_core_InvalidationFlag.__constructs__ = [feathers_core_InvalidationFlag.STATE,feathers_core_InvalidationFlag.SIZE,feathers_core_InvalidationFlag.STYLES,feathers_core_InvalidationFlag.SKIN,feathers_core_InvalidationFlag.LAYOUT,feathers_core_InvalidationFlag.DATA,feathers_core_InvalidationFlag.SCROLL,feathers_core_InvalidationFlag.SELECTION,feathers_core_InvalidationFlag.FOCUS,feathers_core_InvalidationFlag.SORT,feathers_core_InvalidationFlag.CUSTOM]; +var feathers_utils_DisplayObjectFactory = function() { +}; +$hxClasses["feathers.utils.DisplayObjectFactory"] = feathers_utils_DisplayObjectFactory; +feathers_utils_DisplayObjectFactory.__name__ = "feathers.utils.DisplayObjectFactory"; +feathers_utils_DisplayObjectFactory.withDisplayObject = function(displayObject,destroy) { + var item = new feathers_utils_DisplayObjectFactory(); + item.create = function() { + return displayObject; + }; + item.destroy = destroy; + return item; +}; +feathers_utils_DisplayObjectFactory.withClass = function(displayObjectType,destroy) { + if(destroy == null) { + destroy = function(target) { + if(js_Boot.__implements(target,feathers_core_IUIControl)) { + target.dispose(); + } + }; + } + var item = new feathers_utils_DisplayObjectFactory(); + item.create = function() { + return Type.createInstance(displayObjectType,[]); + }; + item.destroy = destroy; + return item; +}; +feathers_utils_DisplayObjectFactory.withFunction = function(create,destroy) { + var item = new feathers_utils_DisplayObjectFactory(); + item.create = create; + item.destroy = destroy; + return item; +}; +feathers_utils_DisplayObjectFactory.prototype = { + create: function() { + return null; + } + ,destroy: function(target) { + } + ,__class__: feathers_utils_DisplayObjectFactory +}; +var js_Boot = function() { }; +$hxClasses["js.Boot"] = js_Boot; +js_Boot.__name__ = "js.Boot"; +js_Boot.getClass = function(o) { + if(o == null) { + return null; + } else if(((o) instanceof Array)) { + return Array; + } else { + var cl = o.__class__; + if(cl != null) { + return cl; + } + var name = js_Boot.__nativeClassName(o); + if(name != null) { + return js_Boot.__resolveNativeClass(name); + } + return null; + } +}; +js_Boot.__string_rec = function(o,s) { + if(o == null) { + return "null"; + } + if(s.length >= 5) { + return "<...>"; + } + var t = typeof(o); + if(t == "function" && (o.__name__ || o.__ename__)) { + t = "object"; + } + switch(t) { + case "function": + return ""; + case "object": + if(o.__enum__) { + var e = $hxEnums[o.__enum__]; + var con = e.__constructs__[o._hx_index]; + var n = con._hx_name; + if(con.__params__) { + s = s + "\t"; + return n + "(" + ((function($this) { + var $r; + var _g = []; + { + var _g1 = 0; + var _g2 = con.__params__; + while(true) { + if(!(_g1 < _g2.length)) { + break; + } + var p = _g2[_g1]; + _g1 = _g1 + 1; + _g.push(js_Boot.__string_rec(o[p],s)); + } + } + $r = _g; + return $r; + }(this))).join(",") + ")"; + } else { + return n; + } + } + if(((o) instanceof Array)) { + var str = "["; + s += "\t"; + var _g = 0; + var _g1 = o.length; + while(_g < _g1) { + var i = _g++; + str += (i > 0 ? "," : "") + js_Boot.__string_rec(o[i],s); + } + str += "]"; + return str; + } + var tostr; + try { + tostr = o.toString; + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + return "???"; + } + if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") { + var s2 = o.toString(); + if(s2 != "[object Object]") { + return s2; + } + } + var str = "{\n"; + s += "\t"; + var hasp = o.hasOwnProperty != null; + var k = null; + for( k in o ) { + if(hasp && !o.hasOwnProperty(k)) { + continue; + } + if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") { + continue; + } + if(str.length != 2) { + str += ", \n"; + } + str += s + k + " : " + js_Boot.__string_rec(o[k],s); + } + s = s.substring(1); + str += "\n" + s + "}"; + return str; + case "string": + return o; + default: + return String(o); + } +}; +js_Boot.__interfLoop = function(cc,cl) { + if(cc == null) { + return false; + } + if(cc == cl) { + return true; + } + var intf = cc.__interfaces__; + if(intf != null) { + var _g = 0; + var _g1 = intf.length; + while(_g < _g1) { + var i = _g++; + var i1 = intf[i]; + if(i1 == cl || js_Boot.__interfLoop(i1,cl)) { + return true; + } + } + } + return js_Boot.__interfLoop(cc.__super__,cl); +}; +js_Boot.__instanceof = function(o,cl) { + if(cl == null) { + return false; + } + switch(cl) { + case Array: + return ((o) instanceof Array); + case Bool: + return typeof(o) == "boolean"; + case Dynamic: + return o != null; + case Float: + return typeof(o) == "number"; + case Int: + if(typeof(o) == "number") { + return ((o | 0) === o); + } else { + return false; + } + break; + case String: + return typeof(o) == "string"; + default: + if(o != null) { + if(typeof(cl) == "function") { + if(js_Boot.__downcastCheck(o,cl)) { + return true; + } + } else if(typeof(cl) == "object" && js_Boot.__isNativeObj(cl)) { + if(((o) instanceof cl)) { + return true; + } + } + } else { + return false; + } + if(cl == Class ? o.__name__ != null : false) { + return true; + } + if(cl == Enum ? o.__ename__ != null : false) { + return true; + } + return o.__enum__ != null ? $hxEnums[o.__enum__] == cl : false; + } +}; +js_Boot.__downcastCheck = function(o,cl) { + if(!((o) instanceof cl)) { + if(cl.__isInterface__) { + return js_Boot.__interfLoop(js_Boot.getClass(o),cl); + } else { + return false; + } + } else { + return true; + } +}; +js_Boot.__implements = function(o,iface) { + return js_Boot.__interfLoop(js_Boot.getClass(o),iface); +}; +js_Boot.__cast = function(o,t) { + if(o == null || js_Boot.__instanceof(o,t)) { + return o; + } else { + throw haxe_Exception.thrown("Cannot cast " + Std.string(o) + " to " + Std.string(t)); + } +}; +js_Boot.__nativeClassName = function(o) { + var name = js_Boot.__toStr.call(o).slice(8,-1); + if(name == "Object" || name == "Function" || name == "Math" || name == "JSON") { + return null; + } + return name; +}; +js_Boot.__isNativeObj = function(o) { + return js_Boot.__nativeClassName(o) != null; +}; +js_Boot.__resolveNativeClass = function(name) { + return $global[name]; +}; +var feathers_controls_supportClasses_BaseScrollBar = function(value,minimum,maximum,changeListener) { + if(maximum == null) { + maximum = 1.0; + } + if(minimum == null) { + minimum = 0.0; + } + if(value == null) { + value = 0.0; + } + this.__hideThumbWhenDisabled = false; + this.__paddingLeft = 0.0; + this.__paddingBottom = 0.0; + this.__paddingRight = 0.0; + this.__paddingTop = 0.0; + this.__fixedThumbSize = false; + this.__secondaryTrackSkin = null; + this.__trackSkin = null; + this.__thumbSkin = null; + this.__customIncrementButtonVariant = null; + this.__customDecrementButtonVariant = null; + this._previousFallbackTrackHeight = 0.0; + this._previousFallbackTrackWidth = 0.0; + this._thumbStartY = 0.0; + this._thumbStartX = 0.0; + this._pointerStartY = 0.0; + this._pointerStartX = 0.0; + this._dragging = false; + this._secondaryTrackSkinMeasurements = null; + this._currentSecondaryTrackSkin = null; + this._trackSkinMeasurements = null; + this._currentTrackSkin = null; + this._thumbSkinMeasurements = null; + this._currentThumbSkin = null; + this._previousCustomIncrementButtonVariant = null; + this._previousCustomDecrementButtonVariant = null; + this.showDecrementAndIncrementButtons = false; + this._enableButtonsAtRangeLimits = true; + this.liveDragging = true; + this._page = 0.0; + this._snapInterval = 0.0; + this._step = 0.01; + this._maximum = 1.0; + this._minimum = 0.0; + this._value = 0.0; + this._isDefaultValue = true; + this.incrementButtonMeasurements = new feathers_layout_Measurements(); + this.decrementButtonMeasurements = new feathers_layout_Measurements(); + feathers_core_FeathersControl.call(this); + this.set_tabChildren(false); + this.focusRect = null; + this.set_minimum(minimum); + this.set_maximum(maximum); + this.set_value(value); + if(changeListener != null) { + this.addEventListener("change",changeListener); + } +}; +$hxClasses["feathers.controls.supportClasses.BaseScrollBar"] = feathers_controls_supportClasses_BaseScrollBar; +feathers_controls_supportClasses_BaseScrollBar.__name__ = "feathers.controls.supportClasses.BaseScrollBar"; +feathers_controls_supportClasses_BaseScrollBar.__interfaces__ = [feathers_controls_IScrollBar]; +feathers_controls_supportClasses_BaseScrollBar.__super__ = feathers_core_FeathersControl; +feathers_controls_supportClasses_BaseScrollBar.prototype = $extend(feathers_core_FeathersControl.prototype,{ + get_value: function() { + return this._value; + } + ,set_value: function(value) { + if(this._value == value) { + return this._value; + } + this._isDefaultValue = false; + this._value = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + if(this.liveDragging || !this._dragging) { + feathers_events_FeathersEvent.dispatch(this,"change"); + } + return this._value; + } + ,get_minimum: function() { + return this._minimum; + } + ,set_minimum: function(value) { + if(this._minimum == value) { + return this._minimum; + } + this._minimum = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._minimum; + } + ,get_maximum: function() { + return this._maximum; + } + ,set_maximum: function(value) { + if(this._maximum == value) { + return this._maximum; + } + this._maximum = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._maximum; + } + ,get_step: function() { + return this._step; + } + ,set_step: function(value) { + if(this._step == value) { + return this._step; + } + this._step = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._step; + } + ,get_snapInterval: function() { + return this._snapInterval; + } + ,set_snapInterval: function(value) { + if(this._snapInterval == value) { + return this._snapInterval; + } + this._snapInterval = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._snapInterval; + } + ,get_page: function() { + return this._page; + } + ,set_page: function(value) { + if(this._page == value) { + return this._page; + } + this._page = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._page; + } + ,get_enableButtonsAtRangeLimits: function() { + return this._enableButtonsAtRangeLimits; + } + ,set_enableButtonsAtRangeLimits: function(value) { + if(this._enableButtonsAtRangeLimits == value) { + return this._enableButtonsAtRangeLimits; + } + this._enableButtonsAtRangeLimits = value; + this.setInvalid(feathers_core_InvalidationFlag.STATE); + return this._enableButtonsAtRangeLimits; + } + ,get_decrementButtonFactory: function() { + return this._decrementButtonFactory; + } + ,set_decrementButtonFactory: function(value) { + if(this._decrementButtonFactory == value) { + return this._decrementButtonFactory; + } + this._decrementButtonFactory = value; + this.setInvalid(feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY); + return this._decrementButtonFactory; + } + ,get_incrementButtonFactory: function() { + return this._incrementButtonFactory; + } + ,set_incrementButtonFactory: function(value) { + if(this._incrementButtonFactory == value) { + return this._incrementButtonFactory; + } + this._incrementButtonFactory = value; + this.setInvalid(feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY); + return this._incrementButtonFactory; + } + ,setPadding: function(value) { + this.set_paddingTop(value); + this.set_paddingRight(value); + this.set_paddingBottom(value); + this.set_paddingLeft(value); + } + ,applyValueRestrictions: function() { + this.set_value(this.restrictValue(this._value)); + } + ,dispose: function() { + this.destroyDecrementButton(); + this.destroyIncrementButton(); + feathers_core_FeathersControl.prototype.dispose.call(this); + } + ,initialize: function() { + feathers_core_FeathersControl.prototype.initialize.call(this); + if(this._isDefaultValue) { + this.set_value(this.restrictValue(this._value)); + } + } + ,update: function() { + var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE); + var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE); + var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES); + if(this._previousCustomDecrementButtonVariant != this.get_customDecrementButtonVariant()) { + this.setInvalidationFlag(feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY); + } + if(this._previousCustomIncrementButtonVariant != this.get_customIncrementButtonVariant()) { + this.setInvalidationFlag(feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY); + } + var decrementButtonFactoryInvalid = this.isInvalid(feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY); + var incrementButtonFactoryInvalid = this.isInvalid(feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY); + if(stylesInvalid) { + this.refreshThumb(); + this.refreshTrack(); + this.refreshSecondaryTrack(); + } + if(decrementButtonFactoryInvalid) { + this.createDecrementButton(); + } + if(incrementButtonFactoryInvalid) { + this.createIncrementButton(); + } + if(stateInvalid || stylesInvalid) { + this.refreshEnabled(); + } + if(this.measure()) { + sizeInvalid = true; + } + this.layoutContent(); + this._previousCustomDecrementButtonVariant = this.get_customDecrementButtonVariant(); + this._previousCustomIncrementButtonVariant = this.get_customIncrementButtonVariant(); + } + ,measure: function() { + var c = js_Boot.getClass(this); + throw new openfl_errors_TypeError("Missing override for 'measure' in type " + c.__name__); + } + ,refreshThumb: function() { + var oldSkin = this._currentThumbSkin; + this._currentThumbSkin = this.get_thumbSkin(); + if(this._currentThumbSkin == oldSkin) { + return; + } + if(oldSkin != null) { + if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) { + oldSkin.set_uiContext(null); + } + oldSkin.removeEventListener("mouseDown",$bind(this,this.thumbSkin_mouseDownHandler)); + this.removeChild(oldSkin); + } + if(this._currentThumbSkin != null) { + if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IUIControl)) { + this._currentThumbSkin.initializeNow(); + } + if(this._thumbSkinMeasurements == null) { + this._thumbSkinMeasurements = new feathers_layout_Measurements(this._currentThumbSkin); + } else { + this._thumbSkinMeasurements.save(this._currentThumbSkin); + } + this.addChild(this._currentThumbSkin); + this._currentThumbSkin.addEventListener("mouseDown",$bind(this,this.thumbSkin_mouseDownHandler)); + if(js_Boot.__implements(this._currentThumbSkin,feathers_skins_IProgrammaticSkin)) { + this._currentThumbSkin.set_uiContext(this); + } + } else { + this._thumbSkinMeasurements = null; + } + } + ,refreshTrack: function() { + var oldSkin = this._currentTrackSkin; + this._currentTrackSkin = this.get_trackSkin(); + if(this._currentTrackSkin == oldSkin) { + return; + } + if(oldSkin != null) { + if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) { + oldSkin.set_uiContext(null); + } + this.removeChild(oldSkin); + oldSkin.removeEventListener("mouseDown",$bind(this,this.trackSkin_mouseDownHandler)); + } + if(this._currentTrackSkin != null) { + if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IUIControl)) { + this._currentTrackSkin.initializeNow(); + } + if(this._trackSkinMeasurements == null) { + this._trackSkinMeasurements = new feathers_layout_Measurements(this._currentTrackSkin); + } else { + this._trackSkinMeasurements.save(this._currentTrackSkin); + } + this.addChildAt(this._currentTrackSkin,0); + this._currentTrackSkin.addEventListener("mouseDown",$bind(this,this.trackSkin_mouseDownHandler)); + if(js_Boot.__implements(this._currentTrackSkin,feathers_skins_IProgrammaticSkin)) { + this._currentTrackSkin.set_uiContext(this); + } + } else { + this._trackSkinMeasurements = null; + } + } + ,refreshSecondaryTrack: function() { + var oldSkin = this._currentSecondaryTrackSkin; + this._currentSecondaryTrackSkin = this.get_secondaryTrackSkin(); + if(this._currentSecondaryTrackSkin == oldSkin) { + return; + } + if(oldSkin != null) { + if(js_Boot.__implements(oldSkin,feathers_skins_IProgrammaticSkin)) { + oldSkin.set_uiContext(null); + } + this.removeChild(oldSkin); + oldSkin.removeEventListener("mouseDown",$bind(this,this.trackSkin_mouseDownHandler)); + } + if(this._currentSecondaryTrackSkin != null) { + if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IUIControl)) { + this._currentSecondaryTrackSkin.initializeNow(); + } + if(this._secondaryTrackSkinMeasurements == null) { + this._secondaryTrackSkinMeasurements = new feathers_layout_Measurements(this._currentSecondaryTrackSkin); + } else { + this._secondaryTrackSkinMeasurements.save(this._currentSecondaryTrackSkin); + } + var index = this._currentTrackSkin != null ? 1 : 0; + this.addChildAt(this._currentSecondaryTrackSkin,index); + this._currentSecondaryTrackSkin.addEventListener("mouseDown",$bind(this,this.trackSkin_mouseDownHandler)); + if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_skins_IProgrammaticSkin)) { + this._currentSecondaryTrackSkin.set_uiContext(this); + } + } else { + this._secondaryTrackSkinMeasurements = null; + } + } + ,refreshEnabled: function() { + if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IUIControl)) { + this._currentThumbSkin.set_enabled(this._enabled); + } + if(this.decrementButton != null) { + this.decrementButton.set_enabled(this._enabled && (this._enableButtonsAtRangeLimits || this._value != this._minimum)); + } + if(this.incrementButton != null) { + this.incrementButton.set_enabled(this._enabled && (this._enableButtonsAtRangeLimits || this._value != this._maximum)); + } + } + ,layoutContent: function() { + this.layoutButtons(); + if(this._currentTrackSkin != null && this._currentSecondaryTrackSkin != null) { + this.get_graphics().clear(); + this.layoutSplitTrack(); + } else if(this._currentTrackSkin != null) { + this.get_graphics().clear(); + this.layoutSingleTrack(); + } else { + this.drawFallbackTrack(); + } + this.layoutThumb(); + } + ,layoutButtons: function() { + if(!this.showDecrementAndIncrementButtons) { + return; + } + var c = js_Boot.getClass(this); + throw new openfl_errors_TypeError("Missing override for 'layoutButtons' in type " + c.__name__); + } + ,layoutSplitTrack: function() { + var c = js_Boot.getClass(this); + throw new openfl_errors_TypeError("Missing override for 'layoutSplitTrack' in type " + c.__name__); + } + ,layoutSingleTrack: function() { + var c = js_Boot.getClass(this); + throw new openfl_errors_TypeError("Missing override for 'layoutSingleTrack' in type " + c.__name__); + } + ,layoutThumb: function() { + var c = js_Boot.getClass(this); + throw new openfl_errors_TypeError("Missing override for 'layoutThumb' in type " + c.__name__); + } + ,createDecrementButton: function() { + this.destroyDecrementButton(); + if(!this.showDecrementAndIncrementButtons) { + return; + } + var factory = this._decrementButtonFactory != null ? this._decrementButtonFactory : feathers_controls_supportClasses_BaseScrollBar.defaultDecrementButtonFactory; + this._oldDecrementButtonFactory = factory; + this.decrementButton = factory.create(); + if(this.decrementButton.get_variant() == null) { + var defaultVariant = this.get_customDecrementButtonVariant(); + if(defaultVariant == null) { + if(((this) instanceof feathers_controls_VScrollBar)) { + defaultVariant = feathers_controls_VScrollBar.CHILD_VARIANT_DECREMENT_BUTTON; + } else if(((this) instanceof feathers_controls_HScrollBar)) { + defaultVariant = feathers_controls_HScrollBar.CHILD_VARIANT_DECREMENT_BUTTON; + } + } + this.decrementButton.set_variant(defaultVariant); + } + this.decrementButton.addEventListener("mouseDown",$bind(this,this.baseScrollBar_decrementButton_mouseDownHandler)); + this.decrementButton.addEventListener("touchBegin",$bind(this,this.baseScrollBar_decrementButton_touchBeginHandler)); + this.decrementButton.initializeNow(); + this.decrementButtonMeasurements.save(this.decrementButton); + this.addChild(this.decrementButton); + } + ,destroyDecrementButton: function() { + if(this.decrementButton == null) { + return; + } + this.decrementButton.removeEventListener("mouseDown",$bind(this,this.baseScrollBar_decrementButton_mouseDownHandler)); + this.decrementButton.removeEventListener("touchBegin",$bind(this,this.baseScrollBar_decrementButton_touchBeginHandler)); + this.removeChild(this.decrementButton); + if(this._oldDecrementButtonFactory.destroy != null) { + this._oldDecrementButtonFactory.destroy(this.decrementButton); + } + this._oldDecrementButtonFactory = null; + this.decrementButton = null; + } + ,createIncrementButton: function() { + this.destroyIncrementButton(); + if(!this.showDecrementAndIncrementButtons) { + return; + } + var factory = this._incrementButtonFactory != null ? this._incrementButtonFactory : feathers_controls_supportClasses_BaseScrollBar.defaultIncrementButtonFactory; + this._oldIncrementButtonFactory = factory; + this.incrementButton = factory.create(); + if(this.incrementButton.get_variant() == null) { + var defaultVariant = this.get_customIncrementButtonVariant(); + if(defaultVariant == null) { + if(((this) instanceof feathers_controls_VScrollBar)) { + defaultVariant = feathers_controls_VScrollBar.CHILD_VARIANT_INCREMENT_BUTTON; + } else if(((this) instanceof feathers_controls_HScrollBar)) { + defaultVariant = feathers_controls_HScrollBar.CHILD_VARIANT_INCREMENT_BUTTON; + } + } + this.incrementButton.set_variant(defaultVariant); + } + this.incrementButton.addEventListener("mouseDown",$bind(this,this.baseScrollBar_incrementButton_mouseDownHandler)); + this.incrementButton.addEventListener("touchBegin",$bind(this,this.baseScrollBar_incrementButton_touchBeginHandler)); + this.incrementButton.initializeNow(); + this.incrementButtonMeasurements.save(this.incrementButton); + this.addChild(this.incrementButton); + } + ,destroyIncrementButton: function() { + if(this.incrementButton == null) { + return; + } + this.incrementButton.removeEventListener("mouseDown",$bind(this,this.baseScrollBar_incrementButton_mouseDownHandler)); + this.incrementButton.removeEventListener("touchBegin",$bind(this,this.baseScrollBar_incrementButton_touchBeginHandler)); + this.removeChild(this.incrementButton); + if(this._oldIncrementButtonFactory.destroy != null) { + this._oldIncrementButtonFactory.destroy(this.incrementButton); + } + this._oldIncrementButtonFactory = null; + this.incrementButton = null; + } + ,drawFallbackTrack: function() { + if(this.actualWidth == this._previousFallbackTrackWidth && this.actualHeight == this._previousFallbackTrackHeight) { + return; + } + this.get_graphics().clear(); + this.get_graphics().beginFill(16711935,0.0); + this.get_graphics().drawRect(0,0,this.actualWidth,this.actualHeight); + this.get_graphics().endFill(); + this._previousFallbackTrackWidth = this.actualWidth; + this._previousFallbackTrackHeight = this.actualHeight; + } + ,normalizeValue: function(value) { + var normalized = 0.0; + if(this._minimum != this._maximum) { + normalized = (value - this._minimum) / (this._maximum - this._minimum); + if(normalized < 0.0) { + normalized = 0.0; + } else if(normalized > 1.0) { + normalized = 1.0; + } + } + return normalized; + } + ,restrictValue: function(value) { + if(this._snapInterval != 0.0 && value != this._minimum && value != this._maximum) { + value = feathers_utils_MathUtil.roundToNearest(value,this._snapInterval); + } + if(value < this._minimum) { + value = this._minimum; + } else if(value > this._maximum) { + value = this._maximum; + } + return value; + } + ,valueToLocation: function(value) { + var c = js_Boot.getClass(this); + throw new openfl_errors_TypeError("Missing override for 'valueToLocation' in type " + c.__name__); + } + ,locationToValue: function(x,y) { + var c = js_Boot.getClass(this); + throw new openfl_errors_TypeError("Missing override for 'locationToValue' in type " + c.__name__); + } + ,saveThumbStart: function(x,y) { + var c = js_Boot.getClass(this); + throw new openfl_errors_TypeError("Missing override for 'saveThumbStart' in type " + c.__name__); + } + ,getAdjustedPage: function() { + var range = this._maximum - this._minimum; + var adjustedPage = this._page; + if(adjustedPage == 0.0) { + adjustedPage = this._step; + } else if(adjustedPage > range) { + adjustedPage = range; + } + return adjustedPage; + } + ,decrement: function() { + var newValue = this._value - this._step; + newValue = this.restrictValue(newValue); + this.set_value(newValue); + } + ,increment: function() { + var newValue = this._value + this._step; + newValue = this.restrictValue(newValue); + this.set_value(newValue); + } + ,thumbSkin_mouseDownHandler: function(event) { + if(!this._enabled || this.stage == null) { + return; + } + var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage); + var result = exclusivePointer.claimMouse(this); + if(!result) { + return; + } + this.stage.addEventListener("mouseMove",$bind(this,this.thumbSkin_stage_mouseMoveHandler),false,0,true); + this.stage.addEventListener("mouseUp",$bind(this,this.thumbSkin_stage_mouseUpHandler),false,0,true); + this._thumbStartX = this._currentThumbSkin.get_x(); + this._thumbStartY = this._currentThumbSkin.get_y(); + this._pointerStartX = this.get_mouseX(); + this._pointerStartY = this.get_mouseY(); + this._dragging = true; + feathers_events_ScrollEvent.dispatch(this,"scrollStart"); + } + ,thumbSkin_stage_mouseMoveHandler: function(event) { + var newValue = this.locationToValue(this.get_mouseX(),this.get_mouseY()); + newValue = this.restrictValue(newValue); + this.set_value(newValue); + } + ,thumbSkin_stage_mouseUpHandler: function(event) { + var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage); + stage.removeEventListener("mouseMove",$bind(this,this.thumbSkin_stage_mouseMoveHandler)); + stage.removeEventListener("mouseUp",$bind(this,this.thumbSkin_stage_mouseUpHandler)); + this._dragging = false; + feathers_events_ScrollEvent.dispatch(this,"scrollComplete"); + if(!this.liveDragging) { + feathers_events_FeathersEvent.dispatch(this,"change"); + } + } + ,trackSkin_mouseDownHandler: function(event) { + if(!this._enabled || this.stage == null) { + return; + } + var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage); + var result = exclusivePointer.claimMouse(this); + if(!result) { + return; + } + this.stage.addEventListener("mouseMove",$bind(this,this.trackSkin_stage_mouseMoveHandler),false,0,true); + this.stage.addEventListener("mouseUp",$bind(this,this.trackSkin_stage_mouseUpHandler),false,0,true); + this.saveThumbStart(this.get_mouseX(),this.get_mouseY()); + this._pointerStartX = this.get_mouseX(); + this._pointerStartY = this.get_mouseY(); + this._dragging = true; + feathers_events_ScrollEvent.dispatch(this,"scrollStart"); + var newValue = this.locationToValue(this.get_mouseX(),this.get_mouseY()); + newValue = this.restrictValue(newValue); + this.set_value(newValue); + } + ,trackSkin_stage_mouseMoveHandler: function(event) { + var newValue = this.locationToValue(this.get_mouseX(),this.get_mouseY()); + newValue = this.restrictValue(newValue); + this.set_value(newValue); + } + ,trackSkin_stage_mouseUpHandler: function(event) { + var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage); + stage.removeEventListener("mouseMove",$bind(this,this.trackSkin_stage_mouseMoveHandler)); + stage.removeEventListener("mouseUp",$bind(this,this.trackSkin_stage_mouseUpHandler)); + this._dragging = false; + feathers_events_ScrollEvent.dispatch(this,"scrollComplete"); + if(!this.liveDragging) { + feathers_events_FeathersEvent.dispatch(this,"change"); + } + } + ,baseScrollBar_decrementButton_mouseDownHandler: function(event) { + if(!this._enabled || !this.decrementButton.get_enabled() || this.stage == null) { + return; + } + var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage); + var result = exclusivePointer.claimMouse(this); + if(!result) { + return; + } + this.decrement(); + } + ,baseScrollBar_decrementButton_touchBeginHandler: function(event) { + if(event.isPrimaryTouchPoint) { + return; + } + if(!this._enabled || !this.decrementButton.get_enabled() || this.stage == null) { + return; + } + var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage); + var result = exclusivePointer.claimMouse(this); + if(!result) { + return; + } + this.decrement(); + } + ,baseScrollBar_incrementButton_mouseDownHandler: function(event) { + if(!this._enabled || !this.incrementButton.get_enabled() || this.stage == null) { + return; + } + var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage); + var result = exclusivePointer.claimMouse(this); + if(!result) { + return; + } + this.increment(); + } + ,baseScrollBar_incrementButton_touchBeginHandler: function(event) { + if(event.isPrimaryTouchPoint) { + return; + } + if(!this._enabled || !this.incrementButton.get_enabled() || this.stage == null) { + return; + } + var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage); + var result = exclusivePointer.claimMouse(this); + if(!result) { + return; + } + this.increment(); + } + ,get_customDecrementButtonVariant: function() { + return this.__customDecrementButtonVariant; + } + ,set_customDecrementButtonVariant: function(value) { + if(!this.setStyle("customDecrementButtonVariant")) { + return this.__customDecrementButtonVariant; + } + if(this.__customDecrementButtonVariant == value) { + return this.__customDecrementButtonVariant; + } + this._previousClearStyle = $bind(this,this.clearStyle_customDecrementButtonVariant); + this.__customDecrementButtonVariant = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__customDecrementButtonVariant; + } + ,clearStyle_customDecrementButtonVariant: function() { + this.set_customDecrementButtonVariant(null); + return this.get_customDecrementButtonVariant(); + } + ,get_customIncrementButtonVariant: function() { + return this.__customIncrementButtonVariant; + } + ,set_customIncrementButtonVariant: function(value) { + if(!this.setStyle("customIncrementButtonVariant")) { + return this.__customIncrementButtonVariant; + } + if(this.__customIncrementButtonVariant == value) { + return this.__customIncrementButtonVariant; + } + this._previousClearStyle = $bind(this,this.clearStyle_customIncrementButtonVariant); + this.__customIncrementButtonVariant = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__customIncrementButtonVariant; + } + ,clearStyle_customIncrementButtonVariant: function() { + this.set_customIncrementButtonVariant(null); + return this.get_customIncrementButtonVariant(); + } + ,get_thumbSkin: function() { + return this.__thumbSkin; + } + ,set_thumbSkin: function(value) { + if(!this.setStyle("thumbSkin")) { + return this.__thumbSkin; + } + if(this.__thumbSkin == value) { + return this.__thumbSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_thumbSkin); + this.__thumbSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__thumbSkin; + } + ,clearStyle_thumbSkin: function() { + this.set_thumbSkin(null); + return this.get_thumbSkin(); + } + ,get_trackSkin: function() { + return this.__trackSkin; + } + ,set_trackSkin: function(value) { + if(!this.setStyle("trackSkin")) { + return this.__trackSkin; + } + if(this.__trackSkin == value) { + return this.__trackSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_trackSkin); + this.__trackSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__trackSkin; + } + ,clearStyle_trackSkin: function() { + this.set_trackSkin(null); + return this.get_trackSkin(); + } + ,get_secondaryTrackSkin: function() { + return this.__secondaryTrackSkin; + } + ,set_secondaryTrackSkin: function(value) { + if(!this.setStyle("secondaryTrackSkin")) { + return this.__secondaryTrackSkin; + } + if(this.__secondaryTrackSkin == value) { + return this.__secondaryTrackSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_secondaryTrackSkin); + this.__secondaryTrackSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__secondaryTrackSkin; + } + ,clearStyle_secondaryTrackSkin: function() { + this.set_secondaryTrackSkin(null); + return this.get_secondaryTrackSkin(); + } + ,get_fixedThumbSize: function() { + return this.__fixedThumbSize; + } + ,set_fixedThumbSize: function(value) { + if(!this.setStyle("fixedThumbSize")) { + return this.__fixedThumbSize; + } + if(this.__fixedThumbSize == value) { + return this.__fixedThumbSize; + } + this._previousClearStyle = $bind(this,this.clearStyle_fixedThumbSize); + this.__fixedThumbSize = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__fixedThumbSize; + } + ,clearStyle_fixedThumbSize: function() { + this.set_fixedThumbSize(false); + return this.get_fixedThumbSize(); + } + ,get_paddingTop: function() { + return this.__paddingTop; + } + ,set_paddingTop: function(value) { + if(!this.setStyle("paddingTop")) { + return this.__paddingTop; + } + if(this.__paddingTop == value) { + return this.__paddingTop; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingTop); + this.__paddingTop = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingTop; + } + ,clearStyle_paddingTop: function() { + this.set_paddingTop(0.0); + return this.get_paddingTop(); + } + ,get_paddingRight: function() { + return this.__paddingRight; + } + ,set_paddingRight: function(value) { + if(!this.setStyle("paddingRight")) { + return this.__paddingRight; + } + if(this.__paddingRight == value) { + return this.__paddingRight; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingRight); + this.__paddingRight = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingRight; + } + ,clearStyle_paddingRight: function() { + this.set_paddingRight(0.0); + return this.get_paddingRight(); + } + ,get_paddingBottom: function() { + return this.__paddingBottom; + } + ,set_paddingBottom: function(value) { + if(!this.setStyle("paddingBottom")) { + return this.__paddingBottom; + } + if(this.__paddingBottom == value) { + return this.__paddingBottom; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom); + this.__paddingBottom = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingBottom; + } + ,clearStyle_paddingBottom: function() { + this.set_paddingBottom(0.0); + return this.get_paddingBottom(); + } + ,get_paddingLeft: function() { + return this.__paddingLeft; + } + ,set_paddingLeft: function(value) { + if(!this.setStyle("paddingLeft")) { + return this.__paddingLeft; + } + if(this.__paddingLeft == value) { + return this.__paddingLeft; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft); + this.__paddingLeft = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingLeft; + } + ,clearStyle_paddingLeft: function() { + this.set_paddingLeft(0.0); + return this.get_paddingLeft(); + } + ,get_hideThumbWhenDisabled: function() { + return this.__hideThumbWhenDisabled; + } + ,set_hideThumbWhenDisabled: function(value) { + if(!this.setStyle("hideThumbWhenDisabled")) { + return this.__hideThumbWhenDisabled; + } + if(this.__hideThumbWhenDisabled == value) { + return this.__hideThumbWhenDisabled; + } + this._previousClearStyle = $bind(this,this.clearStyle_hideThumbWhenDisabled); + this.__hideThumbWhenDisabled = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__hideThumbWhenDisabled; + } + ,clearStyle_hideThumbWhenDisabled: function() { + this.set_hideThumbWhenDisabled(false); + return this.get_hideThumbWhenDisabled(); + } + ,__class__: feathers_controls_supportClasses_BaseScrollBar + ,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_hideThumbWhenDisabled:"set_hideThumbWhenDisabled",get_hideThumbWhenDisabled:"get_hideThumbWhenDisabled",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_fixedThumbSize:"set_fixedThumbSize",get_fixedThumbSize:"get_fixedThumbSize",set_secondaryTrackSkin:"set_secondaryTrackSkin",get_secondaryTrackSkin:"get_secondaryTrackSkin",set_trackSkin:"set_trackSkin",get_trackSkin:"get_trackSkin",set_thumbSkin:"set_thumbSkin",get_thumbSkin:"get_thumbSkin",set_customIncrementButtonVariant:"set_customIncrementButtonVariant",get_customIncrementButtonVariant:"get_customIncrementButtonVariant",set_customDecrementButtonVariant:"set_customDecrementButtonVariant",get_customDecrementButtonVariant:"get_customDecrementButtonVariant",set_incrementButtonFactory:"set_incrementButtonFactory",get_incrementButtonFactory:"get_incrementButtonFactory",set_decrementButtonFactory:"set_decrementButtonFactory",get_decrementButtonFactory:"get_decrementButtonFactory",set_enableButtonsAtRangeLimits:"set_enableButtonsAtRangeLimits",get_enableButtonsAtRangeLimits:"get_enableButtonsAtRangeLimits",set_page:"set_page",get_page:"get_page",set_snapInterval:"set_snapInterval",get_snapInterval:"get_snapInterval",set_step:"set_step",get_step:"get_step",set_maximum:"set_maximum",get_maximum:"get_maximum",set_minimum:"set_minimum",get_minimum:"get_minimum",set_value:"set_value",get_value:"get_value"}) +}); +var feathers_controls_HScrollBar = function(value,minimum,maximum,changeListener) { + if(maximum == null) { + maximum = 1.0; + } + if(minimum == null) { + minimum = 0.0; + } + if(value == null) { + value = 0.0; + } + this.initializeHScrollBarTheme(); + feathers_controls_supportClasses_BaseScrollBar.call(this,value,minimum,maximum,changeListener); +}; +$hxClasses["feathers.controls.HScrollBar"] = feathers_controls_HScrollBar; +feathers_controls_HScrollBar.__name__ = "feathers.controls.HScrollBar"; +feathers_controls_HScrollBar.__super__ = feathers_controls_supportClasses_BaseScrollBar; +feathers_controls_HScrollBar.prototype = $extend(feathers_controls_supportClasses_BaseScrollBar.prototype,{ + initializeHScrollBarTheme: function() { + feathers_themes_steel_components_SteelHScrollBarStyles.initialize(); + } + ,valueToLocation: function(value) { + if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) { + this._currentThumbSkin.validateNow(); + } + if(this.showDecrementAndIncrementButtons) { + this.decrementButton.validateNow(); + this.incrementButton.validateNow(); + } + var normalized = this.normalizeValue(value); + var trackScrollableWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight() - this._currentThumbSkin.get_width(); + if(this.showDecrementAndIncrementButtons) { + trackScrollableWidth -= this.decrementButton.get_width() + this.incrementButton.get_width(); + } + var result = this.get_paddingLeft() + trackScrollableWidth * normalized; + if(this.showDecrementAndIncrementButtons) { + result += this.decrementButton.get_width(); + } + return result; + } + ,locationToValue: function(x,y) { + var percentage = 0.0; + var minXPosition = this.get_paddingLeft(); + var trackScrollableWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight() - this._currentThumbSkin.get_width(); + if(this.showDecrementAndIncrementButtons) { + minXPosition += this.decrementButton.get_width(); + trackScrollableWidth -= this.decrementButton.get_width() + this.incrementButton.get_width(); + } + var xOffset = x - this._pointerStartX; + var xPosition = Math.min(Math.max(0.0,this._thumbStartX + xOffset - minXPosition),trackScrollableWidth); + percentage = xPosition / trackScrollableWidth; + return this._minimum + percentage * (this._maximum - this._minimum); + } + ,saveThumbStart: function(x,y) { + var trackWidthMinusThumbWidth = this.actualWidth; + var locationMinusHalfThumbWidth = x; + if(this._currentThumbSkin != null) { + trackWidthMinusThumbWidth -= this._currentThumbSkin.get_width(); + locationMinusHalfThumbWidth -= this._currentThumbSkin.get_width() / 2.0; + } + this._thumbStartX = Math.min(trackWidthMinusThumbWidth,locationMinusHalfThumbWidth); + this._thumbStartY = y; + } + ,measure: function() { + var needsWidth = this.get_explicitWidth() == null; + var needsHeight = this.get_explicitHeight() == null; + var needsMinWidth = this.get_explicitMinWidth() == null; + var needsMinHeight = this.get_explicitMinHeight() == null; + var needsMaxWidth = this.get_explicitMaxWidth() == null; + var needsMaxHeight = this.get_explicitMaxHeight() == null; + if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) { + return false; + } + if(this.decrementButton != null) { + this.decrementButtonMeasurements.restore(this.decrementButton); + this.decrementButton.validateNow(); + } + if(this.incrementButton != null) { + this.incrementButtonMeasurements.restore(this.incrementButton); + this.incrementButton.validateNow(); + } + if(this._currentThumbSkin != null) { + this._thumbSkinMeasurements.restore(this._currentThumbSkin); + if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) { + this._currentThumbSkin.validateNow(); + } + } + if(this._currentTrackSkin != null) { + this._trackSkinMeasurements.restore(this._currentTrackSkin); + if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) { + this._currentTrackSkin.validateNow(); + } + } + if(this._currentSecondaryTrackSkin != null) { + this._secondaryTrackSkinMeasurements.restore(this._currentSecondaryTrackSkin); + if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) { + this._currentSecondaryTrackSkin.validateNow(); + } + } + var newWidth = this.get_explicitWidth(); + if(needsWidth) { + newWidth = 0.0; + if(this._currentTrackSkin != null) { + newWidth += this._currentTrackSkin.get_width(); + if(this._currentSecondaryTrackSkin != null) { + newWidth += this._currentSecondaryTrackSkin.get_width(); + } + } + var thumbWidth = this.get_paddingLeft() + this.get_paddingRight(); + if(this._currentThumbSkin != null) { + thumbWidth += this._currentThumbSkin.get_width(); + } + if(newWidth < thumbWidth) { + newWidth = thumbWidth; + } + if(this.showDecrementAndIncrementButtons) { + newWidth += this.decrementButton.get_width() + this.incrementButton.get_width(); + } + } + var newHeight = this.get_explicitHeight(); + if(needsHeight) { + newHeight = this.get_paddingTop() + this.get_paddingBottom(); + if(this._currentThumbSkin != null) { + newHeight += this._currentThumbSkin.get_height(); + } + if(this._currentTrackSkin != null) { + if(newHeight < this._currentTrackSkin.get_height()) { + newHeight = this._currentTrackSkin.get_height(); + } + if(this._currentSecondaryTrackSkin != null && newHeight < this._currentSecondaryTrackSkin.get_height()) { + newHeight = this._currentSecondaryTrackSkin.get_height(); + } + } + if(this.showDecrementAndIncrementButtons) { + var buttonHeight = Math.max(this.decrementButton.get_height(),this.incrementButton.get_height()); + if(newHeight < buttonHeight) { + newHeight = buttonHeight; + } + } + } + var newMinWidth = newWidth; + var newMinHeight = newHeight; + var newMaxHeight = newHeight; + return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,null,newMaxHeight); + } + ,layoutButtons: function() { + if(!this.showDecrementAndIncrementButtons) { + return; + } + if(this.decrementButton != null) { + this.decrementButton.validateNow(); + } + this.decrementButton.set_x(0.0); + this.decrementButton.set_y((this.actualHeight - this.decrementButton.get_height()) / 2.0); + if(this.incrementButton != null) { + this.incrementButton.validateNow(); + } + this.incrementButton.set_x(this.actualWidth - this.incrementButton.get_width()); + this.incrementButton.set_y((this.actualHeight - this.incrementButton.get_height()) / 2.0); + } + ,layoutSplitTrack: function() { + var location = this.valueToLocation(this.get_value()); + if(this._currentThumbSkin != null) { + if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) { + this._currentThumbSkin.validateNow(); + } + location += Math.round(this._currentThumbSkin.get_width() / 2.0); + } + var minTrackX = 0.0; + var maxTrackX = this.actualWidth; + if(this.showDecrementAndIncrementButtons) { + minTrackX = this.decrementButton.get_width(); + maxTrackX -= this.incrementButton.get_width(); + } + this._currentTrackSkin.set_x(minTrackX); + this._currentTrackSkin.set_width(location); + this._currentSecondaryTrackSkin.set_x(location); + this._currentSecondaryTrackSkin.set_width(maxTrackX - location); + if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) { + this._currentTrackSkin.validateNow(); + } + if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) { + this._currentSecondaryTrackSkin.validateNow(); + } + this._currentTrackSkin.set_y((this.actualHeight - this._currentTrackSkin.get_height()) / 2.0); + this._currentSecondaryTrackSkin.set_y((this.actualHeight - this._currentSecondaryTrackSkin.get_height()) / 2.0); + } + ,layoutSingleTrack: function() { + if(this._currentTrackSkin == null) { + return; + } + var minTrackX = 0.0; + var maxTrackX = this.actualWidth; + if(this.showDecrementAndIncrementButtons) { + minTrackX = this.decrementButton.get_width(); + maxTrackX -= this.incrementButton.get_width(); + } + this._currentTrackSkin.set_x(minTrackX); + this._currentTrackSkin.set_width(maxTrackX - minTrackX); + if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) { + this._currentTrackSkin.validateNow(); + } + this._currentTrackSkin.set_y((this.actualHeight - this._currentTrackSkin.get_height()) / 2.0); + } + ,layoutThumb: function() { + if(this._currentThumbSkin == null) { + return; + } + var range = this._maximum - this._minimum; + this._currentThumbSkin.set_visible((!this.get_hideThumbWhenDisabled() || this._enabled) && range > 0.0); + if(!this._currentThumbSkin.get_visible()) { + return; + } + if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) { + this._currentThumbSkin.validateNow(); + } + var valueOffset = 0.0; + if(this._value < this._minimum) { + valueOffset = this._minimum - this._value; + } else if(this._value > this._maximum) { + valueOffset = this._value - this._maximum; + } + var contentWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight(); + var contentHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom(); + if(this.get_fixedThumbSize()) { + if(this._thumbSkinMeasurements.width != null) { + this._currentThumbSkin.set_width(this._thumbSkinMeasurements.width); + } + } else { + var adjustedPage = this.getAdjustedPage(); + var thumbWidth = contentWidth * adjustedPage / (range + adjustedPage); + if(thumbWidth > 0.0) { + var widthOffset = contentWidth - thumbWidth; + if(widthOffset > thumbWidth) { + widthOffset = thumbWidth; + } + widthOffset *= valueOffset / (range * thumbWidth / contentWidth); + thumbWidth -= widthOffset; + } + if(this._thumbSkinMeasurements.minWidth != null) { + if(thumbWidth < this._thumbSkinMeasurements.minWidth) { + thumbWidth = this._thumbSkinMeasurements.minWidth; + } + } else if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IMeasureObject)) { + var measureSkin = this._currentThumbSkin; + if(thumbWidth < measureSkin.get_minWidth()) { + thumbWidth = measureSkin.get_minWidth(); + } + } + if(thumbWidth < 0.0) { + thumbWidth = 0.0; + } + this._currentThumbSkin.set_width(thumbWidth); + } + this._currentThumbSkin.set_x(this.valueToLocation(this._value)); + this._currentThumbSkin.set_y(this.get_paddingTop() + (contentHeight - this._currentThumbSkin.get_height()) / 2.0); + } + ,get_styleContext: function() { + return feathers_controls_HScrollBar; + } + ,__class__: feathers_controls_HScrollBar +}); +var feathers_controls_IToggle = function() { }; +$hxClasses["feathers.controls.IToggle"] = feathers_controls_IToggle; +feathers_controls_IToggle.__name__ = "feathers.controls.IToggle"; +feathers_controls_IToggle.__isInterface__ = true; +feathers_controls_IToggle.__interfaces__ = [feathers_core_IUIControl]; +feathers_controls_IToggle.prototype = { + __class__: feathers_controls_IToggle + ,__properties__: {set_selected:"set_selected",get_selected:"get_selected"} +}; +var feathers_controls_IGroupedToggle = function() { }; +$hxClasses["feathers.controls.IGroupedToggle"] = feathers_controls_IGroupedToggle; +feathers_controls_IGroupedToggle.__name__ = "feathers.controls.IGroupedToggle"; +feathers_controls_IGroupedToggle.__isInterface__ = true; +feathers_controls_IGroupedToggle.__interfaces__ = [feathers_controls_IToggle]; +feathers_controls_IGroupedToggle.prototype = { + __class__: feathers_controls_IGroupedToggle + ,__properties__: {set_toggleGroup:"set_toggleGroup",get_toggleGroup:"get_toggleGroup"} +}; +var feathers_core_IStageFocusDelegate = function() { }; +$hxClasses["feathers.core.IStageFocusDelegate"] = feathers_core_IStageFocusDelegate; +feathers_core_IStageFocusDelegate.__name__ = "feathers.core.IStageFocusDelegate"; +feathers_core_IStageFocusDelegate.__isInterface__ = true; +feathers_core_IStageFocusDelegate.__interfaces__ = [feathers_core_IFocusObject]; +feathers_core_IStageFocusDelegate.prototype = { + __class__: feathers_core_IStageFocusDelegate + ,__properties__: {get_stageFocusTarget:"get_stageFocusTarget"} +}; +var feathers_controls_Label = function(text) { + if(text == null) { + text = ""; + } + this.__disabledBackgroundSkin = null; + this.__backgroundSkin = null; + this.__wordWrap = false; + this.__verticalAlign = feathers_layout_VerticalAlign.TOP; + this.__paddingLeft = 0.0; + this.__paddingBottom = 0.0; + this.__paddingRight = 0.0; + this.__paddingTop = 0.0; + this.__disabledTextFormat = null; + this.__embedFonts = false; + this.__styleSheet = null; + this.__textFormat = null; + this._backgroundSkinMeasurements = null; + this._currentBackgroundSkin = null; + this._selectable = false; + this._htmlText = null; + this._wrappedOnMeasure = false; + this._updatedTextStyles = false; + this._previousSimpleTextFormat = null; + this._previousTextFormat = null; + this._previousHTMLText = null; + this._previousText = null; + this.initializeLabelTheme(); + feathers_core_FeathersControl.call(this); + this.set_text(text); + this.set_tabEnabled(false); + this.set_tabChildren(false); + this.addEventListener("focusIn",$bind(this,this.label_focusInHandler)); +}; +$hxClasses["feathers.controls.Label"] = feathers_controls_Label; +feathers_controls_Label.__name__ = "feathers.controls.Label"; +feathers_controls_Label.__interfaces__ = [feathers_core_IStageFocusDelegate,feathers_core_IFocusObject,feathers_core_IHTMLTextControl,feathers_core_ITextControl]; +feathers_controls_Label.__super__ = feathers_core_FeathersControl; +feathers_controls_Label.prototype = $extend(feathers_core_FeathersControl.prototype,{ + get_text: function() { + return this._text; + } + ,set_text: function(value) { + if(value == null) { + if(this._text.length == 0) { + return this._text; + } + value = ""; + } + if(this._text == value) { + return this._text; + } + this._text = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._text; + } + ,get_baseline: function() { + if(this.textField == null) { + return 0.0; + } + var hasText = this._text != null && this._text.length > 0; + var hasHTMLText = this._htmlText != null && this._htmlText.length > 0; + if(!hasText && !hasHTMLText) { + this.textField.set_text("​"); + var result = this.textField.get_y() + this.textField.getLineMetrics(0).ascent; + this.textField.set_text(""); + return result; + } + return this.textField.get_y() + this.textField.getLineMetrics(0).ascent; + } + ,get_htmlText: function() { + return this._htmlText; + } + ,set_htmlText: function(value) { + if(this._htmlText == value) { + return this._htmlText; + } + this._htmlText = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._htmlText; + } + ,get_selectable: function() { + return this._selectable; + } + ,set_selectable: function(value) { + if(this._selectable == value) { + return this._selectable; + } + this._selectable = value; + this.setInvalid(feathers_core_InvalidationFlag.SELECTION); + return this._selectable; + } + ,get_tabEnabled: function() { + if(this._selectable && this._enabled) { + return this.get_rawTabEnabled(); + } else { + return false; + } + } + ,get_focusEnabled: function() { + if(this._selectable) { + return feathers_core_FeathersControl.prototype.get_focusEnabled.call(this); + } else { + return false; + } + } + ,get_stageFocusTarget: function() { + return this.textField; + } + ,get_selectionBeginIndex: function() { + if(!this._selectable) { + return -1; + } + if(this.textField == null) { + return 0; + } + return this.textField.get_selectionBeginIndex(); + } + ,get_selectionEndIndex: function() { + if(!this._selectable) { + return -1; + } + if(this.textField == null) { + return 0; + } + return this.textField.get_selectionEndIndex(); + } + ,setPadding: function(value) { + this.set_paddingTop(value); + this.set_paddingRight(value); + this.set_paddingBottom(value); + this.set_paddingLeft(value); + } + ,initializeLabelTheme: function() { + feathers_themes_steel_components_SteelLabelStyles.initialize(); + } + ,initialize: function() { + feathers_core_FeathersControl.prototype.initialize.call(this); + if(this.textField == null) { + this.textField = new openfl_text_TextField(); + this.textField.set_multiline(true); + this.addChild(this.textField); + } + } + ,update: function() { + var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA); + var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION); + var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE); + var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE); + var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES); + this._updatedTextStyles = false; + if(stylesInvalid || stateInvalid) { + this.refreshBackgroundSkin(); + } + if(stylesInvalid || stateInvalid) { + this.refreshTextStyles(); + } + if(dataInvalid || stylesInvalid || stateInvalid || sizeInvalid) { + this.refreshText(sizeInvalid); + } + if(dataInvalid || stylesInvalid || selectionInvalid) { + this.refreshSelection(); + } + if(this.measure()) { + sizeInvalid = true; + } + if(stylesInvalid || stateInvalid || dataInvalid || sizeInvalid) { + this.layoutContent(); + } + } + ,measure: function() { + var needsWidth = this.get_explicitWidth() == null; + var needsHeight = this.get_explicitHeight() == null; + var needsMinWidth = this.get_explicitMinWidth() == null; + var needsMinHeight = this.get_explicitMinHeight() == null; + var needsMaxWidth = this.get_explicitMaxWidth() == null; + var needsMaxHeight = this.get_explicitMaxHeight() == null; + if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) { + return false; + } + if(this._currentBackgroundSkin != null) { + feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this); + } + var measureSkin = null; + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) { + measureSkin = this._currentBackgroundSkin; + } + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) { + this._currentBackgroundSkin.validateNow(); + } + var newWidth = this.get_explicitWidth(); + if(needsWidth) { + newWidth = this._textMeasuredWidth + this.get_paddingLeft() + this.get_paddingRight(); + if(this._currentBackgroundSkin != null) { + newWidth = Math.max(this._currentBackgroundSkin.get_width(),newWidth); + } + } + var newHeight = this.get_explicitHeight(); + if(needsHeight) { + newHeight = this._textMeasuredHeight + this.get_paddingTop() + this.get_paddingBottom(); + if(this._currentBackgroundSkin != null) { + newHeight = Math.max(this._currentBackgroundSkin.get_height(),newHeight); + } + } + var newMinWidth = this.get_explicitMinWidth(); + if(needsMinWidth) { + newMinWidth = this._textMeasuredWidth + this.get_paddingLeft() + this.get_paddingRight(); + if(measureSkin != null) { + newMinWidth = Math.max(measureSkin.get_minWidth(),newMinWidth); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) { + newMinWidth = Math.max(this._backgroundSkinMeasurements.minWidth,newMinWidth); + } + } + var newMinHeight = this.get_explicitMinHeight(); + if(needsMinHeight) { + newMinHeight = this._textMeasuredHeight + this.get_paddingTop() + this.get_paddingBottom(); + if(measureSkin != null) { + newMinHeight = Math.max(measureSkin.get_minHeight(),newMinHeight); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) { + newMinHeight = Math.max(this._backgroundSkinMeasurements.minHeight,newMinHeight); + } + } + var newMaxWidth = this.get_explicitMaxWidth(); + if(needsMaxWidth) { + if(measureSkin != null) { + newMaxWidth = measureSkin.get_maxWidth(); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) { + newMaxWidth = this._backgroundSkinMeasurements.maxWidth; + } else { + newMaxWidth = 1.0 / 0.0; + } + } + var newMaxHeight = this.get_explicitMaxHeight(); + if(needsMaxHeight) { + if(measureSkin != null) { + newMaxHeight = measureSkin.get_maxHeight(); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) { + newMaxHeight = this._backgroundSkinMeasurements.maxHeight; + } else { + newMaxHeight = 1.0 / 0.0; + } + } + return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight); + } + ,refreshTextStyles: function() { + if(this.textField.get_wordWrap() != this.get_wordWrap()) { + this.textField.set_wordWrap(this.get_wordWrap()); + this._updatedTextStyles = true; + } + if(this.textField.get_embedFonts() != this.get_embedFonts()) { + this.textField.set_embedFonts(this.get_embedFonts()); + this._updatedTextStyles = true; + } + if(this.textField.get_styleSheet() != this.get_styleSheet()) { + this.textField.set_styleSheet(this.get_styleSheet()); + this._updatedTextStyles = true; + } + var textFormat = this.getCurrentTextFormat(); + var simpleTextFormat = textFormat != null ? textFormat.toSimpleTextFormat() : null; + if(simpleTextFormat == this._previousSimpleTextFormat) { + return; + } + if(this._previousTextFormat != null) { + this._previousTextFormat.removeEventListener("change",$bind(this,this.label_textFormat_changeHandler)); + } + if(this.textField.get_caretIndex() != -1 && this.textField.get_selectionBeginIndex() != this.textField.get_selectionEndIndex()) { + this.textField.setSelection(0,0); + } + if(textFormat != null) { + textFormat.addEventListener("change",$bind(this,this.label_textFormat_changeHandler),false,0,true); + this.textField.set_defaultTextFormat(simpleTextFormat); + this._updatedTextStyles = true; + } + this._previousTextFormat = textFormat; + this._previousSimpleTextFormat = simpleTextFormat; + } + ,refreshText: function(forceMeasurement) { + var hasText = this._text != null && this._text.length > 0; + var hasHTMLText = this._htmlText != null && this._htmlText.length > 0; + this.textField.set_visible(hasText || hasHTMLText); + if(this._text == this._previousText && this._htmlText == this._previousHTMLText && !this._updatedTextStyles && !forceMeasurement) { + return; + } + this.textField.set_autoSize(1); + if(hasHTMLText) { + this.textField.set_htmlText(this._htmlText); + } else if(hasText) { + this.textField.set_text(this._text); + } else { + this.textField.set_text("​"); + } + if(this.get_wordWrap()) { + this.textField.set_wordWrap(false); + } + this._textMeasuredWidth = this.textField.get_textWidth() + 4; + this._wrappedOnMeasure = false; + if(this.get_wordWrap()) { + var textFieldExplicitWidth = this.calculateExplicitWidthForTextMeasurement(); + if(textFieldExplicitWidth != null && this._textMeasuredWidth > textFieldExplicitWidth) { + this.textField.set_wordWrap(true); + this.textField.set_width(textFieldExplicitWidth); + this._textMeasuredWidth = this.textField.get_width(); + this._wrappedOnMeasure = true; + } + } + this._textMeasuredHeight = this.textField.get_height(); + this.textField.set_autoSize(2); + if(this.textField.get_wordWrap() != this.get_wordWrap()) { + this.textField.set_wordWrap(this.get_wordWrap()); + } + if(!hasText && !hasHTMLText) { + this.textField.set_text(""); + } + this._previousText = this._text; + this._previousHTMLText = this._htmlText; + } + ,calculateExplicitWidthForTextMeasurement: function() { + var textFieldExplicitWidth = null; + if(this.get_explicitWidth() != null) { + textFieldExplicitWidth = this.get_explicitWidth(); + } else if(this.get_explicitMaxWidth() != null) { + textFieldExplicitWidth = this.get_explicitMaxWidth(); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) { + textFieldExplicitWidth = this._backgroundSkinMeasurements.maxWidth; + } + if(textFieldExplicitWidth == null) { + return textFieldExplicitWidth; + } + textFieldExplicitWidth -= this.get_paddingLeft() + this.get_paddingRight(); + if(textFieldExplicitWidth < 0.0) { + textFieldExplicitWidth = 0.0; + } + return textFieldExplicitWidth; + } + ,refreshSelection: function() { + var selectable = this._selectable && this._enabled; + if(this.textField.get_selectable() != selectable) { + this.textField.set_selectable(selectable); + } + } + ,getCurrentTextFormat: function() { + if(this.get_styleSheet() != null) { + return null; + } + if(!this._enabled && this.get_disabledTextFormat() != null) { + return this.get_disabledTextFormat(); + } + return this.get_textFormat(); + } + ,refreshBackgroundSkin: function() { + var oldSkin = this._currentBackgroundSkin; + this._currentBackgroundSkin = this.getCurrentBackgroundSkin(); + if(this._currentBackgroundSkin == oldSkin) { + return; + } + this.removeCurrentBackgroundSkin(oldSkin); + this.addCurrentBackgroundSkin(this._currentBackgroundSkin); + } + ,getCurrentBackgroundSkin: function() { + if(!this._enabled && this.get_disabledBackgroundSkin() != null) { + return this.get_disabledBackgroundSkin(); + } + return this.get_backgroundSkin(); + } + ,addCurrentBackgroundSkin: function(skin) { + if(skin == null) { + this._backgroundSkinMeasurements = null; + return; + } + if(js_Boot.__implements(skin,feathers_core_IUIControl)) { + skin.initializeNow(); + } + if(this._backgroundSkinMeasurements == null) { + this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin); + } else { + this._backgroundSkinMeasurements.save(skin); + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(this); + } + this.addChildAt(skin,0); + } + ,removeCurrentBackgroundSkin: function(skin) { + if(skin == null) { + return; + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(null); + } + this._backgroundSkinMeasurements.restore(skin); + if(skin.parent == this) { + this.removeChild(skin); + } + } + ,layoutContent: function() { + this.layoutBackgroundSkin(); + var textFieldLayoutWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight(); + if(textFieldLayoutWidth < 0.0) { + textFieldLayoutWidth = 0.0; + } + this.textField.set_x(this.get_paddingLeft()); + this.textField.set_width(textFieldLayoutWidth); + var wordWrap = this.get_wordWrap(); + if(wordWrap && !this._wrappedOnMeasure && textFieldLayoutWidth >= this._textMeasuredWidth) { + wordWrap = false; + } + if(this.textField.get_wordWrap() != wordWrap) { + this.textField.set_wordWrap(wordWrap); + } + var textFieldHeight = this._textMeasuredHeight; + var maxHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom(); + if(textFieldHeight > maxHeight) { + textFieldHeight = maxHeight; + } + if(textFieldHeight < 0.0) { + textFieldHeight = 0.0; + } + this.textField.set_height(textFieldHeight); + switch(this.get_verticalAlign()._hx_index) { + case 0: + this.textField.set_y(this.get_paddingTop()); + break; + case 2: + this.textField.set_y(this.actualHeight - this.get_paddingBottom() - textFieldHeight); + break; + default: + this.textField.set_y(this.get_paddingTop() + (maxHeight - textFieldHeight) / 2.0); + } + } + ,layoutBackgroundSkin: function() { + if(this._currentBackgroundSkin == null) { + return; + } + this._currentBackgroundSkin.set_x(0.0); + this._currentBackgroundSkin.set_y(0.0); + if(this._currentBackgroundSkin.get_width() != this.actualWidth) { + this._currentBackgroundSkin.set_width(this.actualWidth); + } + if(this._currentBackgroundSkin.get_height() != this.actualHeight) { + this._currentBackgroundSkin.set_height(this.actualHeight); + } + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) { + this._currentBackgroundSkin.validateNow(); + } + } + ,label_focusInHandler: function(event) { + if(this.stage != null && this.stage.get_focus() != this.textField) { + event.stopImmediatePropagation(); + this.stage.set_focus(this.textField); + } + } + ,label_textFormat_changeHandler: function(event) { + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + } + ,get_textFormat: function() { + return this.__textFormat; + } + ,set_textFormat: function(value) { + if(!this.setStyle("textFormat")) { + return this.__textFormat; + } + if(this.__textFormat == value) { + return this.__textFormat; + } + this._previousClearStyle = $bind(this,this.clearStyle_textFormat); + this.__textFormat = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__textFormat; + } + ,clearStyle_textFormat: function() { + this.set_textFormat(null); + return this.get_textFormat(); + } + ,get_styleSheet: function() { + return this.__styleSheet; + } + ,set_styleSheet: function(value) { + if(!this.setStyle("styleSheet")) { + return this.__styleSheet; + } + if(this.__styleSheet == value) { + return this.__styleSheet; + } + this._previousClearStyle = $bind(this,this.clearStyle_styleSheet); + this.__styleSheet = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__styleSheet; + } + ,clearStyle_styleSheet: function() { + this.set_styleSheet(null); + return this.get_styleSheet(); + } + ,get_embedFonts: function() { + return this.__embedFonts; + } + ,set_embedFonts: function(value) { + if(!this.setStyle("embedFonts")) { + return this.__embedFonts; + } + if(this.__embedFonts == value) { + return this.__embedFonts; + } + this._previousClearStyle = $bind(this,this.clearStyle_embedFonts); + this.__embedFonts = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__embedFonts; + } + ,clearStyle_embedFonts: function() { + this.set_embedFonts(false); + return this.get_embedFonts(); + } + ,get_disabledTextFormat: function() { + return this.__disabledTextFormat; + } + ,set_disabledTextFormat: function(value) { + if(!this.setStyle("disabledTextFormat")) { + return this.__disabledTextFormat; + } + if(this.__disabledTextFormat == value) { + return this.__disabledTextFormat; + } + this._previousClearStyle = $bind(this,this.clearStyle_disabledTextFormat); + this.__disabledTextFormat = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__disabledTextFormat; + } + ,clearStyle_disabledTextFormat: function() { + this.set_disabledTextFormat(null); + return this.get_disabledTextFormat(); + } + ,get_paddingTop: function() { + return this.__paddingTop; + } + ,set_paddingTop: function(value) { + if(!this.setStyle("paddingTop")) { + return this.__paddingTop; + } + if(this.__paddingTop == value) { + return this.__paddingTop; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingTop); + this.__paddingTop = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingTop; + } + ,clearStyle_paddingTop: function() { + this.set_paddingTop(0.0); + return this.get_paddingTop(); + } + ,get_paddingRight: function() { + return this.__paddingRight; + } + ,set_paddingRight: function(value) { + if(!this.setStyle("paddingRight")) { + return this.__paddingRight; + } + if(this.__paddingRight == value) { + return this.__paddingRight; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingRight); + this.__paddingRight = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingRight; + } + ,clearStyle_paddingRight: function() { + this.set_paddingRight(0.0); + return this.get_paddingRight(); + } + ,get_paddingBottom: function() { + return this.__paddingBottom; + } + ,set_paddingBottom: function(value) { + if(!this.setStyle("paddingBottom")) { + return this.__paddingBottom; + } + if(this.__paddingBottom == value) { + return this.__paddingBottom; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom); + this.__paddingBottom = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingBottom; + } + ,clearStyle_paddingBottom: function() { + this.set_paddingBottom(0.0); + return this.get_paddingBottom(); + } + ,get_paddingLeft: function() { + return this.__paddingLeft; + } + ,set_paddingLeft: function(value) { + if(!this.setStyle("paddingLeft")) { + return this.__paddingLeft; + } + if(this.__paddingLeft == value) { + return this.__paddingLeft; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft); + this.__paddingLeft = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingLeft; + } + ,clearStyle_paddingLeft: function() { + this.set_paddingLeft(0.0); + return this.get_paddingLeft(); + } + ,get_verticalAlign: function() { + return this.__verticalAlign; + } + ,set_verticalAlign: function(value) { + if(!this.setStyle("verticalAlign")) { + return this.__verticalAlign; + } + if(this.__verticalAlign == value) { + return this.__verticalAlign; + } + this._previousClearStyle = $bind(this,this.clearStyle_verticalAlign); + this.__verticalAlign = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__verticalAlign; + } + ,clearStyle_verticalAlign: function() { + this.set_verticalAlign(feathers_layout_VerticalAlign.TOP); + return this.get_verticalAlign(); + } + ,get_wordWrap: function() { + return this.__wordWrap; + } + ,set_wordWrap: function(value) { + if(!this.setStyle("wordWrap")) { + return this.__wordWrap; + } + if(this.__wordWrap == value) { + return this.__wordWrap; + } + this._previousClearStyle = $bind(this,this.clearStyle_wordWrap); + this.__wordWrap = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__wordWrap; + } + ,clearStyle_wordWrap: function() { + this.set_wordWrap(false); + return this.get_wordWrap(); + } + ,get_backgroundSkin: function() { + return this.__backgroundSkin; + } + ,set_backgroundSkin: function(value) { + if(!this.setStyle("backgroundSkin")) { + return this.__backgroundSkin; + } + if(this.__backgroundSkin == value) { + return this.__backgroundSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin); + this.__backgroundSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__backgroundSkin; + } + ,clearStyle_backgroundSkin: function() { + this.set_backgroundSkin(null); + return this.get_backgroundSkin(); + } + ,get_disabledBackgroundSkin: function() { + return this.__disabledBackgroundSkin; + } + ,set_disabledBackgroundSkin: function(value) { + if(!this.setStyle("disabledBackgroundSkin")) { + return this.__disabledBackgroundSkin; + } + if(this.__disabledBackgroundSkin == value) { + return this.__disabledBackgroundSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin); + this.__disabledBackgroundSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__disabledBackgroundSkin; + } + ,clearStyle_disabledBackgroundSkin: function() { + this.set_disabledBackgroundSkin(null); + return this.get_disabledBackgroundSkin(); + } + ,get_styleContext: function() { + return feathers_controls_Label; + } + ,__class__: feathers_controls_Label + ,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_disabledTextFormat:"set_disabledTextFormat",get_disabledTextFormat:"get_disabledTextFormat",get_selectionEndIndex:"get_selectionEndIndex",get_selectionBeginIndex:"get_selectionBeginIndex",get_stageFocusTarget:"get_stageFocusTarget",set_selectable:"set_selectable",get_selectable:"get_selectable",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_styleSheet:"set_styleSheet",get_styleSheet:"get_styleSheet",set_textFormat:"set_textFormat",get_textFormat:"get_textFormat",set_htmlText:"set_htmlText",get_htmlText:"get_htmlText",get_baseline:"get_baseline",set_text:"set_text",get_text:"get_text"}) +}); +var feathers_controls_VScrollBar = function(value,minimum,maximum,changeListener) { + if(maximum == null) { + maximum = 1.0; + } + if(minimum == null) { + minimum = 0.0; + } + if(value == null) { + value = 0.0; + } + this.initializeVScrollBarTheme(); + feathers_controls_supportClasses_BaseScrollBar.call(this,value,minimum,maximum,changeListener); +}; +$hxClasses["feathers.controls.VScrollBar"] = feathers_controls_VScrollBar; +feathers_controls_VScrollBar.__name__ = "feathers.controls.VScrollBar"; +feathers_controls_VScrollBar.__super__ = feathers_controls_supportClasses_BaseScrollBar; +feathers_controls_VScrollBar.prototype = $extend(feathers_controls_supportClasses_BaseScrollBar.prototype,{ + initializeVScrollBarTheme: function() { + feathers_themes_steel_components_SteelVScrollBarStyles.initialize(); + } + ,valueToLocation: function(value) { + if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) { + this._currentThumbSkin.validateNow(); + } + if(this.showDecrementAndIncrementButtons) { + this.decrementButton.validateNow(); + this.incrementButton.validateNow(); + } + var normalized = this.normalizeValue(value); + var trackScrollableHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this._currentThumbSkin.get_height(); + if(this.showDecrementAndIncrementButtons) { + trackScrollableHeight -= this.decrementButton.get_height() + this.incrementButton.get_height(); + } + var result = this.get_paddingTop() + trackScrollableHeight * normalized; + if(this.showDecrementAndIncrementButtons) { + result += this.decrementButton.get_height(); + } + return result; + } + ,locationToValue: function(x,y) { + var percentage = 0.0; + var minYPosition = this.get_paddingTop(); + var trackScrollableHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom() - this._currentThumbSkin.get_height(); + if(this.showDecrementAndIncrementButtons) { + minYPosition += this.decrementButton.get_height(); + trackScrollableHeight -= this.decrementButton.get_height() + this.incrementButton.get_height(); + } + var yOffset = y - this._pointerStartY; + var yPosition = Math.min(Math.max(0.0,this._thumbStartY + yOffset - minYPosition),trackScrollableHeight); + percentage = yPosition / trackScrollableHeight; + return this._minimum + percentage * (this._maximum - this._minimum); + } + ,saveThumbStart: function(x,y) { + var trackHeightMinusThumbHeight = this.actualHeight; + var locationMinusHalfThumbHeight = y; + if(this._currentThumbSkin != null) { + trackHeightMinusThumbHeight -= this._currentThumbSkin.get_height(); + locationMinusHalfThumbHeight -= this._currentThumbSkin.get_height() / 2.0; + } + this._thumbStartX = x; + this._thumbStartY = Math.min(trackHeightMinusThumbHeight,locationMinusHalfThumbHeight); + } + ,measure: function() { + var needsWidth = this.get_explicitWidth() == null; + var needsHeight = this.get_explicitHeight() == null; + var needsMinWidth = this.get_explicitMinWidth() == null; + var needsMinHeight = this.get_explicitMinHeight() == null; + var needsMaxWidth = this.get_explicitMaxWidth() == null; + var needsMaxHeight = this.get_explicitMaxHeight() == null; + if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) { + return false; + } + if(this.decrementButton != null) { + this.decrementButtonMeasurements.restore(this.decrementButton); + this.decrementButton.validateNow(); + } + if(this.incrementButton != null) { + this.incrementButtonMeasurements.restore(this.incrementButton); + this.incrementButton.validateNow(); + } + if(this._currentThumbSkin != null) { + this._thumbSkinMeasurements.restore(this._currentThumbSkin); + if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) { + this._currentThumbSkin.validateNow(); + } + } + if(this._currentTrackSkin != null) { + this._trackSkinMeasurements.restore(this._currentTrackSkin); + if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) { + this._currentTrackSkin.validateNow(); + } + } + if(this._currentSecondaryTrackSkin != null) { + this._secondaryTrackSkinMeasurements.restore(this._currentSecondaryTrackSkin); + if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) { + this._currentSecondaryTrackSkin.validateNow(); + } + } + var newWidth = this.get_explicitWidth(); + if(needsWidth) { + newWidth = this.get_paddingLeft() + this.get_paddingRight(); + if(this._currentThumbSkin != null) { + newWidth += this._currentThumbSkin.get_width(); + } + if(this._currentTrackSkin != null) { + if(newWidth < this._currentTrackSkin.get_width()) { + newWidth = this._currentTrackSkin.get_width(); + } + if(this._currentSecondaryTrackSkin != null && newWidth < this._currentSecondaryTrackSkin.get_width()) { + newWidth = this._currentSecondaryTrackSkin.get_width(); + } + } + if(this.showDecrementAndIncrementButtons) { + var buttonWidth = Math.max(this.decrementButton.get_width(),this.incrementButton.get_width()); + if(newWidth < buttonWidth) { + newWidth = buttonWidth; + } + } + } + var newHeight = this.get_explicitHeight(); + if(needsHeight) { + newHeight = 0.0; + if(this._currentTrackSkin != null) { + newHeight += this._currentTrackSkin.get_height(); + if(this._currentSecondaryTrackSkin != null) { + newHeight += this._currentSecondaryTrackSkin.get_height(); + } + } + var thumbHeight = this.get_paddingTop() + this.get_paddingBottom(); + if(this._currentThumbSkin != null) { + thumbHeight += this._currentThumbSkin.get_height(); + } + if(newHeight < thumbHeight) { + newHeight = thumbHeight; + } + if(this.showDecrementAndIncrementButtons) { + newHeight += this.decrementButton.get_height() + this.incrementButton.get_height(); + } + } + var newMinWidth = newWidth; + var newMinHeight = newHeight; + var newMaxWidth = newWidth; + return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,null); + } + ,layoutButtons: function() { + if(!this.showDecrementAndIncrementButtons) { + return; + } + if(this.decrementButton != null) { + this.decrementButton.validateNow(); + } + this.decrementButton.set_x((this.actualWidth - this.decrementButton.get_width()) / 2.0); + this.decrementButton.set_y(0.0); + if(this.incrementButton != null) { + this.incrementButton.validateNow(); + } + this.incrementButton.set_x((this.actualWidth - this.incrementButton.get_width()) / 2.0); + this.incrementButton.set_y(this.actualHeight - this.incrementButton.get_height()); + } + ,layoutSplitTrack: function() { + var location = this.valueToLocation(this.get_value()); + if(this._currentThumbSkin != null) { + if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) { + this._currentThumbSkin.validateNow(); + } + location += Math.round(this._currentThumbSkin.get_height() / 2.0); + } + var minTrackY = 0.0; + var maxTrackY = this.actualHeight; + if(this.showDecrementAndIncrementButtons) { + minTrackY = this.decrementButton.get_height(); + maxTrackY -= this.incrementButton.get_height(); + } + this._currentSecondaryTrackSkin.set_y(minTrackY); + this._currentSecondaryTrackSkin.set_height(location); + this._currentTrackSkin.set_y(location); + this._currentTrackSkin.set_height(maxTrackY - location); + if(js_Boot.__implements(this._currentSecondaryTrackSkin,feathers_core_IValidating)) { + this._currentSecondaryTrackSkin.validateNow(); + } + if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) { + this._currentTrackSkin.validateNow(); + } + this._currentSecondaryTrackSkin.set_x((this.actualWidth - this._currentSecondaryTrackSkin.get_width()) / 2.0); + this._currentTrackSkin.set_x((this.actualWidth - this._currentTrackSkin.get_width()) / 2.0); + } + ,layoutSingleTrack: function() { + if(this._currentTrackSkin == null) { + return; + } + var minTrackY = 0.0; + var maxTrackY = this.actualHeight; + if(this.showDecrementAndIncrementButtons) { + minTrackY = this.decrementButton.get_height(); + maxTrackY -= this.incrementButton.get_height(); + } + this._currentTrackSkin.set_y(minTrackY); + this._currentTrackSkin.set_height(maxTrackY - minTrackY); + if(js_Boot.__implements(this._currentTrackSkin,feathers_core_IValidating)) { + this._currentTrackSkin.validateNow(); + } + this._currentTrackSkin.set_x((this.actualWidth - this._currentTrackSkin.get_width()) / 2.0); + } + ,layoutThumb: function() { + if(this._currentThumbSkin == null) { + return; + } + var range = this._maximum - this._minimum; + this._currentThumbSkin.set_visible((!this.get_hideThumbWhenDisabled() || this._enabled) && range > 0.0); + if(!this._currentThumbSkin.get_visible()) { + return; + } + if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IValidating)) { + this._currentThumbSkin.validateNow(); + } + var valueOffset = 0.0; + if(this._value < this._minimum) { + valueOffset = this._minimum - this._value; + } else if(this._value > this._maximum) { + valueOffset = this._value - this._maximum; + } + var contentWidth = this.actualWidth - this.get_paddingLeft() - this.get_paddingRight(); + var contentHeight = this.actualHeight - this.get_paddingTop() - this.get_paddingBottom(); + if(this.get_fixedThumbSize()) { + if(this._thumbSkinMeasurements.height != null) { + this._currentThumbSkin.set_height(this._thumbSkinMeasurements.height); + } + } else { + var adjustedPage = this.getAdjustedPage(); + var thumbHeight = contentHeight * adjustedPage / (range + adjustedPage); + if(thumbHeight > 0.0) { + var heightOffset = contentHeight - thumbHeight; + if(heightOffset > thumbHeight) { + heightOffset = thumbHeight; + } + heightOffset *= valueOffset / (range * thumbHeight / contentHeight); + thumbHeight -= heightOffset; + } + if(this._thumbSkinMeasurements.minHeight != null) { + if(thumbHeight < this._thumbSkinMeasurements.minHeight) { + thumbHeight = this._thumbSkinMeasurements.minHeight; + } + } else if(js_Boot.__implements(this._currentThumbSkin,feathers_core_IMeasureObject)) { + var measureSkin = this._currentThumbSkin; + if(thumbHeight < measureSkin.get_minHeight()) { + thumbHeight = measureSkin.get_minHeight(); + } + } + if(thumbHeight < 0.0) { + thumbHeight = 0.0; + } + this._currentThumbSkin.set_height(thumbHeight); + } + this._currentThumbSkin.set_x(this.get_paddingLeft() + (contentWidth - this._currentThumbSkin.get_width()) / 2.0); + this._currentThumbSkin.set_y(this.valueToLocation(this._value)); + } + ,get_styleContext: function() { + return feathers_controls_VScrollBar; + } + ,__class__: feathers_controls_VScrollBar +}); +var feathers_controls_supportClasses_BaseScrollContainer = function() { + this.__scrollPixelSnapping = false; + this.__hideScrollBarEase = motion_easing_Quart.easeOut; + this.__hideScrollBarDuration = 0.2; + this.__showScrollBarMinimumDuration = 0.5; + this.__scrollBarYPosition = feathers_layout_RelativePosition.RIGHT; + this.__scrollBarXPosition = feathers_layout_RelativePosition.BOTTOM; + this.__autoHideScrollBars = true; + this.__showScrollBars = true; + this.__fixedScrollBars = false; + this.__scrollBarsCornerSkin = null; + this.__viewPortMaskSkin = null; + this.__maskSkin = null; + this.__disabledBackgroundSkin = null; + this.__backgroundSkin = null; + this.__paddingLeft = 0.0; + this.__paddingBottom = 0.0; + this.__paddingRight = 0.0; + this.__paddingTop = 0.0; + this._scrollMode = feathers_controls_ScrollMode.MASK; + this._ignoreViewPortResizing = false; + this._settingScrollerDimensions = false; + this._ignoreScrollerChanges = false; + this._scrollRect2 = new openfl_geom_Rectangle(); + this._scrollRect1 = new openfl_geom_Rectangle(); + this._prevMaxScrollY = 0.0; + this._prevMinScrollY = 0.0; + this._prevMaxScrollX = 0.0; + this._prevMinScrollX = 0.0; + this._hideScrollBarY = null; + this._hideScrollBarX = null; + this._scrollPolicyY = feathers_controls_ScrollPolicy.AUTO; + this._scrollPolicyX = feathers_controls_ScrollPolicy.AUTO; + this._scrollStepY = 1.0; + this._scrollStepX = 1.0; + this._temporaryRestrictedScrollY = null; + this._temporaryScrollY = null; + this._temporaryRestrictedScrollX = null; + this._temporaryScrollX = null; + this.showScrollBarY = false; + this.showScrollBarX = false; + this._ignoreScrollBarYChange = false; + this._ignoreScrollBarXChange = false; + this.chromeMeasuredMaxHeight = 1.0 / 0.0; + this.chromeMeasuredMinHeight = 0.0; + this.chromeMeasuredHeight = 0.0; + this.chromeMeasuredMaxWidth = 1.0 / 0.0; + this.chromeMeasuredMinWidth = 0.0; + this.chromeMeasuredWidth = 0.0; + this.leftViewPortOffset = 0.0; + this.bottomViewPortOffset = 0.0; + this.rightViewPortOffset = 0.0; + this.topViewPortOffset = 0.0; + this._fallbackViewPortMaskSkin = null; + this._currentViewPortMaskSkin = null; + this._currentMaskSkin = null; + this._backgroundSkinMeasurements = null; + this._currentBackgroundSkin = null; + this._scrollBarYHover = false; + this._scrollBarXHover = false; + this._scrollerDraggingY = false; + this._scrollerDraggingX = false; + feathers_core_FeathersControl.call(this); + this.set_tabEnabled(true); + this.set_tabChildren(true); + this.focusRect = null; + this.addEventListener("keyDown",$bind(this,this.baseScrollContainer_keyDownHandler)); + this.addEventListener("addedToStage",$bind(this,this.baseScrollContainer_addedToStageHandler)); + this.addEventListener("removedFromStage",$bind(this,this.baseScrollContainer_removedFromStageHandler)); +}; +$hxClasses["feathers.controls.supportClasses.BaseScrollContainer"] = feathers_controls_supportClasses_BaseScrollContainer; +feathers_controls_supportClasses_BaseScrollContainer.__name__ = "feathers.controls.supportClasses.BaseScrollContainer"; +feathers_controls_supportClasses_BaseScrollContainer.__interfaces__ = [feathers_core_IFocusObject]; +feathers_controls_supportClasses_BaseScrollContainer.__super__ = feathers_core_FeathersControl; +feathers_controls_supportClasses_BaseScrollContainer.prototype = $extend(feathers_core_FeathersControl.prototype,{ + get_viewPort: function() { + return this._viewPort; + } + ,set_viewPort: function(value) { + if(this._viewPort == value) { + return this._viewPort; + } + if(this._viewPort != null) { + this._viewPort.removeEventListener("resize",$bind(this,this.viewPort_resizeHandler)); + } + if(this.scroller != null) { + this.scroller.set_target(null); + } + this._viewPort = value; + if(this._viewPort != null) { + this._viewPort.addEventListener("resize",$bind(this,this.viewPort_resizeHandler)); + } + this.setInvalid(feathers_core_InvalidationFlag.SCROLL); + return this._viewPort; + } + ,get_tabEnabled: function() { + if(this.get_maxScrollY() != this.get_minScrollY() || this.get_maxScrollX() != this.get_minScrollX()) { + return this.get_rawTabEnabled(); + } else { + return false; + } + } + ,get_scrollBarXFactory: function() { + return this._scrollBarXFactory; + } + ,set_scrollBarXFactory: function(value) { + if(this._scrollBarXFactory == value) { + return this._scrollBarXFactory; + } + this._scrollBarXFactory = value; + this.setInvalid(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLL_BAR_FACTORY); + return this._scrollBarXFactory; + } + ,get_scrollBarYFactory: function() { + return this._scrollBarYFactory; + } + ,set_scrollBarYFactory: function(value) { + if(this._scrollBarYFactory == value) { + return this._scrollBarYFactory; + } + this._scrollBarYFactory = value; + this.setInvalid(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLL_BAR_FACTORY); + return this._scrollBarYFactory; + } + ,get_scrollerFactory: function() { + return this._scrollerFactory; + } + ,set_scrollerFactory: function(value) { + if(this._scrollerFactory == value) { + return this._scrollerFactory; + } + this._scrollerFactory = value; + this.setInvalid(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLLER_FACTORY); + return this._scrollerFactory; + } + ,get_scrollX: function() { + if(this.scroller == null) { + if(this._temporaryRestrictedScrollX != null) { + return this._temporaryRestrictedScrollX; + } + if(this._temporaryScrollX != null) { + return this._temporaryScrollX; + } + return 0.0; + } + return this.scroller.get_scrollX(); + } + ,set_scrollX: function(value) { + if(this.scroller == null) { + this._temporaryScrollX = value; + this._temporaryRestrictedScrollX = null; + feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._temporaryScrollX,this._temporaryScrollY); + return this._temporaryScrollX; + } + this.scroller.set_scrollX(value); + return this.scroller.get_scrollX(); + } + ,get_restrictedScrollX: function() { + if(this.scroller == null) { + return this.get_scrollX(); + } + return this.scroller.get_restrictedScrollX(); + } + ,set_restrictedScrollX: function(value) { + if(this.scroller == null) { + this._temporaryRestrictedScrollX = value; + this._temporaryScrollX = null; + feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._temporaryScrollX,this._temporaryScrollY); + return this._temporaryRestrictedScrollX; + } + this.scroller.set_restrictedScrollX(value); + return this.scroller.get_restrictedScrollX(); + } + ,get_scrollY: function() { + if(this.scroller == null) { + if(this._temporaryRestrictedScrollY != null) { + return this._temporaryRestrictedScrollY; + } + if(this._temporaryScrollY != null) { + return this._temporaryScrollY; + } + return 0.0; + } + return this.scroller.get_scrollY(); + } + ,set_scrollY: function(value) { + if(this.scroller == null) { + this._temporaryScrollY = value; + this._temporaryRestrictedScrollY = null; + feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._temporaryScrollX,this._temporaryScrollY); + return this._temporaryScrollY; + } + this.scroller.set_scrollY(value); + return this.scroller.get_scrollY(); + } + ,get_restrictedScrollY: function() { + if(this.scroller == null) { + this.get_scrollY(); + } + return this.scroller.get_restrictedScrollY(); + } + ,set_restrictedScrollY: function(value) { + if(this.scroller == null) { + this._temporaryRestrictedScrollY = value; + this._temporaryScrollY = null; + feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._temporaryScrollX,this._temporaryScrollY); + return this._temporaryRestrictedScrollY; + } + this.scroller.set_restrictedScrollY(value); + return this.scroller.get_restrictedScrollY(); + } + ,get_minScrollX: function() { + if(this.scroller == null) { + return 0.0; + } + return this.scroller.get_minScrollX(); + } + ,get_minScrollY: function() { + if(this.scroller == null) { + return 0.0; + } + return this.scroller.get_minScrollY(); + } + ,get_maxScrollX: function() { + if(this.scroller == null) { + return 0.0; + } + return this.scroller.get_maxScrollX(); + } + ,get_maxScrollY: function() { + if(this.scroller == null) { + return 0.0; + } + return this.scroller.get_maxScrollY(); + } + ,get_scrollStepX: function() { + return this._scrollStepX; + } + ,set_scrollStepX: function(value) { + if(this._scrollStepX == value) { + return this._scrollStepX; + } + this._scrollStepX = value; + this.setInvalid(feathers_core_InvalidationFlag.SCROLL); + return this._scrollStepX; + } + ,get_scrollStepY: function() { + return this._scrollStepY; + } + ,set_scrollStepY: function(value) { + if(this._scrollStepY == value) { + return this._scrollStepY; + } + this._scrollStepY = value; + this.setInvalid(feathers_core_InvalidationFlag.SCROLL); + return this._scrollStepY; + } + ,get_scrollPolicyX: function() { + return this._scrollPolicyX; + } + ,set_scrollPolicyX: function(value) { + if(this._scrollPolicyX == value) { + return this._scrollPolicyX; + } + this._scrollPolicyX = value; + this.setInvalid(feathers_core_InvalidationFlag.SCROLL); + return this._scrollPolicyX; + } + ,get_scrollPolicyY: function() { + return this._scrollPolicyY; + } + ,set_scrollPolicyY: function(value) { + if(this._scrollPolicyY == value) { + return this._scrollPolicyY; + } + this._scrollPolicyY = value; + this.setInvalid(feathers_core_InvalidationFlag.SCROLL); + return this._scrollPolicyY; + } + ,get_measureViewPort: function() { + return true; + } + ,get_scrollMode: function() { + return this._scrollMode; + } + ,set_scrollMode: function(value) { + if(this._scrollMode == value) { + return this._scrollMode; + } + this._scrollMode = value; + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + return this._scrollMode; + } + ,setPadding: function(value) { + this.set_paddingTop(value); + this.set_paddingRight(value); + this.set_paddingBottom(value); + this.set_paddingLeft(value); + } + ,getViewPortVisibleBounds: function(result) { + var viewPortX = this.leftViewPortOffset + this.get_paddingLeft(); + var viewPortY = this.topViewPortOffset + this.get_paddingTop(); + if(result == null) { + result = new openfl_geom_Rectangle(viewPortX,viewPortY,this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight()); + } else { + result.setTo(viewPortX,viewPortY,this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight()); + } + return result; + } + ,dispose: function() { + this.destroyScroller(); + this.destroyScrollBarX(); + this.destroyScrollBarY(); + feathers_core_FeathersControl.prototype.dispose.call(this); + } + ,update: function() { + var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES); + var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE); + var stateInvalid = this.isInvalid(feathers_core_InvalidationFlag.STATE); + var scrollerInvalid = this.isInvalid(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLLER_FACTORY); + var scrollBarFactoryInvalid = this.isInvalid(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLL_BAR_FACTORY); + var oldIgnoreScrollerChanges = this._ignoreScrollerChanges; + this._ignoreScrollerChanges = true; + if(scrollerInvalid) { + this.createScroller(); + } + if(stylesInvalid || stateInvalid) { + this.refreshBackgroundSkin(); + } + if(stylesInvalid) { + this.refreshMaskSkin(); + this.refreshViewPortMaskSkin(); + this.refreshScrollBarsCornerSkin(); + } + if(scrollBarFactoryInvalid) { + this.createScrollBars(); + } + this.refreshEnabled(); + this.refreshScrollerValues(); + this.refreshViewPort(); + this.applyTemporaryScrollPositions(); + this.refreshScrollRect(); + this.refreshScrollBarValues(); + this.layoutChildren(); + this._ignoreScrollerChanges = oldIgnoreScrollerChanges; + } + ,applyTemporaryScrollPositions: function() { + if(this._temporaryScrollX != null) { + this.scroller.set_scrollX(this._temporaryScrollX); + } else if(this._temporaryRestrictedScrollX != null) { + this.scroller.set_restrictedScrollX(this._temporaryRestrictedScrollX); + } + if(this._temporaryScrollY != null) { + this.scroller.set_scrollY(this._temporaryScrollY); + } else if(this._temporaryRestrictedScrollY != null) { + this.scroller.set_restrictedScrollY(this._temporaryRestrictedScrollY); + } + this._temporaryScrollX = null; + this._temporaryScrollY = null; + this._temporaryRestrictedScrollX = null; + this._temporaryRestrictedScrollY = null; + } + ,needsMeasurement: function() { + if(!(this.isInvalid(feathers_core_InvalidationFlag.SCROLL) && this.needsScrollMeasurement() || this.isInvalid(feathers_core_InvalidationFlag.DATA) || this.isInvalid(feathers_core_InvalidationFlag.SIZE) || this.isInvalid(feathers_core_InvalidationFlag.STYLES) || this.isInvalid(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLL_BAR_FACTORY) || this.isInvalid(feathers_core_InvalidationFlag.STATE))) { + return this.isInvalid(feathers_core_InvalidationFlag.LAYOUT); + } else { + return true; + } + } + ,needsScrollMeasurement: function() { + return false; + } + ,createScroller: function() { + this.destroyScroller(); + this.scroller = this._scrollerFactory != null ? this._scrollerFactory() : new feathers_utils_Scroller(); + this.scroller.addEventListener("scroll",$bind(this,this.baseScrollContainer_scroller_scrollHandler)); + this.scroller.addEventListener("scrollStart",$bind(this,this.baseScrollContainer_scroller_scrollStartHandler)); + this.scroller.addEventListener("scrollComplete",$bind(this,this.baseScrollContainer_scroller_scrollCompleteHandler)); + } + ,destroyScroller: function() { + if(this.scroller == null) { + return; + } + this._temporaryScrollX = this.scroller.get_scrollX(); + this._temporaryScrollY = this.scroller.get_scrollY(); + this._temporaryRestrictedScrollX = null; + this._temporaryRestrictedScrollY = null; + this.scroller.set_target(null); + this.scroller.removeEventListener("scroll",$bind(this,this.baseScrollContainer_scroller_scrollHandler)); + this.scroller.removeEventListener("scrollStart",$bind(this,this.baseScrollContainer_scroller_scrollStartHandler)); + this.scroller.removeEventListener("scrollComplete",$bind(this,this.baseScrollContainer_scroller_scrollCompleteHandler)); + this.scroller = null; + this.setInvalidationFlag(feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLLER_FACTORY); + } + ,createScrollBars: function() { + this.createScrollBarX(); + this.createScrollBarY(); + } + ,createScrollBarX: function() { + this.destroyScrollBarX(); + var factory = this._scrollBarXFactory != null ? this._scrollBarXFactory : feathers_controls_supportClasses_BaseScrollContainer.defaultScrollBarXFactory; + this._oldScrollBarXFactory = factory; + this.scrollBarX = factory.create(); + if(this.get_autoHideScrollBars()) { + this.scrollBarX.set_alpha(0.0); + } + this.scrollBarX.addEventListener("change",$bind(this,this.scrollBarX_changeHandler)); + this.scrollBarX.addEventListener("rollOver",$bind(this,this.scrollBarX_rollOverHandler)); + this.scrollBarX.addEventListener("rollOut",$bind(this,this.scrollBarX_rollOutHandler)); + this.scrollBarX.addEventListener("scrollStart",$bind(this,this.scrollBarX_scrollStartHandler)); + this.scrollBarX.addEventListener("scrollComplete",$bind(this,this.scrollBarX_scrollCompleteHandler)); + this.addChild(js_Boot.__cast(this.scrollBarX , openfl_display_DisplayObject)); + } + ,destroyScrollBarX: function() { + if(this.scrollBarX == null) { + return; + } + this.scrollBarX.removeEventListener("change",$bind(this,this.scrollBarX_changeHandler)); + this.scrollBarX.removeEventListener("rollOver",$bind(this,this.scrollBarX_rollOverHandler)); + this.scrollBarX.removeEventListener("rollOut",$bind(this,this.scrollBarX_rollOutHandler)); + this.scrollBarX.removeEventListener("scrollStart",$bind(this,this.scrollBarX_scrollStartHandler)); + this.scrollBarX.removeEventListener("scrollComplete",$bind(this,this.scrollBarX_scrollCompleteHandler)); + this.removeChild(js_Boot.__cast(this.scrollBarX , openfl_display_DisplayObject)); + if(this._oldScrollBarXFactory.destroy != null) { + this._oldScrollBarXFactory.destroy(this.scrollBarX); + } + this._oldScrollBarXFactory = null; + this.scrollBarX = null; + } + ,createScrollBarY: function() { + this.destroyScrollBarY(); + var factory = this._scrollBarYFactory != null ? this._scrollBarYFactory : feathers_controls_supportClasses_BaseScrollContainer.defaultScrollBarYFactory; + this._oldScrollBarYFactory = factory; + this.scrollBarY = factory.create(); + if(this.get_autoHideScrollBars()) { + this.scrollBarY.set_alpha(0.0); + } + this.scrollBarY.addEventListener("change",$bind(this,this.scrollBarY_changeHandler)); + this.scrollBarY.addEventListener("rollOver",$bind(this,this.scrollBarY_rollOverHandler)); + this.scrollBarY.addEventListener("rollOut",$bind(this,this.scrollBarY_rollOutHandler)); + this.scrollBarY.addEventListener("scrollStart",$bind(this,this.scrollBarY_scrollStartHandler)); + this.scrollBarY.addEventListener("scrollComplete",$bind(this,this.scrollBarY_scrollCompleteHandler)); + this.addChild(js_Boot.__cast(this.scrollBarY , openfl_display_DisplayObject)); + } + ,destroyScrollBarY: function() { + if(this.scrollBarY == null) { + return; + } + this.scrollBarY.removeEventListener("change",$bind(this,this.scrollBarY_changeHandler)); + this.scrollBarY.removeEventListener("rollOver",$bind(this,this.scrollBarY_rollOverHandler)); + this.scrollBarY.removeEventListener("rollOut",$bind(this,this.scrollBarY_rollOutHandler)); + this.scrollBarY.removeEventListener("scrollStart",$bind(this,this.scrollBarY_scrollStartHandler)); + this.scrollBarY.removeEventListener("scrollComplete",$bind(this,this.scrollBarY_scrollCompleteHandler)); + this.removeChild(js_Boot.__cast(this.scrollBarY , openfl_display_DisplayObject)); + if(this._oldScrollBarYFactory.destroy != null) { + this._oldScrollBarYFactory.destroy(this.scrollBarY); + } + this._oldScrollBarYFactory = null; + this.scrollBarY = null; + } + ,refreshEnabled: function() { + this._viewPort.set_enabled(this._enabled); + if(this.scrollBarX != null) { + this.scrollBarX.set_enabled(this._enabled); + } + if(this.scrollBarY != null) { + this.scrollBarY.set_enabled(this._enabled); + } + } + ,restrictScrollAfterRefreshViewPort: function() { + if(this.scroller.get_scrolling()) { + return; + } + var currentScrollX = this.scroller.get_scrollX(); + var currentScrollY = this.scroller.get_scrollY(); + if(this._prevMinScrollX != this.scroller.get_minScrollX() && currentScrollX < this.scroller.get_minScrollX()) { + this.scroller.set_restrictedScrollX(currentScrollX); + } else if(this._prevMaxScrollX != this.scroller.get_maxScrollX() && currentScrollX > this.scroller.get_maxScrollX()) { + this.scroller.set_restrictedScrollX(currentScrollX); + } + if(this._prevMinScrollY != this.scroller.get_minScrollY() && currentScrollY < this.scroller.get_minScrollY()) { + this.scroller.set_restrictedScrollY(currentScrollY); + } else if(this._prevMaxScrollY != this.scroller.get_maxScrollY() && currentScrollY > this.scroller.get_maxScrollY()) { + this.scroller.set_restrictedScrollY(currentScrollY); + } + if(currentScrollX != this.scroller.get_scrollX() || currentScrollY != this.scroller.get_scrollY()) { + feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY()); + } + } + ,refreshViewPort: function() { + if(js_Boot.__implements(this.scrollBarX,feathers_core_IValidating)) { + this.scrollBarX.validateNow(); + } + if(js_Boot.__implements(this.scrollBarY,feathers_core_IValidating)) { + this.scrollBarY.validateNow(); + } + this._viewPort.set_scrollX(this.get_scrollX()); + this._viewPort.set_scrollY(this.get_scrollY()); + this._prevMinScrollX = this.scroller.get_minScrollX(); + this._prevMaxScrollX = this.scroller.get_maxScrollX(); + this._prevMinScrollY = this.scroller.get_minScrollY(); + this._prevMaxScrollY = this.scroller.get_maxScrollY(); + if(!this.needsMeasurement()) { + this._viewPort.validateNow(); + var oldSettingScrollerDimensions = this._settingScrollerDimensions; + this._settingScrollerDimensions = true; + this.scroller.setDimensions(this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight(),this._viewPort.get_width(),this._viewPort.get_height()); + this._settingScrollerDimensions = oldSettingScrollerDimensions; + this.restrictScrollAfterRefreshViewPort(); + return; + } + this.resetViewPortOffsets(); + this.calculateViewPortOffsets(false,false); + this.refreshViewPortBoundsForMeasurement(); + if(this.get_scrollPolicyX() == feathers_controls_ScrollPolicy.AUTO) { + var oldShowScrollBarX = this.showScrollBarX; + this.calculateViewPortOffsetsForFixedScrollBarX(false); + if(this.get_fixedScrollBars() && this.showScrollBarX != oldShowScrollBarX) { + this.refreshViewPortBoundsForMeasurement(); + } + } + if(this.get_scrollPolicyY() == feathers_controls_ScrollPolicy.AUTO) { + var oldShowScrollBarY = this.showScrollBarY; + this.calculateViewPortOffsetsForFixedScrollBarY(false); + if(this.get_fixedScrollBars() && this.showScrollBarY != oldShowScrollBarY) { + this.refreshViewPortBoundsForMeasurement(); + } + } + if(this.get_fixedScrollBars() && !this.showScrollBarX && this.showScrollBarY && this.get_scrollPolicyX() == feathers_controls_ScrollPolicy.AUTO && this.get_scrollPolicyY() == feathers_controls_ScrollPolicy.AUTO) { + var oldShowScrollBarX = this.showScrollBarX; + this.calculateViewPortOffsetsForFixedScrollBarX(false); + if(this.showScrollBarX != oldShowScrollBarX) { + this.refreshViewPortBoundsForMeasurement(); + } + } + var oldSettingScrollerDimensions = this._settingScrollerDimensions; + this._settingScrollerDimensions = true; + this.scroller.setDimensions(this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight(),this._viewPort.get_width(),this._viewPort.get_height()); + this._settingScrollerDimensions = oldSettingScrollerDimensions; + this.measure(); + this.resetViewPortOffsets(); + this.calculateViewPortOffsets(false,true); + this.refreshViewPortBoundsForLayout(); + if(this.get_scrollPolicyX() == feathers_controls_ScrollPolicy.AUTO) { + var oldShowScrollBarX = this.showScrollBarX; + this.calculateViewPortOffsetsForFixedScrollBarX(true); + if(this.get_fixedScrollBars() && this.showScrollBarX != oldShowScrollBarX) { + this.refreshViewPortBoundsForLayout(); + } + } + if(this.get_scrollPolicyY() == feathers_controls_ScrollPolicy.AUTO) { + var oldShowScrollBarY = this.showScrollBarY; + this.calculateViewPortOffsetsForFixedScrollBarY(true); + if(this.get_fixedScrollBars() && this.showScrollBarY != oldShowScrollBarY) { + this.refreshViewPortBoundsForLayout(); + } + } + if(this.get_fixedScrollBars() && !this.showScrollBarX && this.showScrollBarY && this.get_scrollPolicyX() == feathers_controls_ScrollPolicy.AUTO && this.get_scrollPolicyY() == feathers_controls_ScrollPolicy.AUTO) { + var oldShowScrollBarX = this.showScrollBarX; + this.calculateViewPortOffsetsForFixedScrollBarX(true); + if(this.showScrollBarX != oldShowScrollBarX) { + this.refreshViewPortBoundsForLayout(); + } + } + var oldSettingScrollerDimensions = this._settingScrollerDimensions; + this._settingScrollerDimensions = true; + this.scroller.setDimensions(this._viewPort.get_visibleWidth(),this._viewPort.get_visibleHeight(),this._viewPort.get_width(),this._viewPort.get_height()); + this._settingScrollerDimensions = oldSettingScrollerDimensions; + this.restrictScrollAfterRefreshViewPort(); + } + ,resetViewPortOffsets: function() { + this.showScrollBarX = this.get_showScrollBars() && (this._scrollPolicyX == feathers_controls_ScrollPolicy.ON || this._scrollPolicyX == feathers_controls_ScrollPolicy.AUTO && this.scroller.get_minScrollX() != this.scroller.get_maxScrollX()); + this.showScrollBarY = this.get_showScrollBars() && (this._scrollPolicyX == feathers_controls_ScrollPolicy.ON || this._scrollPolicyY == feathers_controls_ScrollPolicy.AUTO && this.scroller.get_minScrollY() != this.scroller.get_maxScrollY()); + this.topViewPortOffset = this.get_fixedScrollBars() && this.showScrollBarX && this.get_scrollBarXPosition() == feathers_layout_RelativePosition.TOP ? this.scrollBarX.get_height() : 0.0; + this.bottomViewPortOffset = this.get_fixedScrollBars() && this.showScrollBarX && this.get_scrollBarXPosition() == feathers_layout_RelativePosition.BOTTOM ? this.scrollBarX.get_height() : 0.0; + this.leftViewPortOffset = this.get_fixedScrollBars() && this.showScrollBarY && this.get_scrollBarYPosition() == feathers_layout_RelativePosition.LEFT ? this.scrollBarY.get_width() : 0.0; + this.rightViewPortOffset = this.get_fixedScrollBars() && this.showScrollBarY && this.get_scrollBarYPosition() == feathers_layout_RelativePosition.RIGHT ? this.scrollBarY.get_width() : 0.0; + this.chromeMeasuredWidth = 0.0; + this.chromeMeasuredMinWidth = 0.0; + this.chromeMeasuredMaxWidth = 1.0 / 0.0; + this.chromeMeasuredHeight = 0.0; + this.chromeMeasuredMinHeight = 0.0; + this.chromeMeasuredMaxHeight = 1.0 / 0.0; + } + ,calculateViewPortOffsets: function(forceScrollBars,useActualBounds) { + } + ,calculateViewPortOffsetsForFixedScrollBarX: function(useActualBounds) { + if(this.scrollBarX == null) { + return; + } + var newShowScrollBarX = false; + if(this.get_showScrollBars() && this.get_scrollPolicyX() != feathers_controls_ScrollPolicy.OFF) { + newShowScrollBarX = this.get_scrollPolicyX() == feathers_controls_ScrollPolicy.ON; + if(!newShowScrollBarX && this.get_scrollPolicyX() == feathers_controls_ScrollPolicy.AUTO) { + var availableWidth = useActualBounds ? this.actualWidth : this.get_explicitWidth(); + if(availableWidth != null) { + availableWidth -= this.get_paddingLeft() + this.get_paddingRight() + this.leftViewPortOffset + this.rightViewPortOffset; + if(availableWidth < 0.0) { + availableWidth = 0.0; + } + } + if(availableWidth == null && !useActualBounds) { + availableWidth = this._viewPort.get_visibleWidth(); + } + var totalContentWidth = this._viewPort.get_width(); + newShowScrollBarX = availableWidth != null && totalContentWidth > availableWidth && !feathers_utils_MathUtil.fuzzyEquals(totalContentWidth,availableWidth); + if(!newShowScrollBarX) { + var maxAvailableWidth = this.get_explicitMaxWidth(); + if(maxAvailableWidth != null) { + maxAvailableWidth -= this.get_paddingLeft() + this.get_paddingRight() + this.leftViewPortOffset + this.rightViewPortOffset; + if(maxAvailableWidth < 0.0) { + maxAvailableWidth = 0.0; + } + } + newShowScrollBarX = maxAvailableWidth != null && totalContentWidth > maxAvailableWidth && !feathers_utils_MathUtil.fuzzyEquals(totalContentWidth,maxAvailableWidth); + } + } + } + if(this.showScrollBarX == newShowScrollBarX) { + return; + } + this.showScrollBarX = newShowScrollBarX; + if(!this.get_fixedScrollBars()) { + return; + } + var offset = this.scrollBarX.get_height(); + if(!this.showScrollBarX) { + offset = -offset; + } + if(this.get_scrollBarXPosition() == feathers_layout_RelativePosition.TOP) { + this.topViewPortOffset += offset; + } else { + this.bottomViewPortOffset += offset; + } + } + ,calculateViewPortOffsetsForFixedScrollBarY: function(useActualBounds) { + if(this.scrollBarY == null) { + return; + } + var newShowScrollBarY = false; + if(this.get_showScrollBars() && this.get_scrollPolicyY() != feathers_controls_ScrollPolicy.OFF) { + newShowScrollBarY = this.get_scrollPolicyY() == feathers_controls_ScrollPolicy.ON; + if(!newShowScrollBarY && this.get_scrollPolicyY() == feathers_controls_ScrollPolicy.AUTO) { + var availableHeight = useActualBounds ? this.actualHeight : this.get_explicitHeight(); + if(availableHeight != null) { + availableHeight -= this.get_paddingTop() + this.get_paddingBottom() + this.topViewPortOffset + this.bottomViewPortOffset; + if(availableHeight < 0.0) { + availableHeight = 0.0; + } + } + if(availableHeight == null && !useActualBounds) { + availableHeight = this._viewPort.get_visibleHeight(); + } + var totalContentHeight = this._viewPort.get_height(); + newShowScrollBarY = availableHeight != null && totalContentHeight > availableHeight && !feathers_utils_MathUtil.fuzzyEquals(totalContentHeight,availableHeight); + if(!newShowScrollBarY) { + var maxAvailableHeight = this.get_explicitMaxHeight(); + if(maxAvailableHeight != null) { + maxAvailableHeight -= this.get_paddingTop() + this.get_paddingBottom() + this.topViewPortOffset + this.bottomViewPortOffset; + if(maxAvailableHeight < 0.0) { + maxAvailableHeight = 0.0; + } + } + newShowScrollBarY = maxAvailableHeight != null && totalContentHeight > maxAvailableHeight && !feathers_utils_MathUtil.fuzzyEquals(totalContentHeight,maxAvailableHeight); + } + } + } + if(this.showScrollBarY == newShowScrollBarY) { + return; + } + this.showScrollBarY = newShowScrollBarY; + if(!this.get_fixedScrollBars()) { + return; + } + var offset = this.scrollBarY.get_width(); + if(!this.showScrollBarY) { + offset = -offset; + } + if(this.get_scrollBarYPosition() == feathers_layout_RelativePosition.LEFT) { + this.leftViewPortOffset += offset; + } else { + this.rightViewPortOffset += offset; + } + } + ,refreshViewPortBoundsForMeasurement: function() { + var oldIgnoreViewPortResizing = this._ignoreViewPortResizing; + this._ignoreViewPortResizing = true; + var viewPortX = this.get_paddingLeft() + this.leftViewPortOffset; + var viewPortY = this.get_paddingTop() + this.topViewPortOffset; + if(this._scrollMode == feathers_controls_ScrollMode.MASK || this._scrollMode == feathers_controls_ScrollMode.MASKLESS || this._currentViewPortMaskSkin != null) { + viewPortX -= this.get_scrollX(); + viewPortY -= this.get_scrollY(); + } + this._viewPort.set_x(viewPortX); + this._viewPort.set_y(viewPortY); + if(this.get_explicitWidth() != null) { + var visibleWidth = this.get_explicitWidth() - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight(); + if(visibleWidth < 0.0) { + visibleWidth = 0.0; + } + this._viewPort.set_visibleWidth(visibleWidth); + } else { + this._viewPort.set_visibleWidth(null); + } + if(this.get_explicitHeight() != null) { + var visibleHeight = this.get_explicitHeight() - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom(); + if(visibleHeight < 0.0) { + visibleHeight = 0.0; + } + this._viewPort.set_visibleHeight(visibleHeight); + } else { + this._viewPort.set_visibleHeight(null); + } + if(this.get_explicitMinWidth() != null) { + var minVisibleWidth = this.get_explicitMinWidth() - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight(); + if(minVisibleWidth < 0.0) { + minVisibleWidth = 0.0; + } + this._viewPort.set_minVisibleWidth(minVisibleWidth); + } else { + this._viewPort.set_minVisibleWidth(null); + } + if(this.get_explicitMinHeight() != null) { + var minVisibleHeight = this.get_explicitMinHeight() - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom(); + if(minVisibleHeight < 0.0) { + minVisibleHeight = 0.0; + } + this._viewPort.set_minVisibleHeight(minVisibleHeight); + } else { + this._viewPort.set_minVisibleHeight(null); + } + if(this.get_explicitMaxWidth() != null) { + var maxVisibleWidth = this.get_explicitMaxWidth() - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight(); + if(maxVisibleWidth < 0.0) { + maxVisibleWidth = 0.0; + } + this._viewPort.set_maxVisibleWidth(maxVisibleWidth); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) { + var maxVisibleWidth = this._backgroundSkinMeasurements.maxWidth - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight(); + if(maxVisibleWidth < 0.0) { + maxVisibleWidth = 0.0; + } + this._viewPort.set_maxVisibleWidth(maxVisibleWidth); + } else { + this._viewPort.set_maxVisibleWidth(1.0 / 0.0); + } + if(this.get_explicitMaxHeight() != null) { + var maxVisibleHeight = this.get_explicitMaxHeight() - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom(); + if(maxVisibleHeight < 0.0) { + maxVisibleHeight = 0.0; + } + this._viewPort.set_maxVisibleHeight(maxVisibleHeight); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) { + var maxVisibleHeight = this._backgroundSkinMeasurements.maxHeight - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom(); + if(maxVisibleHeight < 0.0) { + maxVisibleHeight = 0.0; + } + this._viewPort.set_maxVisibleHeight(maxVisibleHeight); + } else { + this._viewPort.set_maxVisibleHeight(1.0 / 0.0); + } + this._viewPort.validateNow(); + this._ignoreViewPortResizing = oldIgnoreViewPortResizing; + } + ,refreshViewPortBoundsForLayout: function() { + var oldIgnoreViewPortResizing = this._ignoreViewPortResizing; + this._ignoreViewPortResizing = true; + var visibleWidth = this.actualWidth - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight(); + if(visibleWidth < 0.0) { + visibleWidth = 0.0; + } + var visibleHeight = this.actualHeight - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom(); + if(visibleHeight < 0.0) { + visibleHeight = 0.0; + } + var minVisibleWidth = this.actualMinWidth - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight(); + if(minVisibleWidth < 0.0) { + minVisibleWidth = 0.0; + } + var minVisibleHeight = this.actualMinHeight - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom(); + if(minVisibleHeight < 0.0) { + minVisibleHeight = 0.0; + } + var maxVisibleWidth = this.actualMaxWidth - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight(); + if(maxVisibleWidth < 0.0) { + maxVisibleWidth = 0.0; + } + var maxVisibleHeight = this.actualMaxHeight - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom(); + if(maxVisibleHeight < 0.0) { + maxVisibleHeight = 0.0; + } + var viewPortX = this.get_paddingLeft() + this.leftViewPortOffset; + var viewPortY = this.get_paddingTop() + this.topViewPortOffset; + if(this._scrollMode == feathers_controls_ScrollMode.MASK || this._scrollMode == feathers_controls_ScrollMode.MASKLESS || this._currentViewPortMaskSkin != null) { + viewPortX -= this.get_scrollX(); + viewPortY -= this.get_scrollY(); + } + this._viewPort.set_x(viewPortX); + this._viewPort.set_y(viewPortY); + this._viewPort.set_visibleWidth(visibleWidth); + this._viewPort.set_visibleHeight(visibleHeight); + this._viewPort.set_minVisibleWidth(minVisibleWidth); + this._viewPort.set_minVisibleHeight(minVisibleHeight); + this._viewPort.set_maxVisibleWidth(maxVisibleWidth); + this._viewPort.set_maxVisibleHeight(maxVisibleHeight); + this._viewPort.validateNow(); + this._ignoreViewPortResizing = oldIgnoreViewPortResizing; + } + ,refreshScrollerValues: function() { + if(this.stage != null) { + this.scroller.set_target(js_Boot.__cast(this._viewPort , openfl_display_InteractiveObject)); + } + this.scroller.enabledX = this._enabled && this._scrollPolicyX != feathers_controls_ScrollPolicy.OFF; + this.scroller.enabledY = this._enabled && this._scrollPolicyY != feathers_controls_ScrollPolicy.OFF; + } + ,refreshScrollBarValues: function() { + if(this.scrollBarX != null) { + var oldIgnoreScrollBarXChange = this._ignoreScrollBarXChange; + this._ignoreScrollBarXChange = true; + this.scrollBarX.set_minimum(this.scroller.get_minScrollX()); + this.scrollBarX.set_maximum(this.scroller.get_maxScrollX()); + this.scrollBarX.set_value(this.scroller.get_scrollX()); + this.scrollBarX.set_page((this.scroller.get_maxScrollX() - this.scroller.get_minScrollX()) * this._viewPort.get_visibleWidth() / this._viewPort.get_width()); + this.scrollBarX.set_step(this._scrollStepX); + var displayScrollBarX = js_Boot.__cast(this.scrollBarX , openfl_display_DisplayObjectContainer); + displayScrollBarX.set_visible(this.showScrollBarX); + if(this.get_fixedScrollBars() || !this.get_autoHideScrollBars()) { + this.scrollBarX.set_alpha(1.0); + } + this._ignoreScrollBarXChange = oldIgnoreScrollBarXChange; + } + if(this.scrollBarY != null) { + var oldIgnoreScrollBarYChange = this._ignoreScrollBarYChange; + this._ignoreScrollBarYChange = true; + this.scrollBarY.set_minimum(this.scroller.get_minScrollY()); + this.scrollBarY.set_maximum(this.scroller.get_maxScrollY()); + this.scrollBarY.set_value(this.scroller.get_scrollY()); + this.scrollBarY.set_page((this.scroller.get_maxScrollY() - this.scroller.get_minScrollY()) * this._viewPort.get_visibleHeight() / this._viewPort.get_height()); + this.scrollBarY.set_step(this._scrollStepY); + var displayScrollBarY = js_Boot.__cast(this.scrollBarY , openfl_display_DisplayObjectContainer); + displayScrollBarY.set_visible(this.showScrollBarY); + if(this.get_fixedScrollBars() || !this.get_autoHideScrollBars()) { + this.scrollBarY.set_alpha(1.0); + } + this._ignoreScrollBarYChange = oldIgnoreScrollBarYChange; + } + } + ,measure: function() { + var needsWidth = this.get_explicitWidth() == null; + var needsHeight = this.get_explicitHeight() == null; + var needsMinWidth = this.get_explicitMinWidth() == null; + var needsMinHeight = this.get_explicitMinHeight() == null; + var needsMaxWidth = this.get_explicitMaxWidth() == null; + var needsMaxHeight = this.get_explicitMaxHeight() == null; + if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) { + return false; + } + if(this._currentBackgroundSkin != null) { + feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this); + } + var measureSkin = null; + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IMeasureObject)) { + measureSkin = this._currentBackgroundSkin; + } + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) { + this._currentBackgroundSkin.validateNow(); + } + var newWidth = this.get_explicitWidth(); + if(needsWidth) { + if(this.get_measureViewPort()) { + newWidth = this._viewPort.get_visibleWidth(); + } else { + newWidth = 0.0; + } + newWidth += this.leftViewPortOffset + this.rightViewPortOffset; + newWidth = Math.max(newWidth,this.chromeMeasuredWidth); + newWidth += this.get_paddingLeft() + this.get_paddingRight(); + if(this._currentBackgroundSkin != null) { + newWidth = Math.max(newWidth,this._currentBackgroundSkin.get_width()); + } + } + var newHeight = this.get_explicitHeight(); + if(needsHeight) { + if(this.get_measureViewPort()) { + newHeight = this._viewPort.get_visibleHeight(); + } else { + newHeight = 0.0; + } + newHeight += this.topViewPortOffset + this.bottomViewPortOffset; + newHeight = Math.max(newHeight,this.chromeMeasuredHeight); + newHeight += this.get_paddingTop() + this.get_paddingBottom(); + if(this._currentBackgroundSkin != null) { + newHeight = Math.max(newHeight,this._currentBackgroundSkin.get_height()); + } + } + var newMinWidth = this.get_explicitMinWidth(); + if(needsMinWidth) { + if(this.get_measureViewPort()) { + newMinWidth = this._viewPort.get_minVisibleWidth(); + } else { + newMinWidth = 0.0; + } + newMinWidth += this.leftViewPortOffset + this.rightViewPortOffset; + newMinWidth = Math.max(newMinWidth,this.chromeMeasuredMinWidth); + newMinWidth += this.get_paddingLeft() + this.get_paddingRight(); + if(measureSkin != null) { + newMinWidth = Math.max(newMinWidth,measureSkin.get_minWidth()); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minWidth != null) { + newMinWidth = Math.max(newMinWidth,this._backgroundSkinMeasurements.minWidth); + } + } + var newMinHeight = this.get_explicitMinHeight(); + if(needsMinHeight) { + if(this.get_measureViewPort()) { + newMinHeight = this._viewPort.get_minVisibleHeight(); + } else { + newMinHeight = 0.0; + } + newMinHeight += this.topViewPortOffset + this.bottomViewPortOffset; + newMinHeight = Math.max(newMinHeight,this.chromeMeasuredMinHeight); + newMinHeight += this.get_paddingTop() + this.get_paddingBottom(); + if(measureSkin != null) { + newMinHeight = Math.max(newMinHeight,measureSkin.get_minHeight()); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.minHeight != null) { + newMinHeight = Math.max(newMinHeight,this._backgroundSkinMeasurements.minHeight); + } + } + var newMaxWidth = this.get_explicitMaxWidth(); + if(needsMaxWidth) { + if(this.get_measureViewPort()) { + newMaxWidth = this._viewPort.get_maxVisibleWidth(); + } else { + newMaxWidth = 1.0 / 0.0; + } + newMaxWidth += this.leftViewPortOffset + this.rightViewPortOffset; + newMaxWidth = Math.min(newMaxWidth,this.chromeMeasuredMaxWidth); + newMaxWidth += this.get_paddingLeft() + this.get_paddingRight(); + if(measureSkin != null) { + newMaxWidth = Math.min(newMaxWidth,measureSkin.get_maxWidth()); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxWidth != null) { + newMaxWidth = Math.min(newMaxWidth,this._backgroundSkinMeasurements.maxWidth); + } + } + var newMaxHeight = this.get_explicitMaxHeight(); + if(needsMaxHeight) { + if(this.get_measureViewPort()) { + newMaxHeight = this._viewPort.get_maxVisibleHeight(); + } else { + newMaxHeight = 1.0 / 0.0; + } + newMaxHeight += this.topViewPortOffset + this.bottomViewPortOffset; + newMaxHeight = Math.min(newMaxHeight,this.chromeMeasuredMaxHeight); + newMaxHeight += this.get_paddingTop() + this.get_paddingBottom(); + if(measureSkin != null) { + newMaxHeight = Math.min(newMaxHeight,measureSkin.get_maxHeight()); + } else if(this._backgroundSkinMeasurements != null && this._backgroundSkinMeasurements.maxHeight != null) { + newMaxHeight = Math.min(newMaxHeight,this._backgroundSkinMeasurements.maxHeight); + } + } + return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight); + } + ,refreshBackgroundSkin: function() { + var oldSkin = this._currentBackgroundSkin; + this._currentBackgroundSkin = this.getCurrentBackgroundSkin(); + if(this._currentBackgroundSkin == oldSkin) { + return; + } + this.removeCurrentBackgroundSkin(oldSkin); + this.addCurrentBackgroundSkin(this._currentBackgroundSkin); + } + ,getCurrentBackgroundSkin: function() { + if(!this._enabled && this.get_disabledBackgroundSkin() != null) { + return this.get_disabledBackgroundSkin(); + } + return this.get_backgroundSkin(); + } + ,addCurrentBackgroundSkin: function(skin) { + if(skin == null) { + this._backgroundSkinMeasurements = null; + return; + } + if(js_Boot.__implements(skin,feathers_core_IUIControl)) { + skin.initializeNow(); + } + if(this._backgroundSkinMeasurements == null) { + this._backgroundSkinMeasurements = new feathers_layout_Measurements(skin); + } else { + this._backgroundSkinMeasurements.save(skin); + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(this); + } + this.addChildAt(skin,0); + } + ,removeCurrentBackgroundSkin: function(skin) { + if(skin == null) { + return; + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(null); + } + this._backgroundSkinMeasurements.restore(skin); + if(skin.parent == this) { + this.removeChild(skin); + } + } + ,refreshMaskSkin: function() { + var oldSkin = this._currentMaskSkin; + this._currentMaskSkin = this.getCurrentMaskSkin(); + if(this._currentMaskSkin == oldSkin) { + return; + } + this.removeCurrentMaskSkin(oldSkin); + this.addCurrentMaskSkin(this._currentMaskSkin); + } + ,getCurrentMaskSkin: function() { + return this.get_maskSkin(); + } + ,addCurrentMaskSkin: function(skin) { + if(skin == null) { + return; + } + if(js_Boot.__implements(skin,feathers_core_IUIControl)) { + skin.initializeNow(); + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(this); + } + this.addChild(skin); + this.set_mask(skin); + } + ,removeCurrentMaskSkin: function(skin) { + if(skin == null) { + return; + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(null); + } + if(skin.parent == this) { + this.removeChild(skin); + } + this.set_mask(null); + } + ,refreshViewPortMaskSkin: function() { + var oldSkin = this._currentViewPortMaskSkin; + this._currentViewPortMaskSkin = this.getCurrentViewPortMaskSkin(); + if(this._currentViewPortMaskSkin == oldSkin) { + return; + } + this.removeCurrentViewPortMaskSkin(oldSkin); + this.addCurrentViewPortMaskSkin(this._currentViewPortMaskSkin); + } + ,getCurrentViewPortMaskSkin: function() { + if(this.get_viewPortMaskSkin() != null) { + return this.get_viewPortMaskSkin(); + } + if(this._scrollMode == feathers_controls_ScrollMode.MASK) { + if(this._fallbackViewPortMaskSkin == null) { + this._fallbackViewPortMaskSkin = new feathers_skins_RectangleSkin(feathers_graphics_FillStyle.SolidColor(16711935)); + } + return this._fallbackViewPortMaskSkin; + } + return null; + } + ,addCurrentViewPortMaskSkin: function(skin) { + if(skin == null) { + return; + } + if(js_Boot.__implements(skin,feathers_core_IUIControl)) { + skin.initializeNow(); + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(this); + } + this.addChild(skin); + (js_Boot.__cast(this._viewPort , openfl_display_DisplayObject)).set_mask(skin); + } + ,removeCurrentViewPortMaskSkin: function(skin) { + if(skin == null) { + return; + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(null); + } + if(skin.parent == this) { + this.removeChild(skin); + } + (js_Boot.__cast(this._viewPort , openfl_display_DisplayObject)).set_mask(null); + } + ,refreshScrollBarsCornerSkin: function() { + var oldSkin = this._currentScrollBarsCornerSkin; + this._currentScrollBarsCornerSkin = this.getCurrentScrollBarsCornerSkin(); + if(this._currentScrollBarsCornerSkin == oldSkin) { + return; + } + this.removeCurrentScrollBarsCornerSkin(oldSkin); + this.addCurrentScrollBarsCornerSkin(this._currentScrollBarsCornerSkin); + } + ,getCurrentScrollBarsCornerSkin: function() { + return this.get_scrollBarsCornerSkin(); + } + ,addCurrentScrollBarsCornerSkin: function(skin) { + if(skin == null) { + return; + } + if(js_Boot.__implements(skin,feathers_core_IUIControl)) { + skin.initializeNow(); + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(this); + } + this.addChild(skin); + } + ,removeCurrentScrollBarsCornerSkin: function(skin) { + if(skin == null) { + return; + } + if(js_Boot.__implements(skin,feathers_skins_IProgrammaticSkin)) { + skin.set_uiContext(null); + } + if(skin.parent == this) { + this.removeChild(skin); + } + } + ,layoutChildren: function() { + this.layoutBackgroundSkin(); + this.layoutMaskSkin(); + this.layoutViewPortMaskSkin(); + this.layoutScrollBars(); + } + ,layoutBackgroundSkin: function() { + if(this._currentBackgroundSkin == null) { + return; + } + this._currentBackgroundSkin.set_x(0.0); + this._currentBackgroundSkin.set_y(0.0); + if(this._currentBackgroundSkin.get_width() != this.actualWidth) { + this._currentBackgroundSkin.set_width(this.actualWidth); + } + if(this._currentBackgroundSkin.get_height() != this.actualHeight) { + this._currentBackgroundSkin.set_height(this.actualHeight); + } + if(js_Boot.__implements(this._currentBackgroundSkin,feathers_core_IValidating)) { + this._currentBackgroundSkin.validateNow(); + } + } + ,layoutMaskSkin: function() { + if(this._currentMaskSkin == null) { + return; + } + this._currentMaskSkin.set_x(0.0); + this._currentMaskSkin.set_y(0.0); + this._currentMaskSkin.set_width(this.actualWidth); + this._currentMaskSkin.set_height(this.actualHeight); + if(js_Boot.__implements(this._currentMaskSkin,feathers_core_IValidating)) { + this._currentMaskSkin.validateNow(); + } + } + ,layoutViewPortMaskSkin: function() { + if(this._currentViewPortMaskSkin == null) { + return; + } + var maskX = this.get_paddingLeft() + this.leftViewPortOffset; + var maskY = this.get_paddingTop() + this.topViewPortOffset; + var maskWidth = this._viewPort.get_visibleWidth(); + var maskHeight = this._viewPort.get_visibleHeight(); + if(this.get_fixedScrollBars() && this.scrollBarY.get_visible()) { + maskWidth += this.scrollBarY.get_width(); + if(this.get_scrollBarYPosition() == feathers_layout_RelativePosition.LEFT) { + maskX -= this.scrollBarY.get_width(); + } + } + if(this.get_fixedScrollBars() && this.scrollBarX.get_visible()) { + maskHeight += this.scrollBarX.get_height(); + if(this.get_scrollBarXPosition() == feathers_layout_RelativePosition.TOP) { + maskX -= this.scrollBarX.get_height(); + } + } + this._currentViewPortMaskSkin.set_x(maskX); + this._currentViewPortMaskSkin.set_y(maskY); + this._currentViewPortMaskSkin.set_width(maskWidth); + this._currentViewPortMaskSkin.set_height(maskHeight); + if(js_Boot.__implements(this._currentViewPortMaskSkin,feathers_core_IValidating)) { + this._currentViewPortMaskSkin.validateNow(); + } + } + ,layoutScrollBars: function() { + var visibleWidth = this.actualWidth - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight(); + if(visibleWidth < 0.0) { + visibleWidth = 0.0; + } + var visibleHeight = this.actualHeight - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom(); + if(visibleHeight < 0.0) { + visibleHeight = 0.0; + } + if(this.scrollBarX != null && js_Boot.__implements(this.scrollBarX,feathers_core_IValidating)) { + this.scrollBarX.validateNow(); + } + if(this.scrollBarY != null && js_Boot.__implements(this.scrollBarY,feathers_core_IValidating)) { + this.scrollBarY.validateNow(); + } + if(this.scrollBarX != null) { + if(this.get_scrollBarXPosition()._hx_index == 0) { + this.scrollBarX.set_y(this.get_paddingTop()); + } else { + this.scrollBarX.set_y(this.get_paddingTop() + this.topViewPortOffset + visibleHeight); + } + this.scrollBarX.set_x(this.get_paddingLeft() + this.leftViewPortOffset); + if(!this.get_fixedScrollBars()) { + var fh = this.scrollBarX; + fh.set_y(fh.get_y() - this.scrollBarX.get_height()); + if((this.showScrollBarY || this._hideScrollBarY != null) && this.scrollBarY != null) { + var scrollBarXWidth = visibleWidth - this.scrollBarY.get_width(); + if(scrollBarXWidth < 0.0) { + scrollBarXWidth = 0.0; + } + this.scrollBarX.set_width(scrollBarXWidth); + } else { + this.scrollBarX.set_width(visibleWidth); + } + } else { + this.scrollBarX.set_width(visibleWidth); + } + } + if(this.scrollBarY != null) { + if(this.get_scrollBarYPosition()._hx_index == 3) { + this.scrollBarY.set_x(this.get_paddingLeft()); + } else { + this.scrollBarY.set_x(this.get_paddingLeft() + this.leftViewPortOffset + visibleWidth); + } + this.scrollBarY.set_y(this.get_paddingTop() + this.topViewPortOffset); + if(!this.get_fixedScrollBars()) { + var fh = this.scrollBarY; + fh.set_x(fh.get_x() - this.scrollBarY.get_width()); + if((this.showScrollBarX || this._hideScrollBarX != null) && this.scrollBarX != null) { + var scrollBarYHeight = visibleHeight - this.scrollBarX.get_height(); + if(scrollBarYHeight < 0.0) { + scrollBarYHeight = 0.0; + } + this.scrollBarY.set_height(scrollBarYHeight); + } else { + this.scrollBarY.set_height(visibleHeight); + } + } else { + this.scrollBarY.set_height(visibleHeight); + } + } + if(this._currentScrollBarsCornerSkin != null) { + if(this.get_fixedScrollBars() && this.scrollBarX != null && this.scrollBarY != null && this.scrollBarX.get_visible() && this.scrollBarY.get_visible()) { + this._currentScrollBarsCornerSkin.set_x(this.scrollBarY.get_x()); + this._currentScrollBarsCornerSkin.set_width(this.scrollBarY.get_width()); + this._currentScrollBarsCornerSkin.set_y(this.scrollBarX.get_y()); + this._currentScrollBarsCornerSkin.set_height(this.scrollBarX.get_height()); + this._currentScrollBarsCornerSkin.set_visible(true); + } else { + this._currentScrollBarsCornerSkin.set_visible(false); + } + } + } + ,refreshScrollRect: function() { + var scrollX = this.scroller.get_scrollX(); + var scrollY = this.scroller.get_scrollY(); + if(this.get_scrollPixelSnapping()) { + var scaleFactorX = feathers_utils_DisplayUtil.getConcatenatedScaleX(this); + var scaleFactorY = feathers_utils_DisplayUtil.getConcatenatedScaleY(this); + scrollX = Math.round(scrollX / scaleFactorX) * scaleFactorX; + scrollY = Math.round(scrollY / scaleFactorY) * scaleFactorY; + } + if(this._scrollMode == feathers_controls_ScrollMode.MASK || this._scrollMode == feathers_controls_ScrollMode.MASKLESS || this._currentViewPortMaskSkin != null) { + var displayViewPort = js_Boot.__cast(this._viewPort , openfl_display_DisplayObject); + displayViewPort.set_scrollRect(null); + this._viewPort.set_x(this.get_paddingLeft() + this.leftViewPortOffset - scrollX); + this._viewPort.set_y(this.get_paddingTop() + this.topViewPortOffset - scrollY); + } else if(this._scrollMode == feathers_controls_ScrollMode.SCROLL_RECT) { + var scrollRect = this._scrollRect1; + if(this._currentScrollRect == scrollRect) { + scrollRect = this._scrollRect2; + } + this._currentScrollRect = scrollRect; + var scrollRectWidth = this.actualWidth - this.leftViewPortOffset - this.rightViewPortOffset - this.get_paddingLeft() - this.get_paddingRight(); + if(scrollRectWidth < 0.0) { + scrollRectWidth = 0.0; + } + var scrollRectHeight = this.actualHeight - this.topViewPortOffset - this.bottomViewPortOffset - this.get_paddingTop() - this.get_paddingBottom(); + if(scrollRectHeight < 0.0) { + scrollRectHeight = 0.0; + } + scrollRect.setTo(scrollX,scrollY,scrollRectWidth,scrollRectHeight); + var displayViewPort = js_Boot.__cast(this._viewPort , openfl_display_DisplayObject); + displayViewPort.set_scrollRect(scrollRect); + } else { + throw new openfl_errors_ArgumentError("Unknown scrollMode: " + Std.string(this._scrollMode)); + } + } + ,revealScrollBarX: function() { + if(this.scrollBarX == null || this.scroller.get_minScrollX() == this.scroller.get_maxScrollX()) { + return; + } + if(this._hideScrollBarX != null) { + motion_Actuate.stop(this._hideScrollBarX); + } + this.scrollBarX.set_alpha(1.0); + this._scrollBarXRevealTime = openfl_Lib.getTimer(); + } + ,revealScrollBarY: function() { + if(this.scrollBarY == null || this.scroller.get_minScrollY() == this.scroller.get_maxScrollY()) { + return; + } + if(this._hideScrollBarY != null) { + motion_Actuate.stop(this._hideScrollBarY); + } + this.scrollBarY.set_alpha(1.0); + this._scrollBarYRevealTime = openfl_Lib.getTimer(); + } + ,hideScrollBarX: function() { + var _gthis = this; + if(this.scrollBarX == null || this._hideScrollBarX != null) { + return; + } + if(this.scrollBarX.get_alpha() == 0.0) { + return; + } + if(this.get_hideScrollBarDuration() == 0.0) { + this.scrollBarX.set_alpha(0.0); + return; + } + var tween = motion_Actuate.update(function(alpha) { + return _gthis.scrollBarX.set_alpha(alpha); + },this.get_hideScrollBarDuration(),[this.scrollBarX.get_alpha()],[0.0],true); + this._hideScrollBarX = tween; + this._hideScrollBarX.ease(this.get_hideScrollBarEase()); + this._hideScrollBarX.autoVisible(false); + var visibleTime = (openfl_Lib.getTimer() - this._scrollBarXRevealTime) / 1000.0; + if(visibleTime < this.get_showScrollBarMinimumDuration()) { + this._hideScrollBarX.delay(this.get_showScrollBarMinimumDuration() - visibleTime); + } + this._hideScrollBarX.onComplete($bind(this,this.hideScrollBarX_onComplete)); + } + ,hideScrollBarY: function() { + var _gthis = this; + if(this.scrollBarY == null || this._hideScrollBarY != null) { + return; + } + if(this.scrollBarY.get_alpha() == 0.0) { + return; + } + if(this.get_hideScrollBarDuration() == 0.0) { + this.scrollBarY.set_alpha(0.0); + return; + } + var tween = motion_Actuate.update(function(alpha) { + return _gthis.scrollBarY.set_alpha(alpha); + },this.get_hideScrollBarDuration(),[this.scrollBarY.get_alpha()],[0.0],true); + this._hideScrollBarY = tween; + this._hideScrollBarY.ease(this.get_hideScrollBarEase()); + this._hideScrollBarY.autoVisible(false); + var visibleTime = (openfl_Lib.getTimer() - this._scrollBarYRevealTime) / 1000.0; + if(visibleTime < this.get_showScrollBarMinimumDuration()) { + this._hideScrollBarY.delay(this.get_showScrollBarMinimumDuration() - visibleTime); + } + this._hideScrollBarY.onComplete($bind(this,this.hideScrollBarY_onComplete)); + } + ,checkForRevealScrollBars: function() { + if(!this._scrollerDraggingX && this.scroller.get_draggingX()) { + this._scrollerDraggingX = true; + this.revealScrollBarX(); + } + if(!this._scrollerDraggingY && this.scroller.get_draggingY()) { + this._scrollerDraggingY = true; + this.revealScrollBarY(); + } + } + ,scrollWithKeyboard: function(event) { + if(this._scrollPolicyY == feathers_controls_ScrollPolicy.OFF && this._scrollPolicyX == feathers_controls_ScrollPolicy.OFF) { + return; + } + var stepX = this._scrollStepX; + if(stepX <= 0.0) { + stepX = 1.0; + } + var stepY = this._scrollStepY; + if(stepY <= 0.0) { + stepY = 1.0; + } + var newScrollX = this.get_scrollX(); + var newScrollY = this.get_scrollY(); + switch(event.keyCode) { + case 33: + newScrollY = this.get_scrollY() - this._viewPort.get_visibleHeight(); + break; + case 34: + newScrollY = this.get_scrollY() + this._viewPort.get_visibleHeight(); + break; + case 35: + newScrollY = this.get_maxScrollY(); + break; + case 36: + newScrollY = this.get_minScrollY(); + break; + case 37: + newScrollX = this.get_scrollX() - stepX; + break; + case 38: + newScrollY = this.get_scrollY() - stepY; + break; + case 39: + newScrollX = this.get_scrollX() + stepX; + break; + case 40: + newScrollY = this.get_scrollY() + stepY; + break; + default: + return; + } + if(newScrollY < this.get_minScrollY()) { + newScrollY = this.get_minScrollY(); + } else if(newScrollY > this.get_maxScrollY()) { + newScrollY = this.get_maxScrollY(); + } + if(newScrollX < this.get_minScrollX()) { + newScrollX = this.get_minScrollX(); + } else if(newScrollX > this.get_maxScrollX()) { + newScrollX = this.get_maxScrollX(); + } + var scrolled = false; + if(this.get_scrollY() != newScrollY && this._scrollPolicyY != feathers_controls_ScrollPolicy.OFF) { + scrolled = true; + this.set_scrollY(newScrollY); + } + if(this.get_scrollX() != newScrollX && this._scrollPolicyX != feathers_controls_ScrollPolicy.OFF) { + scrolled = true; + this.set_scrollX(newScrollX); + } + if(scrolled) { + event.preventDefault(); + } + } + ,baseScrollContainer_addedToStageHandler: function(event) { + this.setInvalid(feathers_core_InvalidationFlag.SCROLL); + } + ,baseScrollContainer_removedFromStageHandler: function(event) { + if(this.scroller != null) { + this.scroller.set_target(null); + } + } + ,baseScrollContainer_keyDownHandler: function(event) { + if(!this._enabled || event.isDefaultPrevented()) { + return; + } + if(this.stage != null && ((this.stage.get_focus()) instanceof openfl_text_TextField)) { + var textField = this.stage.get_focus(); + if(textField.get_type() == 1) { + return; + } + } + this.scrollWithKeyboard(event); + } + ,baseScrollContainer_scroller_scrollStartHandler: function(event) { + var touchPointID = this.scroller.get_touchPointID(); + if(this.scroller.get_touchPointIsSimulated()) { + var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage); + var result = exclusivePointer.claimMouse(this); + if(!result) { + this.scroller.stop(); + return; + } + } else if(touchPointID != null) { + var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage); + var result = exclusivePointer.claimTouch(touchPointID,this); + if(!result) { + this.scroller.stop(); + return; + } + } + this._viewPort.addEventListener("mouseDown",$bind(this,this.baseScrollContainer_viewPort_mouseDownHandler)); + this._viewPort.addEventListener("touchBegin",$bind(this,this.baseScrollContainer_viewPort_touchBeginHandler)); + this._scrollerDraggingX = false; + this._scrollerDraggingY = false; + this.checkForRevealScrollBars(); + feathers_events_ScrollEvent.dispatch(this,"scrollStart",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY()); + } + ,baseScrollContainer_scroller_scrollHandler: function(event) { + if(this._ignoreScrollerChanges) { + if(this._settingScrollerDimensions && this.needsScrollMeasurement()) { + this.setInvalid(feathers_core_InvalidationFlag.SCROLL); + } else { + this._viewPort.set_scrollX(this.get_scrollX()); + this._viewPort.set_scrollY(this.get_scrollY()); + } + return; + } + this.checkForRevealScrollBars(); + if(this.needsScrollMeasurement()) { + this.setInvalid(feathers_core_InvalidationFlag.SCROLL); + } else { + this._viewPort.set_scrollX(this.get_scrollX()); + this._viewPort.set_scrollY(this.get_scrollY()); + this.refreshScrollRect(); + this.refreshScrollBarValues(); + } + feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY()); + } + ,baseScrollContainer_scroller_scrollCompleteHandler: function(event) { + this._viewPort.removeEventListener("mouseDown",$bind(this,this.baseScrollContainer_viewPort_mouseDownHandler)); + this._viewPort.removeEventListener("touchBegin",$bind(this,this.baseScrollContainer_viewPort_touchBeginHandler)); + this._scrollerDraggingX = false; + this._scrollerDraggingY = false; + if(!this._scrollBarXHover && !this.get_fixedScrollBars() && this.get_autoHideScrollBars()) { + this.hideScrollBarX(); + } + if(!this._scrollBarYHover && !this.get_fixedScrollBars() && this.get_autoHideScrollBars()) { + this.hideScrollBarY(); + } + feathers_events_ScrollEvent.dispatch(this,"scrollComplete",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY()); + } + ,reclaimMouse: function() { + if(!this.scroller.get_touchPointIsSimulated()) { + return; + } + var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage); + var claim = exclusivePointer.getMouseClaim(); + if(claim != null) { + return; + } + exclusivePointer.claimMouse(this); + } + ,reclaimTouch: function(touchPointID) { + if(this.scroller.get_touchPointIsSimulated() || this.scroller.get_touchPointID() == null || this.scroller.get_touchPointID() != touchPointID) { + return; + } + var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage); + var claim = exclusivePointer.getTouchClaim(touchPointID); + if(claim != null) { + return; + } + exclusivePointer.claimTouch(touchPointID,this); + } + ,baseScrollContainer_viewPort_mouseDownHandler: function(event) { + this.reclaimMouse(); + } + ,baseScrollContainer_viewPort_touchBeginHandler: function(event) { + this.reclaimTouch(event.touchPointID); + } + ,scrollBarX_changeHandler: function(event) { + if(this._ignoreScrollBarXChange) { + return; + } + this.scroller.set_scrollX(this.scrollBarX.get_value()); + } + ,scrollBarY_changeHandler: function(event) { + if(this._ignoreScrollBarYChange) { + return; + } + this.scroller.set_scrollY(this.scrollBarY.get_value()); + } + ,scrollBarX_rollOverHandler: function(event) { + this._scrollBarXHover = true; + this.revealScrollBarX(); + } + ,scrollBarX_rollOutHandler: function(event) { + if(!this._scrollBarXHover) { + return; + } + this._scrollBarXHover = false; + if(!this._scrollerDraggingX && !this.get_fixedScrollBars() && this.get_autoHideScrollBars()) { + this.hideScrollBarX(); + } + } + ,scrollBarY_rollOverHandler: function(event) { + this._scrollBarYHover = true; + this.revealScrollBarY(); + } + ,scrollBarY_rollOutHandler: function(event) { + if(!this._scrollBarYHover) { + return; + } + this._scrollBarYHover = false; + if(!this._scrollerDraggingY && !this.get_fixedScrollBars() && this.get_autoHideScrollBars()) { + this.hideScrollBarY(); + } + } + ,scrollBarX_scrollStartHandler: function(event) { + this.scroller.stop(); + this._scrollerDraggingX = true; + feathers_events_ScrollEvent.dispatch(this,"scrollStart",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY()); + } + ,scrollBarX_scrollCompleteHandler: function(event) { + this._scrollerDraggingX = false; + if(!this._scrollBarXHover && !this.get_fixedScrollBars() && this.get_autoHideScrollBars()) { + this.hideScrollBarX(); + } + feathers_events_ScrollEvent.dispatch(this,"scrollComplete",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY()); + } + ,scrollBarY_scrollStartHandler: function(event) { + this.scroller.stop(); + this._scrollerDraggingY = true; + feathers_events_ScrollEvent.dispatch(this,"scrollStart",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY()); + } + ,scrollBarY_scrollCompleteHandler: function(event) { + this._scrollerDraggingY = false; + if(!this._scrollBarYHover && !this.get_fixedScrollBars() && this.get_autoHideScrollBars()) { + this.hideScrollBarY(); + } + feathers_events_ScrollEvent.dispatch(this,"scrollComplete",false,false,this.scroller.get_scrollX(),this.scroller.get_scrollY()); + } + ,hideScrollBarX_onComplete: function() { + this._hideScrollBarX = null; + } + ,hideScrollBarY_onComplete: function() { + this._hideScrollBarY = null; + } + ,viewPort_resizeHandler: function(event) { + if(this._ignoreViewPortResizing) { + return; + } + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + ,get_paddingTop: function() { + return this.__paddingTop; + } + ,set_paddingTop: function(value) { + if(!this.setStyle("paddingTop")) { + return this.__paddingTop; + } + if(this.__paddingTop == value) { + return this.__paddingTop; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingTop); + this.__paddingTop = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingTop; + } + ,clearStyle_paddingTop: function() { + this.set_paddingTop(0.0); + return this.get_paddingTop(); + } + ,get_paddingRight: function() { + return this.__paddingRight; + } + ,set_paddingRight: function(value) { + if(!this.setStyle("paddingRight")) { + return this.__paddingRight; + } + if(this.__paddingRight == value) { + return this.__paddingRight; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingRight); + this.__paddingRight = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingRight; + } + ,clearStyle_paddingRight: function() { + this.set_paddingRight(0.0); + return this.get_paddingRight(); + } + ,get_paddingBottom: function() { + return this.__paddingBottom; + } + ,set_paddingBottom: function(value) { + if(!this.setStyle("paddingBottom")) { + return this.__paddingBottom; + } + if(this.__paddingBottom == value) { + return this.__paddingBottom; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingBottom); + this.__paddingBottom = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingBottom; + } + ,clearStyle_paddingBottom: function() { + this.set_paddingBottom(0.0); + return this.get_paddingBottom(); + } + ,get_paddingLeft: function() { + return this.__paddingLeft; + } + ,set_paddingLeft: function(value) { + if(!this.setStyle("paddingLeft")) { + return this.__paddingLeft; + } + if(this.__paddingLeft == value) { + return this.__paddingLeft; + } + this._previousClearStyle = $bind(this,this.clearStyle_paddingLeft); + this.__paddingLeft = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__paddingLeft; + } + ,clearStyle_paddingLeft: function() { + this.set_paddingLeft(0.0); + return this.get_paddingLeft(); + } + ,get_backgroundSkin: function() { + return this.__backgroundSkin; + } + ,set_backgroundSkin: function(value) { + if(!this.setStyle("backgroundSkin")) { + return this.__backgroundSkin; + } + if(this.__backgroundSkin == value) { + return this.__backgroundSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_backgroundSkin); + this.__backgroundSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__backgroundSkin; + } + ,clearStyle_backgroundSkin: function() { + this.set_backgroundSkin(null); + return this.get_backgroundSkin(); + } + ,get_disabledBackgroundSkin: function() { + return this.__disabledBackgroundSkin; + } + ,set_disabledBackgroundSkin: function(value) { + if(!this.setStyle("disabledBackgroundSkin")) { + return this.__disabledBackgroundSkin; + } + if(this.__disabledBackgroundSkin == value) { + return this.__disabledBackgroundSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_disabledBackgroundSkin); + this.__disabledBackgroundSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__disabledBackgroundSkin; + } + ,clearStyle_disabledBackgroundSkin: function() { + this.set_disabledBackgroundSkin(null); + return this.get_disabledBackgroundSkin(); + } + ,get_maskSkin: function() { + return this.__maskSkin; + } + ,set_maskSkin: function(value) { + if(!this.setStyle("maskSkin")) { + return this.__maskSkin; + } + if(this.__maskSkin == value) { + return this.__maskSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_maskSkin); + this.__maskSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__maskSkin; + } + ,clearStyle_maskSkin: function() { + this.set_maskSkin(null); + return this.get_maskSkin(); + } + ,get_viewPortMaskSkin: function() { + return this.__viewPortMaskSkin; + } + ,set_viewPortMaskSkin: function(value) { + if(!this.setStyle("viewPortMaskSkin")) { + return this.__viewPortMaskSkin; + } + if(this.__viewPortMaskSkin == value) { + return this.__viewPortMaskSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_viewPortMaskSkin); + this.__viewPortMaskSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__viewPortMaskSkin; + } + ,clearStyle_viewPortMaskSkin: function() { + this.set_viewPortMaskSkin(null); + return this.get_viewPortMaskSkin(); + } + ,get_scrollBarsCornerSkin: function() { + return this.__scrollBarsCornerSkin; + } + ,set_scrollBarsCornerSkin: function(value) { + if(!this.setStyle("scrollBarsCornerSkin")) { + return this.__scrollBarsCornerSkin; + } + if(this.__scrollBarsCornerSkin == value) { + return this.__scrollBarsCornerSkin; + } + this._previousClearStyle = $bind(this,this.clearStyle_scrollBarsCornerSkin); + this.__scrollBarsCornerSkin = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__scrollBarsCornerSkin; + } + ,clearStyle_scrollBarsCornerSkin: function() { + this.set_scrollBarsCornerSkin(null); + return this.get_scrollBarsCornerSkin(); + } + ,get_fixedScrollBars: function() { + return this.__fixedScrollBars; + } + ,set_fixedScrollBars: function(value) { + if(!this.setStyle("fixedScrollBars")) { + return this.__fixedScrollBars; + } + if(this.__fixedScrollBars == value) { + return this.__fixedScrollBars; + } + this._previousClearStyle = $bind(this,this.clearStyle_fixedScrollBars); + this.__fixedScrollBars = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__fixedScrollBars; + } + ,clearStyle_fixedScrollBars: function() { + this.set_fixedScrollBars(false); + return this.get_fixedScrollBars(); + } + ,get_showScrollBars: function() { + return this.__showScrollBars; + } + ,set_showScrollBars: function(value) { + if(!this.setStyle("showScrollBars")) { + return this.__showScrollBars; + } + if(this.__showScrollBars == value) { + return this.__showScrollBars; + } + this._previousClearStyle = $bind(this,this.clearStyle_showScrollBars); + this.__showScrollBars = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__showScrollBars; + } + ,clearStyle_showScrollBars: function() { + this.set_showScrollBars(true); + return this.get_showScrollBars(); + } + ,get_autoHideScrollBars: function() { + return this.__autoHideScrollBars; + } + ,set_autoHideScrollBars: function(value) { + if(!this.setStyle("autoHideScrollBars")) { + return this.__autoHideScrollBars; + } + if(this.__autoHideScrollBars == value) { + return this.__autoHideScrollBars; + } + this._previousClearStyle = $bind(this,this.clearStyle_autoHideScrollBars); + this.__autoHideScrollBars = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__autoHideScrollBars; + } + ,clearStyle_autoHideScrollBars: function() { + this.set_autoHideScrollBars(true); + return this.get_autoHideScrollBars(); + } + ,get_scrollBarXPosition: function() { + return this.__scrollBarXPosition; + } + ,set_scrollBarXPosition: function(value) { + if(!this.setStyle("scrollBarXPosition")) { + return this.__scrollBarXPosition; + } + if(this.__scrollBarXPosition == value) { + return this.__scrollBarXPosition; + } + this._previousClearStyle = $bind(this,this.clearStyle_scrollBarXPosition); + this.__scrollBarXPosition = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__scrollBarXPosition; + } + ,clearStyle_scrollBarXPosition: function() { + this.set_scrollBarXPosition(feathers_layout_RelativePosition.BOTTOM); + return this.get_scrollBarXPosition(); + } + ,get_scrollBarYPosition: function() { + return this.__scrollBarYPosition; + } + ,set_scrollBarYPosition: function(value) { + if(!this.setStyle("scrollBarYPosition")) { + return this.__scrollBarYPosition; + } + if(this.__scrollBarYPosition == value) { + return this.__scrollBarYPosition; + } + this._previousClearStyle = $bind(this,this.clearStyle_scrollBarYPosition); + this.__scrollBarYPosition = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__scrollBarYPosition; + } + ,clearStyle_scrollBarYPosition: function() { + this.set_scrollBarYPosition(feathers_layout_RelativePosition.RIGHT); + return this.get_scrollBarYPosition(); + } + ,get_showScrollBarMinimumDuration: function() { + return this.__showScrollBarMinimumDuration; + } + ,set_showScrollBarMinimumDuration: function(value) { + if(!this.setStyle("showScrollBarMinimumDuration")) { + return this.__showScrollBarMinimumDuration; + } + if(this.__showScrollBarMinimumDuration == value) { + return this.__showScrollBarMinimumDuration; + } + this._previousClearStyle = $bind(this,this.clearStyle_showScrollBarMinimumDuration); + this.__showScrollBarMinimumDuration = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__showScrollBarMinimumDuration; + } + ,clearStyle_showScrollBarMinimumDuration: function() { + this.set_showScrollBarMinimumDuration(0.5); + return this.get_showScrollBarMinimumDuration(); + } + ,get_hideScrollBarDuration: function() { + return this.__hideScrollBarDuration; + } + ,set_hideScrollBarDuration: function(value) { + if(!this.setStyle("hideScrollBarDuration")) { + return this.__hideScrollBarDuration; + } + if(this.__hideScrollBarDuration == value) { + return this.__hideScrollBarDuration; + } + this._previousClearStyle = $bind(this,this.clearStyle_hideScrollBarDuration); + this.__hideScrollBarDuration = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__hideScrollBarDuration; + } + ,clearStyle_hideScrollBarDuration: function() { + this.set_hideScrollBarDuration(0.2); + return this.get_hideScrollBarDuration(); + } + ,get_hideScrollBarEase: function() { + return this.__hideScrollBarEase; + } + ,set_hideScrollBarEase: function(value) { + if(!this.setStyle("hideScrollBarEase")) { + return this.__hideScrollBarEase; + } + if(this.__hideScrollBarEase == value) { + return this.__hideScrollBarEase; + } + this._previousClearStyle = $bind(this,this.clearStyle_hideScrollBarEase); + this.__hideScrollBarEase = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__hideScrollBarEase; + } + ,clearStyle_hideScrollBarEase: function() { + this.set_hideScrollBarEase(motion_easing_Quart.easeOut); + return this.get_hideScrollBarEase(); + } + ,get_scrollPixelSnapping: function() { + return this.__scrollPixelSnapping; + } + ,set_scrollPixelSnapping: function(value) { + if(!this.setStyle("scrollPixelSnapping")) { + return this.__scrollPixelSnapping; + } + if(this.__scrollPixelSnapping == value) { + return this.__scrollPixelSnapping; + } + this._previousClearStyle = $bind(this,this.clearStyle_scrollPixelSnapping); + this.__scrollPixelSnapping = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__scrollPixelSnapping; + } + ,clearStyle_scrollPixelSnapping: function() { + this.set_scrollPixelSnapping(false); + return this.get_scrollPixelSnapping(); + } + ,__class__: feathers_controls_supportClasses_BaseScrollContainer + ,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_scrollMode:"set_scrollMode",get_scrollMode:"get_scrollMode",get_measureViewPort:"get_measureViewPort",set_scrollPixelSnapping:"set_scrollPixelSnapping",get_scrollPixelSnapping:"get_scrollPixelSnapping",set_hideScrollBarEase:"set_hideScrollBarEase",get_hideScrollBarEase:"get_hideScrollBarEase",set_hideScrollBarDuration:"set_hideScrollBarDuration",get_hideScrollBarDuration:"get_hideScrollBarDuration",set_showScrollBarMinimumDuration:"set_showScrollBarMinimumDuration",get_showScrollBarMinimumDuration:"get_showScrollBarMinimumDuration",set_scrollBarYPosition:"set_scrollBarYPosition",get_scrollBarYPosition:"get_scrollBarYPosition",set_scrollBarXPosition:"set_scrollBarXPosition",get_scrollBarXPosition:"get_scrollBarXPosition",set_scrollPolicyY:"set_scrollPolicyY",get_scrollPolicyY:"get_scrollPolicyY",set_scrollPolicyX:"set_scrollPolicyX",get_scrollPolicyX:"get_scrollPolicyX",set_scrollStepY:"set_scrollStepY",get_scrollStepY:"get_scrollStepY",set_scrollStepX:"set_scrollStepX",get_scrollStepX:"get_scrollStepX",get_maxScrollY:"get_maxScrollY",get_maxScrollX:"get_maxScrollX",get_minScrollY:"get_minScrollY",get_minScrollX:"get_minScrollX",set_restrictedScrollY:"set_restrictedScrollY",get_restrictedScrollY:"get_restrictedScrollY",set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_restrictedScrollX:"set_restrictedScrollX",get_restrictedScrollX:"get_restrictedScrollX",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX",set_scrollerFactory:"set_scrollerFactory",get_scrollerFactory:"get_scrollerFactory",set_scrollBarYFactory:"set_scrollBarYFactory",get_scrollBarYFactory:"get_scrollBarYFactory",set_scrollBarXFactory:"set_scrollBarXFactory",get_scrollBarXFactory:"get_scrollBarXFactory",set_autoHideScrollBars:"set_autoHideScrollBars",get_autoHideScrollBars:"get_autoHideScrollBars",set_showScrollBars:"set_showScrollBars",get_showScrollBars:"get_showScrollBars",set_fixedScrollBars:"set_fixedScrollBars",get_fixedScrollBars:"get_fixedScrollBars",set_scrollBarsCornerSkin:"set_scrollBarsCornerSkin",get_scrollBarsCornerSkin:"get_scrollBarsCornerSkin",set_viewPortMaskSkin:"set_viewPortMaskSkin",get_viewPortMaskSkin:"get_viewPortMaskSkin",set_maskSkin:"set_maskSkin",get_maskSkin:"get_maskSkin",set_disabledBackgroundSkin:"set_disabledBackgroundSkin",get_disabledBackgroundSkin:"get_disabledBackgroundSkin",set_backgroundSkin:"set_backgroundSkin",get_backgroundSkin:"get_backgroundSkin",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop",set_viewPort:"set_viewPort",get_viewPort:"get_viewPort"}) +}); +var feathers_core_IFocusContainer = function() { }; +$hxClasses["feathers.core.IFocusContainer"] = feathers_core_IFocusContainer; +feathers_core_IFocusContainer.__name__ = "feathers.core.IFocusContainer"; +feathers_core_IFocusContainer.__isInterface__ = true; +feathers_core_IFocusContainer.__interfaces__ = [feathers_core_IFocusObject]; +feathers_core_IFocusContainer.prototype = { + __class__: feathers_core_IFocusContainer + ,__properties__: {set_childFocusEnabled:"set_childFocusEnabled",get_childFocusEnabled:"get_childFocusEnabled"} +}; +var feathers_controls_ScrollContainer = function() { + this.__layout = null; + this._manageChildVisibility = false; + this._autoSizeMode = feathers_layout_AutoSizeMode.CONTENT; + this._childFocusEnabled = true; + this._xmlContent = null; + this.items = []; + this._displayListBypassEnabled = true; + this._ignoreChangesButSetFlags = false; + this._ignoreChildChanges = false; + this._ignoreRemovedEvent = false; + this.initializeScrollContainerTheme(); + feathers_controls_supportClasses_BaseScrollContainer.call(this); + if(this.get_viewPort() == null) { + this.layoutViewPort = new feathers_controls_supportClasses_LayoutViewPort(); + this.addRawChild(this.layoutViewPort); + this.set_viewPort(this.layoutViewPort); + } + this.addEventListener("addedToStage",$bind(this,this.scrollContainer_addedToStageHandler)); +}; +$hxClasses["feathers.controls.ScrollContainer"] = feathers_controls_ScrollContainer; +feathers_controls_ScrollContainer.__name__ = "feathers.controls.ScrollContainer"; +feathers_controls_ScrollContainer.__interfaces__ = [feathers_core_IFocusContainer]; +feathers_controls_ScrollContainer.__super__ = feathers_controls_supportClasses_BaseScrollContainer; +feathers_controls_ScrollContainer.prototype = $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype,{ + get_xmlContent: function() { + return this._xmlContent; + } + ,set_xmlContent: function(value) { + if(this._xmlContent == value) { + return this._xmlContent; + } + if(this._xmlContent != null) { + var _g = 0; + var _g1 = this._xmlContent; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + this.removeChild(child); + } + } + this._xmlContent = value; + if(this._xmlContent != null) { + var _g = 0; + var _g1 = this._xmlContent; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + this.addChild(child); + } + } + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._xmlContent; + } + ,get_childFocusEnabled: function() { + if(this._enabled) { + return this._childFocusEnabled; + } else { + return false; + } + } + ,set_childFocusEnabled: function(value) { + if(this._childFocusEnabled == value) { + return this._childFocusEnabled; + } + this._childFocusEnabled = value; + return this._childFocusEnabled; + } + ,get_autoSizeMode: function() { + return this._autoSizeMode; + } + ,set_autoSizeMode: function(value) { + if(this._autoSizeMode == value) { + return this._autoSizeMode; + } + this._autoSizeMode = value; + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + if(this.stage != null) { + if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) { + this.stage.addEventListener("resize",$bind(this,this.scrollContainer_stage_resizeHandler),false,0,true); + this.addEventListener("removedFromStage",$bind(this,this.scrollContainer_removedFromStageHandler)); + } else { + this.stage.removeEventListener("resize",$bind(this,this.scrollContainer_stage_resizeHandler)); + this.removeEventListener("removedFromStage",$bind(this,this.scrollContainer_removedFromStageHandler)); + } + } + return this._autoSizeMode; + } + ,get_manageChildVisibility: function() { + return this._manageChildVisibility; + } + ,set_manageChildVisibility: function(value) { + if(this._manageChildVisibility == value) { + return this._manageChildVisibility; + } + this._manageChildVisibility = value; + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + return this._manageChildVisibility; + } + ,get_numRawChildren: function() { + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = false; + var result = this.get_numChildren(); + this._displayListBypassEnabled = oldBypass; + return result; + } + ,get_numChildren: function() { + if(!this._displayListBypassEnabled) { + return feathers_controls_supportClasses_BaseScrollContainer.prototype.get_numChildren.call(this); + } + return this.layoutViewPort.get_numChildren(); + } + ,addChild: function(child) { + if(!this._displayListBypassEnabled) { + return feathers_controls_supportClasses_BaseScrollContainer.prototype.addChild.call(this,child); + } + return this.addChildAt(child,this.layoutViewPort.get_numChildren()); + } + ,addChildAt: function(child,index) { + if(!this._displayListBypassEnabled) { + return feathers_controls_supportClasses_BaseScrollContainer.prototype.addChildAt.call(this,child,index); + } + var oldIndex = this.items.indexOf(child); + if(oldIndex == index) { + return child; + } + if(oldIndex >= 0) { + HxOverrides.remove(this.items,child); + } + this.items.splice(index,0,child); + var result = this.layoutViewPort.addChildAt(child,index); + child.addEventListener("resize",$bind(this,this.scrollContainer_child_resizeHandler)); + if(js_Boot.__implements(child,feathers_layout_ILayoutObject)) { + child.addEventListener("layoutDataChange",$bind(this,this.scrollContainer_child_layoutDataChangeHandler),false,0,true); + } + child.addEventListener("removed",$bind(this,this.scrollContainer_child_removedHandler)); + if(this._ignoreChangesButSetFlags) { + this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT); + } else { + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + return result; + } + ,removeChild: function(child) { + return this.removeChildInternal(child,true); + } + ,removeChildInternal: function(child,removeFromViewPort) { + if(!this._displayListBypassEnabled) { + return feathers_controls_supportClasses_BaseScrollContainer.prototype.removeChild.call(this,child); + } + if(child == null || child.parent != this.layoutViewPort) { + return child; + } + HxOverrides.remove(this.items,child); + var result = child; + if(removeFromViewPort) { + var oldIgnoreRemovedEvent = this._ignoreRemovedEvent; + this._ignoreRemovedEvent = true; + result = this.layoutViewPort.removeChild(child); + this._ignoreRemovedEvent = oldIgnoreRemovedEvent; + } + child.removeEventListener("resize",$bind(this,this.scrollContainer_child_resizeHandler)); + if(js_Boot.__implements(child,feathers_layout_ILayoutObject)) { + child.removeEventListener("layoutDataChange",$bind(this,this.scrollContainer_child_layoutDataChangeHandler)); + } + child.removeEventListener("removed",$bind(this,this.scrollContainer_child_removedHandler)); + if(this._ignoreChangesButSetFlags) { + this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT); + } else { + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + return result; + } + ,removeChildAt: function(index) { + if(!this._displayListBypassEnabled) { + return feathers_controls_supportClasses_BaseScrollContainer.prototype.removeChildAt.call(this,index); + } + return this.removeChild(this.layoutViewPort.getChildAt(index)); + } + ,getChildAt: function(index) { + if(!this._displayListBypassEnabled) { + return feathers_controls_supportClasses_BaseScrollContainer.prototype.removeChildAt.call(this,index); + } + return this.layoutViewPort.getChildAt(index); + } + ,getChildIndex: function(child) { + if(!this._displayListBypassEnabled) { + return feathers_controls_supportClasses_BaseScrollContainer.prototype.getChildIndex.call(this,child); + } + return this.items.indexOf(child); + } + ,setChildIndex: function(child,index) { + if(!this._displayListBypassEnabled) { + feathers_controls_supportClasses_BaseScrollContainer.prototype.setChildIndex.call(this,child,index); + return; + } + var oldIndex = this.getChildIndex(child); + if(oldIndex == index) { + return; + } + HxOverrides.remove(this.items,child); + this.items.splice(index,0,child); + if(this._ignoreChangesButSetFlags) { + this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT); + } else { + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + } + ,getChildByName: function(name) { + if(!this._displayListBypassEnabled) { + return feathers_controls_supportClasses_BaseScrollContainer.prototype.getChildByName.call(this,name); + } + var _g = 0; + var _g1 = this.items; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + if(child.get_name() == name) { + return child; + } + } + return null; + } + ,addRawChild: function(child) { + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = false; + var result = this.addChild(child); + this._displayListBypassEnabled = oldBypass; + return result; + } + ,addRawChildAt: function(child,index) { + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = false; + var result = this.addChildAt(child,index); + this._displayListBypassEnabled = oldBypass; + return result; + } + ,removeRawChild: function(child) { + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = false; + var result = this.removeChild(child); + this._displayListBypassEnabled = oldBypass; + return result; + } + ,removeRawChildAt: function(index) { + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = false; + var result = this.removeChildAt(index); + this._displayListBypassEnabled = oldBypass; + return result; + } + ,getRawChildByName: function(name) { + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = false; + var result = this.getChildByName(name); + this._displayListBypassEnabled = oldBypass; + return result; + } + ,getRawChildAt: function(index) { + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = false; + var result = this.getChildAt(index); + this._displayListBypassEnabled = oldBypass; + return result; + } + ,getRawChildIndex: function(child) { + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = false; + var result = this.getChildIndex(child); + this._displayListBypassEnabled = oldBypass; + return result; + } + ,setRawChildIndex: function(child,index) { + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = false; + this.setChildIndex(child,index); + this._displayListBypassEnabled = oldBypass; + } + ,removeChildren: function(beginIndex,endIndex) { + if(endIndex == null) { + endIndex = 2147483647; + } + if(beginIndex == null) { + beginIndex = 0; + } + if(!this._displayListBypassEnabled) { + feathers_controls_supportClasses_BaseScrollContainer.prototype.removeChildren.call(this,beginIndex,endIndex); + return; + } + if(endIndex == 2147483647) { + endIndex = this.items.length - 1; + if(endIndex < 0) { + return; + } + } + if(beginIndex > this.items.length - 1) { + return; + } else if(endIndex < beginIndex || beginIndex < 0 || endIndex > this.items.length) { + throw new openfl_errors_RangeError("The supplied index is out of bounds."); + } + var numRemovals = endIndex - beginIndex; + while(numRemovals >= 0) { + this.removeChildAt(beginIndex); + --numRemovals; + } + } + ,removeRawChildren: function(beginIndex,endIndex) { + if(endIndex == null) { + endIndex = 2147483647; + } + if(beginIndex == null) { + beginIndex = 0; + } + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = false; + this.removeChildren(beginIndex,endIndex); + this._displayListBypassEnabled = oldBypass; + } + ,readjustLayout: function() { + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + ,initializeScrollContainerTheme: function() { + feathers_themes_steel_components_SteelScrollContainerStyles.initialize(); + } + ,collectChildren: function(result) { + if(result == null) { + return this.items.slice(); + } + var _g = 0; + var _g1 = this.items; + while(_g < _g1.length) { + var item = _g1[_g]; + ++_g; + result.push(item); + } + return result; + } + ,dispatchEvent: function(event) { + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = true; + var result = feathers_controls_supportClasses_BaseScrollContainer.prototype.dispatchEvent.call(this,event); + this._displayListBypassEnabled = oldBypass; + return result; + } + ,validateNow: function() { + var oldIgnoreChildChanges = this._ignoreChangesButSetFlags; + this._ignoreChangesButSetFlags = true; + feathers_controls_supportClasses_BaseScrollContainer.prototype.validateNow.call(this); + this._ignoreChangesButSetFlags = oldIgnoreChildChanges; + } + ,update: function() { + this._ignoreChangesButSetFlags = false; + var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT); + var stylesInvalid = this.isInvalid(feathers_core_InvalidationFlag.STYLES); + if(layoutInvalid || stylesInvalid) { + this.refreshLayout(); + } + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = false; + var oldIgnoreChildChanges = this._ignoreChildChanges; + this._ignoreChildChanges = true; + feathers_controls_supportClasses_BaseScrollContainer.prototype.update.call(this); + this._ignoreChildChanges = oldIgnoreChildChanges; + this._displayListBypassEnabled = oldBypass; + } + ,measure: function() { + var needsWidth = this.get_explicitWidth() == null; + var needsHeight = this.get_explicitHeight() == null; + var needsMinWidth = this.get_explicitMinWidth() == null; + var needsMinHeight = this.get_explicitMinHeight() == null; + var needsMaxWidth = this.get_explicitMaxWidth() == null; + var needsMaxHeight = this.get_explicitMaxHeight() == null; + if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) { + return false; + } + if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE && this.stage != null) { + var topLeft = this.globalToLocal(new openfl_geom_Point()); + var bottomRight = this.globalToLocal(new openfl_geom_Point(this.stage.stageWidth,this.stage.stageHeight)); + var stageWidth = bottomRight.x - topLeft.x; + var stageHeight = bottomRight.y - topLeft.y; + return this.saveMeasurements(stageWidth,stageHeight,stageWidth,stageHeight); + } + return feathers_controls_supportClasses_BaseScrollContainer.prototype.measure.call(this); + } + ,refreshViewPortBoundsForMeasurement: function() { + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = true; + feathers_controls_supportClasses_BaseScrollContainer.prototype.refreshViewPortBoundsForMeasurement.call(this); + this._displayListBypassEnabled = oldBypass; + } + ,refreshViewPortBoundsForLayout: function() { + var oldBypass = this._displayListBypassEnabled; + this._displayListBypassEnabled = true; + feathers_controls_supportClasses_BaseScrollContainer.prototype.refreshViewPortBoundsForLayout.call(this); + this._displayListBypassEnabled = oldBypass; + } + ,refreshScrollerValues: function() { + feathers_controls_supportClasses_BaseScrollContainer.prototype.refreshScrollerValues.call(this); + if(js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout)) { + var scrollLayout = this.get_layout(); + this.scroller.forceElasticTop = scrollLayout.get_elasticTop(); + this.scroller.forceElasticRight = scrollLayout.get_elasticRight(); + this.scroller.forceElasticBottom = scrollLayout.get_elasticBottom(); + this.scroller.forceElasticLeft = scrollLayout.get_elasticLeft(); + } else { + this.scroller.forceElasticTop = false; + this.scroller.forceElasticRight = false; + this.scroller.forceElasticBottom = false; + this.scroller.forceElasticLeft = false; + } + this.scroller.snapPositionsX = this.layoutViewPort.get_snapPositionsX(); + this.scroller.snapPositionsY = this.layoutViewPort.get_snapPositionsY(); + } + ,needsScrollMeasurement: function() { + return js_Boot.__implements(this.get_layout(),feathers_layout_IScrollLayout); + } + ,refreshLayout: function() { + this.layoutViewPort.set_manageChildVisibility(this._manageChildVisibility); + this.layoutViewPort.set_layout(this.get_layout()); + } + ,scrollContainer_addedToStageHandler: function(event) { + if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + this.addEventListener("removedFromStage",$bind(this,this.scrollContainer_removedFromStageHandler)); + this.stage.addEventListener("resize",$bind(this,this.scrollContainer_stage_resizeHandler),false,0,true); + } + } + ,scrollContainer_removedFromStageHandler: function(event) { + this.removeEventListener("removedFromStage",$bind(this,this.scrollContainer_removedFromStageHandler)); + this.stage.removeEventListener("resize",$bind(this,this.scrollContainer_stage_resizeHandler)); + } + ,scrollContainer_stage_resizeHandler: function(event) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + ,scrollContainer_child_layoutDataChangeHandler: function(event) { + if(this._ignoreChildChanges) { + return; + } + if(this._ignoreChangesButSetFlags) { + this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT); + return; + } + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + ,scrollContainer_child_resizeHandler: function(event) { + if(this._ignoreChildChanges) { + return; + } + if(this._ignoreChangesButSetFlags) { + this.setInvalidationFlag(feathers_core_InvalidationFlag.LAYOUT); + return; + } + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + ,scrollContainer_child_removedHandler: function(event) { + if(this._ignoreRemovedEvent || openfl_utils_Object.__neq(event.target,event.currentTarget)) { + return; + } + var child = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject); + this.removeChildInternal(child,false); + } + ,get_styleContext: function() { + return feathers_controls_ScrollContainer; + } + ,get_layout: function() { + return this.__layout; + } + ,set_layout: function(value) { + if(!this.setStyle("layout")) { + return this.__layout; + } + if(this.__layout == value) { + return this.__layout; + } + this._previousClearStyle = $bind(this,this.clearStyle_layout); + this.__layout = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__layout; + } + ,clearStyle_layout: function() { + this.set_layout(null); + return this.get_layout(); + } + ,__class__: feathers_controls_ScrollContainer + ,__properties__: $extend(feathers_controls_supportClasses_BaseScrollContainer.prototype.__properties__,{get_numRawChildren:"get_numRawChildren",set_manageChildVisibility:"set_manageChildVisibility",get_manageChildVisibility:"get_manageChildVisibility",set_autoSizeMode:"set_autoSizeMode",get_autoSizeMode:"get_autoSizeMode",set_childFocusEnabled:"set_childFocusEnabled",get_childFocusEnabled:"get_childFocusEnabled",set_xmlContent:"set_xmlContent",get_xmlContent:"get_xmlContent",set_layout:"set_layout",get_layout:"get_layout"}) +}); +var feathers_core_IFocusExtras = function() { }; +$hxClasses["feathers.core.IFocusExtras"] = feathers_core_IFocusExtras; +feathers_core_IFocusExtras.__name__ = "feathers.core.IFocusExtras"; +feathers_core_IFocusExtras.__isInterface__ = true; +feathers_core_IFocusExtras.__interfaces__ = [feathers_core_IFocusManagerAware]; +feathers_core_IFocusExtras.prototype = { + __class__: feathers_core_IFocusExtras + ,__properties__: {get_focusExtrasAfter:"get_focusExtrasAfter",get_focusExtrasBefore:"get_focusExtrasBefore"} +}; +var feathers_controls_Panel = function() { + this._focusExtrasAfter = []; + this._focusExtrasBefore = []; + this._footer = null; + this._footerMeasurements = null; + this._ignoreFooterResize = false; + this._header = null; + this._headerMeasurements = null; + this._ignoreHeaderResize = false; + this.initializePanelTheme(); + feathers_controls_ScrollContainer.call(this); +}; +$hxClasses["feathers.controls.Panel"] = feathers_controls_Panel; +feathers_controls_Panel.__name__ = "feathers.controls.Panel"; +feathers_controls_Panel.__interfaces__ = [feathers_core_IFocusExtras]; +feathers_controls_Panel.__super__ = feathers_controls_ScrollContainer; +feathers_controls_Panel.prototype = $extend(feathers_controls_ScrollContainer.prototype,{ + get_header: function() { + return this._header; + } + ,set_header: function(value) { + if(this._header == value) { + return this._header; + } + if(this._header != null) { + this._header.removeEventListener("resize",$bind(this,this.panel_header_resizeHandler)); + HxOverrides.remove(this._focusExtrasBefore,this._header); + this.removeRawChild(this._header); + } + this._header = value; + if(this._header != null) { + this._focusExtrasBefore.push(this._header); + var index = this.layoutViewPort != null ? this.getRawChildIndex(this.layoutViewPort) + 1 : 0; + this.addRawChildAt(this._header,index); + if(js_Boot.__implements(this._header,feathers_core_IUIControl)) { + this._header.initializeNow(); + } + if(this._headerMeasurements == null) { + this._headerMeasurements = new feathers_layout_Measurements(this._header); + } else { + this._headerMeasurements.save(this._header); + } + this._header.addEventListener("resize",$bind(this,this.panel_header_resizeHandler),false,0,true); + } else { + this._headerMeasurements = null; + } + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + return this._header; + } + ,get_footer: function() { + return this._footer; + } + ,set_footer: function(value) { + if(this._footer == value) { + return this._footer; + } + if(this._footer != null) { + this._footer.removeEventListener("resize",$bind(this,this.panel_footer_resizeHandler)); + HxOverrides.remove(this._focusExtrasAfter,this._footer); + this.removeRawChild(this._footer); + } + this._footer = value; + if(this._footer != null) { + this._focusExtrasAfter.push(this._footer); + this.addRawChild(this._footer); + if(js_Boot.__implements(this._footer,feathers_core_IUIControl)) { + this._footer.initializeNow(); + } + if(this._footerMeasurements == null) { + this._footerMeasurements = new feathers_layout_Measurements(this._footer); + } else { + this._footerMeasurements.save(this._footer); + } + this._footer.addEventListener("resize",$bind(this,this.panel_footer_resizeHandler),false,0,true); + } else { + this._footerMeasurements = null; + } + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + return this._footer; + } + ,get_focusExtrasBefore: function() { + return this._focusExtrasBefore; + } + ,get_focusExtrasAfter: function() { + return this._focusExtrasAfter; + } + ,dispose: function() { + if(this._header != null) { + this.set_header(null); + } + if(this._footer != null) { + this.set_footer(null); + } + feathers_controls_ScrollContainer.prototype.dispose.call(this); + } + ,initializePanelTheme: function() { + feathers_themes_steel_components_SteelPanelStyles.initialize(); + } + ,update: function() { + this._ignoreChangesButSetFlags = false; + feathers_controls_ScrollContainer.prototype.update.call(this); + var oldIgnoreHeaderResize = this._ignoreHeaderResize; + this._ignoreHeaderResize = true; + this.layoutHeader(); + this._ignoreHeaderResize = oldIgnoreHeaderResize; + var oldIgnoreFooterResize = this._ignoreFooterResize; + this._ignoreFooterResize = true; + this.layoutFooter(); + this._ignoreFooterResize = oldIgnoreFooterResize; + } + ,calculateViewPortOffsets: function(forceScrollBars,useActualBounds) { + if(this._header != null) { + var oldIgnoreHeaderResize = this._ignoreHeaderResize; + this._ignoreHeaderResize = true; + if(this._headerMeasurements != null) { + this._headerMeasurements.restore(this._header); + } + if(useActualBounds) { + this._header.set_width(this.actualWidth - this.get_paddingLeft() - this.get_paddingRight()); + } else if(this.get_explicitWidth() != null) { + this._header.set_width(this.get_explicitWidth() - this.get_paddingLeft() - this.get_paddingRight()); + } + if(js_Boot.__implements(this._header,feathers_core_IValidating)) { + this._header.validateNow(); + } + this.topViewPortOffset += this._header.get_height(); + this.chromeMeasuredWidth = Math.max(this.chromeMeasuredWidth,this._header.get_width()); + if(js_Boot.__implements(this._header,feathers_core_IMeasureObject)) { + var measureHeader = this._header; + this.chromeMeasuredMinWidth = Math.max(this.chromeMeasuredMinWidth,measureHeader.get_minWidth()); + } + this._ignoreHeaderResize = oldIgnoreHeaderResize; + } + if(this._footer != null) { + var oldIgnoreFooterResize = this._ignoreFooterResize; + this._ignoreFooterResize = true; + if(this._footerMeasurements != null) { + this._footerMeasurements.restore(this._footer); + } + if(useActualBounds) { + this._footer.set_width(this.actualWidth - this.get_paddingLeft() - this.get_paddingRight()); + } else if(this.get_explicitWidth() != null) { + this._footer.set_width(this.get_explicitWidth() - this.get_paddingLeft() - this.get_paddingRight()); + } + if(js_Boot.__implements(this._footer,feathers_core_IValidating)) { + this._footer.validateNow(); + } + this.bottomViewPortOffset += this._footer.get_height(); + this.chromeMeasuredWidth = Math.max(this.chromeMeasuredWidth,this._footer.get_width()); + if(js_Boot.__implements(this._footer,feathers_core_IMeasureObject)) { + var measureFooter = this._footer; + this.chromeMeasuredMinWidth = Math.max(this.chromeMeasuredMinWidth,measureFooter.get_minWidth()); + } + this._ignoreFooterResize = oldIgnoreFooterResize; + } + feathers_controls_ScrollContainer.prototype.calculateViewPortOffsets.call(this,forceScrollBars,useActualBounds); + } + ,layoutHeader: function() { + if(this._header == null) { + return; + } + this._header.set_x(this.get_paddingLeft()); + this._header.set_y(this.get_paddingTop()); + this._header.set_width(this.actualWidth - this.get_paddingLeft() - this.get_paddingRight()); + if(js_Boot.__implements(this._header,feathers_core_IValidating)) { + this._header.validateNow(); + } + } + ,layoutFooter: function() { + if(this._footer == null) { + return; + } + this._footer.set_x(this.get_paddingLeft()); + this._footer.set_width(this.actualWidth - this.get_paddingLeft() - this.get_paddingRight()); + if(js_Boot.__implements(this._footer,feathers_core_IValidating)) { + this._footer.validateNow(); + } + this._footer.set_y(this.actualHeight - this._footer.get_height() - this.get_paddingBottom()); + } + ,panel_header_resizeHandler: function(event) { + if(this._ignoreHeaderResize) { + return; + } + if(this._headerMeasurements != null) { + this._headerMeasurements.save(this._header); + } + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + ,panel_footer_resizeHandler: function(event) { + if(this._ignoreFooterResize) { + return; + } + if(this._footerMeasurements != null) { + this._footerMeasurements.save(this._footer); + } + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + ,get_styleContext: function() { + return feathers_controls_Panel; + } + ,__class__: feathers_controls_Panel + ,__properties__: $extend(feathers_controls_ScrollContainer.prototype.__properties__,{get_focusExtrasAfter:"get_focusExtrasAfter",get_focusExtrasBefore:"get_focusExtrasBefore",set_footer:"set_footer",get_footer:"get_footer",set_header:"set_header",get_header:"get_header"}) +}); +var feathers_controls_ScrollMode = $hxEnums["feathers.controls.ScrollMode"] = { __ename__:"feathers.controls.ScrollMode",__constructs__:null + ,SCROLL_RECT: {_hx_name:"SCROLL_RECT",_hx_index:0,__enum__:"feathers.controls.ScrollMode",toString:$estr} + ,MASK: {_hx_name:"MASK",_hx_index:1,__enum__:"feathers.controls.ScrollMode",toString:$estr} + ,MASKLESS: {_hx_name:"MASKLESS",_hx_index:2,__enum__:"feathers.controls.ScrollMode",toString:$estr} +}; +feathers_controls_ScrollMode.__constructs__ = [feathers_controls_ScrollMode.SCROLL_RECT,feathers_controls_ScrollMode.MASK,feathers_controls_ScrollMode.MASKLESS]; +var feathers_controls_ScrollPolicy = $hxEnums["feathers.controls.ScrollPolicy"] = { __ename__:"feathers.controls.ScrollPolicy",__constructs__:null + ,ON: {_hx_name:"ON",_hx_index:0,__enum__:"feathers.controls.ScrollPolicy",toString:$estr} + ,OFF: {_hx_name:"OFF",_hx_index:1,__enum__:"feathers.controls.ScrollPolicy",toString:$estr} + ,AUTO: {_hx_name:"AUTO",_hx_index:2,__enum__:"feathers.controls.ScrollPolicy",toString:$estr} +}; +feathers_controls_ScrollPolicy.__constructs__ = [feathers_controls_ScrollPolicy.ON,feathers_controls_ScrollPolicy.OFF,feathers_controls_ScrollPolicy.AUTO]; +var feathers_controls_navigators_BaseNavigator = function() { + this.chromeMeasuredMaxHeight = 1.0 / 0.0; + this.chromeMeasuredMinHeight = 0.0; + this.chromeMeasuredHeight = 0.0; + this.chromeMeasuredMaxWidth = 1.0 / 0.0; + this.chromeMeasuredMinWidth = 0.0; + this.chromeMeasuredWidth = 0.0; + this.leftContentOffset = 0.0; + this.bottomContentOffset = 0.0; + this.rightContentOffset = 0.0; + this.topContentOffset = 0.0; + this._autoSizeMode = feathers_layout_AutoSizeMode.STAGE; + this._waitingForTransitionFrameCount = 0; + this._waitingForDelayedTransition = false; + this._clearAfterTransition = false; + this._nextViewInTransitionMeasurements = new feathers_layout_Measurements(); + this._previousViewInTransitionMeasurements = new feathers_layout_Measurements(); + this._addedItems = new haxe_ds_StringMap(); + this._addedItemIDs = []; + this._activeViewMeasurements = new feathers_layout_Measurements(); + this._childFocusEnabled = true; + feathers_core_FeathersControl.call(this); + this._viewsContainer = this; + this.addEventListener("addedToStage",$bind(this,this.baseNavigator_addedToStageHandler)); +}; +$hxClasses["feathers.controls.navigators.BaseNavigator"] = feathers_controls_navigators_BaseNavigator; +feathers_controls_navigators_BaseNavigator.__name__ = "feathers.controls.navigators.BaseNavigator"; +feathers_controls_navigators_BaseNavigator.__interfaces__ = [feathers_core_IFocusContainer]; +feathers_controls_navigators_BaseNavigator.defaultTransition = function(oldView,newView) { + return new feathers_motion_effects_NoOpEffectContext(oldView); +}; +feathers_controls_navigators_BaseNavigator.__super__ = feathers_core_FeathersControl; +feathers_controls_navigators_BaseNavigator.prototype = $extend(feathers_core_FeathersControl.prototype,{ + get_activeItemID: function() { + return this._activeItemID; + } + ,get_activeItemView: function() { + return this._activeItemView; + } + ,get_transitionActive: function() { + return this._transitionActive; + } + ,get_tabEnabled: function() { + return false; + } + ,get_childFocusEnabled: function() { + if(this._enabled && !this._transitionActive) { + return this._childFocusEnabled; + } else { + return false; + } + } + ,set_childFocusEnabled: function(value) { + if(this._childFocusEnabled == value) { + return this._childFocusEnabled; + } + this._childFocusEnabled = value; + return this._childFocusEnabled; + } + ,get_autoSizeMode: function() { + return this._autoSizeMode; + } + ,set_autoSizeMode: function(value) { + if(this._autoSizeMode == value) { + return this._autoSizeMode; + } + this._autoSizeMode = value; + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + if(this._activeItemView != null) { + if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) { + this._activeItemView.removeEventListener("resize",$bind(this,this.activeItemView_resizeHandler)); + } else { + this._activeItemView.addEventListener("resize",$bind(this,this.activeItemView_resizeHandler)); + } + } + if(this.stage != null) { + if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) { + this.stage.addEventListener("resize",$bind(this,this.baseNavigator_stage_resizeHandler)); + this.addEventListener("removedFromStage",$bind(this,this.baseNavigator_removedFromStageHandler)); + } else { + this.stage.removeEventListener("resize",$bind(this,this.baseNavigator_stage_resizeHandler)); + this.removeEventListener("removedFromStage",$bind(this,this.baseNavigator_removedFromStageHandler)); + } + } + return this._autoSizeMode; + } + ,dispose: function() { + this._pendingItemID = null; + this._pendingItemTransition = null; + this._transitionActive = false; + if(this._activeTransition != null) { + this._activeTransition.removeEventListener("complete",$bind(this,this.transition_completeHandler)); + this._activeTransition.removeEventListener("cancel",$bind(this,this.transition_cancelHandler)); + this._activeTransition.stop(); + } + this._activeItemID = null; + this._activeItemView = null; + this.removeAllItems(); + feathers_core_FeathersControl.prototype.dispose.call(this); + } + ,removeAllItems: function() { + if(this._activeTransition != null) { + this._clearAfterTransition = false; + this._pendingItemID = null; + this._pendingItemTransition = null; + this._activeTransition.toEnd(); + } + if(this._activeItemView != null) { + this.clearActiveItemInternal(null); + feathers_events_FeathersEvent.dispatch(this,"clear"); + } + this._addedItems.h = Object.create(null); + this._addedItemIDs.length = 0; + } + ,hasItem: function(id) { + return Object.prototype.hasOwnProperty.call(this._addedItems.h,id); + } + ,getItemIDs: function(result) { + if(result == null) { + result = []; + } + var h = this._addedItems.h; + var id_h = h; + var id_keys = Object.keys(h); + var id_length = id_keys.length; + var id_current = 0; + while(id_current < id_length) { + var id = id_keys[id_current++]; + result.push(id); + } + return result; + } + ,update: function() { + var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE); + this.topContentOffset = 0.0; + this.rightContentOffset = 0.0; + this.bottomContentOffset = 0.0; + this.leftContentOffset = 0.0; + this.chromeMeasuredWidth = 0.0; + this.chromeMeasuredMinWidth = 0.0; + this.chromeMeasuredMaxWidth = 1.0 / 0.0; + this.chromeMeasuredHeight = 0.0; + this.chromeMeasuredMinHeight = 0.0; + this.chromeMeasuredMaxHeight = 1.0 / 0.0; + if(this.measure()) { + sizeInvalid = true; + } + this.layoutContent(); + } + ,measure: function() { + var needsWidth = this.get_explicitWidth() == null; + var needsHeight = this.get_explicitHeight() == null; + var needsMinWidth = this.get_explicitMinWidth() == null; + var needsMinHeight = this.get_explicitMinHeight() == null; + var needsMaxWidth = this.get_explicitMaxWidth() == null; + var needsMaxHeight = this.get_explicitMaxHeight() == null; + if(!needsWidth && !needsHeight && !needsMinWidth && !needsMinHeight && !needsMaxWidth && !needsMaxHeight) { + return false; + } + var needsToMeasureContent = this._autoSizeMode == feathers_layout_AutoSizeMode.CONTENT || this.stage == null; + var stageWidth = 0.0; + var stageHeight = 0.0; + if(!needsToMeasureContent) { + var topLeft = this.globalToLocal(new openfl_geom_Point()); + var bottomRight = this.globalToLocal(new openfl_geom_Point(this.stage.stageWidth,this.stage.stageHeight)); + stageWidth = bottomRight.x - topLeft.x; + stageHeight = bottomRight.y - topLeft.y; + } + var measureActiveView = null; + if(js_Boot.__implements(this._activeItemView,feathers_core_IMeasureObject)) { + measureActiveView = this._activeItemView; + } + var measurePrevView = null; + var measureNextView = null; + if(this._transitionActive) { + if(js_Boot.__implements(this._previousViewInTransition,feathers_core_IMeasureObject)) { + measurePrevView = this._previousViewInTransition; + } + if(js_Boot.__implements(this._nextViewInTransition,feathers_core_IMeasureObject)) { + measureNextView = this._nextViewInTransition; + } + } + if(this._transitionActive) { + if(needsToMeasureContent) { + if(this._previousViewInTransition != null) { + this._previousViewInTransitionMeasurements.restore(this._previousViewInTransition); + } + if(this._nextViewInTransition != null) { + this._nextViewInTransitionMeasurements.restore(this._nextViewInTransition); + } + } + if(!needsWidth) { + var viewWidth = this.get_explicitWidth() - this.leftContentOffset - this.rightContentOffset; + if(this._previousViewInTransition != null && this._previousViewInTransition.get_width() != viewWidth) { + this._previousViewInTransition.set_width(viewWidth); + } + if(this._nextViewInTransition != null && this._nextViewInTransition.get_width() != viewWidth) { + this._nextViewInTransition.set_width(viewWidth); + } + } else if(!needsToMeasureContent) { + var viewWidth = stageWidth - this.leftContentOffset - this.rightContentOffset; + if(this._previousViewInTransition != null && this._previousViewInTransition.get_width() != viewWidth) { + this._previousViewInTransition.set_width(viewWidth); + } + if(this._nextViewInTransition != null && this._nextViewInTransition.get_width() != viewWidth) { + this._nextViewInTransition.set_width(viewWidth); + } + } + if(!needsHeight) { + var viewHeight = this.get_explicitHeight() - this.topContentOffset - this.leftContentOffset; + if(this._previousViewInTransition != null && this._previousViewInTransition.get_height() != viewHeight) { + this._previousViewInTransition.set_height(viewHeight); + } + if(this._nextViewInTransition != null && this._nextViewInTransition.get_height() != viewHeight) { + this._nextViewInTransition.set_height(viewHeight); + } + } else if(!needsToMeasureContent) { + var viewHeight = stageHeight - this.topContentOffset - this.leftContentOffset; + if(this._previousViewInTransition != null && this._previousViewInTransition.get_height() != viewHeight) { + this._previousViewInTransition.set_height(viewHeight); + } + if(this._nextViewInTransition != null && this._nextViewInTransition.get_height() != viewHeight) { + this._nextViewInTransition.set_height(viewHeight); + } + } + } else if(this._activeItemView != null) { + if(needsToMeasureContent) { + this._activeViewMeasurements.restore(this._activeItemView); + } + if(!needsWidth) { + var viewWidth = this.get_explicitWidth() - this.leftContentOffset - this.rightContentOffset; + if(this._activeItemView.get_width() != viewWidth) { + this._activeItemView.set_width(viewWidth); + } + } else if(!needsToMeasureContent) { + var viewWidth = stageWidth - this.leftContentOffset - this.rightContentOffset; + if(this._activeItemView.get_width() != viewWidth) { + this._activeItemView.set_width(viewWidth); + } + } + if(!needsHeight) { + var viewHeight = this.get_explicitHeight() - this.topContentOffset - this.leftContentOffset; + if(this._activeItemView.get_height() != viewHeight) { + this._activeItemView.set_height(viewHeight); + } + } else if(!needsToMeasureContent) { + var viewHeight = stageHeight - this.topContentOffset - this.leftContentOffset; + if(this._activeItemView.get_height() != viewHeight) { + this._activeItemView.set_height(viewHeight); + } + } + } + if(this._transitionActive) { + if(js_Boot.__implements(this._previousViewInTransition,feathers_core_IValidating)) { + this._previousViewInTransition.validateNow(); + } + if(js_Boot.__implements(this._nextViewInTransition,feathers_core_IValidating)) { + this._nextViewInTransition.validateNow(); + } + } else if(js_Boot.__implements(this._activeItemView,feathers_core_IValidating)) { + this._activeItemView.validateNow(); + } + var newWidth = this.get_explicitWidth(); + if(needsWidth) { + if(needsToMeasureContent) { + newWidth = 0.0; + if(this._transitionActive) { + if(this._previousViewInTransition != null && newWidth < this._previousViewInTransition.get_width()) { + newWidth = this._previousViewInTransition.get_width(); + } + if(this._nextViewInTransition != null && newWidth < this._nextViewInTransition.get_width()) { + newWidth = this._nextViewInTransition.get_width(); + } + } else if(this._activeItemView != null) { + newWidth = this._activeItemView.get_width(); + } + if(newWidth < this.chromeMeasuredWidth) { + newWidth = this.chromeMeasuredWidth; + } + newWidth += this.rightContentOffset + this.leftContentOffset; + } else { + newWidth = stageWidth; + } + } + var newHeight = this.get_explicitHeight(); + if(needsHeight) { + if(needsToMeasureContent) { + newHeight = 0.0; + if(this._transitionActive) { + if(this._previousViewInTransition != null && newHeight < this._previousViewInTransition.get_height()) { + newHeight = this._previousViewInTransition.get_height(); + } + if(this._nextViewInTransition != null && newHeight < this._nextViewInTransition.get_height()) { + newHeight = this._nextViewInTransition.get_height(); + } + } else if(this._activeItemView != null) { + newHeight = this._activeItemView.get_height(); + } + if(newHeight < this.chromeMeasuredHeight) { + newHeight = this.chromeMeasuredHeight; + } + newHeight += this.topContentOffset + this.bottomContentOffset; + } else { + newHeight = stageHeight; + } + } + var newMinWidth = this.get_explicitMinWidth(); + if(needsMinWidth) { + if(needsToMeasureContent) { + newMinWidth = 0.0; + if(this._transitionActive) { + if(measurePrevView != null && newMinWidth < measurePrevView.get_minWidth()) { + newMinWidth = measurePrevView.get_minWidth(); + } else if(this._previousViewInTransition != null && newMinWidth < this._previousViewInTransition.get_width()) { + newMinWidth = this._previousViewInTransition.get_width(); + } + if(measureNextView != null && newMinWidth < measureNextView.get_minWidth()) { + newMinWidth = measureNextView.get_minWidth(); + } else if(this._nextViewInTransition != null && newMinWidth < this._nextViewInTransition.get_width()) { + newMinWidth = this._nextViewInTransition.get_width(); + } + } else if(measureActiveView != null) { + newMinWidth = measureActiveView.get_minWidth(); + } else if(this._activeItemView != null) { + newMinWidth = this._activeItemView.get_width(); + } + if(newMinWidth < this.chromeMeasuredMinWidth) { + newMinWidth = this.chromeMeasuredMinWidth; + } + newMinWidth += this.rightContentOffset + this.leftContentOffset; + } else { + newMinWidth = stageWidth; + } + } + var newMinHeight = this.get_explicitMinHeight(); + if(needsMinHeight) { + if(needsToMeasureContent) { + newMinHeight = 0.0; + if(this._transitionActive) { + if(measurePrevView != null && newMinHeight < measurePrevView.get_minHeight()) { + newMinHeight = measurePrevView.get_minHeight(); + } else if(this._previousViewInTransition != null && newMinHeight < this._previousViewInTransition.get_height()) { + newMinHeight = this._previousViewInTransition.get_height(); + } + if(measureNextView != null && newMinHeight < measureNextView.get_minHeight()) { + newMinHeight = measureNextView.get_minHeight(); + } else if(this._nextViewInTransition != null && newMinHeight < this._nextViewInTransition.get_height()) { + newMinHeight = this._nextViewInTransition.get_height(); + } + } else if(measureActiveView != null) { + newMinHeight = measureActiveView.get_minHeight(); + } else if(this._activeItemView != null) { + newMinHeight = this._activeItemView.get_height(); + } + if(newMinHeight < this.chromeMeasuredMinHeight) { + newMinHeight = this.chromeMeasuredMinHeight; + } + newMinHeight += this.topContentOffset + this.bottomContentOffset; + } else { + newMinHeight = stageHeight; + } + } + var newMaxWidth = this.get_explicitMaxWidth(); + if(needsMaxWidth) { + if(needsToMeasureContent) { + newMaxWidth = 1.0 / 0.0; + if(this._transitionActive) { + if(measurePrevView != null && newMaxWidth < measurePrevView.get_maxWidth()) { + newMaxWidth = measurePrevView.get_maxWidth(); + } else if(this._previousViewInTransition != null && newMaxWidth < this._previousViewInTransition.get_width()) { + newMaxWidth = this._previousViewInTransition.get_width(); + } + if(measureNextView != null && newMaxWidth < measureNextView.get_maxWidth()) { + newMaxWidth = measureNextView.get_maxWidth(); + } else if(this._nextViewInTransition != null && newMaxWidth < this._nextViewInTransition.get_width()) { + newMaxWidth = this._nextViewInTransition.get_width(); + } + } else if(measureActiveView != null) { + newMaxWidth = measureActiveView.get_maxWidth(); + } else if(this._activeItemView != null) { + newMaxWidth = this._activeItemView.get_width(); + } + if(newMaxWidth > this.chromeMeasuredMaxWidth) { + newMaxWidth = this.chromeMeasuredMaxWidth; + } + newMaxWidth += this.rightContentOffset + this.leftContentOffset; + } else { + newMaxWidth = stageWidth; + } + } + var newMaxHeight = this.get_explicitMaxHeight(); + if(needsMaxHeight) { + if(needsToMeasureContent) { + newMaxHeight = 1.0 / 0.0; + if(this._transitionActive) { + if(measurePrevView != null && newMaxHeight > measurePrevView.get_maxHeight()) { + newMaxHeight = measurePrevView.get_maxHeight(); + } else if(this._previousViewInTransition != null && newMaxHeight > this._previousViewInTransition.get_height()) { + newMaxHeight = this._previousViewInTransition.get_height(); + } + if(measureNextView != null && newMaxHeight > measureNextView.get_maxHeight()) { + newMaxHeight = measureNextView.get_maxHeight(); + } else if(this._nextViewInTransition != null && newMaxHeight > this._nextViewInTransition.get_height()) { + newMaxHeight = this._nextViewInTransition.get_height(); + } + } else if(measureActiveView != null) { + newMaxHeight = measureActiveView.get_maxHeight(); + } else if(this._activeItemView != null) { + newMaxHeight = this._activeItemView.get_height(); + } + if(newMaxHeight > this.chromeMeasuredMaxHeight) { + newMaxHeight = this.chromeMeasuredMaxHeight; + } + newMaxHeight += this.topContentOffset + this.bottomContentOffset; + } else { + newMaxHeight = stageHeight; + } + } + return this.saveMeasurements(newWidth,newHeight,newMinWidth,newMinHeight,newMaxWidth,newMaxHeight); + } + ,layoutContent: function() { + var viewWidth = this.actualWidth - this.leftContentOffset - this.rightContentOffset; + var viewHeight = this.actualHeight - this.topContentOffset - this.bottomContentOffset; + if(this._viewsContainer != null && this._viewsContainer != this) { + this._viewsContainer.set_x(this.leftContentOffset); + this._viewsContainer.set_y(this.topContentOffset); + this._viewsContainer.set_width(viewWidth); + this._viewsContainer.set_height(viewHeight); + } + if(this._activeItemView != null) { + if(this._viewsContainer != null && this._viewsContainer != this) { + this._activeItemView.set_x(0.0); + this._activeItemView.set_y(0.0); + } else { + this._activeItemView.set_x(this.leftContentOffset); + this._activeItemView.set_y(this.topContentOffset); + } + if(this._activeItemView.get_width() != viewWidth) { + this._activeItemView.set_width(viewWidth); + } + if(this._activeItemView.get_height() != viewHeight) { + this._activeItemView.set_height(viewHeight); + } + if(js_Boot.__implements(this._activeItemView,feathers_core_IValidating)) { + this._activeItemView.validateNow(); + } + } + if(this._nextViewInTransition != null) { + if(this._viewsContainer != null && this._viewsContainer != this) { + this._nextViewInTransition.set_x(0.0); + this._nextViewInTransition.set_y(0.0); + } else { + this._nextViewInTransition.set_x(this.leftContentOffset); + this._nextViewInTransition.set_y(this.topContentOffset); + } + if(this._nextViewInTransition.get_width() != viewWidth) { + this._nextViewInTransition.set_width(viewWidth); + } + if(this._nextViewInTransition.get_height() != viewHeight) { + this._nextViewInTransition.set_height(viewHeight); + } + if(js_Boot.__implements(this._nextViewInTransition,feathers_core_IValidating)) { + this._nextViewInTransition.validateNow(); + } + } + if(this._viewsContainer != this && js_Boot.__implements(this._viewsContainer,feathers_core_IValidating)) { + this._viewsContainer.validateNow(); + } + } + ,getView: function(id) { + throw new openfl_errors_IllegalOperationError("Missing override of BaseNavigator.getView()"); + } + ,disposeView: function(id,view) { + throw new openfl_errors_IllegalOperationError("Missing override of BaseNavigator.disposeView()"); + } + ,transitionComplete: function() { + } + ,transitionCancel: function() { + } + ,addItemInternal: function(id,item) { + if(Object.prototype.hasOwnProperty.call(this._addedItems.h,id)) { + throw new openfl_errors_ArgumentError("Item with id '" + id + "' already defined. Cannot add two items with the same id."); + } + this._addedItems.h[id] = item; + this._addedItemIDs.push(id); + } + ,removeItemInternal: function(id) { + if(!Object.prototype.hasOwnProperty.call(this._addedItems.h,id)) { + throw new openfl_errors_ArgumentError("Item with id '" + id + "' cannot be removed because this id has not been added."); + } + if(this._transitionActive && (id == this._previousViewInTransitionID || id == this._activeItemID)) { + throw new openfl_errors_IllegalOperationError("Cannot remove an item while it is transitioning in or out."); + } + if(id == this._activeItemID) { + this.clearActiveItemInternal(null); + feathers_events_FeathersEvent.dispatch(this,"clear"); + } + var item = this._addedItems.h[id]; + var _this = this._addedItems; + if(Object.prototype.hasOwnProperty.call(_this.h,id)) { + delete(_this.h[id]); + } + HxOverrides.remove(this._addedItemIDs,id); + return item; + } + ,clearFocusFromPreviousView: function() { + if(this._previousViewInTransition == null) { + return; + } + if(this._focusManager != null) { + if(this._focusManager.get_focus() == null) { + return; + } + if(js_Boot.__implements(this._previousViewInTransition,feathers_core_IFocusObject) && this._focusManager.get_focus() == this._previousViewInTransition) { + this._focusManager.set_focus(null); + } else if(((this._previousViewInTransition) instanceof openfl_display_DisplayObjectContainer) && this._previousViewInTransition.contains(js_Boot.__cast(this._focusManager.get_focus() , openfl_display_DisplayObject))) { + this._focusManager.set_focus(null); + } + } + if(this.stage.get_focus() == null) { + return; + } + if(this.stage.get_focus() == this._previousViewInTransition || ((this._previousViewInTransition) instanceof openfl_display_DisplayObjectContainer) && this._previousViewInTransition.contains(this.stage.get_focus())) { + this.stage.set_focus(this.stage); + } + } + ,showItemInternal: function(id,transition) { + if(!this.hasItem(id)) { + throw new openfl_errors_ArgumentError("Item with id '" + id + "' cannot be displayed because this id has not been added."); + } + if(this._transitionActive) { + this._pendingItemID = id; + this._pendingItemTransition = transition; + this._clearAfterTransition = false; + return null; + } + this._previousViewInTransition = this._activeItemView; + this._previousViewInTransitionID = this._activeItemID; + var tempMeasurements = this._previousViewInTransitionMeasurements; + this._previousViewInTransitionMeasurements = this._activeViewMeasurements; + this._activeViewMeasurements = tempMeasurements; + this.clearFocusFromPreviousView(); + this._transitionActive = true; + var item = this._addedItems.h[id]; + this._nextViewInTransition = this.getView(id); + this._nextViewInTransitionMeasurements.save(this._nextViewInTransition); + if(this._nextViewInTransition == null) { + throw new openfl_errors_IllegalOperationError("Failed to display navigator item with id '" + id + "'. Call to getView() incorrectly returned null."); + } + this._nextViewInTransitionID = id; + if(this._autoSizeMode == feathers_layout_AutoSizeMode.CONTENT || this.stage == null) { + this._nextViewInTransition.addEventListener("resize",$bind(this,this.activeItemView_resizeHandler)); + } + var sameInstance = this._previousViewInTransition == this._nextViewInTransition; + this._viewsContainer.addChild(this._nextViewInTransition); + if(js_Boot.__implements(this._nextViewInTransition,feathers_core_IUIControl)) { + this._nextViewInTransition.initializeNow(); + } + this.setInvalid(feathers_core_InvalidationFlag.SELECTION); + if(this._validationQueue != null && this._validationQueue.get_validating()) { + this._validationQueue.validateNow(); + } else if(!this._validating) { + this.validateNow(); + } + if(sameInstance) { + this._activeItemView = this._nextViewInTransition; + this._activeItemID = this._nextViewInTransitionID; + var tempMeasurements = this._activeViewMeasurements; + this._activeViewMeasurements = this._nextViewInTransitionMeasurements; + this._nextViewInTransitionMeasurements = tempMeasurements; + this._previousViewInTransition = null; + this._previousViewInTransitionID = null; + this._nextViewInTransition = null; + this._nextViewInTransitionID = null; + this._transitionActive = false; + this._activeTransition = null; + feathers_events_FeathersEvent.dispatch(this,"change"); + } else { + this.startTransition(transition); + } + return this._activeItemView; + } + ,clearActiveItemInternal: function(transition) { + if(this._activeItemView == null) { + return; + } + if(this._transitionActive) { + this._pendingItemID = null; + this._pendingItemTransition = transition; + this._clearAfterTransition = true; + return; + } + this.clearFocusFromPreviousView(); + this._transitionActive = true; + this._previousViewInTransition = this._activeItemView; + this._previousViewInTransitionID = this._activeItemID; + var tempMeasurements = this._previousViewInTransitionMeasurements; + this._previousViewInTransitionMeasurements = this._activeViewMeasurements; + this._activeViewMeasurements = tempMeasurements; + this._nextViewInTransition = null; + this._nextViewInTransitionID = null; + this.setInvalid(feathers_core_InvalidationFlag.SELECTION); + this.startTransition(transition); + } + ,startTransition: function(transition) { + feathers_events_TransitionEvent.dispatch(this,"transitionStart",this._previousViewInTransitionID,this._previousViewInTransition,this._nextViewInTransitionID,this._nextViewInTransition); + if(transition != null && transition != feathers_controls_navigators_BaseNavigator.defaultTransition) { + if(this._nextViewInTransition != null) { + this._nextViewInTransition.set_visible(false); + } + this._waitingForTransitionFrameCount = 0; + this._waitingTransition = transition; + this.addEventListener("enterFrame",$bind(this,this.baseNavigator_transitionWait_enterFrameHandler)); + } else { + if(this._nextViewInTransition != null) { + this._nextViewInTransition.set_visible(true); + } + this._activeTransition = feathers_controls_navigators_BaseNavigator.defaultTransition(this._previousViewInTransition,this._nextViewInTransition); + this._activeTransition.addEventListener("complete",$bind(this,this.transition_completeHandler)); + this._activeTransition.addEventListener("cancel",$bind(this,this.transition_cancelHandler)); + this._activeTransition.play(); + } + } + ,startWaitingTransition: function() { + this.removeEventListener("enterFrame",$bind(this,this.baseNavigator_transitionWait_enterFrameHandler)); + if(this._nextViewInTransition != null) { + this._nextViewInTransition.set_visible(true); + } + var transition = this._waitingTransition; + this._waitingTransition = null; + this._activeTransition = transition(this._previousViewInTransition,this._nextViewInTransition); + this._activeTransition.addEventListener("complete",$bind(this,this.transition_completeHandler)); + this._activeTransition.addEventListener("cancel",$bind(this,this.transition_cancelHandler)); + this._activeTransition.play(); + } + ,baseNavigator_addedToStageHandler: function(event) { + if(this._autoSizeMode == feathers_layout_AutoSizeMode.STAGE) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + this.stage.addEventListener("resize",$bind(this,this.baseNavigator_stage_resizeHandler)); + this.addEventListener("removedFromStage",$bind(this,this.baseNavigator_removedFromStageHandler)); + } + } + ,baseNavigator_removedFromStageHandler: function(event) { + this.removeEventListener("removedFromStage",$bind(this,this.baseNavigator_removedFromStageHandler)); + this.stage.removeEventListener("resize",$bind(this,this.baseNavigator_stage_resizeHandler)); + } + ,baseNavigator_transitionWait_enterFrameHandler: function(event) { + if(this._waitingForTransitionFrameCount < 2) { + this._waitingForTransitionFrameCount++; + return; + } + this.startWaitingTransition(); + } + ,baseNavigator_stage_resizeHandler: function(event) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + ,activeItemView_resizeHandler: function(event) { + if(this._validating || this._autoSizeMode != feathers_layout_AutoSizeMode.CONTENT) { + return; + } + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + ,transition_completeHandler: function(event) { + this._activeTransition = null; + this._transitionActive = this._clearAfterTransition || this._pendingItemID != null; + this.transitionComplete(); + if(this._previousViewInTransition != null) { + this._previousViewInTransition.removeEventListener("resize",$bind(this,this.activeItemView_resizeHandler)); + this._viewsContainer.removeChild(this._previousViewInTransition); + this._previousViewInTransitionMeasurements.restore(this._previousViewInTransition); + this.disposeView(this._previousViewInTransitionID,this._previousViewInTransition); + } + var nextView = this._nextViewInTransition; + var nextItemID = this._nextViewInTransitionID; + var previousView = this._previousViewInTransition; + var previousItemID = this._previousViewInTransitionID; + this._previousViewInTransition = null; + this._previousViewInTransitionID = null; + this._nextViewInTransition = null; + this._nextViewInTransitionID = null; + this._activeItemView = nextView; + this._activeItemID = nextItemID; + var tempMeasurements = this._activeViewMeasurements; + this._activeViewMeasurements = this._nextViewInTransitionMeasurements; + this._nextViewInTransitionMeasurements = tempMeasurements; + feathers_events_TransitionEvent.dispatch(this,"transitionComplete",previousItemID,previousView,nextItemID,nextView); + feathers_events_FeathersEvent.dispatch(this,"change"); + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + if(this.stage != null && (this.stage.get_focus() == null || this.stage.get_focus().stage == null)) { + if(((nextView) instanceof openfl_display_InteractiveObject)) { + this.stage.set_focus(js_Boot.__cast(nextView , openfl_display_InteractiveObject)); + } + } + this._transitionActive = false; + var pendingTransition = this._pendingItemTransition; + this._pendingItemTransition = null; + if(this._clearAfterTransition) { + this._clearAfterTransition = false; + this.clearActiveItemInternal(pendingTransition); + } else if(this._pendingItemID != null) { + var pendingItemID = this._pendingItemID; + this._pendingItemID = null; + this.showItemInternal(pendingItemID,pendingTransition); + } + } + ,transition_cancelHandler: function(event) { + this._activeTransition = null; + this._transitionActive = this._clearAfterTransition || this._pendingItemID != null; + if(this._nextViewInTransition != null) { + this._viewsContainer.removeChild(this._nextViewInTransition); + this._nextViewInTransitionMeasurements.restore(this._nextViewInTransition); + this.disposeView(this._nextViewInTransitionID,this._nextViewInTransition); + } + var nextView = this._nextViewInTransition; + var nextItemID = this._nextViewInTransitionID; + var previousView = this._previousViewInTransition; + var previousItemID = this._previousViewInTransitionID; + this._previousViewInTransition = null; + this._previousViewInTransitionID = null; + this._nextViewInTransition = null; + this._nextViewInTransitionID = null; + this._activeItemView = previousView; + this._activeItemID = previousItemID; + var tempMeasurements = this._activeViewMeasurements; + this._activeViewMeasurements = this._previousViewInTransitionMeasurements; + this._previousViewInTransitionMeasurements = tempMeasurements; + this.transitionCancel(); + feathers_events_TransitionEvent.dispatch(this,"transitionCancel",previousItemID,previousView,nextItemID,nextView); + feathers_events_FeathersEvent.dispatch(this,"change"); + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + if(this.stage != null && (this.stage.get_focus() == null || this.stage.get_focus().stage == null)) { + if(((this._activeItemView) instanceof openfl_display_InteractiveObject)) { + this.stage.set_focus(js_Boot.__cast(this._activeItemView , openfl_display_InteractiveObject)); + } + } + this._transitionActive = false; + var pendingTransition = this._pendingItemTransition; + this._pendingItemTransition = null; + if(this._clearAfterTransition) { + this._clearAfterTransition = false; + this.clearActiveItemInternal(pendingTransition); + } else if(this._pendingItemID != null) { + var pendingItemID = this._pendingItemID; + this._pendingItemID = null; + this.showItemInternal(pendingItemID,pendingTransition); + } + } + ,__class__: feathers_controls_navigators_BaseNavigator + ,__properties__: $extend(feathers_core_FeathersControl.prototype.__properties__,{set_autoSizeMode:"set_autoSizeMode",get_autoSizeMode:"get_autoSizeMode",set_childFocusEnabled:"set_childFocusEnabled",get_childFocusEnabled:"get_childFocusEnabled",get_transitionActive:"get_transitionActive",get_activeItemView:"get_activeItemView",get_activeItemID:"get_activeItemID"}) +}); +var feathers_controls_navigators_StackAction = $hxEnums["feathers.controls.navigators.StackAction"] = { __ename__:"feathers.controls.navigators.StackAction",__constructs__:null + ,Push: ($_=function(id,inject,transition) { return {_hx_index:0,id:id,inject:inject,transition:transition,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="Push",$_.__params__ = ["id","inject","transition"],$_) + ,Replace: ($_=function(id,inject,transition) { return {_hx_index:1,id:id,inject:inject,transition:transition,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="Replace",$_.__params__ = ["id","inject","transition"],$_) + ,Pop: ($_=function(returnedObject,transition) { return {_hx_index:2,returnedObject:returnedObject,transition:transition,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="Pop",$_.__params__ = ["returnedObject","transition"],$_) + ,PopMultiple: ($_=function(count,returnedObject,transition) { return {_hx_index:3,count:count,returnedObject:returnedObject,transition:transition,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="PopMultiple",$_.__params__ = ["count","returnedObject","transition"],$_) + ,PopToRoot: ($_=function(returnedObject,transition) { return {_hx_index:4,returnedObject:returnedObject,transition:transition,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="PopToRoot",$_.__params__ = ["returnedObject","transition"],$_) + ,PopToRootAndReplace: ($_=function(id,inject,transition) { return {_hx_index:5,id:id,inject:inject,transition:transition,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="PopToRootAndReplace",$_.__params__ = ["id","inject","transition"],$_) + ,Listener: ($_=function(callback) { return {_hx_index:6,callback:callback,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="Listener",$_.__params__ = ["callback"],$_) + ,NewAction: ($_=function(callback) { return {_hx_index:7,callback:callback,__enum__:"feathers.controls.navigators.StackAction",toString:$estr}; },$_._hx_name="NewAction",$_.__params__ = ["callback"],$_) +}; +feathers_controls_navigators_StackAction.__constructs__ = [feathers_controls_navigators_StackAction.Push,feathers_controls_navigators_StackAction.Replace,feathers_controls_navigators_StackAction.Pop,feathers_controls_navigators_StackAction.PopMultiple,feathers_controls_navigators_StackAction.PopToRoot,feathers_controls_navigators_StackAction.PopToRootAndReplace,feathers_controls_navigators_StackAction.Listener,feathers_controls_navigators_StackAction.NewAction]; +var feathers_controls_navigators_StackItem = function() { + this._viewToEvents = new haxe_ds_ObjectMap(); +}; +$hxClasses["feathers.controls.navigators.StackItem"] = feathers_controls_navigators_StackItem; +feathers_controls_navigators_StackItem.__name__ = "feathers.controls.navigators.StackItem"; +feathers_controls_navigators_StackItem.withClass = function(id,viewClass,actions,returnHandlers,saveData,restoreData) { + var item = new feathers_controls_navigators_StackItem(); + item.id = id; + item.viewFactory = feathers_utils_AbstractDisplayObjectFactory.fromClass(viewClass); + item.actions = actions; + item.returnHandlers = returnHandlers; + item.saveData = saveData; + item.restoreData = restoreData; + return item; +}; +feathers_controls_navigators_StackItem.withFunction = function(id,viewFunction,actions,returnHandlers,saveData,restoreData) { + var item = new feathers_controls_navigators_StackItem(); + item.id = id; + item.viewFactory = feathers_utils_AbstractDisplayObjectFactory.fromFunction(viewFunction); + item.actions = actions; + item.returnHandlers = returnHandlers; + item.saveData = saveData; + item.restoreData = restoreData; + return item; +}; +feathers_controls_navigators_StackItem.withDisplayObject = function(id,viewInstance,actions,returnHandlers,saveData,restoreData) { + var item = new feathers_controls_navigators_StackItem(); + item.id = id; + item.viewFactory = feathers_utils_AbstractDisplayObjectFactory.fromDisplayObject(viewInstance); + item.actions = actions; + item.returnHandlers = returnHandlers; + item.saveData = saveData; + item.restoreData = restoreData; + return item; +}; +feathers_controls_navigators_StackItem.withFactory = function(id,viewFactory,actions,returnHandlers,saveData,restoreData) { + var item = new feathers_controls_navigators_StackItem(); + item.id = id; + item.viewFactory = viewFactory; + item.actions = actions; + item.returnHandlers = returnHandlers; + item.saveData = saveData; + item.restoreData = restoreData; + return item; +}; +feathers_controls_navigators_StackItem.prototype = { + setAction: function(eventType,action) { + if(this.actions == null) { + this.actions = new haxe_ds_StringMap(); + } + if(action == null) { + var _this = this.actions; + if(Object.prototype.hasOwnProperty.call(_this.h,eventType)) { + delete(_this.h[eventType]); + } + } else { + this.actions.h[eventType] = action; + } + } + ,saveData: function(view) { + return null; + } + ,restoreData: function(view,data) { + } + ,getView: function(navigator) { + var view = this.viewFactory.create(); + var listeners = this.addActionListeners(view,navigator); + this._viewToEvents.set(view,listeners); + return view; + } + ,returnView: function(view) { + var viewListeners = this._viewToEvents.h[view.__id__]; + this.removeEventsFromView(view,viewListeners); + this._viewToEvents.remove(view); + if(this.viewFactory.destroy != null) { + this.viewFactory.destroy(view); + } + } + ,addActionListeners: function(view,navigator) { + var listeners = []; + if(this.actions == null) { + return listeners; + } + var h = this.actions.h; + var eventType_h = h; + var eventType_keys = Object.keys(h); + var eventType_length = eventType_keys.length; + var eventType_current = 0; + while(eventType_current < eventType_length) { + var eventType = eventType_keys[eventType_current++]; + var action = this.actions.h[eventType]; + var listener = this.createActionEventListener(action,navigator); + view.addEventListener(eventType,listener); + listeners.push(new feathers_controls_navigators__$StackItem_ViewListener(eventType,listener)); + } + return listeners; + } + ,performAction: function(action,event,navigator) { + switch(action._hx_index) { + case 0: + var id = action.id; + var inject = action.inject; + var transition = action.transition; + navigator.pushItem(id,inject,transition); + break; + case 1: + var id = action.id; + var inject = action.inject; + var transition = action.transition; + navigator.replaceItem(id,inject,transition); + break; + case 2: + var returnedObject = action.returnedObject; + var transition = action.transition; + navigator.popItem(returnedObject,transition); + break; + case 3: + var count = action.count; + var returnedObject = action.returnedObject; + var transition = action.transition; + navigator.popMultipleItems(count,returnedObject,transition); + break; + case 4: + var returnedObject = action.returnedObject; + var transition = action.transition; + navigator.popToRootItem(returnedObject,transition); + break; + case 5: + var id = action.id; + var inject = action.inject; + var transition = action.transition; + navigator.popToRootItemAndReplace(id,inject,transition); + break; + case 6: + var fn = action.callback; + fn(event); + break; + case 7: + var fn = action.callback; + return fn(event); + } + return null; + } + ,createActionEventListener: function(action,navigator) { + var _gthis = this; + var eventListener = function(event) { + if(navigator.get_transitionActive()) { + return; + } + var current = action; + while(current != null) current = _gthis.performAction(current,event,navigator); + }; + return eventListener; + } + ,removeEventsFromView: function(view,viewListeners) { + var _g = 0; + while(_g < viewListeners.length) { + var viewListener = viewListeners[_g]; + ++_g; + view.removeEventListener(viewListener.eventType,viewListener.listener); + } + } + ,__class__: feathers_controls_navigators_StackItem +}; +var feathers_controls_navigators__$StackItem_ViewListener = function(eventType,listener) { + this.eventType = eventType; + this.listener = listener; +}; +$hxClasses["feathers.controls.navigators._StackItem.ViewListener"] = feathers_controls_navigators__$StackItem_ViewListener; +feathers_controls_navigators__$StackItem_ViewListener.__name__ = "feathers.controls.navigators._StackItem.ViewListener"; +feathers_controls_navigators__$StackItem_ViewListener.prototype = { + __class__: feathers_controls_navigators__$StackItem_ViewListener +}; +var feathers_controls_navigators_StackNavigator = function() { + this.__replaceTransition = null; + this.__popTransition = null; + this.__pushTransition = null; + this._poppedHistoryItems = null; + this.savedIsPop = false; + this._popSwipeActiveEdgeSize = 30.0; + this._simulateTouch = false; + this._popSwipeEnabled = false; + this._history = []; + this.initializeStackNavigatorTheme(); + feathers_controls_navigators_BaseNavigator.call(this); + this.addEventListener("initialize",$bind(this,this.stackNavigator_initializeHandler)); + this.addEventListener("addedToStage",$bind(this,this.stackNavigator_addedToStageHandler)); + this.addEventListener("removedFromStage",$bind(this,this.stackNavigator_removedFromStageHandler)); +}; +$hxClasses["feathers.controls.navigators.StackNavigator"] = feathers_controls_navigators_StackNavigator; +feathers_controls_navigators_StackNavigator.__name__ = "feathers.controls.navigators.StackNavigator"; +feathers_controls_navigators_StackNavigator.__super__ = feathers_controls_navigators_BaseNavigator; +feathers_controls_navigators_StackNavigator.prototype = $extend(feathers_controls_navigators_BaseNavigator.prototype,{ + get_stackSize: function() { + return this._history.length; + } + ,get_rootItemID: function() { + if(this._history.length > 0) { + return this._history[0].id; + } + return this._tempRootItemID; + } + ,set_rootItemID: function(value) { + if(!this.get_initialized()) { + this._tempRootItemID = value; + return this._tempRootItemID; + } + this._tempRootItemID = null; + this._history.length = 0; + if(value == null) { + this.clearActiveItemInternal(null); + return null; + } + var historyItem = new feathers_controls_navigators__$StackNavigator_HistoryItem(value,null,null,null); + this._history.push(historyItem); + this.showItemWithInjectAndReturnedObject(value,null,null,null,null,false); + return value; + } + ,get_popSwipeEnabled: function() { + return this._popSwipeEnabled; + } + ,set_popSwipeEnabled: function(value) { + if(this._popSwipeEnabled == value) { + return this._popSwipeEnabled; + } + this._popSwipeEnabled = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._popSwipeEnabled; + } + ,get_simulateTouch: function() { + return this._simulateTouch; + } + ,set_simulateTouch: function(value) { + if(this._simulateTouch == value) { + return this._simulateTouch; + } + this._simulateTouch = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._simulateTouch; + } + ,get_popSwipeActiveEdgeSize: function() { + return this._popSwipeActiveEdgeSize; + } + ,set_popSwipeActiveEdgeSize: function(value) { + if(this._popSwipeActiveEdgeSize == value) { + return this._popSwipeActiveEdgeSize; + } + this._popSwipeActiveEdgeSize = value; + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._popSwipeActiveEdgeSize; + } + ,initializeStackNavigatorTheme: function() { + feathers_themes_steel_components_SteelStackNavigatorStyles.initialize(); + } + ,addItem: function(item) { + this.addItemInternal(item.id,item); + } + ,removeItem: function(id) { + var _g = 0; + var _g1 = this._history; + while(_g < _g1.length) { + var item = _g1[_g]; + ++_g; + if(item.id == id) { + HxOverrides.remove(this._history,item); + } + } + var item = this.removeItemInternal(id); + return js_Boot.__cast(item , feathers_controls_navigators_StackItem); + } + ,removeAllItems: function() { + this._history.length = 0; + feathers_controls_navigators_BaseNavigator.prototype.removeAllItems.call(this); + } + ,getItem: function(id) { + var item = this._addedItems.h[id]; + if(item == null) { + return null; + } + return js_Boot.__cast(item , feathers_controls_navigators_StackItem); + } + ,pushItem: function(id,inject,transition) { + if(transition == null) { + var item = this.getItem(id); + if(item != null && item.pushTransition != null) { + transition = item.pushTransition; + } else { + transition = this.get_pushTransition(); + } + } + if(this._activeItemView != null) { + var viewData = null; + var oldItem = this._addedItems.h[this._activeItemID]; + if(oldItem.saveData != null) { + viewData = oldItem.saveData(this._activeItemView); + } + var historyItem = this._history[this._history.length - 1]; + historyItem.viewData = viewData; + } + var historyItem = new feathers_controls_navigators__$StackNavigator_HistoryItem(id,inject,null,transition); + this._history.push(historyItem); + return this.showItemWithInjectAndReturnedObject(id,transition,inject,null,null,false); + } + ,popItem: function(returnedObject,transition) { + if(this._history.length <= 1) { + return this.get_activeItemView(); + } + if(transition == null) { + var item = this.getItem(this.get_activeItemID()); + if(item != null && item.popTransition != null) { + transition = item.popTransition; + } else { + transition = this.get_popTransition(); + } + } + this._poppedHistoryItems = [this._history.pop()]; + var item = this._history[this._history.length - 1]; + return this.showItemWithInjectAndReturnedObject(item.id,transition,item.inject,returnedObject,item.viewData,true); + } + ,popMultipleItems: function(count,returnedObject,transition) { + if(count <= 0) { + throw new openfl_errors_RangeError("popMultipleItems() must be called with a value greater than zero"); + } + if(transition == null) { + var item = this.getItem(this.get_activeItemID()); + if(item != null && item.popTransition != null) { + transition = item.popTransition; + } else { + transition = this.get_popTransition(); + } + } + var newHistoryLength = this._history.length - count; + if(newHistoryLength < 1) { + throw new openfl_errors_RangeError("popMultipleItems() called with value larger than available history. Received " + count + ". Expected less than " + this._history.length + "."); + } + this._poppedHistoryItems = this._history.slice(newHistoryLength); + this._history.length = newHistoryLength; + var item = this._history[this._history.length - 1]; + return this.showItemWithInjectAndReturnedObject(item.id,transition,item.inject,returnedObject,item.viewData,true); + } + ,popToRootItem: function(returnedObject,transition) { + if(this._history.length <= 1) { + return this.get_activeItemView(); + } + if(transition == null) { + transition = this.get_popTransition(); + } + this._poppedHistoryItems = this._history.slice(1); + this._history.length = 1; + var item = this._history[0]; + return this.showItemWithInjectAndReturnedObject(item.id,transition,item.inject,returnedObject,null,true); + } + ,popAll: function(transition) { + if(this._history.length == 0) { + return; + } + if(transition == null) { + transition = this.get_popTransition(); + } + this._poppedHistoryItems = this._history.slice(); + this._history.length = 0; + this.clearActiveItemInternal(transition); + } + ,replaceItem: function(id,inject,transition) { + if(transition == null) { + transition = this.get_replaceTransition(); + } + var historyItem = new feathers_controls_navigators__$StackNavigator_HistoryItem(id,inject,null,transition); + this._history[this._history.length - 1] = historyItem; + return this.showItemWithInjectAndReturnedObject(id,transition,inject,null,null,false); + } + ,popToRootItemAndReplace: function(id,inject,transition) { + if(transition == null) { + transition = this.get_popTransition(); + } + this._history.length = 1; + this._history[0] = new feathers_controls_navigators__$StackNavigator_HistoryItem(id,inject,null,transition); + return this.showItemWithInjectAndReturnedObject(id,transition,inject,null,null,false); + } + ,initialize: function() { + feathers_controls_navigators_BaseNavigator.prototype.initialize.call(this); + if(this._backEdgePuller == null) { + this._backEdgePuller = new feathers_utils_EdgePuller(this,feathers_layout_RelativePosition.LEFT); + this._backEdgePuller.addEventListener("opening",$bind(this,this.stackNavigator_backEdgePuller_openingHandler)); + this._backEdgePuller.addEventListener("cancel",$bind(this,this.stackNavigator_backEdgePuller_cancelHandler)); + this._backEdgePuller.addEventListener("open",$bind(this,this.stackNavigator_backEdgePuller_openHandler)); + } + } + ,update: function() { + var dataInvalid = this.isInvalid(feathers_core_InvalidationFlag.DATA); + var selectionInvalid = this.isInvalid(feathers_core_InvalidationFlag.SELECTION); + if(dataInvalid || selectionInvalid) { + var tmp = this._enabled && this._popSwipeEnabled && this.get_stackSize() > 1; + this._backEdgePuller.enabled = tmp; + this._backEdgePuller.set_activeBorderSize(this._popSwipeActiveEdgeSize); + this._backEdgePuller.simulateTouch = this._simulateTouch; + } + feathers_controls_navigators_BaseNavigator.prototype.update.call(this); + } + ,getView: function(id) { + var item = js_Boot.__cast(this._addedItems.h[id] , feathers_controls_navigators_StackItem); + var view = item.getView(this); + if(this.savedInject != null) { + this.savedInject(view); + } + if(item.restoreData != null) { + item.restoreData(view,this.savedViewData); + } + if(this.savedIsPop) { + var returnHandlers = item.returnHandlers; + if(returnHandlers != null && Object.prototype.hasOwnProperty.call(returnHandlers.h,this._previousViewInTransitionID)) { + returnHandlers.h[this._previousViewInTransitionID](view,this.savedReturnedObject); + } + } + return view; + } + ,disposeView: function(id,view) { + var item = js_Boot.__cast(this._addedItems.h[id] , feathers_controls_navigators_StackItem); + item.returnView(view); + } + ,transitionComplete: function() { + this._poppedHistoryItems = null; + } + ,transitionCancel: function() { + if(this._poppedHistoryItems != null) { + var _g = 0; + var _g1 = this._poppedHistoryItems; + while(_g < _g1.length) { + var item = _g1[_g]; + ++_g; + this._history.push(item); + } + this._poppedHistoryItems = null; + } + } + ,showItemWithInjectAndReturnedObject: function(id,transition,inject,returnedObject,viewData,isPop) { + this.savedInject = inject; + this.savedReturnedObject = returnedObject; + this.savedViewData = viewData; + this.savedIsPop = isPop; + var result = this.showItemInternal(id,transition); + this.savedInject = null; + this.savedReturnedObject = null; + this.savedIsPop = false; + this.savedViewData = null; + return result; + } + ,startBackDragTransition: function(one,two) { + var _gthis = this; + var effectContext = (this.get_popTransition())(one,two); + this._backEdgePuller.set_snapDuration(effectContext.get_duration()); + this._dragTransitionContext = new feathers_motion_effects_EventToPositionEffectContext(effectContext,this._backEdgePuller,"change",function(event) { + return _gthis._dragTransitionContext.set_position(_gthis._backEdgePuller.get_pullDistance() / _gthis.actualWidth); + }); + return this._dragTransitionContext; + } + ,stackNavigator_initializeHandler: function(event) { + if(this._tempRootItemID != null) { + var id = this._tempRootItemID; + this._tempRootItemID = null; + var historyItem = new feathers_controls_navigators__$StackNavigator_HistoryItem(id,null,null,null); + this._history.push(historyItem); + this.showItemWithInjectAndReturnedObject(id,null,null,null,null,false); + } + } + ,stackNavigator_addedToStageHandler: function(event) { + this.stage.addEventListener("keyUp",$bind(this,this.stackNavigator_stage_keyUpHandler),false,0,true); + } + ,stackNavigator_removedFromStageHandler: function(event) { + this.stage.removeEventListener("keyUp",$bind(this,this.stackNavigator_stage_keyUpHandler)); + } + ,stackNavigator_stage_backKeyUpHandler: function(event) { + if(event.isDefaultPrevented()) { + return; + } + if(this._history.length <= 1) { + return; + } + event.preventDefault(); + this.popItem(); + } + ,stackNavigator_stage_keyUpHandler: function(event) { + if(!this._enabled) { + return; + } + if(event.keyCode == 1073742094) { + this.stackNavigator_stage_backKeyUpHandler(event); + } + } + ,stackNavigator_backEdgePuller_openingHandler: function(event) { + if(this.get_stackSize() <= 1) { + event.preventDefault(); + return; + } + var touchPointID = this._backEdgePuller.get_touchPointID(); + if(touchPointID != null) { + var exclusivePointer = feathers_utils_ExclusivePointer.forStage(this.stage); + if(this._backEdgePuller.get_touchPointIsSimulated()) { + var result = exclusivePointer.claimMouse(this); + if(!result) { + event.preventDefault(); + return; + } + } else { + var result = exclusivePointer.claimTouch(touchPointID,this); + if(!result) { + event.preventDefault(); + return; + } + } + } + if(this.get_popTransition() != null) { + this.popItem(null,$bind(this,this.startBackDragTransition)); + } else { + event.preventDefault(); + this.popItem(); + } + } + ,stackNavigator_backEdgePuller_cancelHandler: function(event) { + var context = this._dragTransitionContext; + this._dragTransitionContext = null; + if(context != null) { + context.set_dispatcher(null); + feathers_events_FeathersEvent.dispatch(context,"cancel"); + } + var tmp = this._enabled && this._popSwipeEnabled && this.get_stackSize() > 1; + this._backEdgePuller.enabled = tmp; + } + ,stackNavigator_backEdgePuller_openHandler: function(event) { + var context = this._dragTransitionContext; + this._dragTransitionContext = null; + if(context != null) { + context.set_dispatcher(null); + feathers_events_FeathersEvent.dispatch(context,"complete"); + } + var oldSnapDuration = this._backEdgePuller.get_snapDuration(); + this._backEdgePuller.set_snapDuration(0.0); + this._backEdgePuller.set_opened(false); + this._backEdgePuller.set_snapDuration(oldSnapDuration); + var tmp = this._enabled && this._popSwipeEnabled && this.get_stackSize() > 1; + this._backEdgePuller.enabled = tmp; + } + ,get_styleContext: function() { + return feathers_controls_navigators_StackNavigator; + } + ,get_pushTransition: function() { + return this.__pushTransition; + } + ,set_pushTransition: function(value) { + if(!this.setStyle("pushTransition")) { + return this.__pushTransition; + } + if(this.__pushTransition == value) { + return this.__pushTransition; + } + this._previousClearStyle = $bind(this,this.clearStyle_pushTransition); + this.__pushTransition = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__pushTransition; + } + ,clearStyle_pushTransition: function() { + this.set_pushTransition(null); + return this.get_pushTransition(); + } + ,get_popTransition: function() { + return this.__popTransition; + } + ,set_popTransition: function(value) { + if(!this.setStyle("popTransition")) { + return this.__popTransition; + } + if(this.__popTransition == value) { + return this.__popTransition; + } + this._previousClearStyle = $bind(this,this.clearStyle_popTransition); + this.__popTransition = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__popTransition; + } + ,clearStyle_popTransition: function() { + this.set_popTransition(null); + return this.get_popTransition(); + } + ,get_replaceTransition: function() { + return this.__replaceTransition; + } + ,set_replaceTransition: function(value) { + if(!this.setStyle("replaceTransition")) { + return this.__replaceTransition; + } + if(this.__replaceTransition == value) { + return this.__replaceTransition; + } + this._previousClearStyle = $bind(this,this.clearStyle_replaceTransition); + this.__replaceTransition = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this.__replaceTransition; + } + ,clearStyle_replaceTransition: function() { + this.set_replaceTransition(null); + return this.get_replaceTransition(); + } + ,__class__: feathers_controls_navigators_StackNavigator + ,__properties__: $extend(feathers_controls_navigators_BaseNavigator.prototype.__properties__,{set_popSwipeActiveEdgeSize:"set_popSwipeActiveEdgeSize",get_popSwipeActiveEdgeSize:"get_popSwipeActiveEdgeSize",set_simulateTouch:"set_simulateTouch",get_simulateTouch:"get_simulateTouch",set_popSwipeEnabled:"set_popSwipeEnabled",get_popSwipeEnabled:"get_popSwipeEnabled",set_rootItemID:"set_rootItemID",get_rootItemID:"get_rootItemID",get_stackSize:"get_stackSize",set_replaceTransition:"set_replaceTransition",get_replaceTransition:"get_replaceTransition",set_popTransition:"set_popTransition",get_popTransition:"get_popTransition",set_pushTransition:"set_pushTransition",get_pushTransition:"get_pushTransition"}) +}); +var feathers_controls_navigators__$StackNavigator_HistoryItem = function(id,inject,viewData,transition) { + this.id = id; + this.inject = inject; + this.viewData = viewData; + this.transition = transition; +}; +$hxClasses["feathers.controls.navigators._StackNavigator.HistoryItem"] = feathers_controls_navigators__$StackNavigator_HistoryItem; +feathers_controls_navigators__$StackNavigator_HistoryItem.__name__ = "feathers.controls.navigators._StackNavigator.HistoryItem"; +feathers_controls_navigators__$StackNavigator_HistoryItem.prototype = { + __class__: feathers_controls_navigators__$StackNavigator_HistoryItem +}; +var feathers_controls_supportClasses_IViewPort = function() { }; +$hxClasses["feathers.controls.supportClasses.IViewPort"] = feathers_controls_supportClasses_IViewPort; +feathers_controls_supportClasses_IViewPort.__name__ = "feathers.controls.supportClasses.IViewPort"; +feathers_controls_supportClasses_IViewPort.__isInterface__ = true; +feathers_controls_supportClasses_IViewPort.__interfaces__ = [feathers_core_IMeasureObject,feathers_core_IValidating,feathers_core_IUIControl]; +feathers_controls_supportClasses_IViewPort.prototype = { + __class__: feathers_controls_supportClasses_IViewPort + ,__properties__: {set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX",set_maxVisibleHeight:"set_maxVisibleHeight",get_maxVisibleHeight:"get_maxVisibleHeight",set_maxVisibleWidth:"set_maxVisibleWidth",get_maxVisibleWidth:"get_maxVisibleWidth",set_minVisibleHeight:"set_minVisibleHeight",get_minVisibleHeight:"get_minVisibleHeight",set_minVisibleWidth:"set_minVisibleWidth",get_minVisibleWidth:"get_minVisibleWidth",set_visibleHeight:"set_visibleHeight",get_visibleHeight:"get_visibleHeight",set_visibleWidth:"set_visibleWidth",get_visibleWidth:"get_visibleWidth"} +}; +var feathers_controls_supportClasses_LayoutViewPort = function() { + this._manageChildVisibility = false; + this._snapPositionsY = null; + this._snapPositionsX = null; + this._scrollY = 0.0; + this._scrollX = 0.0; + this._explicitVisibleHeight = null; + this._actualVisibleHeight = 0.0; + this._maxVisibleHeight = 1.0 / 0.0; + this._actualMinVisibleHeight = 0.0; + this._explicitVisibleWidth = null; + this._actualVisibleWidth = 0.0; + this._maxVisibleWidth = 1.0 / 0.0; + this._explicitMinVisibleWidth = null; + this._actualMinVisibleWidth = 0.0; + feathers_controls_LayoutGroup.call(this); + this._viewPortBackground = new openfl_display_Sprite(); + this._viewPortBackground.get_graphics().beginFill(16711935,0.0); + this._viewPortBackground.get_graphics().drawRect(0.0,0.0,1.0,1.0); + this._viewPortBackground.get_graphics().endFill(); + this._addChildAt(this._viewPortBackground,0); +}; +$hxClasses["feathers.controls.supportClasses.LayoutViewPort"] = feathers_controls_supportClasses_LayoutViewPort; +feathers_controls_supportClasses_LayoutViewPort.__name__ = "feathers.controls.supportClasses.LayoutViewPort"; +feathers_controls_supportClasses_LayoutViewPort.__interfaces__ = [feathers_controls_supportClasses_IViewPort]; +feathers_controls_supportClasses_LayoutViewPort.__super__ = feathers_controls_LayoutGroup; +feathers_controls_supportClasses_LayoutViewPort.prototype = $extend(feathers_controls_LayoutGroup.prototype,{ + get_minVisibleWidth: function() { + if(this._explicitMinVisibleWidth == null) { + return this._actualMinVisibleWidth; + } + return this._explicitMinVisibleWidth; + } + ,set_minVisibleWidth: function(value) { + if(this._explicitMinVisibleWidth == value) { + return this._explicitMinVisibleWidth; + } + var oldValue = this._explicitMinVisibleWidth; + this._explicitMinVisibleWidth = value; + if(value == null) { + this._actualMinVisibleWidth = 0.0; + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } else { + this._actualMinVisibleWidth = value; + if(this._explicitVisibleWidth == null && (this._actualVisibleWidth < value || this._actualVisibleWidth == oldValue)) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + } + return this._explicitMinVisibleWidth; + } + ,get_maxVisibleWidth: function() { + return this._maxVisibleWidth; + } + ,set_maxVisibleWidth: function(value) { + if(this._maxVisibleWidth == value) { + return this._maxVisibleWidth; + } + if(value == null) { + throw new openfl_errors_ArgumentError("maxVisibleWidth cannot be null"); + } + var oldValue = this._maxVisibleWidth; + this._maxVisibleWidth = value; + if(this._explicitVisibleWidth == null && (this._actualVisibleWidth > value || this._actualVisibleWidth == oldValue)) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + return this._maxVisibleWidth; + } + ,get_visibleWidth: function() { + if(this._explicitVisibleWidth == null) { + return this._actualVisibleWidth; + } + return this._explicitVisibleWidth; + } + ,set_visibleWidth: function(value) { + if(this._explicitVisibleWidth == value) { + return this._explicitVisibleWidth; + } + this._explicitVisibleWidth = value; + if(this._actualVisibleWidth != value) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + return this._explicitVisibleWidth; + } + ,get_minVisibleHeight: function() { + if(this._explicitMinVisibleHeight == null) { + return this._actualMinVisibleHeight; + } + return this._explicitMinVisibleHeight; + } + ,set_minVisibleHeight: function(value) { + if(this._explicitMinVisibleHeight == value) { + return this._explicitMinVisibleHeight; + } + var oldValue = this._explicitMinVisibleHeight; + this._explicitMinVisibleHeight = value; + if(value == null) { + this._actualMinVisibleHeight = 0.0; + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } else { + this._actualMinVisibleHeight = value; + if(this._explicitVisibleHeight == null && (this._actualVisibleHeight < value || this._actualVisibleHeight == oldValue)) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + } + return this._explicitMinVisibleHeight; + } + ,get_maxVisibleHeight: function() { + return this._maxVisibleHeight; + } + ,set_maxVisibleHeight: function(value) { + if(this._maxVisibleHeight == value) { + return this._maxVisibleHeight; + } + if(value == null) { + throw new openfl_errors_ArgumentError("maxVisibleHeight cannot be null"); + } + var oldValue = this._maxVisibleHeight; + this._maxVisibleHeight = value; + if(this._explicitVisibleHeight == null && (this._actualVisibleHeight > value || this._actualVisibleHeight == oldValue)) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + return this._maxVisibleHeight; + } + ,get_visibleHeight: function() { + if(this._explicitVisibleHeight == null) { + return this._actualVisibleHeight; + } + return this._explicitVisibleHeight; + } + ,set_visibleHeight: function(value) { + if(this._explicitVisibleHeight == value) { + return this._explicitVisibleHeight; + } + this._explicitVisibleHeight = value; + if(this._actualVisibleHeight != value) { + this.setInvalid(feathers_core_InvalidationFlag.SIZE); + } + return this._explicitVisibleWidth; + } + ,get_scrollX: function() { + return this._scrollX; + } + ,set_scrollX: function(value) { + if(this._scrollX == value) { + return this._scrollX; + } + this._scrollX = value; + if(this._manageChildVisibility || js_Boot.__implements(this._currentLayout,feathers_layout_IScrollLayout)) { + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + return this._scrollX; + } + ,get_scrollY: function() { + return this._scrollY; + } + ,set_scrollY: function(value) { + if(this._scrollY == value) { + return this._scrollY; + } + this._scrollY = value; + if(this._manageChildVisibility || js_Boot.__implements(this._currentLayout,feathers_layout_IScrollLayout)) { + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } + return this._scrollY; + } + ,get_snapPositionsX: function() { + return this._snapPositionsX; + } + ,get_snapPositionsY: function() { + return this._snapPositionsY; + } + ,refreshViewPortBounds: function() { + var needsWidth = this._explicitVisibleWidth == null; + var needsHeight = this._explicitVisibleHeight == null; + var needsMinWidth = this._explicitMinVisibleWidth == null; + var needsMinHeight = this._explicitMinVisibleHeight == null; + var needsMaxWidth = this._maxVisibleWidth == null; + var needsMaxHeight = this._maxVisibleHeight == null; + if(this._currentBackgroundSkin != null) { + feathers_utils_MeasurementsUtil.resetFluidlyWithParent(this._backgroundSkinMeasurements,this._currentBackgroundSkin,this); + } + var needsToMeasureContent = this.get_autoSizeMode() == feathers_layout_AutoSizeMode.CONTENT || this.stage == null; + var stageWidth = 0.0; + var stageHeight = 0.0; + if(!needsToMeasureContent) { + var topLeft = this.globalToLocal(new openfl_geom_Point()); + var bottomRight = this.globalToLocal(new openfl_geom_Point(this.stage.stageWidth,this.stage.stageHeight)); + stageWidth = bottomRight.x - topLeft.x; + stageHeight = bottomRight.y - topLeft.y; + } + if(needsWidth && !needsToMeasureContent) { + this._layoutMeasurements.width = stageWidth; + } else { + this._layoutMeasurements.width = this._explicitVisibleWidth; + } + if(needsHeight && !needsToMeasureContent) { + this._layoutMeasurements.height = stageHeight; + } else { + this._layoutMeasurements.height = this._explicitVisibleHeight; + } + var viewPortMinWidth = this._explicitMinVisibleWidth; + if(needsMinWidth) { + viewPortMinWidth = 0.0; + } + var viewPortMinHeight = this._explicitMinVisibleHeight; + if(needsMinHeight) { + viewPortMinHeight = 0.0; + } + var viewPortMaxWidth = this._maxVisibleWidth; + if(needsMaxWidth) { + viewPortMaxWidth = 1.0 / 0.0; + } + var viewPortMaxHeight = this._maxVisibleHeight; + if(needsMaxHeight) { + viewPortMaxHeight = 1.0 / 0.0; + } + if(this._currentBackgroundSkin != null) { + if(this._currentBackgroundSkin.get_width() > viewPortMinWidth) { + viewPortMinWidth = this._currentBackgroundSkin.get_width(); + } + if(this._currentBackgroundSkin.get_height() > viewPortMinHeight) { + viewPortMinHeight = this._currentBackgroundSkin.get_height(); + } + } + this._layoutMeasurements.minWidth = viewPortMinWidth; + this._layoutMeasurements.minHeight = viewPortMinHeight; + this._layoutMeasurements.maxWidth = viewPortMaxWidth; + this._layoutMeasurements.maxHeight = viewPortMaxHeight; + } + ,handleCustomLayout: function() { + var oldIgnoreLayoutChanges = this._ignoreLayoutChanges; + this._ignoreLayoutChanges = true; + if(js_Boot.__implements(this._currentLayout,feathers_layout_IScrollLayout)) { + var scrollLayout = this._currentLayout; + scrollLayout.set_scrollX(this._scrollX); + scrollLayout.set_scrollY(this._scrollY); + } + this._ignoreLayoutChanges = oldIgnoreLayoutChanges; + feathers_controls_LayoutGroup.prototype.handleCustomLayout.call(this); + } + ,handleLayoutResult: function() { + this.saveMeasurements(this._layoutResult.contentWidth,this._layoutResult.contentHeight,this._layoutResult.contentMinWidth,this._layoutResult.contentMinHeight); + var viewPortWidth = this._layoutResult.viewPortWidth; + var viewPortHeight = this._layoutResult.viewPortHeight; + this._actualVisibleWidth = viewPortWidth; + this._actualVisibleHeight = viewPortHeight; + this._actualMinVisibleWidth = this._layoutResult.contentMinWidth; + this._actualMinVisibleHeight = this._layoutResult.contentMinHeight; + this._viewPortBackground.set_x(Math.min(this.get_scrollX(),0.0)); + this._viewPortBackground.set_y(Math.min(this.get_scrollY(),0.0)); + this._viewPortBackground.set_width(Math.max(this.actualWidth,this._actualVisibleWidth)); + this._viewPortBackground.set_height(Math.max(this.actualHeight,this._actualVisibleHeight)); + if(js_Boot.__implements(this.get_layout(),feathers_layout_ISnapLayout)) { + var snapLayout = this.get_layout(); + this._snapPositionsX = snapLayout.getSnapPositionsX(this.items,this._actualVisibleWidth,this._actualVisibleHeight,this._snapPositionsX); + this._snapPositionsY = snapLayout.getSnapPositionsY(this.items,this._actualVisibleWidth,this._actualVisibleHeight,this._snapPositionsY); + } else { + this._snapPositionsX = null; + this._snapPositionsY = null; + } + } + ,get_manageChildVisibility: function() { + return this._manageChildVisibility; + } + ,set_manageChildVisibility: function(value) { + if(this._manageChildVisibility == value) { + return this._manageChildVisibility; + } + this._manageChildVisibility = value; + if(this._manageChildVisibility) { + this.setInvalid(feathers_core_InvalidationFlag.LAYOUT); + } else { + var _g = 0; + var _g1 = this.items; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + child.set_visible(true); + } + } + return this._manageChildVisibility; + } + ,update: function() { + var layoutInvalid = this.isInvalid(feathers_core_InvalidationFlag.LAYOUT); + var sizeInvalid = this.isInvalid(feathers_core_InvalidationFlag.SIZE); + var scrollInvalid = this.isInvalid(feathers_core_InvalidationFlag.SCROLL); + feathers_controls_LayoutGroup.prototype.update.call(this); + if(layoutInvalid || sizeInvalid || scrollInvalid) { + if(this._manageChildVisibility) { + var maxX = this._scrollX + this._actualVisibleWidth; + var maxY = this._scrollY + this._actualVisibleHeight; + var _g = 0; + var _g1 = this.items; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + child.set_visible(!(child.get_x() > maxX || child.get_x() + child.get_width() < this._scrollX || child.get_y() > maxY || child.get_y() + child.get_height() < this._scrollY)); + } + } + } + } + ,refreshChildVisibility: function() { + if(!this._manageChildVisibility) { + return; + } + var maxX = this._scrollX + this._actualVisibleWidth; + var maxY = this._scrollY + this._actualVisibleHeight; + var _g = 0; + var _g1 = this.items; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + child.set_visible(!(child.get_x() > maxX || child.get_x() + child.get_width() < this._scrollX || child.get_y() > maxY || child.get_y() + child.get_height() < this._scrollY)); + } + } + ,removeChild: function(child) { + if(this._manageChildVisibility && child != null) { + child.set_visible(true); + } + return feathers_controls_LayoutGroup.prototype.removeChild.call(this,child); + } + ,removeChildAt: function(index) { + var child = feathers_controls_LayoutGroup.prototype.removeChildAt.call(this,index); + if(this._manageChildVisibility && child != null) { + child.set_visible(true); + } + return child; + } + ,__class__: feathers_controls_supportClasses_LayoutViewPort + ,__properties__: $extend(feathers_controls_LayoutGroup.prototype.__properties__,{set_manageChildVisibility:"set_manageChildVisibility",get_manageChildVisibility:"get_manageChildVisibility",get_snapPositionsY:"get_snapPositionsY",get_snapPositionsX:"get_snapPositionsX",set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX",set_visibleHeight:"set_visibleHeight",get_visibleHeight:"get_visibleHeight",set_maxVisibleHeight:"set_maxVisibleHeight",get_maxVisibleHeight:"get_maxVisibleHeight",set_minVisibleHeight:"set_minVisibleHeight",get_minVisibleHeight:"get_minVisibleHeight",set_visibleWidth:"set_visibleWidth",get_visibleWidth:"get_visibleWidth",set_maxVisibleWidth:"set_maxVisibleWidth",get_maxVisibleWidth:"get_maxVisibleWidth",set_minVisibleWidth:"set_minVisibleWidth",get_minVisibleWidth:"get_minVisibleWidth"}) +}); +var feathers_core_IFocusManager = function() { }; +$hxClasses["feathers.core.IFocusManager"] = feathers_core_IFocusManager; +feathers_core_IFocusManager.__name__ = "feathers.core.IFocusManager"; +feathers_core_IFocusManager.__isInterface__ = true; +feathers_core_IFocusManager.__interfaces__ = [openfl_events_IEventDispatcher]; +feathers_core_IFocusManager.prototype = { + __class__: feathers_core_IFocusManager + ,__properties__: {set_enabled:"set_enabled",get_enabled:"get_enabled",get_showFocusIndicator:"get_showFocusIndicator",get_focusPane:"get_focusPane",set_focus:"set_focus",get_focus:"get_focus",get_root:"get_root"} +}; +var feathers_core_DefaultFocusManager = function(root) { + this._cancelMouseFocusChange = false; + this._showFocusIndicator = false; + this._focusPane = null; + this._root = null; + this._enabled = true; + openfl_events_EventDispatcher.call(this); + this.set_root(root); +}; +$hxClasses["feathers.core.DefaultFocusManager"] = feathers_core_DefaultFocusManager; +feathers_core_DefaultFocusManager.__name__ = "feathers.core.DefaultFocusManager"; +feathers_core_DefaultFocusManager.__interfaces__ = [feathers_core_IFocusManager]; +feathers_core_DefaultFocusManager.__super__ = openfl_events_EventDispatcher; +feathers_core_DefaultFocusManager.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_enabled: function() { + return this._enabled; + } + ,set_enabled: function(value) { + if(this._enabled == value) { + return this._enabled; + } + if(value && this._root == null) { + throw new openfl_errors_IllegalOperationError("Cannot enable focus manager without a root container."); + } + this._enabled = value; + if(this._root.stage != null) { + if(this._enabled) { + this.restoreFocus(); + } else { + this.set_focus(null); + } + } + return this._enabled; + } + ,get_root: function() { + return this._root; + } + ,set_root: function(value) { + if(this._root == value) { + return this._root; + } + if(this._root != null) { + this.clearFocusManager(this._root); + this._root.removeEventListener("addedToStage",$bind(this,this.defaultFocusManager_root_addedToStageHandler)); + this._root.removeEventListener("removedFromStage",$bind(this,this.defaultFocusManager_root_removedFromStageHandler)); + this._root.removeEventListener("added",$bind(this,this.defaultFocusManager_root_addedHandler)); + this._root.removeEventListener("removed",$bind(this,this.defaultFocusManager_root_removedHandler)); + this._root.removeEventListener("mouseDown",$bind(this,this.defaultFocusManager_root_mouseDownCaptureHandler),true); + this._root.removeEventListener("focusIn",$bind(this,this.defaultFocusManager_root_focusInCaptureHandler),true); + this._root.removeEventListener("mouseFocusChange",$bind(this,this.defaultFocusManager_root_mouseFocusChangeHandler)); + this._root.removeEventListener("activate",$bind(this,this.defaultFocusManager_root_activateHandler)); + this._root.removeEventListener("deactivate",$bind(this,this.defaultFocusManager_root_deactivateHandler)); + this.handleRootRemovedFromStage(this._root.stage); + } + this._root = value; + if(this._root != null) { + this.handleRootAddedToStage(this._root); + this.setFocusManager(this._root); + this._root.addEventListener("addedToStage",$bind(this,this.defaultFocusManager_root_addedToStageHandler),false,0,true); + this._root.addEventListener("removedFromStage",$bind(this,this.defaultFocusManager_root_removedFromStageHandler),false,0,true); + this._root.addEventListener("added",$bind(this,this.defaultFocusManager_root_addedHandler),false,0,true); + this._root.addEventListener("removed",$bind(this,this.defaultFocusManager_root_removedHandler),false,0,true); + this._root.addEventListener("mouseDown",$bind(this,this.defaultFocusManager_root_mouseDownCaptureHandler),true,0,true); + this._root.addEventListener("focusIn",$bind(this,this.defaultFocusManager_root_focusInCaptureHandler),true,0,true); + this._root.addEventListener("mouseFocusChange",$bind(this,this.defaultFocusManager_root_mouseFocusChangeHandler),false,0,true); + this._root.addEventListener("activate",$bind(this,this.defaultFocusManager_root_activateHandler),false,0,true); + this._root.addEventListener("deactivate",$bind(this,this.defaultFocusManager_root_deactivateHandler),false,0,true); + } + return this._root; + } + ,get_focusPane: function() { + if(this._focusPane == null) { + this._focusPane = new openfl_display_Sprite(); + this._focusPane.mouseEnabled = false; + this._focusPane.mouseChildren = false; + this._focusPane.set_tabEnabled(false); + this._focusPane.set_tabChildren(false); + feathers_core_PopUpManager.forStage(this._root.stage).addPopUp(this._focusPane,false,false); + } + return this._focusPane; + } + ,get_showFocusIndicator: function() { + return this._showFocusIndicator; + } + ,get_focus: function() { + if(this._root.stage == null) { + return null; + } + return this.findFocusForDisplayObject(this._root.stage.get_focus()); + } + ,set_focus: function(value) { + if(this._enabled && this._root.stage != null) { + var oldFocus = this.findFocusForDisplayObject(this._root.stage.get_focus()); + if(oldFocus == value) { + this.setStageFocus(js_Boot.__cast(value , openfl_display_InteractiveObject)); + return this.get_focus(); + } + } + if(value != null && value.get_focusManager() != this) { + throw new openfl_errors_ArgumentError("Failed to change focus. Object is not managed by this focus manager: " + Std.string(value)); + } + if(this._enabled && this._root.stage != null) { + this.setStageFocus(js_Boot.__cast(value , openfl_display_InteractiveObject)); + } + return this.get_focus(); + } + ,dispose: function() { + if(this.get_focus() != null) { + this.set_focus(null); + } + if(this._focusPane != null) { + if(this._focusPane.parent != null) { + this._focusPane.parent.removeChild(this._focusPane); + } + this._focusPane = null; + } + var savedRoot = this._root; + this.set_root(null); + this._root = savedRoot; + feathers_events_FeathersEvent.dispatch(this,"clear"); + this._root = null; + } + ,findNextFocus: function(backward) { + if(backward == null) { + backward = false; + } + var result = this.findNextFocusInternal(backward); + return result.newFocus; + } + ,findNextFocusInternal: function(backward) { + if(backward == null) { + backward = false; + } + var newFocus = null; + var wrapped = false; + var currentFocus = this.get_focus(); + if(currentFocus != null && currentFocus.get_focusOwner() != null) { + var focusOwner = currentFocus.get_focusOwner(); + if(focusOwner != null && focusOwner.get_focusManager() != this) { + focusOwner = null; + } + if(focusOwner != null) { + newFocus = focusOwner; + } + } else if(backward) { + if(currentFocus != null && currentFocus.parent != null) { + newFocus = this.findPreviousContainerFocus(currentFocus.parent,js_Boot.__cast(currentFocus , openfl_display_DisplayObject),true); + } + if(newFocus == null) { + newFocus = this.findPreviousChildFocus(this._root); + wrapped = currentFocus != null; + } + } else { + if(currentFocus != null) { + if(js_Boot.__implements(currentFocus,feathers_core_IFocusContainer) && currentFocus.get_childFocusEnabled()) { + newFocus = this.findNextContainerFocus(js_Boot.__cast(currentFocus , openfl_display_DisplayObjectContainer),null,true); + } else if(currentFocus.parent != null) { + newFocus = this.findNextContainerFocus(currentFocus.parent,js_Boot.__cast(currentFocus , openfl_display_DisplayObject),true); + } + } + if(newFocus == null) { + newFocus = this.findNextChildFocus(this._root); + wrapped = currentFocus != null; + } + } + return new feathers_core__$DefaultFocusManager_FocusResult(newFocus,wrapped); + } + ,findNextRelativeFocusInternal: function(keyCode) { + var relativePosition; + switch(keyCode) { + case 37: + relativePosition = feathers_layout_RelativePosition.LEFT; + break; + case 38: + relativePosition = feathers_layout_RelativePosition.TOP; + break; + case 39: + relativePosition = feathers_layout_RelativePosition.RIGHT; + break; + case 40: + relativePosition = feathers_layout_RelativePosition.BOTTOM; + break; + default: + return new feathers_core__$DefaultFocusManager_FocusResult(null,false); + } + var currentFocus = this.get_focus(); + var focusableObjects = feathers_utils_FocusUtil.findAllFocusableObjects(this._root); + if(currentFocus == null) { + if(focusableObjects.length > 0) { + return new feathers_core__$DefaultFocusManager_FocusResult(focusableObjects[0],false); + } + return new feathers_core__$DefaultFocusManager_FocusResult(null,false); + } + var newFocus = currentFocus; + var focusedRect = (js_Boot.__cast(currentFocus , openfl_display_DisplayObject)).getBounds(currentFocus.stage); + var _g = 0; + while(_g < focusableObjects.length) { + var focusableObject = focusableObjects[_g]; + ++_g; + if(focusableObject == currentFocus) { + continue; + } + if(!this.isValidFocus(focusableObject)) { + continue; + } + if(feathers_utils_DPadFocusUtil.isBetterFocusForRelativePosition(js_Boot.__cast(focusableObject , openfl_display_DisplayObject),js_Boot.__cast(newFocus , openfl_display_DisplayObject),focusedRect,relativePosition)) { + newFocus = focusableObject; + } + } + return new feathers_core__$DefaultFocusManager_FocusResult(newFocus,false); + } + ,isValidFocusWithKeyboard: function(target) { + if(((target) instanceof openfl_display_InteractiveObject) && !target.get_tabEnabled()) { + return false; + } + return this.isValidFocus(target); + } + ,isValidFocus: function(target,allowIfUnderModal) { + if(allowIfUnderModal == null) { + allowIfUnderModal = false; + } + if(target == null || target.stage == null || target.get_focusManager() != this || !target.get_focusEnabled() || !target.get_visible()) { + return false; + } + if(js_Boot.__implements(target,feathers_core_IUIControl)) { + var uiTarget = target; + if(!uiTarget.get_enabled()) { + return false; + } + } + if(!allowIfUnderModal) { + var popUpManager = feathers_core_PopUpManager.forStage(this._root.stage); + if(popUpManager.hasModalPopUps()) { + var displayTarget = js_Boot.__cast(target , openfl_display_DisplayObject); + if(!feathers_utils_PopUpUtil.isTopLevelPopUpOrIsContainedByTopLevelPopUp(displayTarget)) { + return false; + } + } + } + return true; + } + ,setFocusManager: function(target) { + if(js_Boot.__implements(target,feathers_core_IFocusManagerAware)) { + var targetWithFocus = target; + targetWithFocus.set_focusManager(this); + } + var container = ((target) instanceof openfl_display_DisplayObjectContainer) ? target : null; + if(container != null) { + var _g = 0; + var _g1 = container.get_numChildren(); + while(_g < _g1) { + var i = _g++; + var child = container.getChildAt(i); + this.setFocusManager(child); + } + if(js_Boot.__implements(container,feathers_core_IFocusExtras)) { + var focusWithExtras = container; + var extras = focusWithExtras.get_focusExtrasBefore(); + if(extras != null) { + var _g = 0; + while(_g < extras.length) { + var child = extras[_g]; + ++_g; + this.setFocusManager(child); + } + } + extras = focusWithExtras.get_focusExtrasAfter(); + if(extras != null) { + var _g = 0; + while(_g < extras.length) { + var child = extras[_g]; + ++_g; + this.setFocusManager(child); + } + } + } + } + } + ,clearFocusManager: function(target) { + if(js_Boot.__implements(target,feathers_core_IFocusManagerAware)) { + var targetWithFocus = target; + if(targetWithFocus.get_focusManager() == this) { + if(targetWithFocus == this._focusToRestore) { + this._focusToRestore = null; + } + if(this.get_focus() == targetWithFocus) { + var focusOwner = null; + if(js_Boot.__implements(target,feathers_core_IFocusObject)) { + focusOwner = targetWithFocus.get_focusOwner(); + } + if(focusOwner != null && focusOwner.get_focusManager() != this) { + focusOwner = null; + } + this.set_focus(focusOwner); + } + targetWithFocus.set_focusManager(null); + } + } + var container = ((target) instanceof openfl_display_DisplayObjectContainer) ? target : null; + if(container != null) { + var _g = 0; + var _g1 = container.get_numChildren(); + while(_g < _g1) { + var i = _g++; + var child = container.getChildAt(i); + this.clearFocusManager(child); + } + if(js_Boot.__implements(container,feathers_core_IFocusExtras)) { + var focusWithExtras = container; + var extras = focusWithExtras.get_focusExtrasBefore(); + if(extras != null) { + var _g = 0; + while(_g < extras.length) { + var child = extras[_g]; + ++_g; + this.clearFocusManager(child); + } + } + extras = focusWithExtras.get_focusExtrasAfter(); + if(extras != null) { + var _g = 0; + while(_g < extras.length) { + var child = extras[_g]; + ++_g; + this.clearFocusManager(child); + } + } + } + } + } + ,findPreviousContainerFocus: function(container,beforeChild,fallbackToGlobal) { + var outerContainer = container; + if(js_Boot.__implements(container,feathers_controls_supportClasses_IViewPort) && !js_Boot.__implements(container,feathers_core_IFocusContainer)) { + outerContainer = container.parent; + } + var hasProcessedBeforeChild = beforeChild == null; + if(js_Boot.__implements(outerContainer,feathers_core_IFocusExtras)) { + var focusWithExtras = outerContainer; + var extras = focusWithExtras.get_focusExtrasAfter(); + if(extras != null) { + var startIndex = extras.length - 1; + if(!hasProcessedBeforeChild) { + var extraIndex = extras.indexOf(beforeChild); + if(extraIndex != -1) { + startIndex = extraIndex - 1; + hasProcessedBeforeChild = true; + } + } + if(hasProcessedBeforeChild) { + var i = startIndex; + while(i >= 0) { + var child = extras[i]; + var foundChild = this.findPreviousChildFocus(child); + if(foundChild != null) { + return foundChild; + } + --i; + } + } + } + } + var startIndex = container.get_numChildren() - 1; + if(!hasProcessedBeforeChild) { + var childIndex = -1; + try { + childIndex = container.getChildIndex(beforeChild); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + } + if(childIndex != -1) { + startIndex = childIndex - 1; + hasProcessedBeforeChild = true; + } + } + if(hasProcessedBeforeChild) { + var i = startIndex; + while(i >= 0) { + var child = container.getChildAt(i); + var foundChild = this.findPreviousChildFocus(child); + if(foundChild != null) { + return foundChild; + } + --i; + } + } + if(js_Boot.__implements(outerContainer,feathers_core_IFocusExtras)) { + var focusWithExtras = outerContainer; + var extras = focusWithExtras.get_focusExtrasBefore(); + if(extras != null) { + var startIndex = extras.length - 1; + if(!hasProcessedBeforeChild) { + var extraIndex = extras.indexOf(beforeChild); + if(extraIndex != -1) { + startIndex = extraIndex - 1; + hasProcessedBeforeChild = true; + } + } + if(hasProcessedBeforeChild) { + var i = startIndex; + while(i >= 0) { + var child = extras[i]; + var foundChild = this.findPreviousChildFocus(child); + if(foundChild != null) { + return foundChild; + } + --i; + } + } + } + } + if(fallbackToGlobal && outerContainer != this._root) { + if(js_Boot.__implements(outerContainer,feathers_core_IFocusObject)) { + var focusContainer = outerContainer; + if(this.isValidFocusWithKeyboard(focusContainer)) { + return focusContainer; + } + } + return this.findPreviousContainerFocus(outerContainer.parent,outerContainer,true); + } + return null; + } + ,findNextContainerFocus: function(container,afterChild,fallbackToGlobal) { + var outerContainer = container; + if(js_Boot.__implements(container,feathers_controls_supportClasses_IViewPort) && !js_Boot.__implements(container,feathers_core_IFocusContainer)) { + outerContainer = container.parent; + } + var hasProcessedAfterChild = afterChild == null; + var exclusions = null; + if(js_Boot.__implements(outerContainer,feathers_core_IFocusExclusions)) { + exclusions = outerContainer.get_focusExclusions(); + } + if(js_Boot.__implements(outerContainer,feathers_core_IFocusExtras)) { + var focusWithExtras = outerContainer; + var extras = focusWithExtras.get_focusExtrasBefore(); + if(extras != null) { + var startIndex = 0; + if(!hasProcessedAfterChild) { + var extrasIndex = extras.indexOf(afterChild); + if(extrasIndex != -1) { + startIndex = extrasIndex + 1; + hasProcessedAfterChild = true; + } + } + if(hasProcessedAfterChild) { + var _g = startIndex; + var _g1 = extras.length; + while(_g < _g1) { + var i = _g++; + var child = extras[i]; + if(exclusions != null && exclusions.indexOf(child) != -1) { + continue; + } + var foundChild = this.findNextChildFocus(child); + if(foundChild != null) { + return foundChild; + } + } + } + } + } + var startIndex = 0; + if(!hasProcessedAfterChild) { + var childIndex = -1; + try { + childIndex = container.getChildIndex(afterChild); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + } + if(childIndex != -1) { + startIndex = childIndex + 1; + hasProcessedAfterChild = true; + } + } + if(hasProcessedAfterChild) { + var _g = startIndex; + var _g1 = container.get_numChildren(); + while(_g < _g1) { + var i = _g++; + var child = container.getChildAt(i); + if(exclusions != null && exclusions.indexOf(child) != -1) { + continue; + } + var foundChild = this.findNextChildFocus(child); + if(foundChild != null) { + return foundChild; + } + } + } + if(js_Boot.__implements(outerContainer,feathers_core_IFocusExtras)) { + var focusWithExtras = outerContainer; + var extras = focusWithExtras.get_focusExtrasAfter(); + if(extras != null) { + var startIndex = 0; + if(!hasProcessedAfterChild) { + var extrasIndex = extras.indexOf(afterChild); + if(extrasIndex != -1) { + startIndex = extrasIndex + 1; + hasProcessedAfterChild = true; + } + } + if(hasProcessedAfterChild) { + var _g = startIndex; + var _g1 = extras.length; + while(_g < _g1) { + var i = _g++; + var child = extras[i]; + if(exclusions != null && exclusions.indexOf(child) != -1) { + continue; + } + var foundChild = this.findNextChildFocus(child); + if(foundChild != null) { + return foundChild; + } + } + } + } + } + if(fallbackToGlobal && outerContainer != this._root && outerContainer.parent != null) { + var foundChild = this.findNextContainerFocus(outerContainer.parent,outerContainer,true); + if(foundChild != null) { + return foundChild; + } + } + return null; + } + ,findPreviousChildFocus: function(child) { + var childContainer = ((child) instanceof openfl_display_DisplayObjectContainer) ? child : null; + if(childContainer != null) { + var findPrevChildContainer = !js_Boot.__implements(childContainer,feathers_core_IFocusObject); + if(!findPrevChildContainer && js_Boot.__implements(childContainer,feathers_core_IFocusContainer)) { + var focusContainer = childContainer; + findPrevChildContainer = focusContainer.get_childFocusEnabled(); + } + if(findPrevChildContainer) { + var foundChild = this.findPreviousContainerFocus(childContainer,null,false); + if(foundChild != null) { + return foundChild; + } + } + } + if(js_Boot.__implements(child,feathers_core_IFocusObject)) { + var childWithFocus = child; + if(this.isValidFocusWithKeyboard(childWithFocus)) { + if(!js_Boot.__implements(childWithFocus,feathers_controls_IGroupedToggle)) { + return childWithFocus; + } + var toggleGroup = childWithFocus.get_toggleGroup(); + if(toggleGroup == null) { + return childWithFocus; + } + if(js_Boot.__implements(toggleGroup.get_selectedItem(),feathers_core_IFocusObject)) { + var selectedItem = toggleGroup.get_selectedItem(); + if(this.get_focus() != selectedItem) { + return selectedItem; + } + } + } + } + return null; + } + ,findNextChildFocus: function(child) { + if(js_Boot.__implements(child,feathers_core_IFocusObject)) { + var childWithFocus = child; + if(this.isValidFocusWithKeyboard(childWithFocus)) { + if(!js_Boot.__implements(childWithFocus,feathers_controls_IGroupedToggle)) { + return childWithFocus; + } + var toggleGroup = childWithFocus.get_toggleGroup(); + if(toggleGroup == null) { + return childWithFocus; + } + if(js_Boot.__implements(toggleGroup.get_selectedItem(),feathers_core_IFocusObject)) { + var selectedItem = toggleGroup.get_selectedItem(); + if(this.get_focus() != selectedItem) { + return selectedItem; + } + } + } + } + var childContainer = ((child) instanceof openfl_display_DisplayObjectContainer) ? child : null; + if(childContainer != null) { + var findNextChildContainer = !js_Boot.__implements(childContainer,feathers_core_IFocusObject); + if(!findNextChildContainer && js_Boot.__implements(childContainer,feathers_core_IFocusContainer)) { + var focusContainer = childContainer; + findNextChildContainer = focusContainer.get_childFocusEnabled(); + } + if(findNextChildContainer) { + var foundChild = this.findNextContainerFocus(childContainer,null,false); + if(foundChild != null) { + return foundChild; + } + } + } + return null; + } + ,setStageFocus: function(value) { + while(js_Boot.__implements(value,feathers_core_IStageFocusDelegate)) { + var newFocusTarget = value.get_stageFocusTarget(); + if(newFocusTarget == null) { + break; + } + value = newFocusTarget; + } + if(value == null) { + value = this._root.stage; + } + if(this._root.stage.window == null) { + return; + } + if(this._root.stage.get_focus() != value) { + this._root.stage.set_focus(value); + } + } + ,handleRootAddedToStage: function(root) { + var stage = this._root.stage; + if(stage == null) { + return; + } + stage.stageFocusRect = false; + if(this._enabled && stage.get_focus() == null) { + stage.set_focus(stage); + } + this._root.addEventListener("keyDown",$bind(this,this.defaultFocusManager_root_keyDownHandler),false,0,true); + this._root.addEventListener("keyFocusChange",$bind(this,this.defaultFocusManager_root_keyFocusChangeHandler),false,0,true); + } + ,handleRootRemovedFromStage: function(root) { + this.set_focus(null); + var stage = this._root.stage; + if(stage == null) { + return; + } + this._root.removeEventListener("keyDown",$bind(this,this.defaultFocusManager_root_keyDownHandler)); + this._root.removeEventListener("keyFocusChange",$bind(this,this.defaultFocusManager_root_keyFocusChangeHandler)); + } + ,defaultFocusManager_root_addedToStageHandler: function(event) { + this.handleRootAddedToStage(js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject)); + } + ,defaultFocusManager_root_removedFromStageHandler: function(event) { + this.handleRootRemovedFromStage(js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject)); + } + ,restoreFocus: function() { + if(this._root.stage == null || this._focusToRestore == null || !this.isValidFocus(this._focusToRestore)) { + return; + } + this.set_focus(this._focusToRestore); + } + ,shouldBeManaged: function(target) { + if(target == this._root) { + return true; + } + var container = target.parent; + var valid = false; + try { + valid = container.getChildIndex(target) != -1; + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + } + if(valid && js_Boot.__implements(container,feathers_controls_supportClasses_IViewPort) && !js_Boot.__implements(container,feathers_core_IFocusContainer)) { + container = container.parent; + } else if(!valid && js_Boot.__implements(container,feathers_core_IFocusExtras)) { + var focusWithExtras = container; + if(focusWithExtras.get_focusExtrasBefore() != null) { + var _g = 0; + var _g1 = focusWithExtras.get_focusExtrasBefore(); + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + if(child == target) { + valid = true; + break; + } + if(((child) instanceof openfl_display_DisplayObjectContainer)) { + valid = child.contains(child); + if(valid) { + break; + } + } + } + } + if(!valid && focusWithExtras.get_focusExtrasAfter() != null) { + var _g = 0; + var _g1 = focusWithExtras.get_focusExtrasAfter(); + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + if(child == target) { + valid = true; + break; + } + if(((child) instanceof openfl_display_DisplayObjectContainer)) { + valid = child.contains(child); + if(valid) { + break; + } + } + } + } + } + if(!valid) { + return false; + } + if(container != null && container != this._root) { + return this.shouldBeManaged(container); + } + return true; + } + ,defaultFocusManager_root_addedHandler: function(event) { + var target = js_Boot.__cast(event.target , openfl_display_DisplayObject); + if(this._focusPane != null) { + if(this._focusPane == target || this._focusPane.contains(target)) { + feathers_core_PopUpManager.forStage(this._root.stage).addPopUp(this._focusPane,false,false); + return; + } + } + if(this.shouldBeManaged(target)) { + this.setFocusManager(target); + } + var currentFocus = null; + if(this._root.stage != null) { + currentFocus = this.findFocusForDisplayObject(this._root.stage.get_focus(),true); + } + if(currentFocus != null && !this.isValidFocus(currentFocus)) { + this.set_focus(null); + } + } + ,defaultFocusManager_root_removedHandler: function(event) { + var target = js_Boot.__cast(event.target , openfl_display_DisplayObject); + this.clearFocusManager(target); + } + ,defaultFocusManager_root_mouseFocusChangeHandler: function(event) { + if(event.isDefaultPrevented()) { + this._cancelMouseFocusChange = true; + return; + } + if(!this._enabled) { + return; + } + this._showFocusIndicator = false; + var value = event.relatedObject; + var textField = ((value) instanceof openfl_text_TextField) ? value : null; + if(textField != null) { + if(textField.get_type() == 1 || textField.get_selectable()) { + return; + } + var newFocus = js_Boot.__cast(this.findFocusForDisplayObject(textField) , openfl_display_DisplayObject); + while(js_Boot.__implements(newFocus,feathers_core_IStageFocusDelegate)) { + var newFocusTarget = newFocus.get_stageFocusTarget(); + if(newFocusTarget == null) { + break; + } + newFocus = newFocusTarget; + } + if(textField == newFocus) { + return; + } + } + event.preventDefault(); + } + ,handleKeyDownFocusWrapping: function(event) { + if(openfl_system_Capabilities.playerType == "StandAlone" || openfl_system_Capabilities.playerType == "Desktop") { + return; + } + if(!this._enabled || event.isDefaultPrevented()) { + return; + } + if(event.keyCode != 9 && event.keyCode != 0) { + return; + } + if(this._wrapObject != null) { + if(this._wrapObject.get_tabIndex() == feathers_core_DefaultFocusManager.WRAP_OBJECT_HIGH_TAB_INDEX) { + this._wrapObject.set_tabIndex(-1); + } + this._wrapObject = null; + } + var result = this.findNextFocusInternal(event.shiftKey); + if(result.wrapped) { + this._wrapObject = this._root.stage.get_focus(); + if(this._wrapObject != null && this._wrapObject.get_tabIndex() == -1) { + this._wrapObject.set_tabIndex(event.shiftKey ? 0 : feathers_core_DefaultFocusManager.WRAP_OBJECT_HIGH_TAB_INDEX); + } + return; + } + } + ,handleDPadArrowKeys: function(event) { + if(event.keyLocation != 4) { + return; + } + if(event.keyCode != 38 && event.keyCode != 40 && event.keyCode != 37 && event.keyCode != 39) { + return; + } + if(event.isDefaultPrevented()) { + return; + } + this._showFocusIndicator = true; + var result = this.findNextRelativeFocusInternal(event.keyCode); + this.set_focus(result.newFocus); + } + ,defaultFocusManager_root_keyDownHandler: function(event) { + this.handleKeyDownFocusWrapping(event); + this.handleDPadArrowKeys(event); + } + ,defaultFocusManager_root_keyFocusChangeHandler: function(event) { + if(!this._enabled || event.isDefaultPrevented()) { + return; + } + if(event.keyCode != 9 && event.keyCode != 0) { + return; + } + this._showFocusIndicator = true; + var result = this.findNextFocusInternal(event.shiftKey); + this.set_focus(result.newFocus); + if(this._wrapObject == null) { + event.preventDefault(); + } else if(((this._wrapObject) instanceof openfl_text_TextField) && this._wrapObject.get_type() == 1) { + event.preventDefault(); + } + } + ,findFocusForDisplayObject: function(target,allowIfUnderModal) { + if(allowIfUnderModal == null) { + allowIfUnderModal = false; + } + if(target == null) { + return null; + } + var focusTarget = null; + do { + if(js_Boot.__implements(target,feathers_core_IFocusObject)) { + var tempFocusTarget = target; + if(this.isValidFocus(tempFocusTarget,allowIfUnderModal)) { + if(focusTarget == null || !js_Boot.__implements(tempFocusTarget,feathers_core_IFocusContainer) || !tempFocusTarget.get_childFocusEnabled()) { + focusTarget = tempFocusTarget; + } + } else if(tempFocusTarget.get_focusOwner() != null && this.isValidFocus(tempFocusTarget.get_focusOwner(),allowIfUnderModal)) { + focusTarget = tempFocusTarget.get_focusOwner(); + target = js_Boot.__cast(tempFocusTarget , openfl_display_DisplayObject); + } + } + if(target == this._root) { + break; + } + target = target.parent; + } while(target != null); + return focusTarget; + } + ,defaultFocusManager_root_mouseDownCaptureHandler: function(event) { + this._showFocusIndicator = false; + if(this._cancelMouseFocusChange) { + this._cancelMouseFocusChange = false; + return; + } + if(!this._enabled) { + return; + } + var interactiveTarget = event.target; + var newFocus = this.findFocusForDisplayObject(interactiveTarget); + this.set_focus(newFocus); + } + ,defaultFocusManager_root_focusInCaptureHandler: function(event) { + if(!this._enabled) { + return; + } + this._focusToRestore = this.findFocusForDisplayObject(js_Boot.__cast(event.target , openfl_display_DisplayObject)); + } + ,defaultFocusManager_root_activateHandler: function(event) { + if(!this._enabled) { + return; + } + this.restoreFocus(); + } + ,defaultFocusManager_root_deactivateHandler: function(event) { + if(!this._enabled) { + return; + } + this.set_focus(null); + } + ,__class__: feathers_core_DefaultFocusManager + ,__properties__: {set_focus:"set_focus",get_focus:"get_focus",get_showFocusIndicator:"get_showFocusIndicator",get_focusPane:"get_focusPane",set_root:"set_root",get_root:"get_root",set_enabled:"set_enabled",get_enabled:"get_enabled"} +}); +var feathers_core__$DefaultFocusManager_FocusResult = function(newFocus,wrapped) { + this.newFocus = newFocus; + this.wrapped = wrapped; +}; +$hxClasses["feathers.core._DefaultFocusManager.FocusResult"] = feathers_core__$DefaultFocusManager_FocusResult; +feathers_core__$DefaultFocusManager_FocusResult.__name__ = "feathers.core._DefaultFocusManager.FocusResult"; +feathers_core__$DefaultFocusManager_FocusResult.prototype = { + __class__: feathers_core__$DefaultFocusManager_FocusResult +}; +var feathers_core_IPopUpManager = function() { }; +$hxClasses["feathers.core.IPopUpManager"] = feathers_core_IPopUpManager; +feathers_core_IPopUpManager.__name__ = "feathers.core.IPopUpManager"; +feathers_core_IPopUpManager.__isInterface__ = true; +feathers_core_IPopUpManager.prototype = { + __class__: feathers_core_IPopUpManager + ,__properties__: {get_topLevelPopUpCount:"get_topLevelPopUpCount",get_popUpCount:"get_popUpCount",set_root:"set_root",get_root:"get_root",set_overlayFactory:"set_overlayFactory",get_overlayFactory:"get_overlayFactory"} +}; +var feathers_core_DefaultPopUpManager = function(root) { + this._popUpToOverlay = new haxe_ds_ObjectMap(); + this._centeredPopUps = []; + this.popUps = []; + this._ignoreRemoval = false; + this.set_root(root); +}; +$hxClasses["feathers.core.DefaultPopUpManager"] = feathers_core_DefaultPopUpManager; +feathers_core_DefaultPopUpManager.__name__ = "feathers.core.DefaultPopUpManager"; +feathers_core_DefaultPopUpManager.__interfaces__ = [feathers_core_IPopUpManager]; +feathers_core_DefaultPopUpManager.defaultOverlayFactory = function() { + var overlay = new openfl_display_Sprite(); + overlay.get_graphics().beginFill(8421504,0.75); + overlay.get_graphics().drawRect(0,0,1,1); + overlay.get_graphics().endFill(); + return overlay; +}; +feathers_core_DefaultPopUpManager.prototype = { + get_root: function() { + return this._root; + } + ,set_root: function(value) { + if(this._root == value) { + return this._root; + } + if(value.stage == null) { + throw new openfl_errors_ArgumentError("DefaultPopUpManager root's stage property must not be null."); + } + var oldIgnoreRemoval = this._ignoreRemoval; + this._ignoreRemoval = true; + var _g = 0; + var _g1 = this.popUps; + while(_g < _g1.length) { + var popUp = _g1[_g]; + ++_g; + this._root.removeChild(popUp); + var overlay = this._popUpToOverlay.h[popUp.__id__]; + if(overlay != null) { + this._root.removeChild(overlay); + } + } + this._ignoreRemoval = oldIgnoreRemoval; + this._root = value; + var _g = 0; + var _g1 = this.popUps; + while(_g < _g1.length) { + var popUp = _g1[_g]; + ++_g; + var overlay = this._popUpToOverlay.h[popUp.__id__]; + if(overlay != null) { + this._root.addChild(overlay); + } + this._root.addChild(popUp); + } + return this._root; + } + ,get_overlayFactory: function() { + return this._overlayFactory; + } + ,set_overlayFactory: function(value) { + if(this._overlayFactory == value) { + return this._overlayFactory; + } + this._overlayFactory = value; + return this._overlayFactory; + } + ,get_popUpCount: function() { + return this.popUps.length; + } + ,get_topLevelPopUpCount: function() { + var count = 0; + var i = this.popUps.length - 1; + while(i >= 0) { + ++count; + var popUp = this.popUps[i]; + var overlay = this._popUpToOverlay.h[popUp.__id__]; + if(overlay != null) { + return count; + } + --i; + } + return count; + } + ,getPopUpAt: function(index) { + return this.popUps[index]; + } + ,isPopUp: function(target) { + return this.popUps.indexOf(target) != -1; + } + ,isTopLevelPopUp: function(target) { + var i = this.popUps.length - 1; + while(i >= 0) { + var otherPopUp = this.popUps[i]; + if(otherPopUp == target) { + return true; + } + var overlay = this._popUpToOverlay.h[otherPopUp.__id__]; + if(overlay != null) { + return false; + } + --i; + } + return false; + } + ,isModal: function(target) { + if(target == null) { + return false; + } + return this._popUpToOverlay.h[target.__id__] != null; + } + ,hasModalPopUps: function() { + var map = this._popUpToOverlay; + var inlMapKeyValueIterator_map = map; + var inlMapKeyValueIterator_keys = map.keys(); + return inlMapKeyValueIterator_keys.hasNext(); + } + ,addPopUp: function(popUp,isModal,isCentered,customOverlayFactory) { + if(isCentered == null) { + isCentered = true; + } + if(isModal == null) { + isModal = true; + } + var index = this.popUps.indexOf(popUp); + if(index != -1) { + this.cleanupOverlay(popUp); + this.popUps.splice(index,1); + } + if(isModal) { + if(customOverlayFactory == null) { + customOverlayFactory = this._overlayFactory; + } + if(customOverlayFactory == null) { + customOverlayFactory = feathers_core_DefaultPopUpManager.defaultOverlayFactory; + } + var overlay = customOverlayFactory(); + var stage = this._root.stage; + var stageTopLeft = this._root.globalToLocal(new openfl_geom_Point()); + var stageBottomRight = this._root.globalToLocal(new openfl_geom_Point(stage.stageWidth,stage.stageHeight)); + overlay.set_x(stageTopLeft.x); + overlay.set_y(stageTopLeft.y); + overlay.set_width(stageBottomRight.x - stageTopLeft.x); + overlay.set_height(stageBottomRight.y - stageTopLeft.y); + this._root.addChild(overlay); + this._popUpToOverlay.set(popUp,overlay); + } + this.popUps.push(popUp); + var result = this._root.addChild(popUp); + if(popUp.parent == null) { + this.cleanupOverlay(popUp); + HxOverrides.remove(this.popUps,popUp); + return null; + } + popUp.addEventListener("removedFromStage",$bind(this,this.defaultPopUpManager_popUp_removedFromStageHandler)); + if(this.popUps.length == 1) { + this._root.stage.addEventListener("resize",$bind(this,this.defaultPopUpManager_stage_resizeHandler),false,0,true); + } + if(isCentered) { + if(js_Boot.__implements(popUp,feathers_core_IMeasureObject)) { + var measurePopUp = popUp; + measurePopUp.addEventListener("resize",$bind(this,this.defaultPopUpManager_popUp_resizeHandler)); + } + this._centeredPopUps.push(popUp); + this.centerPopUp(popUp); + } + return result; + } + ,removePopUp: function(popUp) { + var index = this.popUps.indexOf(popUp); + if(index == -1) { + return popUp; + } + return this._root.removeChild(popUp); + } + ,removeAllPopUps: function() { + var popUps = this.popUps.slice(); + var _g = 0; + while(_g < popUps.length) { + var popUp = popUps[_g]; + ++_g; + if(this.isPopUp(popUp)) { + this.removePopUp(popUp); + } + } + } + ,centerPopUp: function(popUp) { + if(js_Boot.__implements(popUp,feathers_core_IValidating)) { + popUp.validateNow(); + } + var stage = this._root.stage; + var stageTopLeft = this._root.globalToLocal(new openfl_geom_Point()); + var stageBottomRight = this._root.globalToLocal(new openfl_geom_Point(stage.stageWidth,stage.stageHeight)); + popUp.set_x(stageTopLeft.x + (stageBottomRight.x - stageTopLeft.x - popUp.get_width()) / 2.0); + popUp.set_y(stageTopLeft.y + (stageBottomRight.y - stageTopLeft.y - popUp.get_height()) / 2.0); + } + ,bringToFront: function(popUp) { + if(!HxOverrides.remove(this.popUps,popUp)) { + throw new openfl_errors_Error("Not a popup"); + } + this.popUps.push(popUp); + var overlay = this._popUpToOverlay.h[popUp.__id__]; + if(overlay != null) { + this._root.setChildIndex(overlay,this._root.get_numChildren() - 1); + } + this._root.setChildIndex(popUp,this._root.get_numChildren() - 1); + } + ,cleanupOverlay: function(popUp) { + var overlay = this._popUpToOverlay.h[popUp.__id__]; + if(overlay == null) { + return; + } + this._root.removeChild(overlay); + this._popUpToOverlay.remove(popUp); + } + ,defaultPopUpManager_popUp_removedFromStageHandler: function(event) { + if(this._ignoreRemoval) { + return; + } + var popUp = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject); + popUp.removeEventListener("removedFromStage",$bind(this,this.defaultPopUpManager_popUp_removedFromStageHandler)); + HxOverrides.remove(this.popUps,popUp); + this.cleanupOverlay(popUp); + if(this.popUps.length == 0) { + this._root.stage.removeEventListener("resize",$bind(this,this.defaultPopUpManager_stage_resizeHandler)); + } + } + ,defaultPopUpManager_popUp_resizeHandler: function(event) { + var popUp = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject); + this.centerPopUp(popUp); + } + ,defaultPopUpManager_stage_resizeHandler: function(event) { + var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage); + var stageTopLeft = this._root.globalToLocal(new openfl_geom_Point()); + var stageBottomRight = this._root.globalToLocal(new openfl_geom_Point(stage.stageWidth,stage.stageHeight)); + var _g = 0; + var _g1 = this.popUps; + while(_g < _g1.length) { + var popUp = _g1[_g]; + ++_g; + var overlay = this._popUpToOverlay.h[popUp.__id__]; + if(overlay != null) { + overlay.set_x(stageTopLeft.x); + overlay.set_y(stageTopLeft.y); + overlay.set_width(stageBottomRight.x - stageTopLeft.x); + overlay.set_height(stageBottomRight.y - stageTopLeft.y); + } + } + var _g = 0; + var _g1 = this._centeredPopUps; + while(_g < _g1.length) { + var popUp = _g1[_g]; + ++_g; + this.centerPopUp(popUp); + } + } + ,__class__: feathers_core_DefaultPopUpManager + ,__properties__: {get_topLevelPopUpCount:"get_topLevelPopUpCount",get_popUpCount:"get_popUpCount",set_overlayFactory:"set_overlayFactory",get_overlayFactory:"get_overlayFactory",set_root:"set_root",get_root:"get_root"} +}; +var feathers_core_IToolTipManager = function() { }; +$hxClasses["feathers.core.IToolTipManager"] = feathers_core_IToolTipManager; +feathers_core_IToolTipManager.__name__ = "feathers.core.IToolTipManager"; +feathers_core_IToolTipManager.__isInterface__ = true; +feathers_core_IToolTipManager.prototype = { + __class__: feathers_core_IToolTipManager + ,__properties__: {get_root:"get_root"} +}; +var feathers_core_DefaultToolTipManager = function(root) { + this._offsetY = 0.0; + this._offsetX = 0.0; + this._hideTime = -1; + this._delay = 0.5; + this._delayTimeoutID = null; + this.initializeToolTipStyles(); + this._root = root; + this._root.addEventListener("mouseMove",$bind(this,this.defaultToolTipManager_root_mouseMoveHandler),false,0,true); +}; +$hxClasses["feathers.core.DefaultToolTipManager"] = feathers_core_DefaultToolTipManager; +feathers_core_DefaultToolTipManager.__name__ = "feathers.core.DefaultToolTipManager"; +feathers_core_DefaultToolTipManager.__interfaces__ = [feathers_core_IToolTipManager]; +feathers_core_DefaultToolTipManager.prototype = { + get_root: function() { + return this._root; + } + ,dispose: function() { + this.clearTarget(); + if(this._root != null) { + this._root.removeEventListener("mouseMove",$bind(this,this.defaultToolTipManager_root_mouseMoveHandler)); + this._root = null; + } + } + ,initializeToolTipStyles: function() { + feathers_themes_steel_components_SteelToolTipStyles.initialize(); + } + ,clearTarget: function() { + this.hideToolTip(); + if(this._target != null) { + this._target.removeEventListener("mouseDown",$bind(this,this.defaultToolTipManager_target_mouseDownHandler)); + this._target.removeEventListener("rightMouseDown",$bind(this,this.defaultToolTipManager_target_rightMouseDownHandler)); + this._target.removeEventListener("middleMouseDown",$bind(this,this.defaultToolTipManager_target_middleMouseDownHandler)); + this._target.removeEventListener("rollOut",$bind(this,this.defaultToolTipManager_target_rollOutHandler)); + this._target.removeEventListener("removedFromStage",$bind(this,this.defaultToolTipManager_target_removedFromStageHandler)); + this._target = null; + } + } + ,hideToolTip: function() { + if(this._delayTimeoutID != null) { + openfl_Lib.clearTimeout(this._delayTimeoutID); + this._delayTimeoutID = null; + } + if(this._toolTip != null && this._toolTip.parent != null) { + feathers_core_PopUpManager.removePopUp(js_Boot.__cast(this._toolTip , openfl_display_DisplayObject)); + this._hideTime = openfl_Lib.getTimer(); + } + } + ,hoverDelayCallback: function() { + this._delayTimeoutID = null; + if(this._target.get_toolTip() == null) { + return; + } + if(this._toolTip == null) { + var toolTip = new feathers_controls_Label(); + toolTip.set_variant(feathers_core_DefaultToolTipManager.CHILD_VARIANT_TOOL_TIP); + this._toolTip = toolTip; + } + if(((this._toolTip) instanceof openfl_display_InteractiveObject)) { + var interactiveToolTip = this._toolTip; + interactiveToolTip.mouseEnabled = false; + interactiveToolTip.set_tabEnabled(false); + } + if(((this._toolTip) instanceof openfl_display_DisplayObjectContainer)) { + this._toolTip.mouseChildren = false; + } + if(js_Boot.__implements(this._toolTip,feathers_style_IVariantStyleObject)) { + var variantToolTip = this._toolTip; + if(variantToolTip.get_variant() == null) { + variantToolTip.set_variant(feathers_core_DefaultToolTipManager.CHILD_VARIANT_TOOL_TIP); + } + } + this._toolTip.set_text(this._target.get_toolTip()); + if(js_Boot.__implements(this._toolTip,feathers_core_IValidating)) { + this._toolTip.validateNow(); + } + var stage = this._target.stage; + var popUpManager = feathers_core_PopUpManager.forStage(stage); + var position = popUpManager.get_root().globalToLocal(new openfl_geom_Point(this._toolTipStageX,this._toolTipStageY)); + var dimensions = popUpManager.get_root().globalToLocal(new openfl_geom_Point(stage.stageWidth,stage.stageHeight)); + var toolTipX = position.x + this._offsetX; + if(toolTipX < 0.0) { + toolTipX = 0.0; + } else if(toolTipX + this._toolTip.get_width() > dimensions.x) { + toolTipX = dimensions.x - this._toolTip.get_width(); + } + var toolTipY = position.y - this._toolTip.get_height() + this._offsetY; + if(toolTipY < 0.0) { + toolTipY = 0.0; + } else if(toolTipY + this._toolTip.get_height() > dimensions.y) { + toolTipY = dimensions.y - this._toolTip.get_height(); + } + this._toolTip.set_x(toolTipX); + this._toolTip.set_y(toolTipY); + feathers_core_PopUpManager.addPopUp(js_Boot.__cast(this._toolTip , openfl_display_DisplayObject),js_Boot.__cast(this._target , openfl_display_DisplayObject),false,false); + } + ,defaultToolTipManager_root_mouseMoveHandler: function(event) { + if(event.buttonDown) { + return; + } + var eventTarget = js_Boot.__cast(event.target , openfl_display_DisplayObject); + while(eventTarget != null && !js_Boot.__implements(eventTarget,feathers_core_IUIControl)) eventTarget = eventTarget.parent; + if(!js_Boot.__implements(eventTarget,feathers_core_IUIControl)) { + this.clearTarget(); + return; + } + var uiTarget = eventTarget; + if(this._target == uiTarget) { + this._toolTipStageX = event.stageX; + this._toolTipStageY = event.stageY; + return; + } + this.clearTarget(); + this._target = uiTarget; + if(this._target.get_toolTip() == null) { + this._target = null; + return; + } + this._target.addEventListener("mouseDown",$bind(this,this.defaultToolTipManager_target_mouseDownHandler),false,0,true); + this._target.addEventListener("rightMouseDown",$bind(this,this.defaultToolTipManager_target_rightMouseDownHandler),false,0,true); + this._target.addEventListener("middleMouseDown",$bind(this,this.defaultToolTipManager_target_middleMouseDownHandler),false,0,true); + this._target.addEventListener("rollOut",$bind(this,this.defaultToolTipManager_target_rollOutHandler),false,0,true); + this._target.addEventListener("removedFromStage",$bind(this,this.defaultToolTipManager_target_removedFromStageHandler),false,0,true); + this._toolTipStageX = event.stageX; + this._toolTipStageY = event.stageY; + this._delayTimeoutID = openfl_Lib.setTimeout($bind(this,this.hoverDelayCallback),this._delay * 1000.0 | 0); + } + ,defaultToolTipManager_target_mouseDownHandler: function(event) { + this.hideToolTip(); + } + ,defaultToolTipManager_target_rightMouseDownHandler: function(event) { + this.hideToolTip(); + } + ,defaultToolTipManager_target_middleMouseDownHandler: function(event) { + this.hideToolTip(); + } + ,defaultToolTipManager_target_rollOutHandler: function(event) { + this.clearTarget(); + } + ,defaultToolTipManager_target_removedFromStageHandler: function(event) { + this.clearTarget(); + } + ,__class__: feathers_core_DefaultToolTipManager + ,__properties__: {get_root:"get_root"} +}; +var feathers_core__$FeathersControl_StyleDefinition = $hxEnums["feathers.core._FeathersControl.StyleDefinition"] = { __ename__:"feathers.core._FeathersControl.StyleDefinition",__constructs__:null + ,Name: ($_=function(name) { return {_hx_index:0,name:name,__enum__:"feathers.core._FeathersControl.StyleDefinition",toString:$estr}; },$_._hx_name="Name",$_.__params__ = ["name"],$_) + ,NameAndState: ($_=function(name,state) { return {_hx_index:1,name:name,state:state,__enum__:"feathers.core._FeathersControl.StyleDefinition",toString:$estr}; },$_._hx_name="NameAndState",$_.__params__ = ["name","state"],$_) +}; +feathers_core__$FeathersControl_StyleDefinition.__constructs__ = [feathers_core__$FeathersControl_StyleDefinition.Name,feathers_core__$FeathersControl_StyleDefinition.NameAndState]; +var feathers_core_FocusManager = function() { }; +$hxClasses["feathers.core.FocusManager"] = feathers_core_FocusManager; +feathers_core_FocusManager.__name__ = "feathers.core.FocusManager"; +feathers_core_FocusManager.__properties__ = {set_focusManagerFactory:"set_focusManagerFactory",get_focusManagerFactory:"get_focusManagerFactory"}; +feathers_core_FocusManager.defaultFocusManagerFactory = function(root) { + return new feathers_core_DefaultFocusManager(root); +}; +feathers_core_FocusManager.get_focusManagerFactory = function() { + return feathers_core_FocusManager._focusManagerFactory; +}; +feathers_core_FocusManager.set_focusManagerFactory = function(value) { + if(value == null) { + feathers_core_FocusManager._focusManagerFactory = feathers_core_FocusManager.defaultFocusManagerFactory; + } + if(feathers_core_FocusManager._focusManagerFactory == value) { + return feathers_core_FocusManager._focusManagerFactory; + } + feathers_core_FocusManager._focusManagerFactory = value; + return feathers_core_FocusManager._focusManagerFactory; +}; +feathers_core_FocusManager.hasRoot = function(stage) { + return feathers_core_FocusManager.stageToManager.h.__keys__[stage.__id__] != null; +}; +feathers_core_FocusManager.addRoot = function(stage) { + if(stage == null) { + throw new openfl_errors_ArgumentError("FocusManager stage argument must not be null."); + } + if(feathers_core_FocusManager.stageToManager.h.__keys__[stage.__id__] != null) { + throw new openfl_errors_ArgumentError("Focus manager root already exists"); + } + var focusManager = feathers_core_FocusManager.stageToManager.h[stage.__id__]; + var factory = feathers_core_FocusManager.get_focusManagerFactory(); + if(factory == null) { + factory = feathers_core_FocusManager.defaultFocusManagerFactory; + } + focusManager = factory(stage); + focusManager.addEventListener("clear",feathers_core_FocusManager.focusManager_clearHandler,false,0,true); + feathers_core_FocusManager.stageToManager.set(stage,focusManager); + return focusManager; +}; +feathers_core_FocusManager.removeRoot = function(stage) { + var focusManager = feathers_core_FocusManager.stageToManager.h[stage.__id__]; + if(focusManager == null) { + return; + } + focusManager.dispose(); +}; +feathers_core_FocusManager.dispose = function() { + var stage = feathers_core_FocusManager.stageToManager.keys(); + while(stage.hasNext()) { + var stage1 = stage.next(); + var focusManager = feathers_core_FocusManager.stageToManager.h[stage1.__id__]; + focusManager.dispose(); + feathers_core_FocusManager.stageToManager.remove(stage1); + } +}; +feathers_core_FocusManager.setFocus = function(focusable) { + var focusManager = focusable.get_focusManager(); + if(focusManager == null) { + throw new openfl_errors_ArgumentError("Cannot set focus because focus manager is null."); + } + focusManager.set_focus(focusable); +}; +feathers_core_FocusManager.focusManager_clearHandler = function(event) { + var focusManager = js_Boot.__cast(event.currentTarget , feathers_core_IFocusManager); + focusManager.removeEventListener("clear",feathers_core_FocusManager.focusManager_clearHandler); + var value = focusManager.get_root(); + var stage = ((value) instanceof openfl_display_Stage) ? value : null; + if(stage != null) { + feathers_core_FocusManager.stageToManager.remove(stage); + } +}; +feathers_core_FocusManager.prototype = { + FocusManager: function() { + } + ,__class__: feathers_core_FocusManager +}; +var feathers_core_IDataSelector = function() { }; +$hxClasses["feathers.core.IDataSelector"] = feathers_core_IDataSelector; +feathers_core_IDataSelector.__name__ = "feathers.core.IDataSelector"; +feathers_core_IDataSelector.__isInterface__ = true; +feathers_core_IDataSelector.prototype = { + __class__: feathers_core_IDataSelector + ,__properties__: {set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem"} +}; +var feathers_core_IFocusExclusions = function() { }; +$hxClasses["feathers.core.IFocusExclusions"] = feathers_core_IFocusExclusions; +feathers_core_IFocusExclusions.__name__ = "feathers.core.IFocusExclusions"; +feathers_core_IFocusExclusions.__isInterface__ = true; +feathers_core_IFocusExclusions.__interfaces__ = [feathers_core_IFocusManagerAware]; +feathers_core_IFocusExclusions.prototype = { + __class__: feathers_core_IFocusExclusions + ,__properties__: {get_focusExclusions:"get_focusExclusions"} +}; +var feathers_core_IIndexSelector = function() { }; +$hxClasses["feathers.core.IIndexSelector"] = feathers_core_IIndexSelector; +feathers_core_IIndexSelector.__name__ = "feathers.core.IIndexSelector"; +feathers_core_IIndexSelector.__isInterface__ = true; +feathers_core_IIndexSelector.prototype = { + __class__: feathers_core_IIndexSelector + ,__properties__: {get_maxSelectedIndex:"get_maxSelectedIndex",set_selectedIndex:"set_selectedIndex",get_selectedIndex:"get_selectedIndex"} +}; +var feathers_core_IScaleManager = function() { }; +$hxClasses["feathers.core.IScaleManager"] = feathers_core_IScaleManager; +feathers_core_IScaleManager.__name__ = "feathers.core.IScaleManager"; +feathers_core_IScaleManager.__isInterface__ = true; +feathers_core_IScaleManager.__interfaces__ = [openfl_events_IEventDispatcher]; +feathers_core_IScaleManager.prototype = { + __class__: feathers_core_IScaleManager + ,__properties__: {set_target:"set_target",get_target:"get_target"} +}; +var feathers_core_IStateObserver = function() { }; +$hxClasses["feathers.core.IStateObserver"] = feathers_core_IStateObserver; +feathers_core_IStateObserver.__name__ = "feathers.core.IStateObserver"; +feathers_core_IStateObserver.__isInterface__ = true; +feathers_core_IStateObserver.prototype = { + __class__: feathers_core_IStateObserver + ,__properties__: {set_stateContext:"set_stateContext",get_stateContext:"get_stateContext"} +}; +var feathers_core_PopUpManager = function() { }; +$hxClasses["feathers.core.PopUpManager"] = feathers_core_PopUpManager; +feathers_core_PopUpManager.__name__ = "feathers.core.PopUpManager"; +feathers_core_PopUpManager.__properties__ = {get_popUpCount:"get_popUpCount",set_root:"set_root"}; +feathers_core_PopUpManager.set_root = function(value) { + var popUpManager = feathers_core_PopUpManager.forStage(value.stage); + popUpManager.set_root(value); + return value; +}; +feathers_core_PopUpManager.get_popUpCount = function() { + var count = 0; + var popUpManager = feathers_core_PopUpManager.stageToManager.iterator(); + while(popUpManager.hasNext()) { + var popUpManager1 = popUpManager.next(); + count += popUpManager1.get_popUpCount(); + } + return count; +}; +feathers_core_PopUpManager.forStage = function(stage) { + if(stage == null) { + throw new openfl_errors_ArgumentError("PopUpManager stage argument must not be null."); + } + var popUpManager = feathers_core_PopUpManager.stageToManager.h[stage.__id__]; + if(popUpManager == null) { + var factory = feathers_core_PopUpManager.popUpManagerFactory; + if(factory == null) { + factory = feathers_core_PopUpManager.defaultPopUpManagerFactory; + } + popUpManager = factory(stage); + feathers_core_PopUpManager.stageToManager.set(stage,popUpManager); + } + return popUpManager; +}; +feathers_core_PopUpManager.dispose = function() { + feathers_core_PopUpManager.removeAllPopUps(); + var stage = feathers_core_PopUpManager.stageToManager.keys(); + while(stage.hasNext()) { + var stage1 = stage.next(); + feathers_core_PopUpManager.stageToManager.remove(stage1); + } +}; +feathers_core_PopUpManager.addPopUp = function(popUp,owner,isModal,isCentered,customOverlayFactory) { + if(isCentered == null) { + isCentered = true; + } + if(isModal == null) { + isModal = true; + } + if(owner == null) { + throw new openfl_errors_ArgumentError("The pop-up's owner must not be null."); + } + var stage = owner.stage; + if(stage == null) { + throw new openfl_errors_ArgumentError("The stage property of a pop-up's owner must not be null."); + } + var popUpManager = feathers_core_PopUpManager.forStage(stage); + return popUpManager.addPopUp(popUp,isModal,isCentered,customOverlayFactory); +}; +feathers_core_PopUpManager.removePopUp = function(popUp) { + var stage = popUp.stage; + if(stage == null) { + return popUp; + } + var popUpManager = feathers_core_PopUpManager.forStage(stage); + return popUpManager.removePopUp(popUp); +}; +feathers_core_PopUpManager.removeAllPopUps = function() { + var popUpManager = feathers_core_PopUpManager.stageToManager.iterator(); + while(popUpManager.hasNext()) { + var popUpManager1 = popUpManager.next(); + popUpManager1.removeAllPopUps(); + } +}; +feathers_core_PopUpManager.centerPopUp = function(target) { + var stage = target.stage; + if(stage == null) { + throw new openfl_errors_ArgumentError("A pop-up's stage property must not be null."); + } + var popUpManager = feathers_core_PopUpManager.forStage(stage); + popUpManager.centerPopUp(target); +}; +feathers_core_PopUpManager.bringToFront = function(target) { + var stage = target.stage; + if(stage == null) { + throw new openfl_errors_ArgumentError("A pop-up's stage property must not be null."); + } + var popUpManager = feathers_core_PopUpManager.forStage(stage); + popUpManager.bringToFront(target); +}; +feathers_core_PopUpManager.isPopUp = function(target) { + if(target == null) { + return false; + } + var stage = target.stage; + if(stage == null) { + return false; + } + var popUpManager = feathers_core_PopUpManager.forStage(stage); + return popUpManager.isPopUp(target); +}; +feathers_core_PopUpManager.isModal = function(target) { + if(target == null) { + return false; + } + var stage = target.stage; + if(stage == null) { + return false; + } + var popUpManager = feathers_core_PopUpManager.forStage(stage); + return popUpManager.isModal(target); +}; +feathers_core_PopUpManager.isTopLevelPopUp = function(target) { + if(target == null) { + return false; + } + var stage = target.stage; + if(stage == null) { + return false; + } + var popUpManager = feathers_core_PopUpManager.forStage(stage); + return popUpManager.isTopLevelPopUp(target); +}; +feathers_core_PopUpManager.defaultPopUpManagerFactory = function(stage) { + return new feathers_core_DefaultPopUpManager(stage); +}; +var feathers_core_ScreenDensityScaleManager = function(scaler) { + openfl_events_EventDispatcher.call(this); + this._scaler = scaler; +}; +$hxClasses["feathers.core.ScreenDensityScaleManager"] = feathers_core_ScreenDensityScaleManager; +feathers_core_ScreenDensityScaleManager.__name__ = "feathers.core.ScreenDensityScaleManager"; +feathers_core_ScreenDensityScaleManager.__interfaces__ = [feathers_core_IScaleManager]; +feathers_core_ScreenDensityScaleManager.__super__ = openfl_events_EventDispatcher; +feathers_core_ScreenDensityScaleManager.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_target: function() { + return this._target; + } + ,set_target: function(value) { + if(this._target == value) { + return this._target; + } + if(this._target != null) { + this.removeTargetStageListeners(); + this._target.removeEventListener("addedToStage",$bind(this,this.screenDensityScaleManager_target_addedToStageHandler)); + this._target.removeEventListener("removedFromStage",$bind(this,this.screenDensityScaleManager_target_removedFromStageHandler)); + } + this._target = value; + if(this._target != null) { + this._target.addEventListener("addedToStage",$bind(this,this.screenDensityScaleManager_target_addedToStageHandler),false,0,true); + this._target.addEventListener("removedFromStage",$bind(this,this.screenDensityScaleManager_target_removedFromStageHandler),false,0,true); + this.addTargetStageListeners(); + } + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._target; + } + ,get_scaler: function() { + return this._scaler; + } + ,set_scaler: function(value) { + if(this._scaler == value) { + return this._scaler; + } + this._scaler = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._scaler; + } + ,getScale: function() { + var result = 1.0; + if(this._target == null) { + return result; + } + var jsWindow = js_Boot.__cast($global , Window); + var viewportElement = jsWindow.document.getElementById("viewport"); + if(viewportElement != null && viewportElement.localName == "meta") { + var content = viewportElement.getAttribute("content"); + if(content.indexOf("user-scalable=no") != -1) { + var initialScalePattern = new EReg("initial-scale=(\\d(?:\\.\\d+)?)",""); + if(initialScalePattern.match(content)) { + var initialScale = parseFloat(initialScalePattern.matched(1)); + result *= 1.0 / initialScale; + } + } + } + return result; + } + ,getBounds: function() { + var bounds = new openfl_geom_Rectangle(); + if(this._target == null) { + return bounds; + } + var stage = this._target.stage; + if(stage == null) { + return bounds; + } + var needsToBeDivisibleByTwo = Math.floor(this._target.get_scaleX()) != this._target.get_scaleX(); + var appWidth = Math.floor(stage.stageWidth); + if(needsToBeDivisibleByTwo) { + appWidth = feathers_utils_MathUtil.roundDownToNearest(appWidth,2); + } + bounds.width = appWidth; + var appHeight = Math.floor(stage.stageHeight); + if(needsToBeDivisibleByTwo) { + appHeight = feathers_utils_MathUtil.roundDownToNearest(appHeight,2); + } + bounds.height = appHeight; + return bounds; + } + ,addTargetStageListeners: function() { + if(this._target == null || this._target.stage == null) { + return; + } + this._target.stage.addEventListener("resize",$bind(this,this.screenDensityScaleManager_stage_resizeHandler),false,0,true); + } + ,removeTargetStageListeners: function() { + if(this._target == null || this._target.stage == null) { + return; + } + this._target.stage.removeEventListener("resize",$bind(this,this.screenDensityScaleManager_stage_resizeHandler)); + } + ,screenDensityScaleManager_target_addedToStageHandler: function(event) { + this.addTargetStageListeners(); + } + ,screenDensityScaleManager_target_removedFromStageHandler: function(event) { + this.removeTargetStageListeners(); + } + ,screenDensityScaleManager_stage_resizeHandler: function(event) { + feathers_events_FeathersEvent.dispatch(this,"change"); + } + ,__class__: feathers_core_ScreenDensityScaleManager + ,__properties__: {set_scaler:"set_scaler",get_scaler:"get_scaler",set_target:"set_target",get_target:"get_target"} +}); +var feathers_core_ToggleGroup = function() { + this._requireSelection = true; + this._selectedIndex = -1; + this._ignoreChanges = false; + this._items = []; + openfl_events_EventDispatcher.call(this); +}; +$hxClasses["feathers.core.ToggleGroup"] = feathers_core_ToggleGroup; +feathers_core_ToggleGroup.__name__ = "feathers.core.ToggleGroup"; +feathers_core_ToggleGroup.__interfaces__ = [feathers_core_IDataSelector,feathers_core_IIndexSelector]; +feathers_core_ToggleGroup.__super__ = openfl_events_EventDispatcher; +feathers_core_ToggleGroup.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_numItems: function() { + return this._items.length; + } + ,get_selectedIndex: function() { + return this._selectedIndex; + } + ,set_selectedIndex: function(value) { + var itemCount = this._items.length; + if(value < -1 || value > itemCount) { + throw new openfl_errors_RangeError("Index " + value + " is out of range " + itemCount + " for ToggleGroup."); + } + var hasChanged = this._selectedIndex != value; + this._selectedIndex = value; + var oldIgnoreChanges = this._ignoreChanges; + this._ignoreChanges = true; + var _g = 0; + var _g1 = this._items.length; + while(_g < _g1) { + var i = _g++; + var item = this._items[i]; + item.set_selected(i == value); + } + this._ignoreChanges = oldIgnoreChanges; + if(hasChanged) { + feathers_events_FeathersEvent.dispatch(this,"change"); + } + return this._selectedIndex; + } + ,get_maxSelectedIndex: function() { + return this._items.length - 1; + } + ,get_selectedItem: function() { + if(this._selectedIndex == -1) { + return null; + } + return this._items[this._selectedIndex]; + } + ,set_selectedItem: function(value) { + this.set_selectedIndex(this._items.indexOf(value)); + return this.get_selectedItem(); + } + ,get_requireSelection: function() { + return this._requireSelection; + } + ,set_requireSelection: function(value) { + if(this._requireSelection == value) { + return this._requireSelection; + } + this._requireSelection = value; + if(this._requireSelection && this._selectedIndex == -1 && this._items.length > 0) { + this.set_selectedIndex(0); + } + return this._requireSelection; + } + ,addItem: function(item) { + if(item == null) { + throw new openfl_errors_ArgumentError("IToggle passed to ToggleGroup addItem() must not be null."); + } + var index = this._items.indexOf(item); + if(index != -1) { + throw new openfl_errors_IllegalOperationError("Cannot add an item to a ToggleGroup more than once."); + } + this._items.push(item); + if(item.get_selected()) { + this.set_selectedItem(item); + } else if(this._selectedIndex < 0 && this._requireSelection) { + this.set_selectedItem(item); + } else { + item.set_selected(false); + } + item.addEventListener("change",$bind(this,this.item_changeHandler),false,0,true); + if(js_Boot.__implements(item,feathers_controls_IGroupedToggle)) { + item.set_toggleGroup(this); + } + } + ,removeItem: function(item) { + var index = this._items.indexOf(item); + if(index == -1) { + return; + } + HxOverrides.remove(this._items,item); + item.removeEventListener("change",$bind(this,this.item_changeHandler)); + if(js_Boot.__implements(item,feathers_controls_IGroupedToggle)) { + item.set_toggleGroup(null); + } + if(this._selectedIndex > index) { + this.set_selectedIndex(this.get_selectedIndex() - 1); + } else if(this.get_selectedIndex() == index) { + if(this._requireSelection) { + var maxSelectedIndex = this._items.length - 1; + if(this._selectedIndex > maxSelectedIndex) { + this.set_selectedIndex(maxSelectedIndex); + } else { + feathers_events_FeathersEvent.dispatch(this,"change"); + } + } else { + this.set_selectedIndex(-1); + } + } + } + ,removeAllItems: function() { + var _g = 0; + var _g1 = this._items; + while(_g < _g1.length) { + var item = _g1[_g]; + ++_g; + item.removeEventListener("change",$bind(this,this.item_changeHandler)); + if(js_Boot.__implements(item,feathers_controls_IGroupedToggle)) { + item.set_toggleGroup(null); + } + } + this._items.length = 0; + this.set_selectedIndex(-1); + } + ,hasItem: function(item) { + return this._items.indexOf(item) != -1; + } + ,getItemAt: function(index) { + if(index < 0 || index >= this._items.length) { + throw new openfl_errors_RangeError("The supplied index is out of bounds."); + } + return this._items[index]; + } + ,getItemIndex: function(item) { + return this._items.indexOf(item); + } + ,setItemIndex: function(item,index) { + var oldIndex = this._items.indexOf(item); + if(oldIndex < 0) { + throw new openfl_errors_ArgumentError("Attempting to set index of an item that has not been added to this ToggleGroup."); + } + if(oldIndex == index) { + return; + } + HxOverrides.remove(this._items,item); + this._items.splice(index,0,item); + if(this._selectedIndex >= 0) { + if(this._selectedIndex == oldIndex) { + this.set_selectedIndex(index); + } else if(oldIndex < this._selectedIndex && index > this._selectedIndex) { + this.set_selectedIndex(this.get_selectedIndex() - 1); + } else if(oldIndex > this._selectedIndex && index < this._selectedIndex) { + this.set_selectedIndex(this.get_selectedIndex() + 1); + } + } + } + ,item_changeHandler: function(event) { + if(this._ignoreChanges) { + return; + } + var item = js_Boot.__cast(event.currentTarget , feathers_controls_IToggle); + var index = this._items.indexOf(item); + if(item.get_selected() || this._requireSelection && this._selectedIndex == index) { + this.set_selectedIndex(index); + } else if(!item.get_selected()) { + this.set_selectedIndex(-1); + } + } + ,__class__: feathers_core_ToggleGroup + ,__properties__: {set_requireSelection:"set_requireSelection",get_requireSelection:"get_requireSelection",set_selectedItem:"set_selectedItem",get_selectedItem:"get_selectedItem",get_maxSelectedIndex:"get_maxSelectedIndex",set_selectedIndex:"set_selectedIndex",get_selectedIndex:"get_selectedIndex",get_numItems:"get_numItems"} +}); +var feathers_core_ToolTipManager = function() { }; +$hxClasses["feathers.core.ToolTipManager"] = feathers_core_ToolTipManager; +feathers_core_ToolTipManager.__name__ = "feathers.core.ToolTipManager"; +feathers_core_ToolTipManager.__properties__ = {set_toolTipManagerFactory:"set_toolTipManagerFactory",get_toolTipManagerFactory:"get_toolTipManagerFactory"}; +feathers_core_ToolTipManager.defaultToolTipManagerFactory = function(root) { + return new feathers_core_DefaultToolTipManager(root); +}; +feathers_core_ToolTipManager.get_toolTipManagerFactory = function() { + return feathers_core_ToolTipManager._toolTipManagerFactory; +}; +feathers_core_ToolTipManager.set_toolTipManagerFactory = function(value) { + if(value == null) { + feathers_core_ToolTipManager._toolTipManagerFactory = feathers_core_ToolTipManager.defaultToolTipManagerFactory; + } + if(feathers_core_ToolTipManager._toolTipManagerFactory == value) { + return feathers_core_ToolTipManager._toolTipManagerFactory; + } + feathers_core_ToolTipManager._toolTipManagerFactory = value; + return feathers_core_ToolTipManager._toolTipManagerFactory; +}; +feathers_core_ToolTipManager.hasRoot = function(stage) { + return feathers_core_ToolTipManager.stageToManager.h.__keys__[stage.__id__] != null; +}; +feathers_core_ToolTipManager.forRoot = function(stage) { + return feathers_core_ToolTipManager.stageToManager.h[stage.__id__]; +}; +feathers_core_ToolTipManager.addRoot = function(stage) { + if(stage == null) { + throw new openfl_errors_ArgumentError("ToolTipManager stage argument must not be null."); + } + if(feathers_core_ToolTipManager.stageToManager.h.__keys__[stage.__id__] != null) { + throw new openfl_errors_ArgumentError("Tool tip manager root already exists"); + } + var toolTipManager = feathers_core_ToolTipManager.stageToManager.h[stage.__id__]; + var factory = feathers_core_ToolTipManager.get_toolTipManagerFactory(); + if(factory == null) { + factory = feathers_core_ToolTipManager.defaultToolTipManagerFactory; + } + toolTipManager = factory(stage); + feathers_core_ToolTipManager.stageToManager.set(stage,toolTipManager); + return toolTipManager; +}; +feathers_core_ToolTipManager.removeRoot = function(stage) { + var toolTipManager = feathers_core_ToolTipManager.stageToManager.h[stage.__id__]; + if(toolTipManager == null) { + return; + } + toolTipManager.dispose(); + feathers_core_ToolTipManager.stageToManager.remove(stage); +}; +feathers_core_ToolTipManager.dispose = function() { + var stage = feathers_core_ToolTipManager.stageToManager.keys(); + while(stage.hasNext()) { + var stage1 = stage.next(); + feathers_core_ToolTipManager.stageToManager.remove(stage1); + } +}; +feathers_core_ToolTipManager.prototype = { + ToolTipManager: function() { + } + ,__class__: feathers_core_ToolTipManager +}; +var feathers_core_ValidationQueue = function(stage) { + this._validating = false; + this._queue = []; + this._stage = null; + this._stage = stage; + this._stage.addEventListener("render",$bind(this,this.validationQueue_stage_renderHandler),false,-1000,true); +}; +$hxClasses["feathers.core.ValidationQueue"] = feathers_core_ValidationQueue; +feathers_core_ValidationQueue.__name__ = "feathers.core.ValidationQueue"; +feathers_core_ValidationQueue.forStage = function(stage) { + if(stage == null) { + return null; + } + if(feathers_core_ValidationQueue.STAGE_TO_VALIDATION_QUEUE.h.__keys__[stage.__id__] == null) { + feathers_core_ValidationQueue.STAGE_TO_VALIDATION_QUEUE.set(stage,new feathers_core_ValidationQueue(stage)); + } + return feathers_core_ValidationQueue.STAGE_TO_VALIDATION_QUEUE.h[stage.__id__]; +}; +feathers_core_ValidationQueue.prototype = { + get_validating: function() { + return this._validating; + } + ,dispose: function() { + if(this._stage == null) { + return; + } + this._stage.removeEventListener("render",$bind(this,this.validationQueue_stage_renderHandler)); + this._stage = null; + } + ,addControl: function(control) { + if(this._queue.indexOf(control) != -1) { + return; + } + var queueLength = this._queue.length; + if(this._validating) { + var depth = control.get_depth(); + var i = queueLength - 1; + while(i >= 0) { + var otherControl = this._queue[i]; + var otherDepth = otherControl.get_depth(); + if(depth >= otherDepth) { + break; + } + --i; + } + ++i; + this._queue.splice(i,0,control); + } else { + this._queue[queueLength] = control; + this._stage.invalidate(); + } + } + ,validateNow: function() { + if(this._validating) { + return; + } + var queueLength = this._queue.length; + if(queueLength == 0) { + return; + } + this._validating = true; + if(queueLength > 1) { + this._queue.sort(function(first,second) { + var difference = second.get_depth() - first.get_depth(); + if(difference > 0) { + return -1; + } else if(difference < 0) { + return 1; + } + return 0; + }); + } + while(this._queue.length > 0) { + var item = this._queue.shift(); + if(item.get_depth() < 0) { + continue; + } + item.validateNow(); + } + this._validating = false; + } + ,validationQueue_stage_renderHandler: function(event) { + this.validateNow(); + } + ,__class__: feathers_core_ValidationQueue + ,__properties__: {get_validating:"get_validating"} +}; +var openfl_events_Event = function(type,bubbles,cancelable) { + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + this.type = type; + this.bubbles = bubbles; + this.cancelable = cancelable; + this.eventPhase = 2; +}; +$hxClasses["openfl.events.Event"] = openfl_events_Event; +openfl_events_Event.__name__ = "openfl.events.Event"; +openfl_events_Event.prototype = { + clone: function() { + var event = new openfl_events_Event(this.type,this.bubbles,this.cancelable); + event.eventPhase = this.eventPhase; + event.target = this.target; + event.currentTarget = this.currentTarget; + return event; + } + ,formatToString: function(className,p1,p2,p3,p4,p5) { + var parameters = []; + if(p1 != null) { + parameters.push(p1); + } + if(p2 != null) { + parameters.push(p2); + } + if(p3 != null) { + parameters.push(p3); + } + if(p4 != null) { + parameters.push(p4); + } + if(p5 != null) { + parameters.push(p5); + } + return $bind(this,this.__formatToString).apply(this,[className,parameters]); + } + ,isDefaultPrevented: function() { + return this.__preventDefault; + } + ,preventDefault: function() { + if(this.cancelable) { + this.__preventDefault = true; + } + } + ,stopImmediatePropagation: function() { + this.__isCanceled = true; + this.__isCanceledNow = true; + } + ,stopPropagation: function() { + this.__isCanceled = true; + } + ,toString: function() { + return this.__formatToString("Event",["type","bubbles","cancelable"]); + } + ,__formatToString: function(className,parameters) { + var output = "[" + className; + var arg = null; + var _g = 0; + while(_g < parameters.length) { + var param = parameters[_g]; + ++_g; + arg = Reflect.field(this,param); + if(typeof(arg) == "string") { + output += " " + param + "=\"" + Std.string(arg) + "\""; + } else { + output += " " + param + "=" + Std.string(arg); + } + } + output += "]"; + return output; + } + ,__init: function() { + this.target = null; + this.currentTarget = null; + this.bubbles = false; + this.cancelable = false; + this.eventPhase = 2; + this.__isCanceled = false; + this.__isCanceledNow = false; + this.__preventDefault = false; + } + ,__class__: openfl_events_Event +}; +var feathers_events_FeathersEvent = function(type,bubbles,cancelable) { + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_Event.call(this,type,bubbles,cancelable); +}; +$hxClasses["feathers.events.FeathersEvent"] = feathers_events_FeathersEvent; +feathers_events_FeathersEvent.__name__ = "feathers.events.FeathersEvent"; +feathers_events_FeathersEvent.dispatch = function(dispatcher,type,bubbles,cancelable) { + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + var event = feathers_events_FeathersEvent._pool.get(); + event.type = type; + event.bubbles = bubbles; + event.cancelable = cancelable; + var result = dispatcher.dispatchEvent(event); + feathers_events_FeathersEvent._pool.release(event); + return result; +}; +feathers_events_FeathersEvent.__super__ = openfl_events_Event; +feathers_events_FeathersEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + return new feathers_events_FeathersEvent(this.type,this.bubbles,this.cancelable); + } + ,__class__: feathers_events_FeathersEvent +}); +var feathers_events_ScrollEvent = function(type,bubbles,cancelable,x,y) { + if(y == null) { + y = 0.0; + } + if(x == null) { + x = 0.0; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_Event.call(this,type,bubbles,cancelable); + this.x = x; + this.y = y; +}; +$hxClasses["feathers.events.ScrollEvent"] = feathers_events_ScrollEvent; +feathers_events_ScrollEvent.__name__ = "feathers.events.ScrollEvent"; +feathers_events_ScrollEvent.dispatch = function(dispatcher,type,bubbles,cancelable,x,y) { + if(y == null) { + y = 0.0; + } + if(x == null) { + x = 0.0; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + var event = feathers_events_ScrollEvent._pool.get(); + event.type = type; + event.bubbles = bubbles; + event.cancelable = cancelable; + event.x = x; + event.y = y; + var result = dispatcher.dispatchEvent(event); + feathers_events_ScrollEvent._pool.release(event); + return result; +}; +feathers_events_ScrollEvent.__super__ = openfl_events_Event; +feathers_events_ScrollEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + return new feathers_events_ScrollEvent(this.type,this.bubbles,this.cancelable,this.x,this.y); + } + ,__class__: feathers_events_ScrollEvent +}); +var feathers_events_StyleProviderEvent = function(type,affectsTarget) { + openfl_events_Event.call(this,type); + this.affectsTarget = affectsTarget != null ? affectsTarget : feathers_events_StyleProviderEvent.defaultAffectsTarget; +}; +$hxClasses["feathers.events.StyleProviderEvent"] = feathers_events_StyleProviderEvent; +feathers_events_StyleProviderEvent.__name__ = "feathers.events.StyleProviderEvent"; +feathers_events_StyleProviderEvent.dispatch = function(dispatcher,type,affectsTarget) { + var event = feathers_events_StyleProviderEvent._pool.get(); + event.type = type; + event.affectsTarget = affectsTarget != null ? affectsTarget : feathers_events_StyleProviderEvent.defaultAffectsTarget; + var result = dispatcher.dispatchEvent(event); + feathers_events_StyleProviderEvent._pool.release(event); + return result; +}; +feathers_events_StyleProviderEvent.defaultAffectsTarget = function(value) { + return true; +}; +feathers_events_StyleProviderEvent.__super__ = openfl_events_Event; +feathers_events_StyleProviderEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + return new feathers_events_StyleProviderEvent(this.type,this.affectsTarget); + } + ,__class__: feathers_events_StyleProviderEvent +}); +var feathers_events_TransitionEvent = function(type,previousViewID,previousView,nextViewID,nextView) { + openfl_events_Event.call(this,type,false,false); + this.previousViewID = previousViewID; + this.previousView = previousView; + this.nextViewID = nextViewID; + this.nextView = nextView; +}; +$hxClasses["feathers.events.TransitionEvent"] = feathers_events_TransitionEvent; +feathers_events_TransitionEvent.__name__ = "feathers.events.TransitionEvent"; +feathers_events_TransitionEvent.dispatch = function(dispatcher,type,previousViewID,previousView,nextViewID,nextView) { + var event = feathers_events_TransitionEvent._pool.get(); + event.type = type; + event.bubbles = false; + event.cancelable = false; + event.previousViewID = previousViewID; + event.previousView = previousView; + event.nextViewID = nextViewID; + event.nextView = nextView; + var result = dispatcher.dispatchEvent(event); + feathers_events_TransitionEvent._pool.release(event); + return result; +}; +feathers_events_TransitionEvent.__super__ = openfl_events_Event; +feathers_events_TransitionEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + return new feathers_events_TransitionEvent(this.type,this.previousViewID,this.previousView,this.nextViewID,this.nextView); + } + ,__class__: feathers_events_TransitionEvent +}); +var feathers_events_TriggerEvent = function(type,bubbles,cancelable,touchPointID,isPrimaryTouchPoint,localX,localY,sizeX,sizeY,pressure,relatedObject,ctrlKey,altKey,shiftKey,commandKey) { + if(commandKey == null) { + commandKey = false; + } + if(shiftKey == null) { + shiftKey = false; + } + if(altKey == null) { + altKey = false; + } + if(ctrlKey == null) { + ctrlKey = false; + } + if(pressure == null) { + pressure = 1.0; + } + if(sizeY == null) { + sizeY = 0.0; + } + if(sizeX == null) { + sizeX = 0.0; + } + if(localY == null) { + localY = 0.0; + } + if(localX == null) { + localX = 0.0; + } + if(isPrimaryTouchPoint == null) { + isPrimaryTouchPoint = false; + } + if(touchPointID == null) { + touchPointID = 0; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_Event.call(this,type,bubbles,cancelable); + this.touchPointID = touchPointID; + this.isPrimaryTouchPoint = isPrimaryTouchPoint; + this.localX = localX; + this.localY = localY; + this.stageX = NaN; + this.stageY = NaN; + this.sizeX = sizeX; + this.sizeY = sizeY; + this.pressure = pressure; + this.relatedObject = relatedObject; + this.ctrlKey = ctrlKey; + this.altKey = altKey; + this.shiftKey = shiftKey; + this.commandKey = commandKey; +}; +$hxClasses["feathers.events.TriggerEvent"] = feathers_events_TriggerEvent; +feathers_events_TriggerEvent.__name__ = "feathers.events.TriggerEvent"; +feathers_events_TriggerEvent.dispatchFromMouseEvent = function(dispatcher,mouseEvent) { + var event = feathers_events_TriggerEvent._pool.get(); + event = feathers_events_TriggerEvent.fromMouseEvent(mouseEvent,event); + var result = dispatcher.dispatchEvent(event); + feathers_events_TriggerEvent._pool.release(event); + return result; +}; +feathers_events_TriggerEvent.dispatchFromTouchEvent = function(dispatcher,touchEvent) { + var event = feathers_events_TriggerEvent._pool.get(); + event = feathers_events_TriggerEvent.fromTouchEvent(touchEvent,event); + var result = dispatcher.dispatchEvent(event); + feathers_events_TriggerEvent._pool.release(event); + return result; +}; +feathers_events_TriggerEvent.fromMouseEvent = function(event,existing) { + if(event.type != "click") { + throw new openfl_errors_ArgumentError("TriggerEvent.fromMouseEvent() requires MouseEvent.CLICK"); + } + if(existing != null) { + existing.type = "trigger"; + existing.bubbles = false; + existing.cancelable = event.cancelable; + existing.touchPointID = -1; + existing.isPrimaryTouchPoint = false; + existing.localX = event.localX; + existing.localY = event.localY; + existing.stageX = event.stageX; + existing.stageY = event.stageY; + existing.sizeX = 0.0; + existing.sizeY = 0.0; + existing.pressure = 1.0; + existing.relatedObject = event.relatedObject; + existing.ctrlKey = event.ctrlKey; + existing.altKey = event.altKey; + existing.shiftKey = event.shiftKey; + existing.commandKey = event.commandKey; + return existing; + } + var result = new feathers_events_TriggerEvent("trigger",false,event.cancelable,-1,false,event.localX,event.localY,0.0,0.0,1.0,event.relatedObject,event.ctrlKey,event.altKey,event.shiftKey,Object.prototype.hasOwnProperty.call(event,"commandKey") && Reflect.field(event,"commandKey")); + result.stageX = event.stageX; + result.stageY = event.stageY; + return result; +}; +feathers_events_TriggerEvent.fromTouchEvent = function(event,existing) { + if(event.type != "touchTap") { + throw new openfl_errors_ArgumentError("TriggerEvent.fromTouchEvent() requires TouchEvent.TOUCH_TAP"); + } + if(existing != null) { + existing.type = "trigger"; + existing.bubbles = false; + existing.cancelable = event.cancelable; + existing.touchPointID = event.touchPointID; + existing.isPrimaryTouchPoint = event.isPrimaryTouchPoint; + existing.localX = event.localX; + existing.localY = event.localY; + existing.stageX = event.stageX; + existing.stageY = event.stageY; + existing.sizeX = event.sizeX; + existing.sizeY = event.sizeY; + existing.pressure = event.pressure; + existing.relatedObject = event.relatedObject; + existing.ctrlKey = event.ctrlKey; + existing.altKey = event.altKey; + existing.shiftKey = event.shiftKey; + existing.commandKey = event.commandKey; + return existing; + } + var result = new feathers_events_TriggerEvent("trigger",false,event.cancelable,event.touchPointID,event.isPrimaryTouchPoint,event.localX,event.localY,event.sizeX,event.sizeY,event.pressure,event.relatedObject,event.ctrlKey,event.altKey,event.shiftKey,Object.prototype.hasOwnProperty.call(event,"commandKey") && Reflect.field(event,"commandKey")); + result.stageX = event.stageX; + result.stageY = event.stageY; + return result; +}; +feathers_events_TriggerEvent.__super__ = openfl_events_Event; +feathers_events_TriggerEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var result = new feathers_events_TriggerEvent(this.type,this.bubbles,this.cancelable,this.touchPointID,this.isPrimaryTouchPoint,this.localX,this.localY,this.sizeX,this.sizeY,this.pressure,this.relatedObject,this.ctrlKey,this.altKey,this.shiftKey,this.commandKey); + result.stageX = this.stageX; + result.stageY = this.stageY; + return result; + } + ,__class__: feathers_events_TriggerEvent +}); +var feathers_graphics_CreateGradientBoxMatrix = {}; +feathers_graphics_CreateGradientBoxMatrix.fromGradientBoxTransform = function(transform) { + switch(transform._hx_index) { + case 0: + var rotation = transform.rotation; + return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) { + var matrix = new openfl_geom_Matrix(); + matrix.createGradientBox(defaultWidth,defaultHeight,rotation,defaultTx,defaultTy); + return matrix; + }; + case 1: + var rotation1 = transform.rotation; + return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) { + var matrix = new openfl_geom_Matrix(); + matrix.createGradientBox(defaultWidth,defaultHeight,rotation1 * Math.PI / 180.0,defaultTx,defaultTy); + return matrix; + }; + case 2: + var tx = transform.tx; + var ty = transform.ty; + return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) { + var matrix = new openfl_geom_Matrix(); + matrix.createGradientBox(defaultWidth,defaultHeight,defaultRadians,tx,ty); + return matrix; + }; + case 3: + var rotation2 = transform.rotation; + var tx1 = transform.tx; + var ty1 = transform.ty; + return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) { + var matrix = new openfl_geom_Matrix(); + matrix.createGradientBox(defaultWidth,defaultHeight,rotation2,tx1,ty1); + return matrix; + }; + case 4: + var rotation3 = transform.rotation; + var tx2 = transform.tx; + var ty2 = transform.ty; + return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) { + var matrix = new openfl_geom_Matrix(); + matrix.createGradientBox(defaultWidth,defaultHeight,rotation3 * Math.PI / 180.0,tx2,ty2); + return matrix; + }; + } +}; +feathers_graphics_CreateGradientBoxMatrix.fromRadians = function(radians) { + return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) { + var matrix = new openfl_geom_Matrix(); + matrix.createGradientBox(defaultWidth,defaultHeight,radians,defaultTx,defaultTy); + return matrix; + }; +}; +feathers_graphics_CreateGradientBoxMatrix.fromMatrix = function(matrix) { + return function(defaultWidth,defaultHeight,defaultRadians,defaultTx,defaultTy) { + return matrix; + }; +}; +var feathers_graphics_FillStyle = $hxEnums["feathers.graphics.FillStyle"] = { __ename__:"feathers.graphics.FillStyle",__constructs__:null + ,SolidColor: ($_=function(color,alpha) { return {_hx_index:0,color:color,alpha:alpha,__enum__:"feathers.graphics.FillStyle",toString:$estr}; },$_._hx_name="SolidColor",$_.__params__ = ["color","alpha"],$_) + ,Bitmap: ($_=function(bitmapData,matrix,repeat,smoothing) { return {_hx_index:1,bitmapData:bitmapData,matrix:matrix,repeat:repeat,smoothing:smoothing,__enum__:"feathers.graphics.FillStyle",toString:$estr}; },$_._hx_name="Bitmap",$_.__params__ = ["bitmapData","matrix","repeat","smoothing"],$_) + ,Gradient: ($_=function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) { return {_hx_index:2,type:type,colors:colors,alphas:alphas,ratios:ratios,matrix:matrix,spreadMethod:spreadMethod,interpolationMethod:interpolationMethod,focalPointRatio:focalPointRatio,__enum__:"feathers.graphics.FillStyle",toString:$estr}; },$_._hx_name="Gradient",$_.__params__ = ["type","colors","alphas","ratios","matrix","spreadMethod","interpolationMethod","focalPointRatio"],$_) + ,None: {_hx_name:"None",_hx_index:3,__enum__:"feathers.graphics.FillStyle",toString:$estr} +}; +feathers_graphics_FillStyle.__constructs__ = [feathers_graphics_FillStyle.SolidColor,feathers_graphics_FillStyle.Bitmap,feathers_graphics_FillStyle.Gradient,feathers_graphics_FillStyle.None]; +var feathers_graphics_GradientBoxTransform = $hxEnums["feathers.graphics.GradientBoxTransform"] = { __ename__:"feathers.graphics.GradientBoxTransform",__constructs__:null + ,RotateRadians: ($_=function(rotation) { return {_hx_index:0,rotation:rotation,__enum__:"feathers.graphics.GradientBoxTransform",toString:$estr}; },$_._hx_name="RotateRadians",$_.__params__ = ["rotation"],$_) + ,RotateDegrees: ($_=function(rotation) { return {_hx_index:1,rotation:rotation,__enum__:"feathers.graphics.GradientBoxTransform",toString:$estr}; },$_._hx_name="RotateDegrees",$_.__params__ = ["rotation"],$_) + ,Translate: ($_=function(tx,ty) { return {_hx_index:2,tx:tx,ty:ty,__enum__:"feathers.graphics.GradientBoxTransform",toString:$estr}; },$_._hx_name="Translate",$_.__params__ = ["tx","ty"],$_) + ,RotateRadiansAndTranslate: ($_=function(rotation,tx,ty) { return {_hx_index:3,rotation:rotation,tx:tx,ty:ty,__enum__:"feathers.graphics.GradientBoxTransform",toString:$estr}; },$_._hx_name="RotateRadiansAndTranslate",$_.__params__ = ["rotation","tx","ty"],$_) + ,RotateDegreesAndTranslate: ($_=function(rotation,tx,ty) { return {_hx_index:4,rotation:rotation,tx:tx,ty:ty,__enum__:"feathers.graphics.GradientBoxTransform",toString:$estr}; },$_._hx_name="RotateDegreesAndTranslate",$_.__params__ = ["rotation","tx","ty"],$_) +}; +feathers_graphics_GradientBoxTransform.__constructs__ = [feathers_graphics_GradientBoxTransform.RotateRadians,feathers_graphics_GradientBoxTransform.RotateDegrees,feathers_graphics_GradientBoxTransform.Translate,feathers_graphics_GradientBoxTransform.RotateRadiansAndTranslate,feathers_graphics_GradientBoxTransform.RotateDegreesAndTranslate]; +var feathers_graphics_LineStyle = $hxEnums["feathers.graphics.LineStyle"] = { __ename__:"feathers.graphics.LineStyle",__constructs__:null + ,SolidColor: ($_=function(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit) { return {_hx_index:0,thickness:thickness,color:color,alpha:alpha,pixelHinting:pixelHinting,scaleMode:scaleMode,caps:caps,joints:joints,miterLimit:miterLimit,__enum__:"feathers.graphics.LineStyle",toString:$estr}; },$_._hx_name="SolidColor",$_.__params__ = ["thickness","color","alpha","pixelHinting","scaleMode","caps","joints","miterLimit"],$_) + ,Bitmap: ($_=function(thickness,bitmapData,matrix,repeat,smooth) { return {_hx_index:1,thickness:thickness,bitmapData:bitmapData,matrix:matrix,repeat:repeat,smooth:smooth,__enum__:"feathers.graphics.LineStyle",toString:$estr}; },$_._hx_name="Bitmap",$_.__params__ = ["thickness","bitmapData","matrix","repeat","smooth"],$_) + ,Gradient: ($_=function(thickness,type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) { return {_hx_index:2,thickness:thickness,type:type,colors:colors,alphas:alphas,ratios:ratios,matrix:matrix,spreadMethod:spreadMethod,interpolationMethod:interpolationMethod,focalPointRatio:focalPointRatio,__enum__:"feathers.graphics.LineStyle",toString:$estr}; },$_._hx_name="Gradient",$_.__params__ = ["thickness","type","colors","alphas","ratios","matrix","spreadMethod","interpolationMethod","focalPointRatio"],$_) + ,None: {_hx_name:"None",_hx_index:3,__enum__:"feathers.graphics.LineStyle",toString:$estr} +}; +feathers_graphics_LineStyle.__constructs__ = [feathers_graphics_LineStyle.SolidColor,feathers_graphics_LineStyle.Bitmap,feathers_graphics_LineStyle.Gradient,feathers_graphics_LineStyle.None]; +var feathers_layout_ILayout = function() { }; +$hxClasses["feathers.layout.ILayout"] = feathers_layout_ILayout; +feathers_layout_ILayout.__name__ = "feathers.layout.ILayout"; +feathers_layout_ILayout.__isInterface__ = true; +feathers_layout_ILayout.__interfaces__ = [openfl_events_IEventDispatcher]; +feathers_layout_ILayout.prototype = { + __class__: feathers_layout_ILayout +}; +var feathers_layout_AnchorLayout = function() { + openfl_events_EventDispatcher.call(this); +}; +$hxClasses["feathers.layout.AnchorLayout"] = feathers_layout_AnchorLayout; +feathers_layout_AnchorLayout.__name__ = "feathers.layout.AnchorLayout"; +feathers_layout_AnchorLayout.__interfaces__ = [feathers_layout_ILayout]; +feathers_layout_AnchorLayout.__super__ = openfl_events_EventDispatcher; +feathers_layout_AnchorLayout.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + layout: function(items,measurements,result) { + var _g = 0; + while(_g < items.length) { + var item = items[_g]; + ++_g; + var layoutObject = null; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + layoutObject = item; + if(!layoutObject.get_includeInLayout()) { + continue; + } + var layoutData = null; + if(layoutObject != null && ((layoutObject.get_layoutData()) instanceof feathers_layout_AnchorLayoutData)) { + layoutData = layoutObject.get_layoutData(); + } + if(layoutData != null) { + if(measurements.width != null) { + var leftAnchor = layoutData.get_left(); + var rightAnchor = layoutData.get_right(); + if(leftAnchor != null && rightAnchor != null && leftAnchor.get_relativeTo() == null && rightAnchor.get_relativeTo() == null) { + item.set_width(measurements.width - leftAnchor.get_value() - rightAnchor.get_value()); + } + } + if(measurements.height != null) { + var topAnchor = layoutData.get_top(); + var bottomAnchor = layoutData.get_bottom(); + if(topAnchor != null && bottomAnchor != null && topAnchor.get_relativeTo() == null && bottomAnchor.get_relativeTo() == null) { + item.set_height(measurements.height - topAnchor.get_value() - bottomAnchor.get_value()); + } + } + } + } + if(js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + } + } + var maxX = 0.0; + var maxY = 0.0; + var doneItems = []; + while(doneItems.length < items.length) { + var oldDoneCount = doneItems.length; + var _g = 0; + while(_g < items.length) { + var item = items[_g]; + ++_g; + if(doneItems.indexOf(item) != -1) { + continue; + } + var layoutObject = null; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + layoutObject = item; + if(!layoutObject.get_includeInLayout()) { + doneItems.push(item); + continue; + } + } + var layoutData = null; + if(layoutObject != null && ((layoutObject.get_layoutData()) instanceof feathers_layout_AnchorLayoutData)) { + layoutData = layoutObject.get_layoutData(); + } + if(js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + } + if(layoutData == null) { + var itemMaxX = item.get_x() + item.get_width(); + if(maxX < itemMaxX) { + maxX = itemMaxX; + } + var itemMaxY = item.get_y() + item.get_height(); + if(maxY < itemMaxY) { + maxY = itemMaxY; + } + } else { + if(layoutData.get_top() != null) { + var top = layoutData.get_top(); + var value = top.get_value(); + var relativeTo = top.get_relativeTo(); + if(relativeTo != null && doneItems.indexOf(relativeTo) == -1) { + if(item.parent != relativeTo.parent) { + throw new openfl_errors_IllegalOperationError("relativeTo must have the same parent"); + } + continue; + } + item.set_y(value); + if(relativeTo != null) { + item.set_y(item.get_y() + (relativeTo.get_y() + relativeTo.get_height())); + } + } + if(layoutData.get_left() != null) { + var left = layoutData.get_left(); + var value1 = left.get_value(); + var relativeTo1 = left.get_relativeTo(); + if(relativeTo1 != null && doneItems.indexOf(relativeTo1) == -1) { + if(item.parent != relativeTo1.parent) { + throw new openfl_errors_IllegalOperationError("relativeTo must have the same parent"); + } + continue; + } + item.set_x(value1); + if(relativeTo1 != null) { + item.set_x(item.get_x() + (relativeTo1.get_x() + relativeTo1.get_width())); + } + } + if(layoutData.get_verticalCenter() == null) { + var itemMaxY1 = item.get_y() + item.get_height(); + if(layoutData.get_bottom() != null) { + var bottom = layoutData.get_bottom(); + var value2 = bottom.get_value(); + if(layoutData.get_top() != null) { + itemMaxY1 += value2; + } else { + itemMaxY1 = item.get_height() + value2; + } + } + if(maxY < itemMaxY1) { + maxY = itemMaxY1; + } + } else { + var itemMaxY2 = item.get_height(); + if(maxY < itemMaxY2) { + maxY = itemMaxY2; + } + } + if(layoutData.get_horizontalCenter() == null) { + var itemMaxX1 = item.get_x() + item.get_width(); + if(layoutData.get_right() != null) { + var right = layoutData.get_right(); + var value3 = right.get_value(); + if(layoutData.get_left() != null) { + itemMaxX1 += value3; + } else { + itemMaxX1 = item.get_width() + value3; + } + } + if(maxX < itemMaxX1) { + maxX = itemMaxX1; + } + } else { + var itemMaxX2 = item.get_width(); + if(maxX < itemMaxX2) { + maxX = itemMaxX2; + } + } + } + doneItems.push(item); + } + if(oldDoneCount == doneItems.length) { + throw new openfl_errors_IllegalOperationError("relativeTo circular reference detected"); + } + } + var viewPortWidth = 0.0; + var viewPortHeight = 0.0; + var loopCount = 0; + var needsAnotherPass = true; + while(needsAnotherPass) { + needsAnotherPass = false; + if(measurements.width != null) { + viewPortWidth = measurements.width; + } else { + viewPortWidth = maxX; + if(measurements.minWidth != null && viewPortWidth < measurements.minWidth) { + viewPortWidth = measurements.minWidth; + } else if(measurements.maxWidth != null && viewPortWidth > measurements.maxWidth) { + viewPortWidth = measurements.maxWidth; + } + } + if(measurements.height != null) { + viewPortHeight = measurements.height; + } else { + viewPortHeight = maxY; + if(measurements.minHeight != null && viewPortHeight < measurements.minHeight) { + viewPortHeight = measurements.minHeight; + } else if(measurements.maxHeight != null && viewPortHeight > measurements.maxHeight) { + viewPortHeight = measurements.maxHeight; + } + } + doneItems.length = 0; + while(doneItems.length < items.length) { + var oldDoneCount = doneItems.length; + var _g = 0; + while(_g < items.length) { + var item = items[_g]; + ++_g; + if(doneItems.indexOf(item) != -1) { + continue; + } + var layoutObject = null; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + layoutObject = item; + if(!layoutObject.get_includeInLayout()) { + doneItems.push(item); + continue; + } + } + var layoutData = null; + if(layoutObject != null && ((layoutObject.get_layoutData()) instanceof feathers_layout_AnchorLayoutData)) { + layoutData = layoutObject.get_layoutData(); + } + if(layoutData == null) { + doneItems.push(item); + continue; + } + if(layoutData.get_top() != null) { + var top = layoutData.get_top(); + var relativeTo = top.get_relativeTo(); + if(relativeTo != null && doneItems.indexOf(relativeTo) == -1) { + if(item.parent != relativeTo.parent) { + throw new openfl_errors_IllegalOperationError("relativeTo must have the same parent"); + } + continue; + } + var y = top.get_value(); + if(relativeTo != null) { + y += relativeTo.get_y() + relativeTo.get_height(); + } + item.set_y(y); + } + if(layoutData.get_left() != null) { + var left = layoutData.get_left(); + var relativeTo1 = left.get_relativeTo(); + if(relativeTo1 != null && doneItems.indexOf(relativeTo1) == -1) { + if(item.parent != relativeTo1.parent) { + throw new openfl_errors_IllegalOperationError("relativeTo must have the same parent"); + } + continue; + } + var x = left.get_value(); + if(relativeTo1 != null) { + x += relativeTo1.get_x() + relativeTo1.get_width(); + } + item.set_x(x); + } + if(layoutData.get_bottom() != null) { + var bottom = layoutData.get_bottom(); + var relativeTo2 = bottom.get_relativeTo(); + if(relativeTo2 != null && doneItems.indexOf(relativeTo2) == -1) { + if(item.parent != relativeTo2.parent) { + throw new openfl_errors_IllegalOperationError("relativeTo must have the same parent"); + } + continue; + } + var bottomPixels = bottom.get_value(); + var bottomEdge = viewPortHeight; + if(relativeTo2 != null) { + bottomEdge = relativeTo2.get_y(); + } + if(layoutData.get_top() == null) { + item.set_y(bottomEdge - bottomPixels - item.get_height()); + } else { + var itemHeight = bottomEdge - bottomPixels - item.get_y(); + if(itemHeight < 0.0) { + itemHeight = 0.0; + } + if(item.get_height() != itemHeight) { + item.set_height(itemHeight); + if(measurements.width == null && js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + var maxItemX = item.get_x() + item.get_width(); + if(maxX < maxItemX) { + maxX = maxItemX; + needsAnotherPass = true; + break; + } + } + } + } + } else if(layoutData.get_verticalCenter() != null) { + item.set_y(layoutData.get_verticalCenter() + (viewPortHeight - item.get_height()) / 2.0); + } + if(layoutData.get_right() != null) { + var right = layoutData.get_right(); + var relativeTo3 = right.get_relativeTo(); + if(relativeTo3 != null && doneItems.indexOf(relativeTo3) == -1) { + if(item.parent != relativeTo3.parent) { + throw new openfl_errors_IllegalOperationError("relativeTo must have the same parent"); + } + continue; + } + var rightPixels = right.get_value(); + var rightEdge = viewPortWidth; + if(relativeTo3 != null) { + rightEdge = relativeTo3.get_x(); + } + if(layoutData.get_left() == null) { + item.set_x(rightEdge - rightPixels - item.get_width()); + } else { + var itemWidth = rightEdge - rightPixels - item.get_x(); + if(itemWidth < 0.0) { + itemWidth = 0.0; + } + if(item.get_width() != itemWidth) { + item.set_width(itemWidth); + if(measurements.height == null && js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + var maxItemY = item.get_y() + item.get_height(); + if(maxY < maxItemY) { + maxY = maxItemY; + needsAnotherPass = true; + break; + } + } + } + } + } else if(layoutData.get_horizontalCenter() != null) { + item.set_x(layoutData.get_horizontalCenter() + (viewPortWidth - item.get_width()) / 2.0); + } + doneItems.push(item); + } + if(!needsAnotherPass && oldDoneCount == doneItems.length) { + throw new openfl_errors_IllegalOperationError("relativeTo circular reference detected"); + } + } + if(needsAnotherPass) { + ++loopCount; + if(loopCount > items.length) { + throw new openfl_errors_IllegalOperationError("AnchorLayout is stuck in an infinite loop."); + } + } + } + if(result == null) { + result = new feathers_layout_LayoutBoundsResult(); + } + result.contentX = 0.0; + result.contentY = 0.0; + result.contentWidth = viewPortWidth; + result.contentHeight = viewPortHeight; + result.viewPortWidth = viewPortWidth; + result.viewPortHeight = viewPortHeight; + return result; + } + ,__class__: feathers_layout_AnchorLayout +}); +var feathers_layout_Anchor = function(value,relativeTo) { + if(value == null) { + value = 0.0; + } + openfl_events_EventDispatcher.call(this); + this._value = value; + this._relativeTo = relativeTo; +}; +$hxClasses["feathers.layout.Anchor"] = feathers_layout_Anchor; +feathers_layout_Anchor.__name__ = "feathers.layout.Anchor"; +feathers_layout_Anchor.__super__ = openfl_events_EventDispatcher; +feathers_layout_Anchor.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_value: function() { + return this._value; + } + ,set_value: function(newValue) { + if(this._value == newValue) { + return this._value; + } + this._value = newValue; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._value; + } + ,get_relativeTo: function() { + return this._relativeTo; + } + ,set_relativeTo: function(value) { + if(this._relativeTo == value) { + return this._relativeTo; + } + this._relativeTo = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._relativeTo; + } + ,__class__: feathers_layout_Anchor + ,__properties__: {set_relativeTo:"set_relativeTo",get_relativeTo:"get_relativeTo",set_value:"set_value",get_value:"get_value"} +}); +var feathers_layout_AbstractAnchor = {}; +feathers_layout_AbstractAnchor.fromPixels = function(pixels) { + return new feathers_layout_Anchor(pixels); +}; +feathers_layout_AbstractAnchor.fromDisplayObject = function(relativeTo) { + return new feathers_layout_Anchor(0.0,relativeTo); +}; +var feathers_layout_ILayoutData = function() { }; +$hxClasses["feathers.layout.ILayoutData"] = feathers_layout_ILayoutData; +feathers_layout_ILayoutData.__name__ = "feathers.layout.ILayoutData"; +feathers_layout_ILayoutData.__isInterface__ = true; +feathers_layout_ILayoutData.__interfaces__ = [openfl_events_IEventDispatcher]; +var feathers_layout_AnchorLayoutData = function(top,right,bottom,left,horizontalCenter,verticalCenter) { + this._verticalCenter = null; + this._horizontalCenter = null; + this._left = null; + this._bottom = null; + this._right = null; + this._top = null; + openfl_events_EventDispatcher.call(this); + this.set_top(top); + this.set_right(right); + this.set_bottom(bottom); + this.set_left(left); + this.set_horizontalCenter(horizontalCenter); + this.set_verticalCenter(verticalCenter); +}; +$hxClasses["feathers.layout.AnchorLayoutData"] = feathers_layout_AnchorLayoutData; +feathers_layout_AnchorLayoutData.__name__ = "feathers.layout.AnchorLayoutData"; +feathers_layout_AnchorLayoutData.__interfaces__ = [feathers_layout_ILayoutData]; +feathers_layout_AnchorLayoutData.center = function(x,y) { + if(y == null) { + y = 0.0; + } + if(x == null) { + x = 0.0; + } + return new feathers_layout_AnchorLayoutData(null,null,null,null,x,y); +}; +feathers_layout_AnchorLayoutData.fill = function(padding) { + if(padding == null) { + padding = 0.0; + } + return new feathers_layout_AnchorLayoutData(feathers_layout_AbstractAnchor.fromPixels(padding),feathers_layout_AbstractAnchor.fromPixels(padding),feathers_layout_AbstractAnchor.fromPixels(padding),feathers_layout_AbstractAnchor.fromPixels(padding)); +}; +feathers_layout_AnchorLayoutData.fillHorizontal = function(padding) { + if(padding == null) { + padding = 0.0; + } + return new feathers_layout_AnchorLayoutData(null,feathers_layout_AbstractAnchor.fromPixels(padding),null,feathers_layout_AbstractAnchor.fromPixels(padding)); +}; +feathers_layout_AnchorLayoutData.fillVertical = function(padding) { + if(padding == null) { + padding = 0.0; + } + return new feathers_layout_AnchorLayoutData(feathers_layout_AbstractAnchor.fromPixels(padding),null,feathers_layout_AbstractAnchor.fromPixels(padding),null); +}; +feathers_layout_AnchorLayoutData.topLeft = function(top,left) { + if(left == null) { + left = 0.0; + } + if(top == null) { + top = 0.0; + } + return new feathers_layout_AnchorLayoutData(feathers_layout_AbstractAnchor.fromPixels(top),null,null,feathers_layout_AbstractAnchor.fromPixels(left)); +}; +feathers_layout_AnchorLayoutData.topCenter = function(top,horizontalCenter) { + if(horizontalCenter == null) { + horizontalCenter = 0.0; + } + if(top == null) { + top = 0.0; + } + return new feathers_layout_AnchorLayoutData(feathers_layout_AbstractAnchor.fromPixels(top),null,null,null,horizontalCenter); +}; +feathers_layout_AnchorLayoutData.topRight = function(top,right) { + if(right == null) { + right = 0.0; + } + if(top == null) { + top = 0.0; + } + return new feathers_layout_AnchorLayoutData(feathers_layout_AbstractAnchor.fromPixels(top),feathers_layout_AbstractAnchor.fromPixels(right)); +}; +feathers_layout_AnchorLayoutData.middleLeft = function(verticalCenter,left) { + if(left == null) { + left = 0.0; + } + if(verticalCenter == null) { + verticalCenter = 0.0; + } + return new feathers_layout_AnchorLayoutData(null,null,null,feathers_layout_AbstractAnchor.fromPixels(left),null,verticalCenter); +}; +feathers_layout_AnchorLayoutData.middleRight = function(verticalCenter,right) { + if(right == null) { + right = 0.0; + } + if(verticalCenter == null) { + verticalCenter = 0.0; + } + return new feathers_layout_AnchorLayoutData(null,feathers_layout_AbstractAnchor.fromPixels(right),null,null,null,verticalCenter); +}; +feathers_layout_AnchorLayoutData.bottomLeft = function(bottom,left) { + if(left == null) { + left = 0.0; + } + if(bottom == null) { + bottom = 0.0; + } + return new feathers_layout_AnchorLayoutData(null,null,feathers_layout_AbstractAnchor.fromPixels(bottom),feathers_layout_AbstractAnchor.fromPixels(left)); +}; +feathers_layout_AnchorLayoutData.bottomCenter = function(bottom,horizontalCenter) { + if(horizontalCenter == null) { + horizontalCenter = 0.0; + } + if(bottom == null) { + bottom = 0.0; + } + return new feathers_layout_AnchorLayoutData(null,null,feathers_layout_AbstractAnchor.fromPixels(bottom),null,horizontalCenter); +}; +feathers_layout_AnchorLayoutData.bottomRight = function(bottom,right) { + if(right == null) { + right = 0.0; + } + if(bottom == null) { + bottom = 0.0; + } + return new feathers_layout_AnchorLayoutData(null,feathers_layout_AbstractAnchor.fromPixels(right),feathers_layout_AbstractAnchor.fromPixels(bottom)); +}; +feathers_layout_AnchorLayoutData.__super__ = openfl_events_EventDispatcher; +feathers_layout_AnchorLayoutData.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_top: function() { + return this._top; + } + ,set_top: function(value) { + if(this._top == value) { + return this._top; + } + if(this._top != null) { + var top = this._top; + top.removeEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler)); + } + this._top = value; + if(this._top != null) { + var top = this._top; + top.addEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler),false,0,true); + } + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._top; + } + ,get_right: function() { + return this._right; + } + ,set_right: function(value) { + if(this._right == value) { + return this._right; + } + if(this._right != null) { + var anchor = this._right; + anchor.removeEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler)); + } + this._right = value; + if(this._right != null) { + var anchor = this._right; + anchor.addEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler),false,0,true); + } + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._right; + } + ,get_bottom: function() { + return this._bottom; + } + ,set_bottom: function(value) { + if(this._bottom == value) { + return this._bottom; + } + if(this._bottom != null) { + var anchor = this._bottom; + anchor.removeEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler)); + } + this._bottom = value; + if(this._bottom != null) { + var anchor = this._bottom; + anchor.addEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler),false,0,true); + } + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._bottom; + } + ,get_left: function() { + return this._left; + } + ,set_left: function(value) { + if(this._left == value) { + return this._left; + } + if(this._left != null) { + var anchor = this._left; + anchor.removeEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler)); + } + this._left = value; + if(this._left != null) { + var anchor = this._left; + anchor.addEventListener("change",$bind(this,this.anchorLayoutData_anchor_changeHandler),false,0,true); + } + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._left; + } + ,get_horizontalCenter: function() { + return this._horizontalCenter; + } + ,set_horizontalCenter: function(value) { + if(this._horizontalCenter == value) { + return this._horizontalCenter; + } + this._horizontalCenter = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._horizontalCenter; + } + ,get_verticalCenter: function() { + return this._verticalCenter; + } + ,set_verticalCenter: function(value) { + if(this._verticalCenter == value) { + return this._verticalCenter; + } + this._verticalCenter = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._verticalCenter; + } + ,anchorLayoutData_anchor_changeHandler: function(event) { + feathers_events_FeathersEvent.dispatch(this,"change"); + } + ,__class__: feathers_layout_AnchorLayoutData + ,__properties__: {set_verticalCenter:"set_verticalCenter",get_verticalCenter:"get_verticalCenter",set_horizontalCenter:"set_horizontalCenter",get_horizontalCenter:"get_horizontalCenter",set_left:"set_left",get_left:"get_left",set_bottom:"set_bottom",get_bottom:"get_bottom",set_right:"set_right",get_right:"get_right",set_top:"set_top",get_top:"get_top"} +}); +var feathers_layout_AutoSizeMode = $hxEnums["feathers.layout.AutoSizeMode"] = { __ename__:"feathers.layout.AutoSizeMode",__constructs__:null + ,STAGE: {_hx_name:"STAGE",_hx_index:0,__enum__:"feathers.layout.AutoSizeMode",toString:$estr} + ,CONTENT: {_hx_name:"CONTENT",_hx_index:1,__enum__:"feathers.layout.AutoSizeMode",toString:$estr} +}; +feathers_layout_AutoSizeMode.__constructs__ = [feathers_layout_AutoSizeMode.STAGE,feathers_layout_AutoSizeMode.CONTENT]; +var feathers_layout_HorizontalAlign = $hxEnums["feathers.layout.HorizontalAlign"] = { __ename__:"feathers.layout.HorizontalAlign",__constructs__:null + ,LEFT: {_hx_name:"LEFT",_hx_index:0,__enum__:"feathers.layout.HorizontalAlign",toString:$estr} + ,CENTER: {_hx_name:"CENTER",_hx_index:1,__enum__:"feathers.layout.HorizontalAlign",toString:$estr} + ,RIGHT: {_hx_name:"RIGHT",_hx_index:2,__enum__:"feathers.layout.HorizontalAlign",toString:$estr} + ,JUSTIFY: {_hx_name:"JUSTIFY",_hx_index:3,__enum__:"feathers.layout.HorizontalAlign",toString:$estr} +}; +feathers_layout_HorizontalAlign.__constructs__ = [feathers_layout_HorizontalAlign.LEFT,feathers_layout_HorizontalAlign.CENTER,feathers_layout_HorizontalAlign.RIGHT,feathers_layout_HorizontalAlign.JUSTIFY]; +var feathers_layout_IDragDropLayout = function() { }; +$hxClasses["feathers.layout.IDragDropLayout"] = feathers_layout_IDragDropLayout; +feathers_layout_IDragDropLayout.__name__ = "feathers.layout.IDragDropLayout"; +feathers_layout_IDragDropLayout.__isInterface__ = true; +feathers_layout_IDragDropLayout.__interfaces__ = [feathers_layout_ILayout]; +feathers_layout_IDragDropLayout.prototype = { + __class__: feathers_layout_IDragDropLayout +}; +var feathers_layout_HorizontalLayout = function() { + this._percentHeightResetEnabled = false; + this._percentWidthResetEnabled = false; + this._justifyResetEnabled = false; + this._verticalAlign = feathers_layout_VerticalAlign.TOP; + this._horizontalAlign = feathers_layout_HorizontalAlign.LEFT; + this._minGap = 0.0; + this._gap = 0.0; + this._paddingLeft = 0.0; + this._paddingBottom = 0.0; + this._paddingRight = 0.0; + this._paddingTop = 0.0; + openfl_events_EventDispatcher.call(this); +}; +$hxClasses["feathers.layout.HorizontalLayout"] = feathers_layout_HorizontalLayout; +feathers_layout_HorizontalLayout.__name__ = "feathers.layout.HorizontalLayout"; +feathers_layout_HorizontalLayout.__interfaces__ = [feathers_layout_IDragDropLayout,feathers_layout_ILayout]; +feathers_layout_HorizontalLayout.__super__ = openfl_events_EventDispatcher; +feathers_layout_HorizontalLayout.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_paddingTop: function() { + return this._paddingTop; + } + ,set_paddingTop: function(value) { + if(this._paddingTop == value) { + return this._paddingTop; + } + this._paddingTop = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._paddingTop; + } + ,get_paddingRight: function() { + return this._paddingRight; + } + ,set_paddingRight: function(value) { + if(this._paddingRight == value) { + return this._paddingRight; + } + this._paddingRight = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._paddingRight; + } + ,get_paddingBottom: function() { + return this._paddingBottom; + } + ,set_paddingBottom: function(value) { + if(this._paddingBottom == value) { + return this._paddingBottom; + } + this._paddingBottom = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._paddingBottom; + } + ,get_paddingLeft: function() { + return this._paddingLeft; + } + ,set_paddingLeft: function(value) { + if(this._paddingLeft == value) { + return this._paddingLeft; + } + this._paddingLeft = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._paddingLeft; + } + ,get_gap: function() { + return this._gap; + } + ,set_gap: function(value) { + if(this._gap == value) { + return this._gap; + } + this._gap = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._gap; + } + ,get_minGap: function() { + return this._minGap; + } + ,set_minGap: function(value) { + if(this._minGap == value) { + return this._minGap; + } + this._minGap = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._minGap; + } + ,get_horizontalAlign: function() { + return this._horizontalAlign; + } + ,set_horizontalAlign: function(value) { + if(this._horizontalAlign == value) { + return this._horizontalAlign; + } + this._horizontalAlign = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._horizontalAlign; + } + ,get_verticalAlign: function() { + return this._verticalAlign; + } + ,set_verticalAlign: function(value) { + if(this._verticalAlign == value) { + return this._verticalAlign; + } + this._verticalAlign = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._verticalAlign; + } + ,get_justifyResetEnabled: function() { + return this._justifyResetEnabled; + } + ,set_justifyResetEnabled: function(value) { + if(this._justifyResetEnabled == value) { + return this._justifyResetEnabled; + } + this._justifyResetEnabled = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._justifyResetEnabled; + } + ,get_percentWidthResetEnabled: function() { + return this._percentWidthResetEnabled; + } + ,set_percentWidthResetEnabled: function(value) { + if(this._percentWidthResetEnabled == value) { + return this._percentWidthResetEnabled; + } + this._percentWidthResetEnabled = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._percentWidthResetEnabled; + } + ,get_percentHeightResetEnabled: function() { + return this._percentHeightResetEnabled; + } + ,set_percentHeightResetEnabled: function(value) { + if(this._percentHeightResetEnabled == value) { + return this._percentHeightResetEnabled; + } + this._percentHeightResetEnabled = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._percentHeightResetEnabled; + } + ,setPadding: function(value) { + this.set_paddingTop(value); + this.set_paddingRight(value); + this.set_paddingBottom(value); + this.set_paddingLeft(value); + } + ,layout: function(items,measurements,result) { + var adjustedGap = this._gap; + var hasFlexGap = this._gap == 1.0 / 0.0; + if(hasFlexGap) { + adjustedGap = this._minGap; + } + var isJustified = this._verticalAlign == feathers_layout_VerticalAlign.JUSTIFY; + var explicitContentWidth = measurements.width; + if(explicitContentWidth != null) { + explicitContentWidth -= this._paddingLeft + this._paddingRight; + } + var explicitContentHeight = measurements.height; + if(explicitContentHeight != null) { + explicitContentHeight -= this._paddingTop + this._paddingBottom; + } + var _g = 0; + while(_g < items.length) { + var item = items[_g]; + ++_g; + var percentWidth = null; + var percentHeight = null; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + var layoutItem = item; + if(!layoutItem.get_includeInLayout()) { + continue; + } + var value = layoutItem.get_layoutData(); + var layoutData = ((value) instanceof feathers_layout_HorizontalLayoutData) ? value : null; + if(layoutData != null) { + percentWidth = layoutData.get_percentWidth(); + percentHeight = layoutData.get_percentHeight(); + } + } + if(isJustified) { + if(explicitContentHeight != null) { + item.set_height(explicitContentHeight); + } else if(this._justifyResetEnabled && js_Boot.__implements(item,feathers_core_IMeasureObject)) { + item.resetHeight(); + } + } else if(explicitContentHeight != null) { + if(percentHeight != null) { + if(percentHeight < 0.0) { + percentHeight = 0.0; + } else if(percentHeight > 100.0) { + percentHeight = 100.0; + } + item.set_height(explicitContentHeight * (percentHeight / 100.0)); + } + } else if(percentHeight != null && this._percentHeightResetEnabled && js_Boot.__implements(item,feathers_core_IMeasureObject)) { + item.resetHeight(); + } + if(percentWidth != null && this._percentWidthResetEnabled && explicitContentWidth == null && js_Boot.__implements(item,feathers_core_IMeasureObject)) { + item.resetWidth(); + } + if(js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + } + if(isJustified && explicitContentHeight == null && measurements.maxHeight != null) { + var maxExplicitContentHeight = measurements.maxHeight - this._paddingTop - this._paddingBottom; + if(item.get_height() > maxExplicitContentHeight) { + item.set_height(maxExplicitContentHeight); + if(js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + } + } + } + } + this.applyPercentWidth(items,measurements.width,measurements.minWidth,measurements.maxWidth,adjustedGap); + var contentWidth = this._paddingLeft; + var contentHeight = 0.0; + var _g = 0; + while(_g < items.length) { + var item = items[_g]; + ++_g; + var layoutData = null; + var layoutObject = null; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + layoutObject = item; + if(!layoutObject.get_includeInLayout()) { + continue; + } + var value = layoutObject.get_layoutData(); + layoutData = ((value) instanceof feathers_layout_HorizontalLayoutData) ? value : null; + } + if(js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + } + if(layoutData != null && layoutData.get_marginLeft() != null) { + contentWidth += layoutData.get_marginLeft(); + } + if(contentHeight < item.get_height()) { + contentHeight = item.get_height(); + } + item.set_x(contentWidth); + contentWidth += item.get_width() + adjustedGap; + if(layoutData != null && layoutData.get_marginRight() != null) { + contentWidth += layoutData.get_marginRight(); + } + } + var maxItemHeight = contentHeight; + contentWidth += this._paddingRight; + if(items.length > 0) { + contentWidth -= adjustedGap; + } + contentHeight += this._paddingTop + this._paddingBottom; + var viewPortWidth = contentWidth; + if(measurements.width != null) { + viewPortWidth = measurements.width; + } else if(measurements.minWidth != null && viewPortWidth < measurements.minWidth) { + viewPortWidth = measurements.minWidth; + } else if(measurements.maxWidth != null && viewPortWidth > measurements.maxWidth) { + viewPortWidth = measurements.maxWidth; + } + var viewPortHeight = contentHeight; + if(measurements.height != null) { + viewPortHeight = measurements.height; + } else if(measurements.minHeight != null && viewPortHeight < measurements.minHeight) { + viewPortHeight = measurements.minHeight; + } else if(measurements.maxHeight != null && viewPortHeight > measurements.maxHeight) { + viewPortHeight = measurements.maxHeight; + } + this.applyPercentHeight(items,viewPortHeight); + var _g = 0; + while(_g < items.length) { + var item = items[_g]; + ++_g; + var layoutObject = null; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + layoutObject = item; + if(!layoutObject.get_includeInLayout()) { + continue; + } + } + switch(this._verticalAlign._hx_index) { + case 0: + item.set_y(this._paddingTop); + break; + case 1: + item.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom - item.get_height()) / 2.0)); + break; + case 2: + item.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom) - item.get_height())); + break; + case 3: + item.set_y(this._paddingTop); + item.set_height(viewPortHeight - this._paddingTop - this._paddingBottom); + break; + } + } + var contentWidth1 = contentWidth - this._paddingLeft - this._paddingRight; + var alignOffset = 0.0; + var gapOffset = 0.0; + var maxAlignmentWidth = viewPortWidth - this._paddingLeft - this._paddingRight; + var adjustedGap = this._gap; + var hasFlexGap = this._gap == 1.0 / 0.0; + if(hasFlexGap) { + adjustedGap = this._minGap; + if(items.length > 1 && maxAlignmentWidth > contentWidth1) { + adjustedGap += (maxAlignmentWidth - contentWidth1) / (items.length - 1); + } + gapOffset = adjustedGap - this._minGap; + } else { + switch(this._horizontalAlign._hx_index) { + case 0: + alignOffset = 0.0; + break; + case 1: + alignOffset = (maxAlignmentWidth - contentWidth1) / 2.0; + break; + case 2: + alignOffset = maxAlignmentWidth - contentWidth1; + break; + default: + throw new openfl_errors_ArgumentError("Unknown horizontal align: " + Std.string(this._horizontalAlign)); + } + if(alignOffset < 0.0) { + alignOffset = 0.0; + } + } + if(!(alignOffset == 0.0 && gapOffset == 0.0)) { + var totalOffset = alignOffset; + var _g = 0; + while(_g < items.length) { + var item = items[_g]; + ++_g; + var layoutObject = null; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + layoutObject = item; + if(!layoutObject.get_includeInLayout()) { + continue; + } + } + item.set_x(Math.max(this._paddingLeft,item.get_x() + totalOffset)); + totalOffset += gapOffset; + } + } + if(contentWidth < viewPortWidth) { + contentWidth = viewPortWidth; + } + if(contentHeight < viewPortHeight) { + contentHeight = viewPortHeight; + } + if(result == null) { + result = new feathers_layout_LayoutBoundsResult(); + } + result.contentX = 0.0; + result.contentY = 0.0; + result.contentWidth = contentWidth; + result.contentHeight = contentHeight; + result.viewPortWidth = viewPortWidth; + result.viewPortHeight = viewPortHeight; + return result; + } + ,getDragDropIndex: function(items,x,y,width,height) { + var adjustedGap = this._gap; + var hasFlexGap = this._gap == 1.0 / 0.0; + if(hasFlexGap) { + adjustedGap = this._minGap; + } + var positionX = this._paddingLeft; + var _g = 0; + var _g1 = items.length; + while(_g < _g1) { + var i = _g++; + var item = items[i]; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + var layoutItem = item; + if(!layoutItem.get_includeInLayout()) { + continue; + } + } + if(js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + } + var itemWidth = item.get_width(); + if(x < positionX + itemWidth / 2.0) { + return i; + } + positionX += itemWidth + adjustedGap; + } + return items.length; + } + ,getDragDropRegion: function(items,dropIndex,x,y,width,height,result) { + var adjustedGap = this._gap; + var hasFlexGap = this._gap == 1.0 / 0.0; + if(hasFlexGap) { + adjustedGap = this._minGap; + } + var maxIndex = dropIndex; + if(maxIndex < 0) { + maxIndex = 0; + } else if(maxIndex > items.length) { + maxIndex = items.length; + } + var positionX = this._paddingLeft; + var _g = 0; + var _g1 = maxIndex; + while(_g < _g1) { + var i = _g++; + var item = items[i]; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + var layoutItem = item; + if(!layoutItem.get_includeInLayout()) { + continue; + } + } + if(js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + } + positionX += item.get_width() + adjustedGap; + } + if(result == null) { + result = new openfl_geom_Rectangle(positionX,0.0,0.0,height); + } else { + result.setTo(positionX,0.0,0.0,height); + } + return result; + } + ,validateItems: function(items,measurements) { + var isJustified = this._verticalAlign == feathers_layout_VerticalAlign.JUSTIFY; + var explicitContentWidth = measurements.width; + if(explicitContentWidth != null) { + explicitContentWidth -= this._paddingLeft + this._paddingRight; + } + var explicitContentHeight = measurements.height; + if(explicitContentHeight != null) { + explicitContentHeight -= this._paddingTop + this._paddingBottom; + } + var _g = 0; + while(_g < items.length) { + var item = items[_g]; + ++_g; + var percentWidth = null; + var percentHeight = null; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + var layoutItem = item; + if(!layoutItem.get_includeInLayout()) { + continue; + } + var value = layoutItem.get_layoutData(); + var layoutData = ((value) instanceof feathers_layout_HorizontalLayoutData) ? value : null; + if(layoutData != null) { + percentWidth = layoutData.get_percentWidth(); + percentHeight = layoutData.get_percentHeight(); + } + } + if(isJustified) { + if(explicitContentHeight != null) { + item.set_height(explicitContentHeight); + } else if(this._justifyResetEnabled && js_Boot.__implements(item,feathers_core_IMeasureObject)) { + item.resetHeight(); + } + } else if(explicitContentHeight != null) { + if(percentHeight != null) { + if(percentHeight < 0.0) { + percentHeight = 0.0; + } else if(percentHeight > 100.0) { + percentHeight = 100.0; + } + item.set_height(explicitContentHeight * (percentHeight / 100.0)); + } + } else if(percentHeight != null && this._percentHeightResetEnabled && js_Boot.__implements(item,feathers_core_IMeasureObject)) { + item.resetHeight(); + } + if(percentWidth != null && this._percentWidthResetEnabled && explicitContentWidth == null && js_Boot.__implements(item,feathers_core_IMeasureObject)) { + item.resetWidth(); + } + if(js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + } + if(isJustified && explicitContentHeight == null && measurements.maxHeight != null) { + var maxExplicitContentHeight = measurements.maxHeight - this._paddingTop - this._paddingBottom; + if(item.get_height() > maxExplicitContentHeight) { + item.set_height(maxExplicitContentHeight); + if(js_Boot.__implements(item,feathers_core_IValidating)) { + item.validateNow(); + } + } + } + } + } + ,applyVerticalAlign: function(items,maxItemHeight,viewPortHeight) { + var _g = 0; + while(_g < items.length) { + var item = items[_g]; + ++_g; + var layoutObject = null; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + layoutObject = item; + if(!layoutObject.get_includeInLayout()) { + continue; + } + } + switch(this._verticalAlign._hx_index) { + case 0: + item.set_y(this._paddingTop); + break; + case 1: + item.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom - item.get_height()) / 2.0)); + break; + case 2: + item.set_y(Math.max(this._paddingTop,this._paddingTop + (viewPortHeight - this._paddingTop - this._paddingBottom) - item.get_height())); + break; + case 3: + item.set_y(this._paddingTop); + item.set_height(viewPortHeight - this._paddingTop - this._paddingBottom); + break; + } + } + } + ,applyHorizontalAlign: function(items,contentWidth,viewPortWidth) { + var alignOffset = 0.0; + var gapOffset = 0.0; + var maxAlignmentWidth = viewPortWidth - this._paddingLeft - this._paddingRight; + var adjustedGap = this._gap; + var hasFlexGap = this._gap == 1.0 / 0.0; + if(hasFlexGap) { + adjustedGap = this._minGap; + if(items.length > 1 && maxAlignmentWidth > contentWidth) { + adjustedGap += (maxAlignmentWidth - contentWidth) / (items.length - 1); + } + gapOffset = adjustedGap - this._minGap; + } else { + switch(this._horizontalAlign._hx_index) { + case 0: + alignOffset = 0.0; + break; + case 1: + alignOffset = (maxAlignmentWidth - contentWidth) / 2.0; + break; + case 2: + alignOffset = maxAlignmentWidth - contentWidth; + break; + default: + throw new openfl_errors_ArgumentError("Unknown horizontal align: " + Std.string(this._horizontalAlign)); + } + if(alignOffset < 0.0) { + alignOffset = 0.0; + } + } + if(alignOffset == 0.0 && gapOffset == 0.0) { + return; + } + var totalOffset = alignOffset; + var _g = 0; + while(_g < items.length) { + var item = items[_g]; + ++_g; + var layoutObject = null; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + layoutObject = item; + if(!layoutObject.get_includeInLayout()) { + continue; + } + } + item.set_x(Math.max(this._paddingLeft,item.get_x() + totalOffset)); + totalOffset += gapOffset; + } + } + ,applyPercentWidth: function(items,explicitWidth,explicitMinWidth,explicitMaxWidth,adjustedGap) { + var pendingItems = []; + var totalMeasuredWidth = 0.0; + var totalMinWidth = 0.0; + var totalPercentWidth = 0.0; + var _g = 0; + while(_g < items.length) { + var item = items[_g]; + ++_g; + if(js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + var layoutItem = item; + if(!layoutItem.get_includeInLayout()) { + continue; + } + var value = layoutItem.get_layoutData(); + var layoutData = ((value) instanceof feathers_layout_HorizontalLayoutData) ? value : null; + if(layoutData != null) { + var percentWidth = layoutData.get_percentWidth(); + if(percentWidth != null) { + if(percentWidth < 0.0) { + percentWidth = 0.0; + } + if(js_Boot.__implements(layoutItem,feathers_core_IMeasureObject)) { + var measureItem = layoutItem; + totalMinWidth += measureItem.get_minWidth(); + } + totalPercentWidth += percentWidth; + if(layoutData.get_marginLeft() != null) { + totalMeasuredWidth += layoutData.get_marginLeft(); + } + if(layoutData.get_marginRight() != null) { + totalMeasuredWidth += layoutData.get_marginRight(); + } + totalMeasuredWidth += adjustedGap; + pendingItems.push(layoutItem); + continue; + } + } + } + totalMeasuredWidth += item.get_width() + adjustedGap; + } + totalMeasuredWidth -= adjustedGap; + totalMeasuredWidth += this._paddingLeft + this._paddingRight; + if(totalPercentWidth < 100.0) { + totalPercentWidth = 100.0; + } + var remainingWidth = 0.0; + if(explicitWidth != null) { + remainingWidth = explicitWidth; + } else { + remainingWidth = totalMeasuredWidth + totalMinWidth; + if(explicitMinWidth != null && remainingWidth < explicitMinWidth) { + remainingWidth = explicitMinWidth; + } else if(explicitMaxWidth != null && remainingWidth > explicitMaxWidth) { + remainingWidth = explicitMaxWidth; + } + } + remainingWidth -= totalMeasuredWidth; + if(remainingWidth < 0.0) { + remainingWidth = 0.0; + } + var needsAnotherPass = true; + while(needsAnotherPass) { + needsAnotherPass = false; + var percentToPixels = remainingWidth / totalPercentWidth; + var _g = 0; + while(_g < pendingItems.length) { + var layoutItem = pendingItems[_g]; + ++_g; + var layoutData = js_Boot.__cast(layoutItem.get_layoutData() , feathers_layout_HorizontalLayoutData); + var percentWidth = layoutData.get_percentWidth(); + if(percentWidth < 0.0) { + percentWidth = 0.0; + } + var itemWidth = percentToPixels * percentWidth; + if(js_Boot.__implements(layoutItem,feathers_core_IMeasureObject)) { + var measureItem = layoutItem; + var itemMinWidth = measureItem.get_explicitMinWidth(); + if(itemMinWidth != null && itemMinWidth > remainingWidth) { + itemMinWidth = remainingWidth; + } + if(itemWidth < itemMinWidth) { + itemWidth = itemMinWidth; + remainingWidth -= itemWidth; + totalPercentWidth -= percentWidth; + HxOverrides.remove(pendingItems,layoutItem); + needsAnotherPass = true; + } + } + (js_Boot.__cast(layoutItem , openfl_display_DisplayObject)).set_width(itemWidth); + if(js_Boot.__implements(layoutItem,feathers_core_IValidating)) { + layoutItem.validateNow(); + } + } + } + } + ,applyPercentHeight: function(items,viewPortHeight) { + var availableHeight = viewPortHeight - this._paddingTop - this._paddingBottom; + var _g = 0; + while(_g < items.length) { + var item = items[_g]; + ++_g; + if(!js_Boot.__implements(item,feathers_layout_ILayoutObject)) { + continue; + } + var layoutItem = item; + if(!layoutItem.get_includeInLayout()) { + continue; + } + var value = layoutItem.get_layoutData(); + var layoutData = ((value) instanceof feathers_layout_HorizontalLayoutData) ? value : null; + if(layoutData == null) { + continue; + } + var percentHeight = layoutData.get_percentHeight(); + if(percentHeight == null) { + continue; + } + if(percentHeight < 0.0) { + percentHeight = 0.0; + } else if(percentHeight > 100.0) { + percentHeight = 100.0; + } + var itemHeight = availableHeight * percentHeight / 100.0; + if(js_Boot.__implements(item,feathers_core_IMeasureObject)) { + var measureItem = item; + var itemMinHeight = measureItem.get_explicitMinHeight(); + if(itemMinHeight != null) { + if(itemMinHeight > availableHeight) { + itemMinHeight = availableHeight; + } + if(itemHeight < itemMinHeight) { + itemHeight = itemMinHeight; + } + } + var itemMaxHeight = measureItem.get_explicitMaxHeight(); + if(itemMaxHeight != null && itemHeight > itemMaxHeight) { + itemHeight = itemMaxHeight; + } + } + item.set_height(itemHeight); + } + } + ,__class__: feathers_layout_HorizontalLayout + ,__properties__: {set_percentHeightResetEnabled:"set_percentHeightResetEnabled",get_percentHeightResetEnabled:"get_percentHeightResetEnabled",set_percentWidthResetEnabled:"set_percentWidthResetEnabled",get_percentWidthResetEnabled:"get_percentWidthResetEnabled",set_justifyResetEnabled:"set_justifyResetEnabled",get_justifyResetEnabled:"get_justifyResetEnabled",set_verticalAlign:"set_verticalAlign",get_verticalAlign:"get_verticalAlign",set_horizontalAlign:"set_horizontalAlign",get_horizontalAlign:"get_horizontalAlign",set_minGap:"set_minGap",get_minGap:"get_minGap",set_gap:"set_gap",get_gap:"get_gap",set_paddingLeft:"set_paddingLeft",get_paddingLeft:"get_paddingLeft",set_paddingBottom:"set_paddingBottom",get_paddingBottom:"get_paddingBottom",set_paddingRight:"set_paddingRight",get_paddingRight:"get_paddingRight",set_paddingTop:"set_paddingTop",get_paddingTop:"get_paddingTop"} +}); +var feathers_layout_HorizontalLayoutData = function(percentWidth,percentHeight) { + this._marginRight = null; + this._marginLeft = null; + this._percentHeight = null; + this._percentWidth = null; + openfl_events_EventDispatcher.call(this); + this.set_percentWidth(percentWidth); + this.set_percentHeight(percentHeight); +}; +$hxClasses["feathers.layout.HorizontalLayoutData"] = feathers_layout_HorizontalLayoutData; +feathers_layout_HorizontalLayoutData.__name__ = "feathers.layout.HorizontalLayoutData"; +feathers_layout_HorizontalLayoutData.__interfaces__ = [feathers_layout_ILayoutData]; +feathers_layout_HorizontalLayoutData.fill = function() { + return new feathers_layout_HorizontalLayoutData(100.0,100.0); +}; +feathers_layout_HorizontalLayoutData.fillHorizontal = function(percentWidth) { + if(percentWidth == null) { + percentWidth = 100.0; + } + return new feathers_layout_HorizontalLayoutData(percentWidth,null); +}; +feathers_layout_HorizontalLayoutData.fillVertical = function(percentHeight) { + if(percentHeight == null) { + percentHeight = 100.0; + } + return new feathers_layout_HorizontalLayoutData(null,percentHeight); +}; +feathers_layout_HorizontalLayoutData.__super__ = openfl_events_EventDispatcher; +feathers_layout_HorizontalLayoutData.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_percentWidth: function() { + return this._percentWidth; + } + ,set_percentWidth: function(value) { + if(this._percentWidth == value) { + return this._percentWidth; + } + this._percentWidth = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._percentWidth; + } + ,get_percentHeight: function() { + return this._percentHeight; + } + ,set_percentHeight: function(value) { + if(this._percentHeight == value) { + return this._percentHeight; + } + this._percentHeight = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._percentHeight; + } + ,get_marginLeft: function() { + return this._marginLeft; + } + ,set_marginLeft: function(value) { + if(this._marginLeft == value) { + return this._marginLeft; + } + this._marginLeft = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._marginLeft; + } + ,get_marginRight: function() { + return this._marginRight; + } + ,set_marginRight: function(value) { + if(this._marginRight == value) { + return this._marginRight; + } + this._marginRight = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._marginRight; + } + ,__class__: feathers_layout_HorizontalLayoutData + ,__properties__: {set_marginRight:"set_marginRight",get_marginRight:"get_marginRight",set_marginLeft:"set_marginLeft",get_marginLeft:"get_marginLeft",set_percentHeight:"set_percentHeight",get_percentHeight:"get_percentHeight",set_percentWidth:"set_percentWidth",get_percentWidth:"get_percentWidth"} +}); +var feathers_layout_IScrollLayout = function() { }; +$hxClasses["feathers.layout.IScrollLayout"] = feathers_layout_IScrollLayout; +feathers_layout_IScrollLayout.__name__ = "feathers.layout.IScrollLayout"; +feathers_layout_IScrollLayout.__isInterface__ = true; +feathers_layout_IScrollLayout.__interfaces__ = [feathers_layout_ILayout]; +feathers_layout_IScrollLayout.prototype = { + __class__: feathers_layout_IScrollLayout + ,__properties__: {get_elasticLeft:"get_elasticLeft",get_elasticBottom:"get_elasticBottom",get_elasticRight:"get_elasticRight",get_elasticTop:"get_elasticTop",set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX"} +}; +var feathers_layout_ISnapLayout = function() { }; +$hxClasses["feathers.layout.ISnapLayout"] = feathers_layout_ISnapLayout; +feathers_layout_ISnapLayout.__name__ = "feathers.layout.ISnapLayout"; +feathers_layout_ISnapLayout.__isInterface__ = true; +feathers_layout_ISnapLayout.__interfaces__ = [feathers_layout_ILayout]; +feathers_layout_ISnapLayout.prototype = { + __class__: feathers_layout_ISnapLayout +}; +var feathers_layout_LayoutBoundsResult = function() { + this.reset(); +}; +$hxClasses["feathers.layout.LayoutBoundsResult"] = feathers_layout_LayoutBoundsResult; +feathers_layout_LayoutBoundsResult.__name__ = "feathers.layout.LayoutBoundsResult"; +feathers_layout_LayoutBoundsResult.prototype = { + reset: function() { + this.contentX = 0.0; + this.contentY = 0.0; + this.contentWidth = 0.0; + this.contentHeight = 0.0; + this.contentMinWidth = 0.0; + this.contentMinHeight = 0.0; + this.contentMaxWidth = 1.0 / 0.0; + this.contentMaxHeight = 1.0 / 0.0; + this.viewPortWidth = 0.0; + this.viewPortHeight = 0.0; + } + ,__class__: feathers_layout_LayoutBoundsResult +}; +var feathers_layout_Measurements = function(target) { + this.maxHeight = null; + this.maxWidth = null; + this.minHeight = null; + this.minWidth = null; + this.height = null; + this.width = null; + this.save(target); +}; +$hxClasses["feathers.layout.Measurements"] = feathers_layout_Measurements; +feathers_layout_Measurements.__name__ = "feathers.layout.Measurements"; +feathers_layout_Measurements.prototype = { + save: function(target) { + if(target == null) { + this.width = null; + this.height = null; + this.minWidth = null; + this.minHeight = null; + this.maxWidth = null; + this.maxHeight = null; + return; + } + if(js_Boot.__implements(target,feathers_core_IMeasureObject)) { + var measureTarget = target; + this.width = measureTarget.get_explicitWidth(); + this.height = measureTarget.get_explicitHeight(); + this.minWidth = measureTarget.get_explicitMinWidth(); + this.minHeight = measureTarget.get_explicitMinHeight(); + this.maxWidth = measureTarget.get_explicitMaxWidth(); + this.maxHeight = measureTarget.get_explicitMaxHeight(); + return; + } + this.width = target.get_width(); + this.height = target.get_height(); + this.minWidth = this.width; + this.minHeight = this.height; + this.maxWidth = this.width; + this.maxHeight = this.height; + } + ,restore: function(target) { + if(js_Boot.__implements(target,feathers_core_IMeasureObject)) { + var measureTarget = target; + if(this.width == null) { + measureTarget.resetWidth(); + } else { + measureTarget.set_width(this.width); + } + if(this.height == null) { + measureTarget.resetHeight(); + } else { + measureTarget.set_height(this.height); + } + if(this.minWidth == null) { + measureTarget.resetMinWidth(); + } else { + measureTarget.set_minWidth(this.minWidth); + } + if(this.minHeight == null) { + measureTarget.resetMinHeight(); + } else { + measureTarget.set_minHeight(this.minHeight); + } + if(this.maxWidth == null) { + measureTarget.resetMaxWidth(); + } else { + measureTarget.set_maxWidth(this.maxWidth); + } + if(this.maxHeight == null) { + measureTarget.resetMaxHeight(); + } else { + measureTarget.set_maxHeight(this.maxHeight); + } + return; + } + if(this.width != null) { + target.set_width(this.width); + } + if(this.height != null) { + target.set_height(this.height); + } + } + ,__class__: feathers_layout_Measurements +}; +var feathers_layout_RelativePosition = $hxEnums["feathers.layout.RelativePosition"] = { __ename__:"feathers.layout.RelativePosition",__constructs__:null + ,TOP: {_hx_name:"TOP",_hx_index:0,__enum__:"feathers.layout.RelativePosition",toString:$estr} + ,RIGHT: {_hx_name:"RIGHT",_hx_index:1,__enum__:"feathers.layout.RelativePosition",toString:$estr} + ,BOTTOM: {_hx_name:"BOTTOM",_hx_index:2,__enum__:"feathers.layout.RelativePosition",toString:$estr} + ,LEFT: {_hx_name:"LEFT",_hx_index:3,__enum__:"feathers.layout.RelativePosition",toString:$estr} + ,MANUAL: {_hx_name:"MANUAL",_hx_index:4,__enum__:"feathers.layout.RelativePosition",toString:$estr} +}; +feathers_layout_RelativePosition.__constructs__ = [feathers_layout_RelativePosition.TOP,feathers_layout_RelativePosition.RIGHT,feathers_layout_RelativePosition.BOTTOM,feathers_layout_RelativePosition.LEFT,feathers_layout_RelativePosition.MANUAL]; +var feathers_layout_VerticalAlign = $hxEnums["feathers.layout.VerticalAlign"] = { __ename__:"feathers.layout.VerticalAlign",__constructs__:null + ,TOP: {_hx_name:"TOP",_hx_index:0,__enum__:"feathers.layout.VerticalAlign",toString:$estr} + ,MIDDLE: {_hx_name:"MIDDLE",_hx_index:1,__enum__:"feathers.layout.VerticalAlign",toString:$estr} + ,BOTTOM: {_hx_name:"BOTTOM",_hx_index:2,__enum__:"feathers.layout.VerticalAlign",toString:$estr} + ,JUSTIFY: {_hx_name:"JUSTIFY",_hx_index:3,__enum__:"feathers.layout.VerticalAlign",toString:$estr} +}; +feathers_layout_VerticalAlign.__constructs__ = [feathers_layout_VerticalAlign.TOP,feathers_layout_VerticalAlign.MIDDLE,feathers_layout_VerticalAlign.BOTTOM,feathers_layout_VerticalAlign.JUSTIFY]; +var feathers_motion_effects_IEffectContext = function() { }; +$hxClasses["feathers.motion.effects.IEffectContext"] = feathers_motion_effects_IEffectContext; +feathers_motion_effects_IEffectContext.__name__ = "feathers.motion.effects.IEffectContext"; +feathers_motion_effects_IEffectContext.__isInterface__ = true; +feathers_motion_effects_IEffectContext.__interfaces__ = [openfl_events_IEventDispatcher]; +feathers_motion_effects_IEffectContext.prototype = { + __class__: feathers_motion_effects_IEffectContext + ,__properties__: {set_position:"set_position",get_position:"get_position",get_duration:"get_duration",get_target:"get_target"} +}; +var feathers_motion_effects_BaseDelegateEffectContext = function(context) { + openfl_events_EventDispatcher.call(this); + this._context = context; + this._context.addEventListener("change",$bind(this,this.baseDelegateEffectContext_context_changeHandler)); + this._context.addEventListener("complete",$bind(this,this.baseDelegateEffectContext_context_completeHandler)); +}; +$hxClasses["feathers.motion.effects.BaseDelegateEffectContext"] = feathers_motion_effects_BaseDelegateEffectContext; +feathers_motion_effects_BaseDelegateEffectContext.__name__ = "feathers.motion.effects.BaseDelegateEffectContext"; +feathers_motion_effects_BaseDelegateEffectContext.__interfaces__ = [feathers_motion_effects_IEffectContext]; +feathers_motion_effects_BaseDelegateEffectContext.__super__ = openfl_events_EventDispatcher; +feathers_motion_effects_BaseDelegateEffectContext.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_context: function() { + return this._context; + } + ,get_target: function() { + return this.get_context().get_target(); + } + ,get_duration: function() { + return this.get_context().get_duration(); + } + ,get_position: function() { + return this.get_context().get_position(); + } + ,set_position: function(value) { + this.get_context().set_position(value); + return this.get_context().get_position(); + } + ,play: function() { + this._context.play(); + } + ,playReverse: function() { + this._context.playReverse(); + } + ,pause: function() { + this._context.pause(); + } + ,stop: function() { + this._context.stop(); + } + ,toEnd: function() { + this._context.toEnd(); + } + ,interrupt: function() { + this._context.interrupt(); + } + ,baseDelegateEffectContext_context_changeHandler: function(event) { + feathers_events_FeathersEvent.dispatch(this,"change"); + } + ,baseDelegateEffectContext_context_completeHandler: function(event) { + feathers_events_FeathersEvent.dispatch(this,"complete"); + } + ,__class__: feathers_motion_effects_BaseDelegateEffectContext + ,__properties__: {set_position:"set_position",get_position:"get_position",get_duration:"get_duration",get_target:"get_target",get_context:"get_context"} +}); +var feathers_motion_effects_BaseEffectContext = function(target,duration,ease) { + this._reversed = false; + this._playing = false; + this._position = 0.0; + this._duration = 0.0; + openfl_events_EventDispatcher.call(this); + this._target = target; + this._duration = duration; + this._ease = ease; +}; +$hxClasses["feathers.motion.effects.BaseEffectContext"] = feathers_motion_effects_BaseEffectContext; +feathers_motion_effects_BaseEffectContext.__name__ = "feathers.motion.effects.BaseEffectContext"; +feathers_motion_effects_BaseEffectContext.__interfaces__ = [feathers_motion_effects_IEffectContext]; +feathers_motion_effects_BaseEffectContext.__super__ = openfl_events_EventDispatcher; +feathers_motion_effects_BaseEffectContext.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_target: function() { + return this._target; + } + ,get_duration: function() { + return this._duration; + } + ,get_position: function() { + return this._position; + } + ,set_position: function(value) { + if(this._position == value) { + return this._position; + } + this._position = value; + this.updateEffect(); + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._position; + } + ,get_ease: function() { + return this._ease; + } + ,play: function() { + var _gthis = this; + if(this._playing && !this._reversed) { + return; + } + if(this._animatePlayback != null) { + motion_Actuate.stop(this._animatePlayback,null,false,false); + this._animatePlayback = null; + } + this._playing = true; + this._reversed = false; + var duration = this._duration * (1.0 - this._position); + this._animatePlayback = motion_Actuate.update(function(value) { + _gthis.set_position(value); + },duration,[this._position],[1.0]); + this._animatePlayback.ease(this._ease); + this._animatePlayback.onComplete($bind(this,this.animatePlayback_onComplete)); + } + ,playReverse: function() { + var _gthis = this; + if(this._playing && this._reversed) { + return; + } + if(this._animatePlayback != null) { + motion_Actuate.stop(this._animatePlayback,null,false,false); + this._animatePlayback = null; + } + this._playing = true; + this._reversed = true; + var duration = this._duration * this._position; + this._animatePlayback = motion_Actuate.update(function(value) { + _gthis.set_position(value); + },duration,[this._position],[0.0]); + this._animatePlayback.ease(this._ease); + this._animatePlayback.onComplete($bind(this,this.animatePlayback_onComplete)); + } + ,pause: function() { + if(!this._playing) { + return; + } + if(this._animatePlayback != null) { + motion_Actuate.stop(this._animatePlayback,null,false,false); + this._animatePlayback = null; + } + this._playing = false; + } + ,stop: function() { + this.pause(); + this.cleanupEffect(); + feathers_events_FeathersEvent.dispatch(this,"complete"); + } + ,toEnd: function() { + this.pause(); + this._position = 1.0; + this.cleanupEffect(); + feathers_events_FeathersEvent.dispatch(this,"complete"); + } + ,interrupt: function() { + this.toEnd(); + } + ,prepareEffect: function() { + } + ,updateEffect: function() { + } + ,cleanupEffect: function() { + } + ,animatePlayback_onComplete: function() { + this._animatePlayback = null; + this.cleanupEffect(); + feathers_events_FeathersEvent.dispatch(this,"complete"); + } + ,__class__: feathers_motion_effects_BaseEffectContext + ,__properties__: {get_ease:"get_ease",set_position:"set_position",get_position:"get_position",get_duration:"get_duration",get_target:"get_target"} +}); +var feathers_motion_effects_EffectInterruptBehavior = $hxEnums["feathers.motion.effects.EffectInterruptBehavior"] = { __ename__:"feathers.motion.effects.EffectInterruptBehavior",__constructs__:null + ,END: {_hx_name:"END",_hx_index:0,__enum__:"feathers.motion.effects.EffectInterruptBehavior",toString:$estr} + ,STOP: {_hx_name:"STOP",_hx_index:1,__enum__:"feathers.motion.effects.EffectInterruptBehavior",toString:$estr} +}; +feathers_motion_effects_EffectInterruptBehavior.__constructs__ = [feathers_motion_effects_EffectInterruptBehavior.END,feathers_motion_effects_EffectInterruptBehavior.STOP]; +var feathers_motion_effects_EventToPositionEffectContext = function(context,dispatcher,eventType,callback) { + this._paused = true; + feathers_motion_effects_BaseDelegateEffectContext.call(this,context); + this.set_callback(callback); + this.set_eventType(eventType); + this.set_dispatcher(dispatcher); +}; +$hxClasses["feathers.motion.effects.EventToPositionEffectContext"] = feathers_motion_effects_EventToPositionEffectContext; +feathers_motion_effects_EventToPositionEffectContext.__name__ = "feathers.motion.effects.EventToPositionEffectContext"; +feathers_motion_effects_EventToPositionEffectContext.__super__ = feathers_motion_effects_BaseDelegateEffectContext; +feathers_motion_effects_EventToPositionEffectContext.prototype = $extend(feathers_motion_effects_BaseDelegateEffectContext.prototype,{ + get_dispatcher: function() { + return this._dispatcher; + } + ,set_dispatcher: function(value) { + if(this._dispatcher == value) { + return this._dispatcher; + } + this.clearEvent(); + this._dispatcher = value; + this.updateEvent(); + return this.get_dispatcher(); + } + ,get_eventType: function() { + return this._eventType; + } + ,set_eventType: function(value) { + if(this._eventType == value) { + return this._eventType; + } + this.clearEvent(); + this._eventType = value; + this.updateEvent(); + return this._eventType; + } + ,get_callback: function() { + return this._callback; + } + ,set_callback: function(value) { + if(this._callback == value) { + return this._callback; + } + this._callback = value; + return this._callback; + } + ,play: function() { + this._paused = false; + } + ,playReverse: function() { + this._paused = false; + } + ,pause: function() { + this._paused = true; + } + ,clearEvent: function() { + if(this._dispatcher == null || this._eventType == null) { + return; + } + this._dispatcher.removeEventListener(this._eventType,$bind(this,this.eventToPositionEffectContext_dispatcher_eventHandler)); + } + ,updateEvent: function() { + if(this._dispatcher == null || this._eventType == null) { + return; + } + this._dispatcher.addEventListener(this._eventType,$bind(this,this.eventToPositionEffectContext_dispatcher_eventHandler),false,0,true); + } + ,eventToPositionEffectContext_dispatcher_eventHandler: function(event) { + if(this._paused) { + return; + } + this.set_position(this._callback(event)); + } + ,__class__: feathers_motion_effects_EventToPositionEffectContext + ,__properties__: $extend(feathers_motion_effects_BaseDelegateEffectContext.prototype.__properties__,{set_callback:"set_callback",get_callback:"get_callback",set_eventType:"set_eventType",get_eventType:"get_eventType",set_dispatcher:"set_dispatcher",get_dispatcher:"get_dispatcher"}) +}); +var feathers_motion_effects_NoOpEffectContext = function(target) { + this._position = 0.0; + this._duration = 0.0; + openfl_events_EventDispatcher.call(this); + this._target = target; +}; +$hxClasses["feathers.motion.effects.NoOpEffectContext"] = feathers_motion_effects_NoOpEffectContext; +feathers_motion_effects_NoOpEffectContext.__name__ = "feathers.motion.effects.NoOpEffectContext"; +feathers_motion_effects_NoOpEffectContext.__interfaces__ = [feathers_motion_effects_IEffectContext]; +feathers_motion_effects_NoOpEffectContext.__super__ = openfl_events_EventDispatcher; +feathers_motion_effects_NoOpEffectContext.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_target: function() { + return this._target; + } + ,get_duration: function() { + return this._duration; + } + ,get_position: function() { + return this._position; + } + ,set_position: function(value) { + if(value != 0.0) { + throw new openfl_errors_RangeError("Position must always be 0.0"); + } + return this._position; + } + ,play: function() { + this.toEnd(); + } + ,pause: function() { + } + ,playReverse: function() { + this.toEnd(); + } + ,stop: function() { + this.toEnd(); + } + ,toEnd: function() { + feathers_events_FeathersEvent.dispatch(this,"complete"); + } + ,interrupt: function() { + this.toEnd(); + } + ,__class__: feathers_motion_effects_NoOpEffectContext + ,__properties__: {set_position:"set_position",get_position:"get_position",get_duration:"get_duration",get_target:"get_target"} +}); +var feathers_motion_effects_actuate_ActuateEffectContext = function(target,actuator,interruptBehavior) { + if(interruptBehavior == null) { + interruptBehavior = feathers_motion_effects_EffectInterruptBehavior.END; + } + this._actuator = actuator; + this.interruptBehavior = interruptBehavior; + var originalEase = this._actuator.getEase(); + this._actuator.ease(motion_easing_Linear.get_easeNone()); + this._onComplete = this._actuator.getOnComplete(); + this._onCompleteParams = this._actuator.getOnCompleteParams(); + this._actuator.onComplete(null,null); + if(target == null) { + target = this._actuator.getTarget(); + } + feathers_motion_effects_BaseEffectContext.call(this,target,this._actuator.getDuration(),originalEase); +}; +$hxClasses["feathers.motion.effects.actuate.ActuateEffectContext"] = feathers_motion_effects_actuate_ActuateEffectContext; +feathers_motion_effects_actuate_ActuateEffectContext.__name__ = "feathers.motion.effects.actuate.ActuateEffectContext"; +feathers_motion_effects_actuate_ActuateEffectContext.__super__ = feathers_motion_effects_BaseEffectContext; +feathers_motion_effects_actuate_ActuateEffectContext.prototype = $extend(feathers_motion_effects_BaseEffectContext.prototype,{ + get_actuator: function() { + return this._actuator; + } + ,interrupt: function() { + if(this.interruptBehavior == feathers_motion_effects_EffectInterruptBehavior.STOP) { + this.stop(); + return; + } + this.toEnd(); + } + ,updateEffect: function() { + this._actuator.goto(this.get_position()); + } + ,cleanupEffect: function() { + if(this._onComplete != null) { + var params = this._onCompleteParams; + if(params == null) { + params = []; + } + this._onComplete.apply(this._onComplete,params); + } + } + ,__class__: feathers_motion_effects_actuate_ActuateEffectContext + ,__properties__: $extend(feathers_motion_effects_BaseEffectContext.prototype.__properties__,{get_actuator:"get_actuator"}) +}); +var feathers_motion_effects_actuate_ActuateForEffects = function() { }; +$hxClasses["feathers.motion.effects.actuate.ActuateForEffects"] = feathers_motion_effects_actuate_ActuateForEffects; +feathers_motion_effects_actuate_ActuateForEffects.__name__ = "feathers.motion.effects.actuate.ActuateForEffects"; +feathers_motion_effects_actuate_ActuateForEffects.tween = function(target,duration,properties,overwrite) { + if(overwrite == null) { + overwrite = true; + } + var result = motion_Actuate.tween(target,duration,properties,overwrite,feathers_motion_effects_actuate_SimpleEffectActuator); + return js_Boot.__cast(result , feathers_motion_effects_actuate_IReadableGenericActuator); +}; +feathers_motion_effects_actuate_ActuateForEffects.update = function(target,duration,start,end,overwrite) { + if(overwrite == null) { + overwrite = true; + } + var properties = { start : start, end : end}; + var result = motion_Actuate.tween(target,duration,properties,overwrite,feathers_motion_effects_actuate_MethodEffectActuator); + return js_Boot.__cast(result , feathers_motion_effects_actuate_IReadableGenericActuator); +}; +var motion_actuators_IGenericActuator = function() { }; +$hxClasses["motion.actuators.IGenericActuator"] = motion_actuators_IGenericActuator; +motion_actuators_IGenericActuator.__name__ = "motion.actuators.IGenericActuator"; +motion_actuators_IGenericActuator.__isInterface__ = true; +motion_actuators_IGenericActuator.prototype = { + __class__: motion_actuators_IGenericActuator +}; +var feathers_motion_effects_actuate_IGotoActuator = function() { }; +$hxClasses["feathers.motion.effects.actuate.IGotoActuator"] = feathers_motion_effects_actuate_IGotoActuator; +feathers_motion_effects_actuate_IGotoActuator.__name__ = "feathers.motion.effects.actuate.IGotoActuator"; +feathers_motion_effects_actuate_IGotoActuator.__isInterface__ = true; +feathers_motion_effects_actuate_IGotoActuator.__interfaces__ = [motion_actuators_IGenericActuator]; +feathers_motion_effects_actuate_IGotoActuator.prototype = { + __class__: feathers_motion_effects_actuate_IGotoActuator +}; +var feathers_motion_effects_actuate_IReadableGenericActuator = function() { }; +$hxClasses["feathers.motion.effects.actuate.IReadableGenericActuator"] = feathers_motion_effects_actuate_IReadableGenericActuator; +feathers_motion_effects_actuate_IReadableGenericActuator.__name__ = "feathers.motion.effects.actuate.IReadableGenericActuator"; +feathers_motion_effects_actuate_IReadableGenericActuator.__isInterface__ = true; +feathers_motion_effects_actuate_IReadableGenericActuator.__interfaces__ = [feathers_motion_effects_actuate_IGotoActuator,motion_actuators_IGenericActuator]; +feathers_motion_effects_actuate_IReadableGenericActuator.prototype = { + __class__: feathers_motion_effects_actuate_IReadableGenericActuator +}; +var motion_actuators_GenericActuator = function(target,duration,properties) { + this._autoVisible = true; + this._delay = 0; + this._reflect = false; + this._repeat = 0; + this._reverse = false; + this._smartRotation = false; + this._snapping = false; + this.special = false; + this.target = target; + this.properties = properties; + this.duration = duration; + this._ease = motion_Actuate.defaultEase; +}; +$hxClasses["motion.actuators.GenericActuator"] = motion_actuators_GenericActuator; +motion_actuators_GenericActuator.__name__ = "motion.actuators.GenericActuator"; +motion_actuators_GenericActuator.__interfaces__ = [motion_actuators_IGenericActuator]; +motion_actuators_GenericActuator.prototype = { + apply: function() { + var _g = 0; + var _g1 = Reflect.fields(this.properties); + while(_g < _g1.length) { + var i = _g1[_g]; + ++_g; + if(Object.prototype.hasOwnProperty.call(this.target,i)) { + this.target[i] = Reflect.field(this.properties,i); + } else { + Reflect.setProperty(this.target,i,Reflect.field(this.properties,i)); + } + } + } + ,autoVisible: function(value) { + if(value == null) { + value = true; + } + this._autoVisible = value; + return this; + } + ,callMethod: function(method,params) { + if(params == null) { + params = []; + } + return method.apply(method,params); + } + ,change: function() { + if(this._onUpdate != null) { + var method = this._onUpdate; + var params = this._onUpdateParams; + if(params == null) { + params = []; + } + method.apply(method,params); + } + } + ,complete: function(sendEvent) { + if(sendEvent == null) { + sendEvent = true; + } + if(sendEvent) { + this.change(); + if(this._onComplete != null) { + var method = this._onComplete; + var params = this._onCompleteParams; + if(params == null) { + params = []; + } + method.apply(method,params); + } + } + motion_Actuate.unload(this); + } + ,delay: function(duration) { + this._delay = duration; + return this; + } + ,ease: function(easing) { + this._ease = easing; + return this; + } + ,move: function() { + } + ,onComplete: function(handler,parameters) { + this._onComplete = handler; + if(parameters == null) { + this._onCompleteParams = []; + } else { + this._onCompleteParams = parameters; + } + if(this.duration == 0) { + this.complete(); + } + return this; + } + ,onRepeat: function(handler,parameters) { + this._onRepeat = handler; + if(parameters == null) { + this._onRepeatParams = []; + } else { + this._onRepeatParams = parameters; + } + return this; + } + ,onUpdate: function(handler,parameters) { + this._onUpdate = handler; + if(parameters == null) { + this._onUpdateParams = []; + } else { + this._onUpdateParams = parameters; + } + return this; + } + ,onPause: function(handler,parameters) { + this._onPause = handler; + if(parameters == null) { + this._onPauseParams = []; + } else { + this._onPauseParams = parameters; + } + return this; + } + ,onResume: function(handler,parameters) { + this._onResume = handler; + if(parameters == null) { + this._onResumeParams = []; + } else { + this._onResumeParams = parameters; + } + return this; + } + ,pause: function() { + if(this._onPause != null) { + var method = this._onPause; + var params = this._onPauseParams; + if(params == null) { + params = []; + } + method.apply(method,params); + } + } + ,reflect: function(value) { + if(value == null) { + value = true; + } + this._reflect = value; + this.special = true; + return this; + } + ,repeat: function(times) { + if(times == null) { + times = -1; + } + this._repeat = times; + return this; + } + ,resume: function() { + if(this._onResume != null) { + var method = this._onResume; + var params = this._onResumeParams; + if(params == null) { + params = []; + } + method.apply(method,params); + } + } + ,reverse: function(value) { + if(value == null) { + value = true; + } + this._reverse = value; + this.special = true; + return this; + } + ,smartRotation: function(value) { + if(value == null) { + value = true; + } + this._smartRotation = value; + this.special = true; + return this; + } + ,snapping: function(value) { + if(value == null) { + value = true; + } + this._snapping = value; + this.special = true; + return this; + } + ,stop: function(properties,complete,sendEvent) { + } + ,__class__: motion_actuators_GenericActuator +}; +var motion_actuators_SimpleActuator = function(target,duration,properties) { + this.active = true; + this.propertyDetails = []; + this.sendChange = false; + this.paused = false; + this.cacheVisible = false; + this.initialized = false; + this.setVisible = false; + this.toggleVisible = false; + this.startTime = openfl_Lib.getTimer() / 1000; + motion_actuators_GenericActuator.call(this,target,duration,properties); + if(!motion_actuators_SimpleActuator.addedEvent) { + motion_actuators_SimpleActuator.addedEvent = true; + openfl_Lib.get_current().stage.addEventListener("enterFrame",motion_actuators_SimpleActuator.stage_onEnterFrame); + } +}; +$hxClasses["motion.actuators.SimpleActuator"] = motion_actuators_SimpleActuator; +motion_actuators_SimpleActuator.__name__ = "motion.actuators.SimpleActuator"; +motion_actuators_SimpleActuator.stage_onEnterFrame = function(event) { + var currentTime = openfl_Lib.getTimer() / 1000; + var actuator; + var j = 0; + var cleanup = false; + var _g = 0; + var _g1 = motion_actuators_SimpleActuator.actuatorsLength; + while(_g < _g1) { + var i = _g++; + actuator = motion_actuators_SimpleActuator.actuators[j]; + if(actuator != null && actuator.active) { + if(currentTime >= actuator.timeOffset) { + actuator.update(currentTime); + } + ++j; + } else { + motion_actuators_SimpleActuator.actuators.splice(j,1); + --motion_actuators_SimpleActuator.actuatorsLength; + } + } +}; +motion_actuators_SimpleActuator.__super__ = motion_actuators_GenericActuator; +motion_actuators_SimpleActuator.prototype = $extend(motion_actuators_GenericActuator.prototype,{ + reverse: function(value) { + var ga = motion_actuators_GenericActuator.prototype.reverse.call(this,value); + var startTime = 0; + startTime = openfl_Lib.getTimer() / 1000; + this.update(startTime); + return ga; + } + ,apply: function() { + motion_actuators_GenericActuator.prototype.apply.call(this); + if(this.toggleVisible && Object.prototype.hasOwnProperty.call(this.properties,"alpha")) { + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"visible")) { + value = Reflect.field(target,"visible"); + } else { + value = Reflect.getProperty(target,"visible"); + } + if(value != null) { + var target = this.target; + var value = Reflect.field(this.properties,"alpha") > 0; + if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) { + target["visible"] = value; + } else { + Reflect.setProperty(target,"visible",value); + } + } + } + } + ,autoVisible: function(value) { + if(value == null) { + value = true; + } + this._autoVisible = value; + if(!value) { + this.toggleVisible = false; + if(this.setVisible) { + var target = this.target; + var value = this.cacheVisible; + if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) { + target["visible"] = value; + } else { + Reflect.setProperty(target,"visible",value); + } + } + } + return this; + } + ,delay: function(duration) { + this._delay = duration; + this.timeOffset = this.startTime + duration; + return this; + } + ,getField: function(target,propertyName) { + var value = null; + if(Object.prototype.hasOwnProperty.call(target,propertyName)) { + value = Reflect.field(target,propertyName); + } else { + value = Reflect.getProperty(target,propertyName); + } + return value; + } + ,initialize: function() { + var details; + var start; + var _g = 0; + var _g1 = Reflect.fields(this.properties); + while(_g < _g1.length) { + var i = _g1[_g]; + ++_g; + var isField = true; + if(Object.prototype.hasOwnProperty.call(this.target,i) && !(this.target.__properties__ && this.target.__properties__["set_" + i])) { + start = Reflect.field(this.target,i); + } else { + isField = false; + start = Reflect.getProperty(this.target,i); + } + if(typeof(start) == "number") { + var target = this.properties; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,i)) { + value = Reflect.field(target,i); + } else { + value = Reflect.getProperty(target,i); + } + var value1 = value; + if(start == null) { + start = 0; + } + if(value1 == null) { + value1 = 0; + } + details = new motion_actuators_PropertyDetails(this.target,i,start,value1 - start,isField); + this.propertyDetails.push(details); + } + } + this.detailsLength = this.propertyDetails.length; + this.initialized = true; + } + ,move: function() { + this.toggleVisible = Object.prototype.hasOwnProperty.call(this.properties,"alpha") && ((this.target) instanceof openfl_display_DisplayObject); + var tmp; + if(this.toggleVisible && this.properties.alpha != 0) { + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"visible")) { + value = Reflect.field(target,"visible"); + } else { + value = Reflect.getProperty(target,"visible"); + } + tmp = !value; + } else { + tmp = false; + } + if(tmp) { + this.setVisible = true; + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"visible")) { + value = Reflect.field(target,"visible"); + } else { + value = Reflect.getProperty(target,"visible"); + } + this.cacheVisible = value; + var target = this.target; + var value = true; + if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) { + target["visible"] = value; + } else { + Reflect.setProperty(target,"visible",value); + } + } + this.timeOffset = this.startTime; + motion_actuators_SimpleActuator.actuators.push(this); + ++motion_actuators_SimpleActuator.actuatorsLength; + } + ,onUpdate: function(handler,parameters) { + this._onUpdate = handler; + if(parameters == null) { + this._onUpdateParams = []; + } else { + this._onUpdateParams = parameters; + } + this.sendChange = true; + return this; + } + ,pause: function() { + if(!this.paused) { + this.paused = true; + motion_actuators_GenericActuator.prototype.pause.call(this); + this.pauseTime = openfl_Lib.getTimer(); + } + } + ,resume: function() { + if(this.paused) { + this.paused = false; + this.timeOffset += (openfl_Lib.getTimer() - this.pauseTime) / 1000; + motion_actuators_GenericActuator.prototype.resume.call(this); + } + } + ,setField: function(target,propertyName,value) { + if(Object.prototype.hasOwnProperty.call(target,propertyName) && !(target.__properties__ && target.__properties__["set_" + propertyName])) { + target[propertyName] = value; + } else { + Reflect.setProperty(target,propertyName,value); + } + } + ,setProperty: function(details,value) { + if(details.isField) { + details.target[details.propertyName] = value; + } else { + Reflect.setProperty(details.target,details.propertyName,value); + } + } + ,stop: function(properties,complete,sendEvent) { + if(this.active) { + if(properties == null) { + this.active = false; + if(complete) { + this.apply(); + } + this.complete(sendEvent); + return; + } + var _g = 0; + var _g1 = Reflect.fields(properties); + while(_g < _g1.length) { + var i = _g1[_g]; + ++_g; + if(Object.prototype.hasOwnProperty.call(this.properties,i)) { + this.active = false; + if(complete) { + this.apply(); + } + this.complete(sendEvent); + return; + } + } + } + } + ,update: function(currentTime) { + if(!this.paused) { + var details; + var easing; + var i; + var tweenPosition = (currentTime - this.timeOffset) / this.duration; + if(tweenPosition > 1) { + tweenPosition = 1; + } + if(!this.initialized) { + this.initialize(); + } + if(!this.special) { + easing = this._ease.calculate(tweenPosition); + var _g = 0; + var _g1 = this.detailsLength; + while(_g < _g1) { + var i = _g++; + details = this.propertyDetails[i]; + this.setProperty(details,details.start + details.change * easing); + } + } else { + if(!this._reverse) { + easing = this._ease.calculate(tweenPosition); + } else { + easing = this._ease.calculate(1 - tweenPosition); + } + var endValue; + var _g = 0; + var _g1 = this.detailsLength; + while(_g < _g1) { + var i = _g++; + details = this.propertyDetails[i]; + if(this._smartRotation && (details.propertyName == "rotation" || details.propertyName == "rotationX" || details.propertyName == "rotationY" || details.propertyName == "rotationZ")) { + var rotation = details.change % 360; + if(rotation > 180) { + rotation -= 360; + } else if(rotation < -180) { + rotation += 360; + } + endValue = details.start + rotation * easing; + } else { + endValue = details.start + details.change * easing; + } + if(!this._snapping) { + this.setProperty(details,endValue); + } else { + this.setProperty(details,Math.round(endValue)); + } + } + } + if(tweenPosition == 1) { + if(this._repeat == 0) { + this.active = false; + var tmp; + if(this.toggleVisible) { + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"alpha")) { + value = Reflect.field(target,"alpha"); + } else { + value = Reflect.getProperty(target,"alpha"); + } + tmp = value == 0; + } else { + tmp = false; + } + if(tmp) { + var target = this.target; + var value = false; + if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) { + target["visible"] = value; + } else { + Reflect.setProperty(target,"visible",value); + } + } + this.complete(true); + return; + } else { + if(this._onRepeat != null) { + var method = this._onRepeat; + var params = this._onRepeatParams; + if(params == null) { + params = []; + } + method.apply(method,params); + } + if(this._reflect) { + this._reverse = !this._reverse; + } + this.startTime = currentTime; + this.timeOffset = this.startTime + this._delay; + if(this._repeat > 0) { + this._repeat--; + } + } + } + if(this.sendChange) { + this.change(); + } + } + } + ,__class__: motion_actuators_SimpleActuator +}); +var motion_actuators_MethodActuator = function(target,duration,properties) { + this.currentParameters = []; + this.tweenProperties = { }; + motion_actuators_SimpleActuator.call(this,target,duration,properties); + if(!Object.prototype.hasOwnProperty.call(properties,"start")) { + this.properties.start = []; + } + if(!Object.prototype.hasOwnProperty.call(properties,"end")) { + this.properties.end = this.properties.start; + } + var _g = 0; + var _g1 = this.properties.start.length; + while(_g < _g1) { + var i = _g++; + this.currentParameters.push(this.properties.start[i]); + } +}; +$hxClasses["motion.actuators.MethodActuator"] = motion_actuators_MethodActuator; +motion_actuators_MethodActuator.__name__ = "motion.actuators.MethodActuator"; +motion_actuators_MethodActuator.__super__ = motion_actuators_SimpleActuator; +motion_actuators_MethodActuator.prototype = $extend(motion_actuators_SimpleActuator.prototype,{ + apply: function() { + var method = this.target; + var params = this.properties.end; + if(params == null) { + params = []; + } + method.apply(method,params); + } + ,complete: function(sendEvent) { + if(sendEvent == null) { + sendEvent = true; + } + if(this.initialized) { + var _g = 0; + var _g1 = this.properties.start.length; + while(_g < _g1) { + var i = _g++; + this.currentParameters[i] = Reflect.field(this.tweenProperties,"param" + i); + } + var method = this.target; + var params = this.currentParameters; + if(params == null) { + params = []; + } + method.apply(method,params); + } + motion_actuators_SimpleActuator.prototype.complete.call(this,sendEvent); + } + ,initialize: function() { + var details; + var propertyName; + var start; + var _g = 0; + var _g1 = this.properties.start.length; + while(_g < _g1) { + var i = _g++; + propertyName = "param" + i; + start = this.properties.start[i]; + this.tweenProperties[propertyName] = start; + if(typeof(start) == "number" || typeof(start) == "number" && ((start | 0) === start)) { + details = new motion_actuators_PropertyDetails(this.tweenProperties,propertyName,start,this.properties.end[i] - start); + this.propertyDetails.push(details); + } + } + this.detailsLength = this.propertyDetails.length; + this.initialized = true; + } + ,update: function(currentTime) { + motion_actuators_SimpleActuator.prototype.update.call(this,currentTime); + if(this.active && !this.paused) { + var _g = 0; + var _g1 = this.properties.start.length; + while(_g < _g1) { + var i = _g++; + this.currentParameters[i] = Reflect.field(this.tweenProperties,"param" + i); + } + var method = this.target; + var params = this.currentParameters; + if(params == null) { + params = []; + } + method.apply(method,params); + } + } + ,__class__: motion_actuators_MethodActuator +}); +var feathers_motion_effects_actuate_MethodEffectActuator = function(target,duration,properties) { + motion_actuators_MethodActuator.call(this,target,duration,properties); +}; +$hxClasses["feathers.motion.effects.actuate.MethodEffectActuator"] = feathers_motion_effects_actuate_MethodEffectActuator; +feathers_motion_effects_actuate_MethodEffectActuator.__name__ = "feathers.motion.effects.actuate.MethodEffectActuator"; +feathers_motion_effects_actuate_MethodEffectActuator.__interfaces__ = [feathers_motion_effects_actuate_IReadableGenericActuator]; +feathers_motion_effects_actuate_MethodEffectActuator.__super__ = motion_actuators_MethodActuator; +feathers_motion_effects_actuate_MethodEffectActuator.prototype = $extend(motion_actuators_MethodActuator.prototype,{ + getTarget: function() { + return this.target; + } + ,getDuration: function() { + return this.duration; + } + ,getEase: function() { + return this._ease; + } + ,getAutoVisible: function() { + return this._autoVisible; + } + ,getDelay: function() { + return this._delay; + } + ,getReflect: function() { + return this._reflect; + } + ,getRepeat: function() { + return this._repeat; + } + ,getReverse: function() { + return this._reverse; + } + ,getSmartRotation: function() { + return this._smartRotation; + } + ,getSnapping: function() { + return this._snapping; + } + ,getOnComplete: function() { + return this._onComplete; + } + ,getOnCompleteParams: function() { + return this._onCompleteParams; + } + ,getOnRepeat: function() { + return this._onRepeat; + } + ,getOnRepeatParams: function() { + return this._onRepeatParams; + } + ,getOnUpdate: function() { + return this._onUpdate; + } + ,getOnUpdateParams: function() { + return this._onUpdateParams; + } + ,getOnPause: function() { + return this._onPause; + } + ,getOnPauseParams: function() { + return this._onPauseParams; + } + ,getOnResume: function() { + return this._onResume; + } + ,getOnResumeParams: function() { + return this._onResumeParams; + } + ,goto: function(tweenPosition) { + var details; + var easing; + var i; + if(!this.initialized) { + this.initialize(); + } + if(!this.special) { + easing = this._ease.calculate(tweenPosition); + var _g = 0; + var _g1 = this.detailsLength; + while(_g < _g1) { + var i = _g++; + details = this.propertyDetails[i]; + this.setProperty(details,details.start + details.change * easing); + } + } else { + if(!this._reverse) { + easing = this._ease.calculate(tweenPosition); + } else { + easing = this._ease.calculate(1 - tweenPosition); + } + var endValue; + var _g = 0; + var _g1 = this.detailsLength; + while(_g < _g1) { + var i = _g++; + details = this.propertyDetails[i]; + if(this._smartRotation && (details.propertyName == "rotation" || details.propertyName == "rotationX" || details.propertyName == "rotationY" || details.propertyName == "rotationZ")) { + var rotation = details.change % 360; + if(rotation > 180) { + rotation -= 360; + } else if(rotation < -180) { + rotation += 360; + } + endValue = details.start + rotation * easing; + } else { + endValue = details.start + details.change * easing; + } + if(!this._snapping) { + this.setProperty(details,endValue); + } else { + this.setProperty(details,Math.round(endValue)); + } + } + } + var _g = 0; + var _g1 = this.properties.start.length; + while(_g < _g1) { + var i = _g++; + this.currentParameters[i] = Reflect.field(this.tweenProperties,"param" + i); + } + var method = this.target; + var params = this.currentParameters; + if(params == null) { + params = []; + } + method.apply(method,params); + } + ,update: function(currentTime) { + if(!this.paused) { + var tweenPosition = (currentTime - this.timeOffset) / this.duration; + if(tweenPosition > 1) { + tweenPosition = 1; + } + this.goto(tweenPosition); + if(tweenPosition == 1) { + if(this._repeat == 0) { + this.active = false; + var tmp; + if(this.toggleVisible) { + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"alpha")) { + value = Reflect.field(target,"alpha"); + } else { + value = Reflect.getProperty(target,"alpha"); + } + tmp = value == 0; + } else { + tmp = false; + } + if(tmp) { + var target = this.target; + var value = false; + if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) { + target["visible"] = value; + } else { + Reflect.setProperty(target,"visible",value); + } + } + this.complete(true); + return; + } else { + if(this._onRepeat != null) { + var method = this._onRepeat; + var params = this._onRepeatParams; + if(params == null) { + params = []; + } + method.apply(method,params); + } + if(this._reflect) { + this._reverse = !this._reverse; + } + this.startTime = currentTime; + this.timeOffset = this.startTime + this._delay; + if(this._repeat > 0) { + this._repeat--; + } + } + } + if(this.sendChange) { + this.change(); + } + } + } + ,__class__: feathers_motion_effects_actuate_MethodEffectActuator +}); +var feathers_motion_effects_actuate_SimpleEffectActuator = function(target,duration,properties) { + motion_actuators_SimpleActuator.call(this,target,duration,properties); +}; +$hxClasses["feathers.motion.effects.actuate.SimpleEffectActuator"] = feathers_motion_effects_actuate_SimpleEffectActuator; +feathers_motion_effects_actuate_SimpleEffectActuator.__name__ = "feathers.motion.effects.actuate.SimpleEffectActuator"; +feathers_motion_effects_actuate_SimpleEffectActuator.__interfaces__ = [feathers_motion_effects_actuate_IReadableGenericActuator]; +feathers_motion_effects_actuate_SimpleEffectActuator.__super__ = motion_actuators_SimpleActuator; +feathers_motion_effects_actuate_SimpleEffectActuator.prototype = $extend(motion_actuators_SimpleActuator.prototype,{ + getTarget: function() { + return this.target; + } + ,getDuration: function() { + return this.duration; + } + ,getEase: function() { + return this._ease; + } + ,getAutoVisible: function() { + return this._autoVisible; + } + ,getDelay: function() { + return this._delay; + } + ,getReflect: function() { + return this._reflect; + } + ,getRepeat: function() { + return this._repeat; + } + ,getReverse: function() { + return this._reverse; + } + ,getSmartRotation: function() { + return this._smartRotation; + } + ,getSnapping: function() { + return this._snapping; + } + ,getOnComplete: function() { + return this._onComplete; + } + ,getOnCompleteParams: function() { + return this._onCompleteParams; + } + ,getOnRepeat: function() { + return this._onRepeat; + } + ,getOnRepeatParams: function() { + return this._onRepeatParams; + } + ,getOnUpdate: function() { + return this._onUpdate; + } + ,getOnUpdateParams: function() { + return this._onUpdateParams; + } + ,getOnPause: function() { + return this._onPause; + } + ,getOnPauseParams: function() { + return this._onPauseParams; + } + ,getOnResume: function() { + return this._onResume; + } + ,getOnResumeParams: function() { + return this._onResumeParams; + } + ,goto: function(tweenPosition) { + var details; + var easing; + var i; + if(!this.initialized) { + this.initialize(); + } + if(!this.special) { + easing = this._ease.calculate(tweenPosition); + var _g = 0; + var _g1 = this.detailsLength; + while(_g < _g1) { + var i = _g++; + details = this.propertyDetails[i]; + this.setProperty(details,details.start + details.change * easing); + } + } else { + if(!this._reverse) { + easing = this._ease.calculate(tweenPosition); + } else { + easing = this._ease.calculate(1 - tweenPosition); + } + var endValue; + var _g = 0; + var _g1 = this.detailsLength; + while(_g < _g1) { + var i = _g++; + details = this.propertyDetails[i]; + if(this._smartRotation && (details.propertyName == "rotation" || details.propertyName == "rotationX" || details.propertyName == "rotationY" || details.propertyName == "rotationZ")) { + var rotation = details.change % 360; + if(rotation > 180) { + rotation -= 360; + } else if(rotation < -180) { + rotation += 360; + } + endValue = details.start + rotation * easing; + } else { + endValue = details.start + details.change * easing; + } + if(!this._snapping) { + this.setProperty(details,endValue); + } else { + this.setProperty(details,Math.round(endValue)); + } + } + } + } + ,update: function(currentTime) { + if(!this.paused) { + var tweenPosition = (currentTime - this.timeOffset) / this.duration; + if(tweenPosition > 1) { + tweenPosition = 1; + } + this.goto(tweenPosition); + if(tweenPosition == 1) { + if(this._repeat == 0) { + this.active = false; + var tmp; + if(this.toggleVisible) { + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"alpha")) { + value = Reflect.field(target,"alpha"); + } else { + value = Reflect.getProperty(target,"alpha"); + } + tmp = value == 0; + } else { + tmp = false; + } + if(tmp) { + var target = this.target; + var value = false; + if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) { + target["visible"] = value; + } else { + Reflect.setProperty(target,"visible",value); + } + } + this.complete(true); + return; + } else { + if(this._onRepeat != null) { + var method = this._onRepeat; + var params = this._onRepeatParams; + if(params == null) { + params = []; + } + method.apply(method,params); + } + if(this._reflect) { + this._reverse = !this._reverse; + } + this.startTime = currentTime; + this.timeOffset = this.startTime + this._delay; + if(this._repeat > 0) { + this._repeat--; + } + } + } + if(this.sendChange) { + this.change(); + } + } + } + ,__class__: feathers_motion_effects_actuate_SimpleEffectActuator +}); +var feathers_motion_transitions_SlideTransitionBuilder = function(angleDegrees,duration,ease) { + if(duration == null) { + duration = 0.5; + } + if(angleDegrees == null) { + angleDegrees = 0.0; + } + this._parallax = 1.0; + this._angle = angleDegrees; + this._duration = duration; + this._ease = ease; +}; +$hxClasses["feathers.motion.transitions.SlideTransitionBuilder"] = feathers_motion_transitions_SlideTransitionBuilder; +feathers_motion_transitions_SlideTransitionBuilder.__name__ = "feathers.motion.transitions.SlideTransitionBuilder"; +feathers_motion_transitions_SlideTransitionBuilder.prototype = { + setAngle: function(angleDegrees) { + this._angle = angleDegrees; + return this; + } + ,setRadians: function(angleRadians) { + this._angle = angleRadians * 180.0 / Math.PI; + return this; + } + ,setUp: function() { + this._angle = 90.0; + return this; + } + ,setDown: function() { + this._angle = 270.0; + return this; + } + ,setLeft: function() { + this._angle = 180.0; + return this; + } + ,setRight: function() { + this._angle = 0.0; + return this; + } + ,setDuration: function(duration) { + this._duration = duration; + return this; + } + ,setEase: function(ease) { + this._ease = ease; + return this; + } + ,setParallax: function(parallax) { + if(parallax < 0.0 || parallax > 1.0) { + throw new openfl_errors_RangeError("Invalid parallax value: " + parallax + ". Expected a value between 0.0 and 1.0."); + } + this._parallax = parallax; + return this; + } + ,setInterruptBehavior: function(interruptBehavior) { + this._interruptBehavior = interruptBehavior; + return this; + } + ,build: function() { + var _gthis = this; + var angle = this._angle % 360.0; + if(angle < 0.0) { + angle += 360.0; + } + var duration = this._duration; + var ease = this._ease; + var interruptBehavior = this._interruptBehavior; + return function(oldView,newView) { + if(oldView == null && newView == null) { + throw new openfl_errors_ArgumentError(feathers_motion_transitions_SlideTransitionBuilder.VIEW_REQUIRED_ERROR); + } + var parent = null; + var width = 0.0; + var height = 0.0; + if(oldView != null) { + parent = oldView.parent; + width = oldView.get_width(); + height = oldView.get_height(); + } + if(newView != null) { + parent = newView.parent; + width = Math.max(width,newView.get_width()); + height = Math.max(height,newView.get_height()); + } + var endX = 0.0; + var endY = 0.0; + if(angle >= 0.0 && angle < 45.0) { + endX = width; + var hy = width / Math.cos(angle * Math.PI / 180.0); + endY = -Math.sqrt(hy * hy - width * width); + } else if(angle >= 45.0 && angle < 90.0) { + endY = -height; + var hy = height / Math.sin(angle * Math.PI / 180.0); + endX = Math.sqrt(hy * hy - height * height); + } else if(angle >= 90.0 && angle < 135.0) { + endY = -height; + var hy = height / Math.cos((angle - 90.0) * Math.PI / 180.0); + endX = -Math.sqrt(hy * hy - height * height); + } else if(angle >= 135.0 && angle < 180.0) { + endX = -width; + var hy = width / Math.sin((angle - 90.0) * Math.PI / 180.0); + endY = -Math.sqrt(hy * hy - width * width); + } else if(angle >= 180.0 && angle < 225.0) { + endX = -width; + var hy = width / Math.cos((angle - 180.0) * Math.PI / 180.0); + endY = Math.sqrt(hy * hy - width * width); + } else if(angle >= 225.0 && angle < 270.0) { + endY = height; + var hy = height / Math.sin((angle - 180.0) * Math.PI / 180.0); + endX = -Math.sqrt(hy * hy - height * height); + } else if(angle >= 270.0 && angle < 315.0) { + endY = height; + var hy = height / Math.cos((angle - 270.0) * Math.PI / 180.0); + endX = Math.sqrt(hy * hy - height * height); + } else { + endX = width; + var hy = width / Math.sin((angle - 270.0) * Math.PI / 180.0); + endY = Math.sqrt(hy * hy - width * width); + } + if(newView != null) { + newView.set_x(-endX); + newView.set_y(-endY); + } + if(parent != null && oldView != null && newView != null) { + var oldViewIndex = parent.getChildIndex(oldView); + var newViewIndex = parent.getChildIndex(newView); + if(oldViewIndex > newViewIndex) { + parent.swapChildren(oldView,newView); + } + } + var actuator = feathers_motion_effects_actuate_ActuateForEffects.update(function(x,y) { + if(oldView != null) { + oldView.set_x(x * _gthis._parallax); + oldView.set_y(y * _gthis._parallax); + } + if(newView != null) { + newView.set_x(x - endX); + newView.set_y(y - endY); + } + },duration,[0.0,0.0],[endX,endY]); + if(ease != null) { + actuator.ease(ease); + } + motion_Actuate.pause(actuator); + return new feathers_motion_effects_actuate_ActuateEffectContext(null,actuator,interruptBehavior); + }; + } + ,__class__: feathers_motion_transitions_SlideTransitionBuilder +}; +var feathers_skins_IProgrammaticSkin = function() { }; +$hxClasses["feathers.skins.IProgrammaticSkin"] = feathers_skins_IProgrammaticSkin; +feathers_skins_IProgrammaticSkin.__name__ = "feathers.skins.IProgrammaticSkin"; +feathers_skins_IProgrammaticSkin.__isInterface__ = true; +feathers_skins_IProgrammaticSkin.__interfaces__ = [feathers_core_IMeasureObject]; +feathers_skins_IProgrammaticSkin.prototype = { + __class__: feathers_skins_IProgrammaticSkin + ,__properties__: {set_uiContext:"set_uiContext",get_uiContext:"get_uiContext"} +}; +var feathers_skins_ProgrammaticSkin = function() { + feathers_core_MeasureSprite.call(this); + this.mouseChildren = false; + this.set_tabEnabled(false); + this.set_tabChildren(false); +}; +$hxClasses["feathers.skins.ProgrammaticSkin"] = feathers_skins_ProgrammaticSkin; +feathers_skins_ProgrammaticSkin.__name__ = "feathers.skins.ProgrammaticSkin"; +feathers_skins_ProgrammaticSkin.__interfaces__ = [feathers_core_IStateObserver,feathers_skins_IProgrammaticSkin]; +feathers_skins_ProgrammaticSkin.__super__ = feathers_core_MeasureSprite; +feathers_skins_ProgrammaticSkin.prototype = $extend(feathers_core_MeasureSprite.prototype,{ + get_uiContext: function() { + return this._uiContext; + } + ,set_uiContext: function(value) { + if(this._uiContext == value) { + return this._uiContext; + } + if(this._uiContext != null) { + this._uiContext.removeEventListener("stateChange",$bind(this,this.uiContext_stateChangeHandler)); + if(js_Boot.__implements(this._uiContext,feathers_controls_IToggle)) { + this._uiContext.removeEventListener("change",$bind(this,this.uiContextToggle_changeHandler)); + } + this.onRemoveUIContext(); + } + this._uiContext = value; + if(this._uiContext != null) { + this._uiContext.addEventListener("stateChange",$bind(this,this.uiContext_stateChangeHandler),false,0,true); + if(js_Boot.__implements(this._uiContext,feathers_controls_IToggle)) { + this._uiContext.addEventListener("change",$bind(this,this.uiContextToggle_changeHandler)); + } + this.onAddUIContext(); + } + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._uiContext; + } + ,get_stateContext: function() { + return this._stateContext; + } + ,set_stateContext: function(value) { + if(this._stateContext == value) { + return this._stateContext; + } + if(this._stateContext != null) { + this._stateContext.removeEventListener("stateChange",$bind(this,this.stateContext_stateChangeHandler)); + } + this._stateContext = value; + if(this._stateContext != null) { + this._stateContext.addEventListener("stateChange",$bind(this,this.stateContext_stateChangeHandler),false,0,true); + } + this.setInvalid(feathers_core_InvalidationFlag.DATA); + return this._stateContext; + } + ,onAddUIContext: function() { + } + ,onRemoveUIContext: function() { + } + ,update: function() { + } + ,needsStateUpdate: function() { + return true; + } + ,checkForStateChange: function() { + if(!this.needsStateUpdate()) { + return; + } + this.setInvalid(feathers_core_InvalidationFlag.STATE); + } + ,uiContext_stateChangeHandler: function(event) { + this.checkForStateChange(); + } + ,uiContextToggle_changeHandler: function(event) { + this.checkForStateChange(); + } + ,stateContext_stateChangeHandler: function(event) { + this.checkForStateChange(); + } + ,stateContextToggle_changeHandler: function(event) { + this.checkForStateChange(); + } + ,__class__: feathers_skins_ProgrammaticSkin + ,__properties__: $extend(feathers_core_MeasureSprite.prototype.__properties__,{set_stateContext:"set_stateContext",get_stateContext:"get_stateContext",set_uiContext:"set_uiContext",get_uiContext:"get_uiContext"}) +}); +var feathers_skins_BaseGraphicsPathSkin = function(fill,border) { + this._previousFill = null; + this._previousBorder = null; + feathers_skins_ProgrammaticSkin.call(this); + this.set_fill(fill); + this.set_border(border); +}; +$hxClasses["feathers.skins.BaseGraphicsPathSkin"] = feathers_skins_BaseGraphicsPathSkin; +feathers_skins_BaseGraphicsPathSkin.__name__ = "feathers.skins.BaseGraphicsPathSkin"; +feathers_skins_BaseGraphicsPathSkin.__super__ = feathers_skins_ProgrammaticSkin; +feathers_skins_BaseGraphicsPathSkin.prototype = $extend(feathers_skins_ProgrammaticSkin.prototype,{ + get_fill: function() { + return this._fill; + } + ,set_fill: function(value) { + if(this._fill == value) { + return this._fill; + } + if(this._previousFill == this._fill) { + this._previousFill = null; + } + this._fill = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._fill; + } + ,get_disabledFill: function() { + return this._disabledFill; + } + ,set_disabledFill: function(value) { + if(this._disabledFill == value) { + return this._disabledFill; + } + if(this._previousFill == this._disabledFill) { + this._previousFill = null; + } + this._disabledFill = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._disabledFill; + } + ,get_selectedFill: function() { + return this._selectedFill; + } + ,set_selectedFill: function(value) { + if(this._selectedFill == value) { + return this._selectedFill; + } + if(this._previousFill == this._selectedFill) { + this._previousFill = null; + } + this._selectedFill = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._selectedFill; + } + ,get_border: function() { + return this._border; + } + ,set_border: function(value) { + if(this._border == value) { + return this._border; + } + if(this._previousBorder == this._border) { + this._previousBorder = null; + } + this._border = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._border; + } + ,get_disabledBorder: function() { + return this._disabledBorder; + } + ,set_disabledBorder: function(value) { + if(this._disabledBorder == value) { + return this._disabledBorder; + } + if(this._previousBorder == this._disabledBorder) { + this._previousBorder = null; + } + this._disabledBorder = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._disabledBorder; + } + ,get_selectedBorder: function() { + return this._selectedBorder; + } + ,set_selectedBorder: function(value) { + if(this._selectedBorder == value) { + return this._selectedBorder; + } + if(this._previousBorder == this._selectedBorder) { + this._previousBorder = null; + } + this._selectedBorder = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._selectedBorder; + } + ,getFillForState: function(state) { + if(this._stateToFill == null) { + return null; + } + return this._stateToFill.get(state); + } + ,setFillForState: function(state,fill) { + if(this._stateToFill == null) { + this._stateToFill = new haxe_ds_EnumValueMap(); + } + var oldFill = this._stateToFill.get(state); + if(oldFill == fill) { + return; + } + if(this._previousFill == oldFill) { + this._previousFill = null; + } + this._stateToFill.set(state,fill); + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + } + ,getBorderForState: function(state) { + if(this._stateToBorder == null) { + return null; + } + return this._stateToBorder.get(state); + } + ,setBorderForState: function(state,border) { + if(this._stateToBorder == null) { + this._stateToBorder = new haxe_ds_EnumValueMap(); + } + var oldBorder = this._stateToBorder.get(state); + if(oldBorder == border) { + return; + } + if(this._previousBorder == oldBorder) { + this._previousBorder = null; + } + this._stateToBorder.set(state,border); + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + } + ,update: function() { + this._previousBorder = this.getCurrentBorder(); + this._previousFill = this.getCurrentFill(); + this.get_graphics().clear(); + this.draw(); + } + ,draw: function() { + this.applyLineStyle(this.getCurrentBorder()); + var currentFill = this.getCurrentFill(); + this.applyFillStyle(currentFill); + this.drawPath(); + if(currentFill != null && currentFill != feathers_graphics_FillStyle.None) { + this.get_graphics().endFill(); + } + } + ,drawPath: function() { + } + ,applyLineStyle: function(lineStyle) { + if(lineStyle == null) { + return; + } + switch(lineStyle._hx_index) { + case 0: + var thickness = lineStyle.thickness; + var color = lineStyle.color; + var alpha = lineStyle.alpha; + var pixelHinting = lineStyle.pixelHinting; + var scaleMode = lineStyle.scaleMode; + var caps = lineStyle.caps; + var joints = lineStyle.joints; + var miterLimit = lineStyle.miterLimit; + if(color == null) { + color = 0; + } + if(alpha == null) { + alpha = 1.0; + } + if(pixelHinting == null) { + pixelHinting = false; + } + if(scaleMode == null) { + scaleMode = 2; + } + if(miterLimit == null) { + miterLimit = 3.0; + } + this.get_graphics().lineStyle(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit); + break; + case 1: + var thickness = lineStyle.thickness; + var bitmapData = lineStyle.bitmapData; + var matrix = lineStyle.matrix; + var repeat = lineStyle.repeat; + var smooth = lineStyle.smooth; + if(repeat == null) { + repeat = true; + } + if(smooth == null) { + smooth = false; + } + this.get_graphics().lineStyle(thickness); + this.get_graphics().lineBitmapStyle(bitmapData,matrix,repeat,smooth); + break; + case 2: + var thickness = lineStyle.thickness; + var type = lineStyle.type; + var colors = lineStyle.colors; + var alphas = lineStyle.alphas; + var ratios = lineStyle.ratios; + var matrixCallback = lineStyle.matrix; + var spreadMethod = lineStyle.spreadMethod; + var interpolationMethod = lineStyle.interpolationMethod; + var focalPointRatio = lineStyle.focalPointRatio; + var callback = matrixCallback; + if(callback == null) { + callback = $bind(this,this.getDefaultGradientMatrix); + } + if(spreadMethod == null) { + spreadMethod = 0; + } + if(interpolationMethod == null) { + interpolationMethod = 1; + } + if(focalPointRatio == null) { + focalPointRatio = 0.0; + } + var matrix = callback(this.getDefaultGradientMatrixWidth(),this.getDefaultGradientMatrixHeight(),this.getDefaultGradientMatrixRadians(),this.getDefaultGradientMatrixTx(),this.getDefaultGradientMatrixTy()); + this.get_graphics().lineStyle(thickness); + this.get_graphics().lineGradientStyle(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio); + break; + case 3: + this.get_graphics().lineStyle(NaN,0,0.0); + break; + } + } + ,applyFillStyle: function(fillStyle) { + if(fillStyle == null) { + return; + } + switch(fillStyle._hx_index) { + case 0: + var color = fillStyle.color; + var alpha = fillStyle.alpha; + if(alpha == null) { + alpha = 1.0; + } + this.get_graphics().beginFill(color,alpha); + break; + case 1: + var bitmapData = fillStyle.bitmapData; + var matrix = fillStyle.matrix; + var repeat = fillStyle.repeat; + var smooth = fillStyle.smoothing; + if(repeat == null) { + repeat = true; + } + if(smooth == null) { + smooth = false; + } + this.get_graphics().beginBitmapFill(bitmapData,matrix,repeat,smooth); + break; + case 2: + var type = fillStyle.type; + var colors = fillStyle.colors; + var alphas = fillStyle.alphas; + var ratios = fillStyle.ratios; + var matrixCallback = fillStyle.matrix; + var spreadMethod = fillStyle.spreadMethod; + var interpolationMethod = fillStyle.interpolationMethod; + var focalPointRatio = fillStyle.focalPointRatio; + var callback = matrixCallback; + if(callback == null) { + callback = $bind(this,this.getDefaultGradientMatrix); + } + if(spreadMethod == null) { + spreadMethod = 0; + } + if(interpolationMethod == null) { + interpolationMethod = 1; + } + if(focalPointRatio == null) { + focalPointRatio = 0.0; + } + var matrix = callback(this.getDefaultGradientMatrixWidth(),this.getDefaultGradientMatrixHeight(),this.getDefaultGradientMatrixRadians(),this.getDefaultGradientMatrixTx(),this.getDefaultGradientMatrixTy()); + this.get_graphics().beginGradientFill(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio); + break; + case 3: + return; + } + } + ,getLineThickness: function(lineStyle) { + if(lineStyle == null) { + return 0; + } + switch(lineStyle._hx_index) { + case 0: + var _g = lineStyle.color; + var _g = lineStyle.alpha; + var _g = lineStyle.pixelHinting; + var _g = lineStyle.scaleMode; + var _g = lineStyle.caps; + var _g = lineStyle.joints; + var _g = lineStyle.miterLimit; + var thickness = lineStyle.thickness; + return thickness; + case 2: + var _g = lineStyle.matrix; + var _g = lineStyle.spreadMethod; + var _g = lineStyle.interpolationMethod; + var _g = lineStyle.focalPointRatio; + var thickness = lineStyle.thickness; + var colors = lineStyle.type; + var alphas = lineStyle.colors; + var ratios = lineStyle.alphas; + var matrixCallback = lineStyle.ratios; + return thickness; + default: + return 0; + } + } + ,getDefaultGradientMatrix: function(width,height,radians,tx,ty) { + if(ty == null) { + ty = 0.0; + } + if(tx == null) { + tx = 0.0; + } + if(radians == null) { + radians = 0.0; + } + var matrix = new openfl_geom_Matrix(); + matrix.createGradientBox(width,height,radians,tx,ty); + return matrix; + } + ,getDefaultGradientMatrixWidth: function() { + return this.actualWidth; + } + ,getDefaultGradientMatrixHeight: function() { + return this.actualHeight; + } + ,getDefaultGradientMatrixRadians: function() { + return 0.0; + } + ,getDefaultGradientMatrixTx: function() { + return 0.0; + } + ,getDefaultGradientMatrixTy: function() { + return 0.0; + } + ,getCurrentBorder: function() { + if(this._previousBorder != null) { + return this._previousBorder; + } + return this.getCurrentBorderWithoutCache(); + } + ,getCurrentBorderWithoutCache: function() { + var stateContext = this._stateContext; + if(stateContext == null && js_Boot.__implements(this._uiContext,feathers_core_IStateContext)) { + stateContext = this._uiContext; + } + if(this._stateToBorder != null && stateContext != null) { + var result = this._stateToBorder.get(stateContext.get_currentState()); + if(result != null) { + return result; + } + } + if(this._uiContext == null) { + return this._border; + } + if(this._disabledBorder != null) { + if(!this._uiContext.get_enabled()) { + return this._disabledBorder; + } + } + if(this._selectedBorder != null && js_Boot.__implements(this._uiContext,feathers_controls_IToggle)) { + var toggle = this._uiContext; + if(toggle.get_selected()) { + return this._selectedBorder; + } + } + return this._border; + } + ,getCurrentFill: function() { + if(this._previousFill != null) { + return this._previousFill; + } + return this.getCurrentFillWithoutCache(); + } + ,getCurrentFillWithoutCache: function() { + var stateContext = this._stateContext; + if(stateContext == null && js_Boot.__implements(this._uiContext,feathers_core_IStateContext)) { + stateContext = this._uiContext; + } + if(this._stateToFill != null && stateContext != null) { + var result = this._stateToFill.get(stateContext.get_currentState()); + if(result != null) { + return result; + } + } + if(this._uiContext == null) { + return this._fill; + } + if(this._disabledFill != null) { + if(!this._uiContext.get_enabled()) { + return this._disabledFill; + } + } + if(this._selectedFill != null && js_Boot.__implements(this._uiContext,feathers_controls_IToggle)) { + var toggle = this._uiContext; + if(toggle.get_selected()) { + return this._selectedFill; + } + } + return this._fill; + } + ,needsStateUpdate: function() { + var updated = false; + if(this._previousBorder != this.getCurrentBorderWithoutCache()) { + this._previousBorder = null; + updated = true; + } + if(this._previousFill != this.getCurrentFillWithoutCache()) { + this._previousFill = null; + updated = true; + } + return updated; + } + ,__class__: feathers_skins_BaseGraphicsPathSkin + ,__properties__: $extend(feathers_skins_ProgrammaticSkin.prototype.__properties__,{set_selectedBorder:"set_selectedBorder",get_selectedBorder:"get_selectedBorder",set_disabledBorder:"set_disabledBorder",get_disabledBorder:"get_disabledBorder",set_border:"set_border",get_border:"get_border",set_selectedFill:"set_selectedFill",get_selectedFill:"get_selectedFill",set_disabledFill:"set_disabledFill",get_disabledFill:"get_disabledFill",set_fill:"set_fill",get_fill:"get_fill"}) +}); +var feathers_skins_RectangleSkin = function(fill,border) { + this._cornerRadius = 0.0; + feathers_skins_BaseGraphicsPathSkin.call(this,fill,border); +}; +$hxClasses["feathers.skins.RectangleSkin"] = feathers_skins_RectangleSkin; +feathers_skins_RectangleSkin.__name__ = "feathers.skins.RectangleSkin"; +feathers_skins_RectangleSkin.__super__ = feathers_skins_BaseGraphicsPathSkin; +feathers_skins_RectangleSkin.prototype = $extend(feathers_skins_BaseGraphicsPathSkin.prototype,{ + get_cornerRadius: function() { + return this._cornerRadius; + } + ,set_cornerRadius: function(value) { + if(this._cornerRadius == value) { + return this._cornerRadius; + } + this._cornerRadius = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._cornerRadius; + } + ,drawPath: function() { + var currentBorder = this.getCurrentBorder(); + var thickness = this.getLineThickness(currentBorder); + var thicknessOffset = thickness / 2.0; + var drawWidth = Math.max(0.0,this.actualWidth - thickness); + var drawHeight = Math.max(0.0,this.actualHeight - thickness); + if(this._cornerRadius == 0.0) { + this.get_graphics().drawRect(thicknessOffset,thicknessOffset,drawWidth,drawHeight); + } else { + var ellipseSize = this._cornerRadius * 2.0; + ellipseSize = Math.min(ellipseSize,Math.min(this.actualWidth,this.actualHeight)); + this.get_graphics().drawRoundRect(thicknessOffset,thicknessOffset,drawWidth,drawHeight,ellipseSize); + } + } + ,__class__: feathers_skins_RectangleSkin + ,__properties__: $extend(feathers_skins_BaseGraphicsPathSkin.prototype.__properties__,{set_cornerRadius:"set_cornerRadius",get_cornerRadius:"get_cornerRadius"}) +}); +var feathers_skins_TriangleSkin = function(fill,border) { + this._drawBaseBorder = true; + this._pointPosition = feathers_layout_RelativePosition.TOP; + feathers_skins_BaseGraphicsPathSkin.call(this,fill,border); +}; +$hxClasses["feathers.skins.TriangleSkin"] = feathers_skins_TriangleSkin; +feathers_skins_TriangleSkin.__name__ = "feathers.skins.TriangleSkin"; +feathers_skins_TriangleSkin.__super__ = feathers_skins_BaseGraphicsPathSkin; +feathers_skins_TriangleSkin.prototype = $extend(feathers_skins_BaseGraphicsPathSkin.prototype,{ + get_pointPosition: function() { + return this._pointPosition; + } + ,set_pointPosition: function(value) { + if(this._pointPosition == value) { + return this._pointPosition; + } + this._pointPosition = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._pointPosition; + } + ,get_drawBaseBorder: function() { + return this._drawBaseBorder; + } + ,set_drawBaseBorder: function(value) { + if(this._drawBaseBorder == value) { + return this._drawBaseBorder; + } + this._drawBaseBorder = value; + this.setInvalid(feathers_core_InvalidationFlag.STYLES); + return this._drawBaseBorder; + } + ,drawPath: function() { + var currentBorder = this.getCurrentBorder(); + var thicknessOffset = this.getLineThickness(currentBorder) / 2.0; + var maxX = Math.max(0.0,this.actualWidth - thicknessOffset); + var maxY = Math.max(0.0,this.actualHeight - thicknessOffset); + switch(this._pointPosition._hx_index) { + case 0: + this.get_graphics().moveTo(this.actualWidth / 2.0,thicknessOffset); + if(this._drawBaseBorder) { + this.get_graphics().lineTo(maxX,maxY); + this.get_graphics().lineTo(thicknessOffset,maxY); + } else { + this.get_graphics().lineTo(maxX,this.actualHeight); + this.get_graphics().lineStyle(0.0,null,0.0,null,null,null,null,0.0); + this.get_graphics().lineTo(thicknessOffset,this.actualHeight); + this.applyLineStyle(currentBorder); + } + this.get_graphics().lineTo(this.actualWidth / 2.0,thicknessOffset); + break; + case 1: + if(this._drawBaseBorder) { + this.get_graphics().moveTo(thicknessOffset,thicknessOffset); + } else { + this.get_graphics().moveTo(0.0,thicknessOffset); + } + this.get_graphics().lineTo(maxX,this.actualHeight / 2.0); + if(this._drawBaseBorder) { + this.get_graphics().lineTo(thicknessOffset,maxY); + this.get_graphics().lineTo(thicknessOffset,thicknessOffset); + } else { + this.get_graphics().lineTo(0.0,maxY); + this.get_graphics().lineStyle(0.0,null,0.0,null,null,null,null,0.0); + this.get_graphics().lineTo(0.0,thicknessOffset); + this.applyLineStyle(currentBorder); + } + break; + case 2: + if(this._drawBaseBorder) { + this.get_graphics().moveTo(thicknessOffset,thicknessOffset); + this.get_graphics().lineTo(maxX,thicknessOffset); + } else { + this.get_graphics().lineStyle(0.0,null,0.0,null,null,null,null,0.0); + this.get_graphics().moveTo(thicknessOffset,0.0); + this.get_graphics().lineTo(maxX,0.0); + this.applyLineStyle(currentBorder); + } + this.get_graphics().lineTo(this.actualWidth / 2.0,maxY); + if(this._drawBaseBorder) { + this.get_graphics().lineTo(thicknessOffset,thicknessOffset); + } else { + this.get_graphics().lineTo(thicknessOffset,0.0); + } + break; + case 3: + if(this._drawBaseBorder) { + this.get_graphics().moveTo(maxX,thicknessOffset); + this.get_graphics().lineTo(maxX,maxY); + } else { + this.get_graphics().moveTo(this.actualWidth,thicknessOffset); + this.get_graphics().lineStyle(0.0,null,0.0,null,null,null,null,0.0); + this.get_graphics().lineTo(this.actualWidth,maxY); + this.applyLineStyle(currentBorder); + } + this.get_graphics().lineTo(thicknessOffset,this.actualHeight / 2.0); + if(this._drawBaseBorder) { + this.get_graphics().lineTo(maxX,thicknessOffset); + } else { + this.get_graphics().lineTo(this.actualWidth,thicknessOffset); + } + break; + default: + throw new openfl_errors_ArgumentError("Triangle pointPosition not supported: " + Std.string(this._pointPosition)); + } + } + ,__class__: feathers_skins_TriangleSkin + ,__properties__: $extend(feathers_skins_BaseGraphicsPathSkin.prototype.__properties__,{set_drawBaseBorder:"set_drawBaseBorder",get_drawBaseBorder:"get_drawBaseBorder",set_pointPosition:"set_pointPosition",get_pointPosition:"get_pointPosition"}) +}); +var feathers_style_IStyleProvider = function() { }; +$hxClasses["feathers.style.IStyleProvider"] = feathers_style_IStyleProvider; +feathers_style_IStyleProvider.__name__ = "feathers.style.IStyleProvider"; +feathers_style_IStyleProvider.__isInterface__ = true; +feathers_style_IStyleProvider.__interfaces__ = [openfl_events_IEventDispatcher]; +feathers_style_IStyleProvider.prototype = { + __class__: feathers_style_IStyleProvider +}; +var feathers_style_ClassVariantStyleProvider = function() { + openfl_events_EventDispatcher.call(this); +}; +$hxClasses["feathers.style.ClassVariantStyleProvider"] = feathers_style_ClassVariantStyleProvider; +feathers_style_ClassVariantStyleProvider.__name__ = "feathers.style.ClassVariantStyleProvider"; +feathers_style_ClassVariantStyleProvider.__interfaces__ = [feathers_style_IStyleProvider]; +feathers_style_ClassVariantStyleProvider.__super__ = openfl_events_EventDispatcher; +feathers_style_ClassVariantStyleProvider.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + setStyleFunction: function(type,variant,callback) { + var _gthis = this; + if(this.styleTargets == null) { + this.styleTargets = new haxe_ds_EnumValueMap(); + } + var typeName = type.__name__; + var styleTarget = variant == null ? feathers_style__$ClassVariantStyleProvider_StyleTarget.Class(typeName) : feathers_style__$ClassVariantStyleProvider_StyleTarget.ClassAndVariant(typeName,variant); + if(callback == null) { + if(!this.styleTargets.exists(styleTarget)) { + return; + } + this.styleTargets.remove(styleTarget); + } else { + var oldCallback = this.styleTargets.get(styleTarget); + if(callback == oldCallback || Reflect.compare(callback,oldCallback) == 0) { + return; + } + this.styleTargets.set(styleTarget,callback); + } + feathers_events_StyleProviderEvent.dispatch(this,"stylesChange",function(target) { + var styleContext = _gthis.getStyleContext(target); + var variant = _gthis.getVariant(target); + var otherCallback = _gthis.getStyleFunctionInternal(styleContext,variant,false); + if(callback != otherCallback) { + return Reflect.compare(callback,otherCallback) == 0; + } else { + return true; + } + }); + } + ,getStyleFunction: function(type,variant) { + return this.getStyleFunctionInternal(type,variant,true); + } + ,applyStyles: function(target) { + if(this.styleTargets == null) { + return; + } + var styleContext = this.getStyleContext(target); + var variant = this.getVariant(target); + var callback = this.getStyleFunctionInternal(styleContext,variant,false); + if(callback == null) { + return; + } + callback(target); + } + ,getStyleContext: function(target) { + var styleContext = null; + if(js_Boot.__implements(target,feathers_style_IVariantStyleObject)) { + var variantObject = target; + styleContext = variantObject.get_styleContext(); + } + if(styleContext == null) { + styleContext = js_Boot.getClass(target); + } + return styleContext; + } + ,getVariant: function(target) { + var variant = null; + if(js_Boot.__implements(target,feathers_style_IVariantStyleObject)) { + var variantObject = target; + variant = variantObject.get_variant(); + } + return variant; + } + ,getStyleFunctionInternal: function(type,variant,strict) { + if(this.styleTargets == null) { + return null; + } + var typeName = type.__name__; + var styleTarget = variant == null ? feathers_style__$ClassVariantStyleProvider_StyleTarget.Class(typeName) : feathers_style__$ClassVariantStyleProvider_StyleTarget.ClassAndVariant(typeName,variant); + var result = this.styleTargets.get(styleTarget); + if(result != null || strict) { + return result; + } + return this.styleTargets.get(feathers_style__$ClassVariantStyleProvider_StyleTarget.Class(typeName)); + } + ,__class__: feathers_style_ClassVariantStyleProvider +}); +var feathers_style__$ClassVariantStyleProvider_StyleTarget = $hxEnums["feathers.style._ClassVariantStyleProvider.StyleTarget"] = { __ename__:"feathers.style._ClassVariantStyleProvider.StyleTarget",__constructs__:null + ,Class: ($_=function(type) { return {_hx_index:0,type:type,__enum__:"feathers.style._ClassVariantStyleProvider.StyleTarget",toString:$estr}; },$_._hx_name="Class",$_.__params__ = ["type"],$_) + ,ClassAndVariant: ($_=function(type,variant) { return {_hx_index:1,type:type,variant:variant,__enum__:"feathers.style._ClassVariantStyleProvider.StyleTarget",toString:$estr}; },$_._hx_name="ClassAndVariant",$_.__params__ = ["type","variant"],$_) +}; +feathers_style__$ClassVariantStyleProvider_StyleTarget.__constructs__ = [feathers_style__$ClassVariantStyleProvider_StyleTarget.Class,feathers_style__$ClassVariantStyleProvider_StyleTarget.ClassAndVariant]; +var feathers_style_ITheme = function() { }; +$hxClasses["feathers.style.ITheme"] = feathers_style_ITheme; +feathers_style_ITheme.__name__ = "feathers.style.ITheme"; +feathers_style_ITheme.__isInterface__ = true; +feathers_style_ITheme.prototype = { + __class__: feathers_style_ITheme +}; +var feathers_style_IDarkModeTheme = function() { }; +$hxClasses["feathers.style.IDarkModeTheme"] = feathers_style_IDarkModeTheme; +feathers_style_IDarkModeTheme.__name__ = "feathers.style.IDarkModeTheme"; +feathers_style_IDarkModeTheme.__isInterface__ = true; +feathers_style_IDarkModeTheme.__interfaces__ = [feathers_style_ITheme]; +feathers_style_IDarkModeTheme.prototype = { + __class__: feathers_style_IDarkModeTheme + ,__properties__: {set_darkMode:"set_darkMode",get_darkMode:"get_darkMode"} +}; +var feathers_style_Theme = function() { }; +$hxClasses["feathers.style.Theme"] = feathers_style_Theme; +feathers_style_Theme.__name__ = "feathers.style.Theme"; +feathers_style_Theme.__properties__ = {get_fallbackTheme:"get_fallbackTheme"}; +feathers_style_Theme.get_fallbackTheme = function() { + if(feathers_style_Theme._fallbackTheme == null) { + feathers_style_Theme._fallbackTheme = new feathers_themes_steel_DefaultSteelTheme(); + } + return feathers_style_Theme._fallbackTheme; +}; +feathers_style_Theme.setTheme = function(theme,root,disposeOldTheme) { + if(disposeOldTheme == null) { + disposeOldTheme = true; + } + var oldTheme = null; + if(root == null) { + oldTheme = feathers_style_Theme.primaryTheme; + feathers_style_Theme.primaryTheme = theme; + } else if(feathers_style_Theme.roots == null) { + feathers_style_Theme.roots = [root]; + var _g = new haxe_ds_ObjectMap(); + _g.set(root,theme); + feathers_style_Theme.rootToTheme = _g; + } else { + oldTheme = feathers_style_Theme.rootToTheme.h[root.__id__]; + if(oldTheme == null) { + feathers_style_Theme.roots.push(root); + } + feathers_style_Theme.rootToTheme.set(root,theme); + } + if(oldTheme != null && disposeOldTheme) { + oldTheme.dispose(); + } +}; +feathers_style_Theme.getTheme = function(object) { + if(((object) instanceof openfl_display_DisplayObject)) { + var current = object; + while(current != null) { + if(js_Boot.__implements(current,feathers_style_IStyleObject)) { + var currentStylable = current; + if(!currentStylable.get_themeEnabled()) { + return null; + } + } + current = current.parent; + } + if(feathers_style_Theme.roots != null) { + var displayObject = object; + var _g = 0; + var _g1 = feathers_style_Theme.roots; + while(_g < _g1.length) { + var root = _g1[_g]; + ++_g; + if(root.contains(displayObject)) { + return feathers_style_Theme.rootToTheme.h[root.__id__]; + } + } + } + } else if(object != null && !object.get_themeEnabled()) { + return null; + } + if(feathers_style_Theme.primaryTheme != null) { + return feathers_style_Theme.primaryTheme; + } + return feathers_style_Theme.get_fallbackTheme(); +}; +var feathers_text_TextFormat = function(font,size,color,bold,italic,underline,url,target,align,leftMargin,rightMargin,indent,leading) { + openfl_events_EventDispatcher.call(this); + this._textFormat = new openfl_text_TextFormat(font,size,color,bold,italic,underline,url,target,align,leftMargin,rightMargin,indent,leading); +}; +$hxClasses["feathers.text.TextFormat"] = feathers_text_TextFormat; +feathers_text_TextFormat.__name__ = "feathers.text.TextFormat"; +feathers_text_TextFormat.__super__ = openfl_events_EventDispatcher; +feathers_text_TextFormat.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_font: function() { + return this._textFormat.font; + } + ,set_font: function(value) { + if(this._textFormat.font == value) { + return this._textFormat.font; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.set_font(value); + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.font; + } + ,get_size: function() { + return this._textFormat.size; + } + ,set_size: function(value) { + if(this._textFormat.size == value) { + return this._textFormat.size; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.set_size(value); + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.size; + } + ,get_color: function() { + return this._textFormat.color; + } + ,set_color: function(value) { + if(this._textFormat.color == value) { + return this._textFormat.color; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.color = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.color; + } + ,get_bold: function() { + return this._textFormat.bold; + } + ,set_bold: function(value) { + if(this._textFormat.bold == value) { + return this._textFormat.bold; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.set_bold(value); + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.bold; + } + ,get_italic: function() { + return this._textFormat.italic; + } + ,set_italic: function(value) { + if(this._textFormat.italic == value) { + return this._textFormat.italic; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.set_italic(value); + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.italic; + } + ,get_underline: function() { + return this._textFormat.underline; + } + ,set_underline: function(value) { + if(this._textFormat.underline == value) { + return this._textFormat.underline; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.underline = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.underline; + } + ,get_url: function() { + return this._textFormat.url; + } + ,set_url: function(value) { + if(this._textFormat.url == value) { + return this._textFormat.url; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.url = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.url; + } + ,get_target: function() { + return this._textFormat.target; + } + ,set_target: function(value) { + if(this._textFormat.target == value) { + return this._textFormat.target; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.target = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.target; + } + ,get_align: function() { + return this._textFormat.align; + } + ,set_align: function(value) { + if(this._textFormat.align == value) { + return this._textFormat.align; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.align = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.align; + } + ,get_leftMargin: function() { + return this._textFormat.leftMargin; + } + ,set_leftMargin: function(value) { + if(this._textFormat.leftMargin == value) { + return this._textFormat.leftMargin; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.leftMargin = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.leftMargin; + } + ,get_rightMargin: function() { + return this._textFormat.rightMargin; + } + ,set_rightMargin: function(value) { + if(this._textFormat.rightMargin == value) { + return this._textFormat.rightMargin; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.rightMargin = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.rightMargin; + } + ,get_indent: function() { + return this._textFormat.indent; + } + ,set_indent: function(value) { + if(this._textFormat.indent == value) { + return this._textFormat.indent; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.indent = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.indent; + } + ,get_leading: function() { + return this._textFormat.leading; + } + ,set_leading: function(value) { + if(this._textFormat.leading == value) { + return this._textFormat.leading; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.leading = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.leading; + } + ,get_blockIndent: function() { + return this._textFormat.blockIndent; + } + ,set_blockIndent: function(value) { + if(this._textFormat.blockIndent == value) { + return this._textFormat.blockIndent; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.blockIndent = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.blockIndent; + } + ,get_bullet: function() { + return this._textFormat.bullet; + } + ,set_bullet: function(value) { + if(this._textFormat.bullet == value) { + return this._textFormat.bullet; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.bullet = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.bullet; + } + ,get_kerning: function() { + return this._textFormat.kerning; + } + ,set_kerning: function(value) { + if(this._textFormat.kerning == value) { + return this._textFormat.kerning; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.kerning = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.kerning; + } + ,get_letterSpacing: function() { + return this._textFormat.letterSpacing; + } + ,set_letterSpacing: function(value) { + if(this._textFormat.letterSpacing == value) { + return this._textFormat.letterSpacing; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.letterSpacing = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.letterSpacing; + } + ,get_tabStops: function() { + return this._textFormat.tabStops; + } + ,set_tabStops: function(value) { + if(this._textFormat.tabStops == value) { + return this._textFormat.tabStops; + } + this._textFormat = feathers_utils_TextFormatUtil.clone(this._textFormat); + this._textFormat.tabStops = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._textFormat.tabStops; + } + ,clone: function() { + var clone = new feathers_text_TextFormat(this.get_font(),this.get_size(),this.get_color(),this.get_bold(),this.get_italic(),this.get_underline(),this.get_url(),this.get_target(),this.get_align(),this.get_leftMargin(),this.get_rightMargin(),this.get_indent(),this.get_leading()); + clone._textFormat.blockIndent = this.get_blockIndent(); + clone._textFormat.bullet = this.get_bullet(); + clone._textFormat.kerning = this.get_kerning(); + clone._textFormat.letterSpacing = this.get_letterSpacing(); + clone._textFormat.tabStops = this.get_tabStops(); + return clone; + } + ,toSimpleTextFormat: function() { + return this._textFormat; + } + ,__class__: feathers_text_TextFormat + ,__properties__: {set_tabStops:"set_tabStops",get_tabStops:"get_tabStops",set_letterSpacing:"set_letterSpacing",get_letterSpacing:"get_letterSpacing",set_kerning:"set_kerning",get_kerning:"get_kerning",set_bullet:"set_bullet",get_bullet:"get_bullet",set_blockIndent:"set_blockIndent",get_blockIndent:"get_blockIndent",set_leading:"set_leading",get_leading:"get_leading",set_indent:"set_indent",get_indent:"get_indent",set_rightMargin:"set_rightMargin",get_rightMargin:"get_rightMargin",set_leftMargin:"set_leftMargin",get_leftMargin:"get_leftMargin",set_align:"set_align",get_align:"get_align",set_target:"set_target",get_target:"get_target",set_url:"set_url",get_url:"get_url",set_underline:"set_underline",get_underline:"get_underline",set_italic:"set_italic",get_italic:"get_italic",set_bold:"set_bold",get_bold:"get_bold",set_color:"set_color",get_color:"get_color",set_size:"set_size",get_size:"get_size",set_font:"set_font",get_font:"get_font"} +}); +var feathers_text_AbstractTextFormat = {}; +feathers_text_AbstractTextFormat.fromSimpleTextFormat = function(textFormat) { + var clone = new feathers_text_TextFormat(textFormat.font,textFormat.size,textFormat.color,textFormat.bold,textFormat.italic,textFormat.underline,textFormat.url,textFormat.target,textFormat.align,textFormat.leftMargin,textFormat.rightMargin,textFormat.indent,textFormat.leading); + clone.set_blockIndent(textFormat.blockIndent); + clone.set_bullet(textFormat.bullet); + clone.set_kerning(textFormat.kerning); + clone.set_letterSpacing(textFormat.letterSpacing); + clone.set_tabStops(textFormat.tabStops); + return clone; +}; +feathers_text_AbstractTextFormat.toSimpleTextFormat = function(this1) { + return this1.toSimpleTextFormat(); +}; +var feathers_themes_ClassVariantTheme = function() { + this.styleProvider = new feathers_style_ClassVariantStyleProvider(); +}; +$hxClasses["feathers.themes.ClassVariantTheme"] = feathers_themes_ClassVariantTheme; +feathers_themes_ClassVariantTheme.__name__ = "feathers.themes.ClassVariantTheme"; +feathers_themes_ClassVariantTheme.__interfaces__ = [feathers_style_ITheme]; +feathers_themes_ClassVariantTheme.prototype = { + getStyleProvider: function(target) { + var styleContext = null; + var variant = null; + if(js_Boot.__implements(target,feathers_style_IVariantStyleObject)) { + var variantObject = target; + styleContext = variantObject.get_styleContext(); + variant = variantObject.get_variant(); + } + if(styleContext == null) { + styleContext = js_Boot.getClass(target); + } + var styleFunction = this.styleProvider.getStyleFunction(styleContext,variant); + if(styleFunction != null) { + return this.styleProvider; + } + if(variant == null) { + return null; + } + var fallbackTheme = feathers_style_Theme.get_fallbackTheme(); + if(fallbackTheme != null && fallbackTheme != this && ((fallbackTheme) instanceof feathers_themes_ClassVariantTheme)) { + var value = fallbackTheme.getStyleProvider(target); + var fallbackStyleProvider = ((value) instanceof feathers_style_ClassVariantStyleProvider) ? value : null; + if(fallbackStyleProvider != null) { + var styleFunction1 = fallbackStyleProvider.getStyleFunction(styleContext,variant); + if(styleFunction1 != null) { + return null; + } + } + } + styleFunction = this.styleProvider.getStyleFunction(styleContext,null); + if(styleFunction != null) { + return this.styleProvider; + } + return null; + } + ,dispose: function() { + feathers_events_FeathersEvent.dispatch(this.styleProvider,"clear"); + } + ,__class__: feathers_themes_ClassVariantTheme +}; +var feathers_themes_steel_BaseSteelTheme = function(themeColor,darkThemeColor) { + this._darkMode = false; + feathers_themes_ClassVariantTheme.call(this); + this.customThemeColor = themeColor; + this.customDarkThemeColor = darkThemeColor; + this.refreshColors(); + this.refreshFonts(); + this.refreshPaddings(); + this.styleProvider = new feathers_style_ClassVariantStyleProvider(); + var htmlWindow = js_Boot.__cast($global , Window); + this.mediaQueryList = htmlWindow.matchMedia("(hover: hover) and (pointer: fine)"); + this.mediaQueryList.addListener($bind(this,this.mediaQueryList_changeHandler)); +}; +$hxClasses["feathers.themes.steel.BaseSteelTheme"] = feathers_themes_steel_BaseSteelTheme; +feathers_themes_steel_BaseSteelTheme.__name__ = "feathers.themes.steel.BaseSteelTheme"; +feathers_themes_steel_BaseSteelTheme.__interfaces__ = [feathers_style_IDarkModeTheme]; +feathers_themes_steel_BaseSteelTheme.__super__ = feathers_themes_ClassVariantTheme; +feathers_themes_steel_BaseSteelTheme.prototype = $extend(feathers_themes_ClassVariantTheme.prototype,{ + get_darkMode: function() { + return this._darkMode; + } + ,set_darkMode: function(value) { + if(this._darkMode == value) { + return this._darkMode; + } + this._darkMode = value; + this.refreshColors(); + feathers_events_StyleProviderEvent.dispatch(this.styleProvider,"stylesChange"); + return this._darkMode; + } + ,dispose: function() { + if(this.mediaQueryList != null) { + this.mediaQueryList.removeListener($bind(this,this.mediaQueryList_changeHandler)); + this.mediaQueryList = null; + } + feathers_themes_ClassVariantTheme.prototype.dispose.call(this); + } + ,refreshColors: function() { + if(this._darkMode) { + if(this.customDarkThemeColor != null) { + this.themeColor = this.customDarkThemeColor; + } else if(this.customThemeColor != null) { + this.themeColor = this.customThemeColor; + } else { + this.themeColor = 5205919; + } + this.offsetThemeColor = this.darken(this.themeColor,986895); + this.rootFillColor = 3684408; + this.controlFillColor1 = 6250335; + this.controlFillColor2 = 5000268; + this.controlDisabledFillColor = 3158064; + this.scrollBarThumbFillColor = 7303023; + this.scrollBarThumbDisabledFillColor = 4144959; + this.insetFillColor = 1579032; + this.disabledInsetFillColor = 2631720; + this.insetBorderColor = 4737096; + this.disabledInsetBorderColor = 3684408; + this.selectedInsetBorderColor = this.themeColor; + this.activeFillBorderColor = this.darken(this.themeColor,3092271); + this.selectedBorderColor = this.lighten(this.themeColor,986895); + this.focusBorderColor = this.lighten(this.themeColor,986895); + this.containerFillColor = 3684408; + this.headerFillColor = 4144959; + this.overlayFillColor = 7303023; + this.subHeadingFillColor = 2894892; + this.dangerFillColor = 10440527; + this.offsetDangerFillColor = this.darken(this.dangerFillColor,986895); + this.dangerBorderColor = this.darken(this.dangerFillColor,3092271); + this.borderColor = 526344; + this.dividerColor = 2631720; + this.subHeadingDividerColor = 789516; + this.textColor = 15856113; + this.disabledTextColor = 9408399; + this.secondaryTextColor = 11513775; + this.dangerTextColor = 13385535; + } else { + if(this.customThemeColor != null) { + this.themeColor = this.customThemeColor; + } else { + this.themeColor = 10535152; + } + this.offsetThemeColor = this.darken(this.themeColor,986895); + this.rootFillColor = 16316664; + this.controlFillColor1 = 16777215; + this.controlFillColor2 = 15263976; + this.controlDisabledFillColor = 15724527; + this.scrollBarThumbFillColor = 9408399; + this.scrollBarThumbDisabledFillColor = 13619151; + this.insetFillColor = 16579836; + this.disabledInsetFillColor = 15856113; + this.insetBorderColor = 11316396; + this.disabledInsetBorderColor = 13421772; + this.selectedInsetBorderColor = this.darken(this.themeColor,3092271); + this.activeFillBorderColor = this.darken(this.themeColor,3092271); + this.selectedBorderColor = this.darken(this.themeColor,3092271); + this.focusBorderColor = this.darken(this.themeColor,3092271); + this.containerFillColor = 16316664; + this.headerFillColor = 15527148; + this.overlayFillColor = 9408399; + this.subHeadingFillColor = 14671839; + this.dangerFillColor = 15769760; + this.offsetDangerFillColor = this.darken(this.dangerFillColor,986895); + this.dangerBorderColor = this.darken(this.dangerFillColor,3092271); + this.borderColor = 11316396; + this.dividerColor = 14671839; + this.subHeadingDividerColor = 13619151; + this.textColor = 2039583; + this.disabledTextColor = 10461087; + this.secondaryTextColor = 7303023; + this.dangerTextColor = 13385535; + } + } + ,refreshFonts: function() { + this.fontName = "_sans"; + this.refreshFontSizes(); + } + ,refreshFontSizes: function() { + if(feathers_utils_DeviceUtil.isDesktop()) { + this.fontSize = 13; + this.headerFontSize = 14; + this.detailFontSize = 11; + } else { + this.fontSize = 14; + this.headerFontSize = 18; + this.detailFontSize = 12; + } + } + ,refreshPaddings: function() { + if(feathers_utils_DeviceUtil.isDesktop()) { + this.borderThickness = 1.0; + this.xsmallPadding = 1.0; + this.smallPadding = 2.0; + this.mediumPadding = 4.0; + this.largePadding = 8.0; + this.xlargePadding = 10.0; + } else { + this.borderThickness = 1.0; + this.xsmallPadding = 2.0; + this.smallPadding = 4.0; + this.mediumPadding = 6.0; + this.largePadding = 10.0; + this.xlargePadding = 14.0; + } + } + ,getThemeFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.themeColor); + } + ,getControlFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.controlFillColor2); + } + ,getControlDisabledFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.controlDisabledFillColor,0.7); + } + ,getButtonFill: function() { + return feathers_graphics_FillStyle.Gradient(0,[this.controlFillColor1,this.controlFillColor2],[1.0,1.0],[0,255],feathers_graphics_CreateGradientBoxMatrix.fromRadians(Math.PI / 2.0)); + } + ,getButtonDownFill: function() { + return feathers_graphics_FillStyle.Gradient(0,[this.controlFillColor2,this.controlFillColor1],[1.0,1.0],[0,255],feathers_graphics_CreateGradientBoxMatrix.fromRadians(Math.PI / 2.0)); + } + ,getButtonDisabledFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.controlDisabledFillColor); + } + ,getScrollBarThumbFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.scrollBarThumbFillColor); + } + ,getScrollBarThumbDisabledFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.scrollBarThumbDisabledFillColor,0.7); + } + ,getBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.borderColor); + } + ,getButtonBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.borderColor); + } + ,getButtonDisabledBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.disabledInsetBorderColor); + } + ,getInsetBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.insetBorderColor); + } + ,getDisabledInsetBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.disabledInsetBorderColor); + } + ,getSelectedInsetBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.selectedInsetBorderColor); + } + ,getThemeBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.themeColor); + } + ,getSelectedBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.selectedBorderColor); + } + ,getActiveFillBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.activeFillBorderColor); + } + ,getContainerBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.borderColor); + } + ,getDividerBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.dividerColor); + } + ,getDividerFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.dividerColor); + } + ,getSubHeadingDividerBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.subHeadingDividerColor); + } + ,getSubHeadingDividerFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.subHeadingDividerColor); + } + ,getFocusBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.focusBorderColor); + } + ,getInsetFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.insetFillColor); + } + ,getDisabledInsetFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.disabledInsetFillColor); + } + ,getActiveThemeFill: function() { + var colors = [this.themeColor,this.offsetThemeColor]; + return feathers_graphics_FillStyle.Gradient(0,colors,[1.0,1.0],[0,255],feathers_graphics_CreateGradientBoxMatrix.fromRadians(Math.PI / 2.0)); + } + ,getReversedActiveThemeFill: function() { + var colors = [this.offsetThemeColor,this.themeColor]; + return feathers_graphics_FillStyle.Gradient(0,colors,[1.0,1.0],[0,255],feathers_graphics_CreateGradientBoxMatrix.fromRadians(Math.PI / 2.0)); + } + ,getDangerFill: function() { + var colors = [this.dangerFillColor,this.offsetDangerFillColor]; + return feathers_graphics_FillStyle.Gradient(0,colors,[1.0,1.0],[0,255],feathers_graphics_CreateGradientBoxMatrix.fromRadians(Math.PI / 2.0)); + } + ,getReversedDangerFill: function() { + var colors = [this.offsetDangerFillColor,this.dangerFillColor]; + return feathers_graphics_FillStyle.Gradient(0,colors,[1.0,1.0],[0,255],feathers_graphics_CreateGradientBoxMatrix.fromRadians(Math.PI / 2.0)); + } + ,getDangerBorder: function(thickness) { + if(thickness == null) { + thickness = 1.0; + } + return feathers_graphics_LineStyle.SolidColor(thickness,this.dangerBorderColor); + } + ,getOverlayFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.overlayFillColor,0.8); + } + ,getRootFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.rootFillColor); + } + ,getContainerFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.containerFillColor); + } + ,getSubHeadingFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.subHeadingFillColor); + } + ,getTextFormat: function(align) { + if(align == null) { + align = 3; + } + return new feathers_text_TextFormat(this.fontName,this.fontSize,this.textColor,false,false,false,null,null,align); + } + ,getDisabledTextFormat: function(align) { + if(align == null) { + align = 3; + } + return new feathers_text_TextFormat(this.fontName,this.fontSize,this.disabledTextColor,false,false,false,null,null,align); + } + ,getSecondaryTextFormat: function(align) { + if(align == null) { + align = 3; + } + return new feathers_text_TextFormat(this.fontName,this.fontSize,this.secondaryTextColor,false,false,false,null,null,align); + } + ,getDangerTextFormat: function(align) { + if(align == null) { + align = 3; + } + return new feathers_text_TextFormat(this.fontName,this.fontSize,this.dangerTextColor,false,false,false,null,null,align); + } + ,getHeaderTextFormat: function(align) { + if(align == null) { + align = 3; + } + return new feathers_text_TextFormat(this.fontName,this.headerFontSize,this.textColor,false,false,false,null,null,align); + } + ,getDisabledHeaderTextFormat: function(align) { + if(align == null) { + align = 3; + } + return new feathers_text_TextFormat(this.fontName,this.headerFontSize,this.disabledTextColor,false,false,false,null,null,align); + } + ,getDetailTextFormat: function(align) { + if(align == null) { + align = 3; + } + return new feathers_text_TextFormat(this.fontName,this.detailFontSize,this.textColor,false,false,false,null,null,align); + } + ,getDisabledDetailTextFormat: function(align) { + if(align == null) { + align = 3; + } + return new feathers_text_TextFormat(this.fontName,this.detailFontSize,this.disabledTextColor,false,false,false,null,null,align); + } + ,getSecondaryDetailTextFormat: function(align) { + if(align == null) { + align = 3; + } + return new feathers_text_TextFormat(this.fontName,this.detailFontSize,this.secondaryTextColor,false,false,false,null,null,align); + } + ,getHeaderFill: function() { + return feathers_graphics_FillStyle.SolidColor(this.headerFillColor); + } + ,lighten: function(color,offset) { + var r1 = color >> 16 & 255; + var g1 = color >> 8 & 255; + var b1 = color & 255; + var r2 = offset >> 16 & 255; + var g2 = offset >> 8 & 255; + var b2 = offset & 255; + r1 += r2; + if(r1 > 255) { + r1 = 255; + } + g1 += g2; + if(g1 > 255) { + g1 = 255; + } + b1 += b2; + if(b1 > 255) { + b1 = 255; + } + return (r1 << 16) + (g1 << 8) + b1; + } + ,darken: function(color,offset) { + var r1 = color >> 16 & 255; + var g1 = color >> 8 & 255; + var b1 = color & 255; + var r2 = offset >> 16 & 255; + var g2 = offset >> 8 & 255; + var b2 = offset & 255; + r1 -= r2; + if(r1 < 0) { + r1 = 0; + } + g1 -= g2; + if(g1 < 0) { + g1 = 0; + } + b1 -= b2; + if(b1 < 0) { + b1 = 0; + } + return (r1 << 16) + (g1 << 8) + b1; + } + ,mediaQueryList_changeHandler: function(event) { + this.refreshFontSizes(); + this.refreshPaddings(); + feathers_events_StyleProviderEvent.dispatch(this.styleProvider,"stylesChange"); + } + ,__class__: feathers_themes_steel_BaseSteelTheme + ,__properties__: {set_darkMode:"set_darkMode",get_darkMode:"get_darkMode"} +}); +var feathers_themes_steel_DefaultSteelTheme = function(themeColor,darkThemeColor) { + feathers_themes_steel_BaseSteelTheme.call(this,themeColor,darkThemeColor); +}; +$hxClasses["feathers.themes.steel.DefaultSteelTheme"] = feathers_themes_steel_DefaultSteelTheme; +feathers_themes_steel_DefaultSteelTheme.__name__ = "feathers.themes.steel.DefaultSteelTheme"; +feathers_themes_steel_DefaultSteelTheme.__super__ = feathers_themes_steel_BaseSteelTheme; +feathers_themes_steel_DefaultSteelTheme.prototype = $extend(feathers_themes_steel_BaseSteelTheme.prototype,{ + __class__: feathers_themes_steel_DefaultSteelTheme +}); +var feathers_themes_steel_components_SteelApplicationStyles = function() { }; +$hxClasses["feathers.themes.steel.components.SteelApplicationStyles"] = feathers_themes_steel_components_SteelApplicationStyles; +feathers_themes_steel_components_SteelApplicationStyles.__name__ = "feathers.themes.steel.components.SteelApplicationStyles"; +feathers_themes_steel_components_SteelApplicationStyles.initialize = function(theme) { + if(theme == null) { + var value = feathers_style_Theme.get_fallbackTheme(); + theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null; + } + if(theme == null) { + return; + } + var styleProvider = theme.styleProvider; + if(styleProvider.getStyleFunction(feathers_controls_Application,null) == null) { + styleProvider.setStyleFunction(feathers_controls_Application,null,function(app) { + if(app.get_scaleManager() == null) { + app.set_scaleManager(new feathers_core_ScreenDensityScaleManager()); + } + }); + } +}; +feathers_themes_steel_components_SteelApplicationStyles.refreshStageColor = function(stage,theme) { + if(stage == null) { + return; + } + stage.set_color(theme.rootFillColor); +}; +var feathers_themes_steel_components_SteelButtonStyles = function() { }; +$hxClasses["feathers.themes.steel.components.SteelButtonStyles"] = feathers_themes_steel_components_SteelButtonStyles; +feathers_themes_steel_components_SteelButtonStyles.__name__ = "feathers.themes.steel.components.SteelButtonStyles"; +feathers_themes_steel_components_SteelButtonStyles.initialize = function(theme) { + if(theme == null) { + var value = feathers_style_Theme.get_fallbackTheme(); + theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null; + } + if(theme == null) { + return; + } + var styleProvider = theme.styleProvider; + if(styleProvider.getStyleFunction(feathers_controls_Button,null) == null) { + styleProvider.setStyleFunction(feathers_controls_Button,null,function(button) { + if(button.get_backgroundSkin() == null) { + var skin = new feathers_skins_RectangleSkin(); + skin.set_fill(theme.getButtonFill()); + skin.set_disabledFill(theme.getButtonDisabledFill()); + skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill()); + skin.set_border(theme.getButtonBorder()); + skin.set_disabledBorder(theme.getButtonDisabledBorder()); + skin.setBorderForState(feathers_controls_ButtonState.DOWN,theme.getActiveFillBorder()); + skin.set_cornerRadius(3.0); + button.set_backgroundSkin(skin); + } + if(button.get_focusRectSkin() == null) { + var focusRectSkin = new feathers_skins_RectangleSkin(); + focusRectSkin.set_fill(feathers_graphics_FillStyle.None); + focusRectSkin.set_border(theme.getFocusBorder()); + focusRectSkin.set_cornerRadius(3.0); + button.set_focusRectSkin(focusRectSkin); + } + if(button.get_textFormat() == null) { + button.set_textFormat(theme.getTextFormat()); + } + if(button.get_disabledTextFormat() == null) { + button.set_disabledTextFormat(theme.getDisabledTextFormat()); + } + button.set_paddingTop(theme.smallPadding); + button.set_paddingRight(theme.largePadding); + button.set_paddingBottom(theme.smallPadding); + button.set_paddingLeft(theme.largePadding); + button.set_gap(theme.smallPadding); + }); + } + if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_Button.VARIANT_PRIMARY) == null) { + styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_Button.VARIANT_PRIMARY,function(button) { + if(button.get_backgroundSkin() == null) { + var skin = new feathers_skins_RectangleSkin(); + skin.set_fill(theme.getActiveThemeFill()); + skin.set_disabledFill(theme.getButtonDisabledFill()); + skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill()); + skin.set_border(theme.getActiveFillBorder()); + skin.set_disabledBorder(theme.getButtonDisabledBorder()); + skin.set_cornerRadius(3.0); + button.set_backgroundSkin(skin); + } + if(button.get_focusRectSkin() == null) { + var focusRectSkin = new feathers_skins_RectangleSkin(); + focusRectSkin.set_fill(feathers_graphics_FillStyle.None); + focusRectSkin.set_border(theme.getFocusBorder()); + focusRectSkin.set_cornerRadius(3.0); + button.set_focusRectSkin(focusRectSkin); + } + if(button.get_textFormat() == null) { + button.set_textFormat(theme.getTextFormat()); + } + if(button.get_disabledTextFormat() == null) { + button.set_disabledTextFormat(theme.getDisabledTextFormat()); + } + button.set_paddingTop(theme.smallPadding); + button.set_paddingRight(theme.largePadding); + button.set_paddingBottom(theme.smallPadding); + button.set_paddingLeft(theme.largePadding); + button.set_gap(theme.smallPadding); + }); + } + if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_Button.VARIANT_DANGER) == null) { + styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_Button.VARIANT_DANGER,function(button) { + if(button.get_backgroundSkin() == null) { + var skin = new feathers_skins_RectangleSkin(); + skin.set_fill(theme.getDangerFill()); + skin.set_disabledFill(theme.getButtonDisabledFill()); + skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedDangerFill()); + skin.set_border(theme.getDangerBorder()); + skin.set_disabledBorder(theme.getButtonDisabledBorder()); + skin.set_cornerRadius(3.0); + button.set_backgroundSkin(skin); + } + if(button.get_focusRectSkin() == null) { + var focusRectSkin = new feathers_skins_RectangleSkin(); + focusRectSkin.set_fill(feathers_graphics_FillStyle.None); + focusRectSkin.set_border(theme.getFocusBorder()); + focusRectSkin.set_cornerRadius(3.0); + button.set_focusRectSkin(focusRectSkin); + } + if(button.get_textFormat() == null) { + button.set_textFormat(theme.getTextFormat()); + } + if(button.get_disabledTextFormat() == null) { + button.set_disabledTextFormat(theme.getDisabledTextFormat()); + } + button.set_paddingTop(theme.smallPadding); + button.set_paddingRight(theme.largePadding); + button.set_paddingBottom(theme.smallPadding); + button.set_paddingLeft(theme.largePadding); + button.set_gap(theme.smallPadding); + }); + } +}; +var feathers_themes_steel_components_SteelHScrollBarStyles = function() { }; +$hxClasses["feathers.themes.steel.components.SteelHScrollBarStyles"] = feathers_themes_steel_components_SteelHScrollBarStyles; +feathers_themes_steel_components_SteelHScrollBarStyles.__name__ = "feathers.themes.steel.components.SteelHScrollBarStyles"; +feathers_themes_steel_components_SteelHScrollBarStyles.initialize = function(theme) { + if(theme == null) { + var value = feathers_style_Theme.get_fallbackTheme(); + theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null; + } + if(theme == null) { + return; + } + var styleProvider = theme.styleProvider; + if(styleProvider.getStyleFunction(feathers_controls_HScrollBar,null) == null) { + styleProvider.setStyleFunction(feathers_controls_HScrollBar,null,function(scrollBar) { + var isDesktop = feathers_utils_DeviceUtil.isDesktop(); + if(scrollBar.get_thumbSkin() == null) { + var thumbSkin = new feathers_skins_RectangleSkin(); + thumbSkin.set_fill(theme.getScrollBarThumbFill()); + thumbSkin.set_disabledFill(theme.getScrollBarThumbDisabledFill()); + thumbSkin.set_border(feathers_graphics_LineStyle.None); + var size = isDesktop ? 6.0 : 4.0; + thumbSkin.set_width(size); + thumbSkin.set_height(size); + thumbSkin.set_minWidth(size); + thumbSkin.set_minHeight(size); + thumbSkin.set_cornerRadius(size / 2.0); + var thumb = new feathers_controls_BasicButton(); + thumb.set_keepDownStateOnRollOut(true); + thumb.set_backgroundSkin(thumbSkin); + scrollBar.set_thumbSkin(thumb); + } + if(isDesktop && scrollBar.get_trackSkin() == null) { + var trackSkin = new feathers_skins_RectangleSkin(); + trackSkin.set_fill(theme.getControlFill()); + trackSkin.set_disabledFill(theme.getControlDisabledFill()); + trackSkin.set_border(feathers_graphics_LineStyle.None); + trackSkin.set_width(12.0); + trackSkin.set_height(12.0); + trackSkin.set_minWidth(12.0); + trackSkin.set_minHeight(12.0); + scrollBar.set_trackSkin(trackSkin); + } + scrollBar.set_paddingTop(theme.xsmallPadding); + scrollBar.set_paddingRight(theme.xsmallPadding); + scrollBar.set_paddingBottom(theme.xsmallPadding); + scrollBar.set_paddingLeft(theme.xsmallPadding); + }); + } + if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_HScrollBar.CHILD_VARIANT_DECREMENT_BUTTON) == null) { + styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_HScrollBar.CHILD_VARIANT_DECREMENT_BUTTON,function(button) { + if(button.get_backgroundSkin() == null) { + var skin = new feathers_skins_RectangleSkin(); + skin.set_fill(theme.getControlFill()); + skin.set_disabledFill(theme.getControlDisabledFill()); + skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill()); + skin.set_border(feathers_graphics_LineStyle.None); + skin.set_width(12.0); + skin.set_height(12.0); + button.set_backgroundSkin(skin); + } + if(button.get_icon() == null) { + var icon = new feathers_skins_TriangleSkin(); + icon.set_pointPosition(feathers_layout_RelativePosition.LEFT); + icon.set_fill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbFillColor)); + icon.set_disabledFill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbDisabledFillColor)); + icon.set_width(4.0); + icon.set_height(8.0); + button.set_icon(icon); + } + button.set_showText(false); + button.set_paddingTop(theme.xsmallPadding); + button.set_paddingRight(theme.xsmallPadding); + button.set_paddingBottom(theme.xsmallPadding); + button.set_paddingLeft(theme.xsmallPadding); + button.set_gap(theme.xsmallPadding); + }); + } + if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_HScrollBar.CHILD_VARIANT_INCREMENT_BUTTON) == null) { + styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_HScrollBar.CHILD_VARIANT_INCREMENT_BUTTON,function(button) { + if(button.get_backgroundSkin() == null) { + var skin = new feathers_skins_RectangleSkin(); + skin.set_fill(theme.getControlFill()); + skin.set_disabledFill(theme.getControlDisabledFill()); + skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill()); + skin.set_border(feathers_graphics_LineStyle.None); + skin.set_width(12.0); + skin.set_height(12.0); + button.set_backgroundSkin(skin); + } + if(button.get_icon() == null) { + var icon = new feathers_skins_TriangleSkin(); + icon.set_pointPosition(feathers_layout_RelativePosition.RIGHT); + icon.set_fill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbFillColor)); + icon.set_disabledFill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbDisabledFillColor)); + icon.set_width(4.0); + icon.set_height(8.0); + button.set_icon(icon); + } + button.set_showText(false); + button.set_paddingTop(theme.xsmallPadding); + button.set_paddingRight(theme.xsmallPadding); + button.set_paddingBottom(theme.xsmallPadding); + button.set_paddingLeft(theme.xsmallPadding); + button.set_gap(theme.xsmallPadding); + }); + } +}; +var feathers_themes_steel_components_SteelLabelStyles = function() { }; +$hxClasses["feathers.themes.steel.components.SteelLabelStyles"] = feathers_themes_steel_components_SteelLabelStyles; +feathers_themes_steel_components_SteelLabelStyles.__name__ = "feathers.themes.steel.components.SteelLabelStyles"; +feathers_themes_steel_components_SteelLabelStyles.initialize = function(theme) { + if(theme == null) { + var value = feathers_style_Theme.get_fallbackTheme(); + theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null; + } + if(theme == null) { + return; + } + var styleProvider = theme.styleProvider; + if(styleProvider.getStyleFunction(feathers_controls_Label,null) == null) { + styleProvider.setStyleFunction(feathers_controls_Label,null,function(label) { + if(label.get_textFormat() == null) { + label.set_textFormat(theme.getTextFormat()); + } + if(label.get_disabledTextFormat() == null) { + label.set_disabledTextFormat(theme.getDisabledTextFormat()); + } + }); + } + if(styleProvider.getStyleFunction(feathers_controls_Label,feathers_controls_Label.VARIANT_HEADING) == null) { + styleProvider.setStyleFunction(feathers_controls_Label,feathers_controls_Label.VARIANT_HEADING,function(label) { + if(label.get_textFormat() == null) { + label.set_textFormat(theme.getHeaderTextFormat()); + } + if(label.get_disabledTextFormat() == null) { + label.set_disabledTextFormat(theme.getDisabledHeaderTextFormat()); + } + }); + } + if(styleProvider.getStyleFunction(feathers_controls_Label,feathers_controls_Label.VARIANT_DETAIL) == null) { + styleProvider.setStyleFunction(feathers_controls_Label,feathers_controls_Label.VARIANT_DETAIL,function(label) { + if(label.get_textFormat() == null) { + label.set_textFormat(theme.getDetailTextFormat()); + } + if(label.get_disabledTextFormat() == null) { + label.set_disabledTextFormat(theme.getDisabledDetailTextFormat()); + } + }); + } + if(styleProvider.getStyleFunction(feathers_controls_Label,feathers_controls_Label.VARIANT_DANGER) == null) { + styleProvider.setStyleFunction(feathers_controls_Label,feathers_controls_Label.VARIANT_DANGER,function(label) { + if(label.get_textFormat() == null) { + label.set_textFormat(theme.getDangerTextFormat()); + } + if(label.get_disabledTextFormat() == null) { + label.set_disabledTextFormat(theme.getDisabledTextFormat()); + } + }); + } +}; +var feathers_themes_steel_components_SteelLayoutGroupStyles = function() { }; +$hxClasses["feathers.themes.steel.components.SteelLayoutGroupStyles"] = feathers_themes_steel_components_SteelLayoutGroupStyles; +feathers_themes_steel_components_SteelLayoutGroupStyles.__name__ = "feathers.themes.steel.components.SteelLayoutGroupStyles"; +feathers_themes_steel_components_SteelLayoutGroupStyles.initialize = function(theme) { + if(theme == null) { + var value = feathers_style_Theme.get_fallbackTheme(); + theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null; + } + if(theme == null) { + return; + } + var styleProvider = theme.styleProvider; + if(styleProvider.getStyleFunction(feathers_controls_LayoutGroup,feathers_controls_LayoutGroup.VARIANT_TOOL_BAR) == null) { + styleProvider.setStyleFunction(feathers_controls_LayoutGroup,feathers_controls_LayoutGroup.VARIANT_TOOL_BAR,function(group) { + var isDesktop = feathers_utils_DeviceUtil.isDesktop(); + if(group.get_backgroundSkin() == null) { + var backgroundSkin = new feathers_skins_RectangleSkin(); + backgroundSkin.set_fill(theme.getHeaderFill()); + backgroundSkin.set_border(feathers_graphics_LineStyle.None); + if(isDesktop) { + backgroundSkin.set_width(32.0); + backgroundSkin.set_height(32.0); + backgroundSkin.set_minHeight(32.0); + } else { + backgroundSkin.set_width(44.0); + backgroundSkin.set_height(44.0); + backgroundSkin.set_minHeight(44.0); + } + group.set_backgroundSkin(backgroundSkin); + } + if(group.get_layout() == null) { + var layout = new feathers_layout_HorizontalLayout(); + layout.set_horizontalAlign(feathers_layout_HorizontalAlign.LEFT); + layout.set_verticalAlign(feathers_layout_VerticalAlign.MIDDLE); + layout.set_paddingTop(theme.smallPadding); + layout.set_paddingRight(theme.largePadding); + layout.set_paddingBottom(theme.smallPadding); + layout.set_paddingLeft(theme.largePadding); + layout.set_gap(theme.smallPadding); + group.set_layout(layout); + } + }); + } +}; +var feathers_themes_steel_components_SteelPanelStyles = function() { }; +$hxClasses["feathers.themes.steel.components.SteelPanelStyles"] = feathers_themes_steel_components_SteelPanelStyles; +feathers_themes_steel_components_SteelPanelStyles.__name__ = "feathers.themes.steel.components.SteelPanelStyles"; +feathers_themes_steel_components_SteelPanelStyles.initialize = function(theme) { + if(theme == null) { + var value = feathers_style_Theme.get_fallbackTheme(); + theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null; + } + if(theme == null) { + return; + } + var styleProvider = theme.styleProvider; + if(styleProvider.getStyleFunction(feathers_controls_Panel,null) == null) { + styleProvider.setStyleFunction(feathers_controls_Panel,null,function(panel) { + var isDesktop = feathers_utils_DeviceUtil.isDesktop(); + panel.set_autoHideScrollBars(!isDesktop); + panel.set_fixedScrollBars(isDesktop); + if(panel.get_backgroundSkin() == null) { + var backgroundSkin = new feathers_skins_RectangleSkin(); + backgroundSkin.set_fill(theme.getContainerFill()); + backgroundSkin.set_border(feathers_graphics_LineStyle.None); + panel.set_backgroundSkin(backgroundSkin); + } + if(panel.get_scrollBarsCornerSkin() == null) { + var scrollBarsCornerSkin = new feathers_skins_RectangleSkin(); + scrollBarsCornerSkin.set_fill(theme.getContainerFill()); + scrollBarsCornerSkin.set_border(feathers_graphics_LineStyle.None); + panel.set_scrollBarsCornerSkin(scrollBarsCornerSkin); + } + }); + } +}; +var feathers_themes_steel_components_SteelScrollContainerStyles = function() { }; +$hxClasses["feathers.themes.steel.components.SteelScrollContainerStyles"] = feathers_themes_steel_components_SteelScrollContainerStyles; +feathers_themes_steel_components_SteelScrollContainerStyles.__name__ = "feathers.themes.steel.components.SteelScrollContainerStyles"; +feathers_themes_steel_components_SteelScrollContainerStyles.initialize = function(theme) { + if(theme == null) { + var value = feathers_style_Theme.get_fallbackTheme(); + theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null; + } + if(theme == null) { + return; + } + var styleProvider = theme.styleProvider; + if(styleProvider.getStyleFunction(feathers_controls_ScrollContainer,null) == null) { + styleProvider.setStyleFunction(feathers_controls_ScrollContainer,null,function(container) { + var isDesktop = feathers_utils_DeviceUtil.isDesktop(); + container.set_autoHideScrollBars(!isDesktop); + container.set_fixedScrollBars(isDesktop); + if(container.get_backgroundSkin() == null) { + var backgroundSkin = new feathers_skins_RectangleSkin(); + backgroundSkin.set_fill(theme.getContainerFill()); + backgroundSkin.set_border(feathers_graphics_LineStyle.None); + container.set_backgroundSkin(backgroundSkin); + } + if(container.get_scrollBarsCornerSkin() == null) { + var scrollBarsCornerSkin = new feathers_skins_RectangleSkin(); + scrollBarsCornerSkin.set_fill(theme.getContainerFill()); + scrollBarsCornerSkin.set_border(feathers_graphics_LineStyle.None); + container.set_scrollBarsCornerSkin(scrollBarsCornerSkin); + } + if(container.get_focusRectSkin() == null) { + var focusRectSkin = new feathers_skins_RectangleSkin(); + focusRectSkin.set_fill(feathers_graphics_FillStyle.None); + focusRectSkin.set_border(theme.getFocusBorder()); + container.set_focusRectSkin(focusRectSkin); + } + }); + } +}; +var feathers_themes_steel_components_SteelStackNavigatorStyles = function() { }; +$hxClasses["feathers.themes.steel.components.SteelStackNavigatorStyles"] = feathers_themes_steel_components_SteelStackNavigatorStyles; +feathers_themes_steel_components_SteelStackNavigatorStyles.__name__ = "feathers.themes.steel.components.SteelStackNavigatorStyles"; +feathers_themes_steel_components_SteelStackNavigatorStyles.initialize = function(theme) { + if(theme == null) { + var value = feathers_style_Theme.get_fallbackTheme(); + theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null; + } + if(theme == null) { + return; + } + var styleProvider = theme.styleProvider; + if(styleProvider.getStyleFunction(feathers_controls_navigators_StackNavigator,null) == null) { + styleProvider.setStyleFunction(feathers_controls_navigators_StackNavigator,null,function(navigator) { + navigator.set_popTransition(new feathers_motion_transitions_SlideTransitionBuilder().setRight().build()); + navigator.set_pushTransition(new feathers_motion_transitions_SlideTransitionBuilder().setLeft().build()); + }); + } +}; +var feathers_themes_steel_components_SteelToolTipStyles = function() { }; +$hxClasses["feathers.themes.steel.components.SteelToolTipStyles"] = feathers_themes_steel_components_SteelToolTipStyles; +feathers_themes_steel_components_SteelToolTipStyles.__name__ = "feathers.themes.steel.components.SteelToolTipStyles"; +feathers_themes_steel_components_SteelToolTipStyles.initialize = function(theme) { + if(theme == null) { + var value = feathers_style_Theme.get_fallbackTheme(); + theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null; + } + if(theme == null) { + return; + } + var styleProvider = theme.styleProvider; + if(styleProvider.getStyleFunction(feathers_controls_Label,feathers_core_DefaultToolTipManager.CHILD_VARIANT_TOOL_TIP) == null) { + styleProvider.setStyleFunction(feathers_controls_Label,feathers_core_DefaultToolTipManager.CHILD_VARIANT_TOOL_TIP,function(label) { + if(label.get_backgroundSkin() == null) { + var backgroundSkin = new feathers_skins_RectangleSkin(); + backgroundSkin.set_border(theme.getBorder()); + backgroundSkin.set_fill(theme.getContainerFill()); + backgroundSkin.set_cornerRadius(2.0); + backgroundSkin.set_maxWidth(276.0); + label.set_backgroundSkin(backgroundSkin); + } + if(label.get_textFormat() == null) { + label.set_textFormat(theme.getTextFormat()); + } + if(label.get_disabledTextFormat() == null) { + label.set_disabledTextFormat(theme.getDisabledDetailTextFormat()); + } + label.set_wordWrap(true); + label.set_paddingTop(theme.xsmallPadding); + label.set_paddingRight(theme.xsmallPadding); + label.set_paddingBottom(theme.xsmallPadding); + label.set_paddingLeft(theme.xsmallPadding); + }); + } +}; +var feathers_themes_steel_components_SteelVScrollBarStyles = function() { }; +$hxClasses["feathers.themes.steel.components.SteelVScrollBarStyles"] = feathers_themes_steel_components_SteelVScrollBarStyles; +feathers_themes_steel_components_SteelVScrollBarStyles.__name__ = "feathers.themes.steel.components.SteelVScrollBarStyles"; +feathers_themes_steel_components_SteelVScrollBarStyles.initialize = function(theme) { + if(theme == null) { + var value = feathers_style_Theme.get_fallbackTheme(); + theme = ((value) instanceof feathers_themes_steel_BaseSteelTheme) ? value : null; + } + if(theme == null) { + return; + } + var styleProvider = theme.styleProvider; + if(styleProvider.getStyleFunction(feathers_controls_VScrollBar,null) == null) { + styleProvider.setStyleFunction(feathers_controls_VScrollBar,null,function(scrollBar) { + var isDesktop = feathers_utils_DeviceUtil.isDesktop(); + if(scrollBar.get_thumbSkin() == null) { + var thumbSkin = new feathers_skins_RectangleSkin(); + thumbSkin.set_fill(theme.getScrollBarThumbFill()); + thumbSkin.set_disabledFill(theme.getScrollBarThumbDisabledFill()); + thumbSkin.set_border(feathers_graphics_LineStyle.None); + var size = isDesktop ? 6.0 : 4.0; + thumbSkin.set_width(size); + thumbSkin.set_height(size); + thumbSkin.set_minWidth(size); + thumbSkin.set_minHeight(size); + thumbSkin.set_cornerRadius(size / 2.0); + var thumb = new feathers_controls_BasicButton(); + thumb.set_keepDownStateOnRollOut(true); + thumb.set_backgroundSkin(thumbSkin); + scrollBar.set_thumbSkin(thumb); + } + if(isDesktop && scrollBar.get_trackSkin() == null) { + var trackSkin = new feathers_skins_RectangleSkin(); + trackSkin.set_fill(theme.getControlFill()); + trackSkin.set_disabledFill(theme.getControlDisabledFill()); + trackSkin.set_border(feathers_graphics_LineStyle.None); + trackSkin.set_width(12.0); + trackSkin.set_height(12.0); + trackSkin.set_minWidth(12.0); + trackSkin.set_minHeight(12.0); + scrollBar.set_trackSkin(trackSkin); + } + scrollBar.set_paddingTop(theme.xsmallPadding); + scrollBar.set_paddingRight(theme.xsmallPadding); + scrollBar.set_paddingBottom(theme.xsmallPadding); + scrollBar.set_paddingLeft(theme.xsmallPadding); + }); + } + if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_VScrollBar.CHILD_VARIANT_DECREMENT_BUTTON) == null) { + styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_VScrollBar.CHILD_VARIANT_DECREMENT_BUTTON,function(button) { + if(button.get_backgroundSkin() == null) { + var skin = new feathers_skins_RectangleSkin(); + skin.set_fill(theme.getControlFill()); + skin.set_disabledFill(theme.getControlDisabledFill()); + skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill()); + skin.set_border(feathers_graphics_LineStyle.None); + skin.set_width(12.0); + skin.set_height(12.0); + button.set_backgroundSkin(skin); + } + if(button.get_icon() == null) { + var icon = new feathers_skins_TriangleSkin(); + icon.set_pointPosition(feathers_layout_RelativePosition.TOP); + icon.set_fill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbFillColor)); + icon.set_disabledFill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbDisabledFillColor)); + icon.set_width(8.0); + icon.set_height(4.0); + button.set_icon(icon); + } + button.set_showText(false); + button.set_paddingTop(theme.xsmallPadding); + button.set_paddingRight(theme.xsmallPadding); + button.set_paddingBottom(theme.xsmallPadding); + button.set_paddingLeft(theme.xsmallPadding); + button.set_gap(theme.xsmallPadding); + }); + } + if(styleProvider.getStyleFunction(feathers_controls_Button,feathers_controls_VScrollBar.CHILD_VARIANT_INCREMENT_BUTTON) == null) { + styleProvider.setStyleFunction(feathers_controls_Button,feathers_controls_VScrollBar.CHILD_VARIANT_INCREMENT_BUTTON,function(button) { + if(button.get_backgroundSkin() == null) { + var skin = new feathers_skins_RectangleSkin(); + skin.set_fill(theme.getControlFill()); + skin.set_disabledFill(theme.getControlDisabledFill()); + skin.setFillForState(feathers_controls_ButtonState.DOWN,theme.getReversedActiveThemeFill()); + skin.set_border(feathers_graphics_LineStyle.None); + skin.set_width(12.0); + skin.set_height(12.0); + button.set_backgroundSkin(skin); + } + if(button.get_icon() == null) { + var icon = new feathers_skins_TriangleSkin(); + icon.set_pointPosition(feathers_layout_RelativePosition.BOTTOM); + icon.set_fill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbFillColor)); + icon.set_disabledFill(feathers_graphics_FillStyle.SolidColor(theme.scrollBarThumbDisabledFillColor)); + icon.set_width(8.0); + icon.set_height(4.0); + button.set_icon(icon); + } + button.set_showText(false); + button.set_paddingTop(theme.xsmallPadding); + button.set_paddingRight(theme.xsmallPadding); + button.set_paddingBottom(theme.xsmallPadding); + button.set_paddingLeft(theme.xsmallPadding); + button.set_gap(theme.xsmallPadding); + }); + } +}; +var feathers_utils_AbstractDisplayObjectFactory = {}; +feathers_utils_AbstractDisplayObjectFactory.fromFunction = function(func) { + return feathers_utils_DisplayObjectFactory.withFunction(func); +}; +feathers_utils_AbstractDisplayObjectFactory.fromClass = function(type) { + return feathers_utils_DisplayObjectFactory.withClass(type); +}; +feathers_utils_AbstractDisplayObjectFactory.fromDisplayObject = function(displayObject) { + return feathers_utils_DisplayObjectFactory.withDisplayObject(displayObject); +}; +var feathers_utils_DPadFocusUtil = function() { }; +$hxClasses["feathers.utils.DPadFocusUtil"] = feathers_utils_DPadFocusUtil; +feathers_utils_DPadFocusUtil.__name__ = "feathers.utils.DPadFocusUtil"; +feathers_utils_DPadFocusUtil.isBetterFocusForRelativePosition = function(object1,object2,focusedRect,relativePosition) { + var rect = object1.getBounds(object1.stage); + var minPrimaryDistance1 = feathers_utils_DPadFocusUtil.calculateMinPrimaryAxisDistanceForRelativePosition(focusedRect,rect,relativePosition); + if(minPrimaryDistance1 == Infinity) { + return false; + } + var maxPrimaryDistance1 = feathers_utils_DPadFocusUtil.calculateMaxPrimaryAxisDistanceForRelativePosition(focusedRect,rect,relativePosition); + var secondaryDistance1 = feathers_utils_DPadFocusUtil.calculateSecondaryAxisDistanceForRelativePosition(focusedRect,rect,relativePosition); + var onSameAxis1 = feathers_utils_DPadFocusUtil.itemsAreOnSameAxis(focusedRect,rect,relativePosition); + var minPrimaryDistance2 = Infinity; + var maxPrimaryDistance2 = Infinity; + var secondaryDistance2 = Infinity; + var onSameAxis2 = false; + if(object2 != null) { + rect = object2.getBounds(object2.stage); + minPrimaryDistance2 = feathers_utils_DPadFocusUtil.calculateMinPrimaryAxisDistanceForRelativePosition(focusedRect,rect,relativePosition); + maxPrimaryDistance2 = feathers_utils_DPadFocusUtil.calculateMaxPrimaryAxisDistanceForRelativePosition(focusedRect,rect,relativePosition); + secondaryDistance2 = feathers_utils_DPadFocusUtil.calculateSecondaryAxisDistanceForRelativePosition(focusedRect,rect,relativePosition); + onSameAxis2 = feathers_utils_DPadFocusUtil.itemsAreOnSameAxis(focusedRect,rect,relativePosition); + } + if(onSameAxis1 && onSameAxis2) { + if(minPrimaryDistance1 > 0.0) { + return minPrimaryDistance1 < minPrimaryDistance2; + } else { + return false; + } + } + var isVertical = relativePosition == feathers_layout_RelativePosition.TOP || relativePosition == feathers_layout_RelativePosition.BOTTOM; + if(onSameAxis1) { + if(isVertical) { + if(minPrimaryDistance1 > 0.0 && minPrimaryDistance1 < maxPrimaryDistance2) { + return true; + } + } else { + return true; + } + } else if(onSameAxis2) { + if(isVertical) { + if(minPrimaryDistance2 > 0.0 && minPrimaryDistance2 < maxPrimaryDistance1) { + return false; + } + } else { + return false; + } + } + var weightedDistance1 = 13.0 * minPrimaryDistance1 * minPrimaryDistance1 + secondaryDistance1 * secondaryDistance1; + var weightedDistance2 = 13.0 * minPrimaryDistance2 * minPrimaryDistance2 + secondaryDistance2 * secondaryDistance2; + return weightedDistance1 < weightedDistance2; +}; +feathers_utils_DPadFocusUtil.calculateSecondaryAxisDistanceForRelativePosition = function(globalRect1,globalRect2,position) { + if(position == feathers_layout_RelativePosition.TOP || position == feathers_layout_RelativePosition.BOTTOM) { + return Math.abs(globalRect1.x + globalRect1.width / 2.0 - (globalRect2.x + globalRect2.width / 2.0)); + } + return Math.abs(globalRect1.y + globalRect1.height / 2.0 - (globalRect2.y + globalRect2.height / 2.0)); +}; +feathers_utils_DPadFocusUtil.calculateMaxPrimaryAxisDistanceForRelativePosition = function(globalRect1,globalRect2,position) { + switch(position._hx_index) { + case 0: + if(globalRect1.get_bottom() > globalRect2.get_bottom() || globalRect1.y >= globalRect2.get_bottom()) { + var result = globalRect1.get_bottom() - globalRect2.y; + if(result > 0.0) { + return result; + } + } + break; + case 1: + if(globalRect1.x < globalRect2.x || globalRect1.get_right() <= globalRect2.x) { + var result = globalRect2.get_right() - globalRect1.x; + if(result > 0.0) { + return result; + } + } + break; + case 2: + if(globalRect1.y < globalRect2.y || globalRect1.get_bottom() <= globalRect2.y) { + var result = globalRect2.get_bottom() - globalRect1.y; + if(result > 0.0) { + return result; + } + } + break; + case 3: + if(globalRect1.get_right() > globalRect2.get_right() || globalRect1.x >= globalRect2.get_right()) { + var result = globalRect1.get_right() - globalRect2.x; + if(result > 0.0) { + return result; + } + } + break; + default: + } + return Infinity; +}; +feathers_utils_DPadFocusUtil.calculateMinPrimaryAxisDistanceForRelativePosition = function(globalRect1,globalRect2,position) { + switch(position._hx_index) { + case 0: + if(globalRect1.get_bottom() > globalRect2.get_bottom() || globalRect1.y >= globalRect2.get_bottom()) { + var result = globalRect1.get_bottom() - globalRect2.get_bottom(); + if(result > 0.0) { + return result; + } + } + break; + case 1: + if(globalRect1.x < globalRect2.x || globalRect1.get_right() <= globalRect2.x) { + var result = globalRect2.x - globalRect1.x; + if(result > 0.0) { + return result; + } + } + break; + case 2: + if(globalRect1.y < globalRect2.y || globalRect1.get_bottom() <= globalRect2.y) { + var result = globalRect2.y - globalRect1.y; + if(result > 0.0) { + return result; + } + } + break; + case 3: + if(globalRect1.get_right() > globalRect2.get_right() || globalRect1.x >= globalRect2.get_right()) { + var result = globalRect1.get_right() - globalRect2.get_right(); + if(result > 0.0) { + return result; + } + } + break; + default: + } + return Infinity; +}; +feathers_utils_DPadFocusUtil.itemsAreOnSameAxis = function(globalRect1,globalRect2,position) { + if(position == feathers_layout_RelativePosition.TOP || position == feathers_layout_RelativePosition.BOTTOM) { + if(globalRect1.x <= globalRect2.get_right()) { + return globalRect2.x <= globalRect1.get_right(); + } else { + return false; + } + } + if(globalRect1.y <= globalRect2.get_bottom()) { + return globalRect2.y <= globalRect1.get_bottom(); + } else { + return false; + } +}; +var feathers_utils_DeviceUtil = function() { }; +$hxClasses["feathers.utils.DeviceUtil"] = feathers_utils_DeviceUtil; +feathers_utils_DeviceUtil.__name__ = "feathers.utils.DeviceUtil"; +feathers_utils_DeviceUtil.isDesktop = function() { + var htmlWindow = js_Boot.__cast($global , Window); + return htmlWindow.matchMedia(feathers_utils_DeviceUtil.MEDIA_QUERY_DESKTOP).matches; +}; +feathers_utils_DeviceUtil.isMobile = function() { + var htmlWindow = js_Boot.__cast($global , Window); + return htmlWindow.matchMedia(feathers_utils_DeviceUtil.MEDIA_QUERY_MOBILE).matches; +}; +var feathers_utils_DisplayUtil = function() { }; +$hxClasses["feathers.utils.DisplayUtil"] = feathers_utils_DisplayUtil; +feathers_utils_DisplayUtil.__name__ = "feathers.utils.DisplayUtil"; +feathers_utils_DisplayUtil.getDisplayObjectDepthFromStage = function(target) { + if(target.stage == null) { + return -1; + } + var count = 0; + while(target.parent != null) { + target = target.parent; + ++count; + } + return count; +}; +feathers_utils_DisplayUtil.getConcatenatedScaleX = function(target) { + if(target == null) { + throw new openfl_errors_ArgumentError("getConcatenatedScaleX target must not be null"); + } + var result = 1.0; + var current = target; + do { + result /= current.get_scaleX(); + current = current.parent; + } while(current != null && current != current.stage); + return result; +}; +feathers_utils_DisplayUtil.getConcatenatedScaleY = function(target) { + if(target == null) { + throw new openfl_errors_ArgumentError("getConcatenatedScaleY target must not be null"); + } + var result = 1.0; + var current = target; + do { + result /= current.get_scaleY(); + current = current.parent; + } while(current != null && current != current.stage); + return result; +}; +feathers_utils_DisplayUtil.getConcatenatedScale = function(target,result) { + if(target == null) { + throw new openfl_errors_ArgumentError("getConcatenatedScale target must not be null"); + } + var resultX = 1.0; + var resultY = 1.0; + var current = target; + do { + resultX /= current.get_scaleX(); + resultY /= current.get_scaleY(); + current = current.parent; + } while(current != null && current != current.stage); + if(result == null) { + return new openfl_geom_Point(resultX,resultY); + } + result.setTo(resultX,resultY); + return result; +}; +var feathers_utils_EdgePuller = function(target,pullableEdge,maxPullDistance) { + if(pullableEdge == null) { + pullableEdge = feathers_layout_RelativePosition.LEFT; + } + this._animatePull = null; + this._savedTouchMoves = []; + this._targetPullDistance = 0.0; + this._startPullDistance = 0.0; + this._startTouch = 0.0; + this._restoreMouseChildren = false; + this._touchPointIsSimulated = false; + this._touchPointID = null; + this._snapDuration = 0.5; + this._opened = false; + this._pendingOpened = null; + this._pullableEdge = feathers_layout_RelativePosition.LEFT; + this._activeBorderSize = null; + this._pullDistance = 0.0; + this._maxPullDistance = null; + this.simulateTouch = false; + this.ease = motion_easing_Quart.easeOut; + this.minDragDistance = 6.0; + this._dragging = false; + this._active = false; + this.enabled = true; + openfl_events_EventDispatcher.call(this); + this.set_target(target); + this.set_pullableEdge(pullableEdge); + this.set_maxPullDistance(maxPullDistance); +}; +$hxClasses["feathers.utils.EdgePuller"] = feathers_utils_EdgePuller; +feathers_utils_EdgePuller.__name__ = "feathers.utils.EdgePuller"; +feathers_utils_EdgePuller.__super__ = openfl_events_EventDispatcher; +feathers_utils_EdgePuller.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_active: function() { + return this._active; + } + ,get_dragging: function() { + return this._dragging; + } + ,get_target: function() { + return this._target; + } + ,set_target: function(value) { + if(this._target == value) { + return this._target; + } + if(this._target != null) { + this.cleanupAfterDrag(); + this._target.removeEventListener("mouseDown",$bind(this,this.edgePuller_target_mouseDownHandler)); + this._target.removeEventListener("mouseDown",$bind(this,this.edgePuller_target_mouseDownCaptureHandler),true); + this._target.removeEventListener("touchBegin",$bind(this,this.edgePuller_target_touchBeginHandler)); + this._target.removeEventListener("touchBegin",$bind(this,this.edgePuller_target_touchBeginCaptureHandler),true); + this._target.removeEventListener("addedToStage",$bind(this,this.edgePuller_target_addedToStageHandler)); + this._target.removeEventListener("removedFromStage",$bind(this,this.edgePuller_target_removedFromStageHandler)); + this.removeStageEvents(); + } + this._target = value; + if(this._target != null) { + this._target.addEventListener("mouseDown",$bind(this,this.edgePuller_target_mouseDownHandler),false,0,true); + this._target.addEventListener("mouseDown",$bind(this,this.edgePuller_target_mouseDownCaptureHandler),true,0,true); + this._target.addEventListener("touchBegin",$bind(this,this.edgePuller_target_touchBeginHandler),false,0,true); + this._target.addEventListener("touchBegin",$bind(this,this.edgePuller_target_touchBeginCaptureHandler),true,0,true); + this._target.addEventListener("addedToStage",$bind(this,this.edgePuller_target_addedToStageHandler),false,0,true); + this._target.addEventListener("removedFromStage",$bind(this,this.edgePuller_target_removedFromStageHandler),false,0,true); + this.addStageEvents(); + } + return this._target; + } + ,get_maxPullDistance: function() { + return this._maxPullDistance; + } + ,set_maxPullDistance: function(value) { + if(this._maxPullDistance == value) { + return this._maxPullDistance; + } + this._maxPullDistance = value; + return this._maxPullDistance; + } + ,get_pullDistance: function() { + return this._pullDistance; + } + ,get_activeBorderSize: function() { + return this._activeBorderSize; + } + ,set_activeBorderSize: function(value) { + if(this._activeBorderSize == value) { + return this._activeBorderSize; + } + this._activeBorderSize = value; + return this._activeBorderSize; + } + ,get_pullableEdge: function() { + return this._pullableEdge; + } + ,set_pullableEdge: function(value) { + if(this._pullableEdge == value) { + return this._pullableEdge; + } + this._pullableEdge = value; + return this._pullableEdge; + } + ,get_opened: function() { + if(this._pendingOpened != null) { + return this._pendingOpened; + } + return this._opened; + } + ,set_opened: function(value) { + if(this._pendingOpened != null) { + if(this._pendingOpened == value) { + return this._pendingOpened; + } + } else if(this._opened == value) { + return this._opened; + } + this._pendingOpened = value; + if(this._pendingOpened) { + this.throwTo(this.getMaxPullDistance()); + } else { + this.throwTo(0.0); + } + return this._pendingOpened; + } + ,get_snapDuration: function() { + return this._snapDuration; + } + ,set_snapDuration: function(value) { + if(this._snapDuration == value) { + return this._snapDuration; + } + this._snapDuration = value; + return this._snapDuration; + } + ,get_touchPointID: function() { + return this._touchPointID; + } + ,get_touchPointIsSimulated: function() { + return this._touchPointIsSimulated; + } + ,setOpened: function(value) { + this._pendingOpened = null; + if(this._opened == value) { + return this._opened; + } + this._opened = value; + if(this._opened) { + feathers_events_FeathersEvent.dispatch(this,"open"); + } else { + feathers_events_FeathersEvent.dispatch(this,"close"); + } + return this._opened; + } + ,setPullDistance: function(value) { + if(this._pullDistance == value) { + return this._pullDistance; + } + this._pullDistance = value; + feathers_events_FeathersEvent.dispatch(this,"change"); + return this._pullDistance; + } + ,getMaxPullDistance: function() { + if(this._maxPullDistance != null) { + return this._maxPullDistance; + } + switch(this._pullableEdge._hx_index) { + case 0: + return this._target.get_height(); + case 1: + return this._target.get_width(); + case 2: + return this._target.get_height(); + case 3: + return this._target.get_width(); + default: + throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge)); + } + } + ,getTouchPosition: function(stageX,stageY) { + switch(this._pullableEdge._hx_index) { + case 0: + return stageY; + case 1: + return stageX; + case 2: + return stageY; + case 3: + return stageX; + default: + throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge)); + } + } + ,getTouchScale: function() { + switch(this._pullableEdge._hx_index) { + case 0: + return feathers_utils_DisplayUtil.getConcatenatedScaleY(this._target); + case 1: + return feathers_utils_DisplayUtil.getConcatenatedScaleX(this._target); + case 2: + return feathers_utils_DisplayUtil.getConcatenatedScaleY(this._target); + case 3: + return feathers_utils_DisplayUtil.getConcatenatedScaleX(this._target); + default: + throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge)); + } + } + ,isInActiveBorder: function(stageX,stageY,activeBorderSize) { + var point = new openfl_geom_Point(stageX,stageY); + point = this._target.globalToLocal(point); + switch(this._pullableEdge._hx_index) { + case 0: + if(point.y >= 0.0) { + return point.y < activeBorderSize; + } else { + return false; + } + break; + case 1: + if(point.x >= this._target.get_width() - activeBorderSize) { + return point.x < this._target.get_width(); + } else { + return false; + } + break; + case 2: + if(point.y >= this._target.get_height() - activeBorderSize) { + return point.y < this._target.get_height(); + } else { + return false; + } + break; + case 3: + if(point.x >= 0.0) { + return point.x < activeBorderSize; + } else { + return false; + } + break; + default: + throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge)); + } + } + ,checkMinDrag: function(touchOffset) { + if(this._opened) { + switch(this._pullableEdge._hx_index) { + case 0: + return touchOffset < -this.minDragDistance; + case 1: + return touchOffset > this.minDragDistance; + case 2: + return touchOffset > this.minDragDistance; + case 3: + return touchOffset < -this.minDragDistance; + default: + throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge)); + } + } + switch(this._pullableEdge._hx_index) { + case 0: + return touchOffset > this.minDragDistance; + case 1: + return touchOffset < -this.minDragDistance; + case 2: + return touchOffset < -this.minDragDistance; + case 3: + return touchOffset > this.minDragDistance; + default: + throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge)); + } + } + ,touchBegin: function(touchPointID,simulatedTouch,stageX,stageY) { + if(!this.enabled) { + return; + } + if(simulatedTouch && !this.simulateTouch) { + return; + } + if(this._touchPointID != null) { + return; + } + if(!this._opened && this._activeBorderSize != null) { + if(!this.isInActiveBorder(stageX,stageY,this._activeBorderSize)) { + return; + } + } + if(this._animatePull != null) { + motion_Actuate.stop(this._animatePull,null,false,false); + this._animatePull = null; + } + this._target.stage.addEventListener("mouseMove",$bind(this,this.edgePuller_target_stage_mouseMoveHandler),false,0,true); + this._target.stage.addEventListener("mouseUp",$bind(this,this.edgePuller_target_stage_mouseUpHandler),false,0,true); + this._target.stage.addEventListener("touchMove",$bind(this,this.edgePuller_target_stage_touchMoveHandler),false,0,true); + this._target.stage.addEventListener("touchEnd",$bind(this,this.edgePuller_target_stage_touchEndHandler),false,0,true); + if(((this._target) instanceof openfl_display_DisplayObjectContainer)) { + var container = this._target; + if(this._active) { + container.mouseChildren = false; + } + } + this._pendingOpened = null; + this._touchPointID = touchPointID; + this._touchPointIsSimulated = simulatedTouch; + this._startTouch = this.getTouchPosition(stageX,stageY); + this._startPullDistance = this._pullDistance; + this._savedTouchMoves.length = 0; + } + ,touchMove: function(touchPointID,simulatedTouch,stageX,stageY) { + if(this._touchPointID == null) { + return; + } + if(this._touchPointID != touchPointID) { + return; + } + if(this._touchPointIsSimulated != simulatedTouch) { + return; + } + var touchPosition = this.getTouchPosition(stageX,stageY); + var touchOffset = touchPosition - this._startTouch; + var touchScale = this.getTouchScale(); + touchOffset *= touchScale; + if(!this._dragging && this.enabled && this.checkMinDrag(touchOffset)) { + this._startTouch = touchPosition; + touchOffset = 0.0; + this._dragging = this.startPull(); + } + if(!this._dragging) { + return; + } + var maxPullDistance = this.getMaxPullDistance(); + var pullDistance = this._startPullDistance; + if(this._pullableEdge == feathers_layout_RelativePosition.RIGHT || this._pullableEdge == feathers_layout_RelativePosition.BOTTOM) { + pullDistance -= touchOffset; + } else { + pullDistance += touchOffset; + } + if(pullDistance < 0.0) { + pullDistance = 0.0; + } else if(pullDistance > maxPullDistance) { + pullDistance = maxPullDistance; + } + this.setPullDistance(pullDistance); + if(this._savedTouchMoves.length > 60) { + this._savedTouchMoves.length = 30; + } + this._savedTouchMoves.push(pullDistance); + this._savedTouchMoves.push(openfl_Lib.getTimer()); + } + ,touchEnd: function(touchPointID,simulatedTouch) { + if(this._touchPointID == null) { + return; + } + if(this._touchPointID != touchPointID) { + return; + } + if(this._touchPointIsSimulated != simulatedTouch) { + return; + } + this.cleanupAfterDrag(); + if(!this._dragging) { + return; + } + var targetTime = openfl_Lib.getTimer() - 100; + var endIndex = this._savedTouchMoves.length - 1; + var startIndex = endIndex; + var i = endIndex; + while(endIndex > 0 && this._savedTouchMoves[i] > targetTime) { + startIndex = i; + i -= 2; + } + var velocity = 0.0; + if(this._dragging && startIndex != endIndex) { + var timeOffset = this._savedTouchMoves[endIndex] - this._savedTouchMoves[startIndex]; + var moved = this._pullDistance - this._savedTouchMoves[startIndex - 1]; + velocity = moved / timeOffset; + } + if(velocity != 0.0 || this._dragging) { + this.throwWithVelocity(velocity); + } else { + this.completeDrag(); + } + } + ,startPull: function() { + if(this._active) { + return true; + } + this._active = true; + var result = true; + if(this._opened) { + result = feathers_events_FeathersEvent.dispatch(this,"closing",false,true); + } else { + result = feathers_events_FeathersEvent.dispatch(this,"opening",false,true); + } + if(!result) { + this._active = false; + this._dragging = false; + this.cleanupAfterDrag(); + return false; + } + if(((this._target) instanceof openfl_display_DisplayObjectContainer)) { + var container = this._target; + this._restoreMouseChildren = container.mouseChildren; + container.mouseChildren = false; + } + feathers_events_FeathersEvent.dispatch(this,"change"); + return true; + } + ,completeDrag: function() { + this._dragging = false; + this.completePull(); + } + ,completePull: function() { + if(!this._active || this._dragging || this._animatePull != null) { + return; + } + this._active = false; + if(((this._target) instanceof openfl_display_DisplayObjectContainer)) { + var container = this._target; + container.mouseChildren = this._restoreMouseChildren; + } + var oldOpened = this._opened; + var newOpened = this._pullDistance != 0.0; + this.setOpened(newOpened); + if(newOpened == oldOpened) { + feathers_events_FeathersEvent.dispatch(this,"cancel"); + } + } + ,addStageEvents: function() { + if(this._target == null || this._target.stage == null) { + return; + } + this._target.stage.addEventListener("touchBegin",$bind(this,this.edgePuller_target_stage_touchBeginHandler),false,0,true); + this._target.stage.addEventListener("mouseDown",$bind(this,this.edgePuller_target_stage_mouseDownHandler),false,0,true); + } + ,removeStageEvents: function() { + if(this._target == null || this._target.stage == null) { + return; + } + this._target.stage.removeEventListener("touchBegin",$bind(this,this.edgePuller_target_stage_touchBeginHandler)); + this._target.stage.removeEventListener("mouseDown",$bind(this,this.edgePuller_target_stage_mouseDownHandler)); + } + ,cleanupAfterDrag: function() { + if(this._touchPointID == null) { + return; + } + this._touchPointID = null; + this._touchPointIsSimulated = false; + if(this._target.stage != null) { + this._target.stage.removeEventListener("mouseMove",$bind(this,this.edgePuller_target_stage_mouseMoveHandler)); + this._target.stage.removeEventListener("mouseUp",$bind(this,this.edgePuller_target_stage_mouseUpHandler)); + this._target.stage.removeEventListener("touchMove",$bind(this,this.edgePuller_target_stage_touchMoveHandler)); + this._target.stage.removeEventListener("touchEnd",$bind(this,this.edgePuller_target_stage_touchEndHandler)); + } + } + ,throwWithVelocity: function(velocity) { + var maxPullDistance = this.getMaxPullDistance(); + var targetPosition = 0.0; + if(Math.abs(velocity) <= feathers_utils_EdgePuller.MINIMUM_VELOCITY) { + targetPosition = this._pullDistance < maxPullDistance / 2.0 ? 0.0 : maxPullDistance; + } else { + targetPosition = velocity < 0.0 ? 0.0 : maxPullDistance; + } + this.throwTo(targetPosition); + } + ,throwTo: function(targetPosition) { + var _gthis = this; + var pullChanged = false; + if(targetPosition != null) { + if(this._animatePull != null) { + motion_Actuate.stop(this._animatePull,null,false,false); + this._animatePull = null; + } + if(this._pullDistance != targetPosition) { + pullChanged = true; + if(!this.startPull()) { + return; + } + this._startPullDistance = this._pullDistance; + this._targetPullDistance = targetPosition; + if(this._snapDuration > 0.0) { + var tween = motion_Actuate.update(function(pullDistance) { + return _gthis.setPullDistance(pullDistance); + },this._snapDuration,[this._startPullDistance],[this._targetPullDistance],true); + this._animatePull = tween; + this._animatePull.ease(this.ease); + this._animatePull.onComplete($bind(this,this.animatePull_onComplete)); + } else { + this.setPullDistance(this._targetPullDistance); + this.completeDrag(); + } + } else { + this.completeDrag(); + } + } + } + ,animatePull_onComplete: function() { + this._animatePull = null; + this.completeDrag(); + } + ,edgePuller_target_addedToStageHandler: function(event) { + this.addStageEvents(); + } + ,edgePuller_target_removedFromStageHandler: function(event) { + this.removeStageEvents(); + this.cleanupAfterDrag(); + } + ,edgePuller_target_touchBeginCaptureHandler: function(event) { + if(!this._active) { + return; + } + event.stopImmediatePropagation(); + this.edgePuller_target_touchBeginHandler(event); + } + ,edgePuller_target_touchBeginHandler: function(event) { + if(this.simulateTouch && event.isPrimaryTouchPoint) { + return; + } + this.touchBegin(event.touchPointID,false,event.stageX,event.stageY); + } + ,edgePuller_target_mouseDownCaptureHandler: function(event) { + if(!this._active) { + return; + } + event.stopImmediatePropagation(); + this.edgePuller_target_mouseDownHandler(event); + } + ,edgePuller_target_mouseDownHandler: function(event) { + if(this._opened) { + return; + } + var stage = this._target.stage; + if(stage == null) { + return; + } + this.touchBegin(feathers_utils_EdgePuller.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY()); + } + ,edgePuller_target_stage_touchMoveHandler: function(event) { + this.touchMove(event.touchPointID,false,event.stageX,event.stageY); + } + ,edgePuller_target_stage_mouseMoveHandler: function(event) { + var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage); + this.touchMove(feathers_utils_EdgePuller.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY()); + } + ,edgePuller_target_stage_touchEndHandler: function(event) { + this.touchEnd(event.touchPointID,false); + } + ,edgePuller_target_stage_mouseUpHandler: function(event) { + this.touchEnd(feathers_utils_EdgePuller.POINTER_ID_MOUSE,true); + } + ,edgePuller_target_stage_touchBeginHandler: function(event) { + if(!this._opened || !this.enabled || this._touchPointID != null) { + return; + } + var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage); + var maxPullDistance = this.getMaxPullDistance(); + if(!this.isInActiveBorder(event.stageX,event.stageY,maxPullDistance)) { + this._touchPointID = event.touchPointID; + stage.addEventListener("touchMove",$bind(this,this.edgePuller_target_stage_touchMoveHandler2),false,0,true); + stage.addEventListener("touchEnd",$bind(this,this.edgePuller_target_stage_touchEndHandler2),false,0,true); + return; + } + this.touchBegin(event.touchPointID,false,event.stageX,event.stageY); + } + ,edgePuller_target_stage_touchMoveHandler2: function(event) { + if(this._touchPointID == null || event.touchPointID != this._touchPointID) { + return; + } + var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage); + var maxPullDistance = this.getMaxPullDistance(); + var point = new openfl_geom_Point(event.stageX,event.stageY); + point = this._target.globalToLocal(point); + switch(this._pullableEdge._hx_index) { + case 0: + if(point.y > maxPullDistance || point.y < 0.0) { + return; + } + break; + case 1: + if(point.x < this._target.get_width() - maxPullDistance || point.x > this._target.get_width()) { + return; + } + break; + case 2: + if(point.y < this._target.get_height() - maxPullDistance || point.y > this._target.get_height()) { + return; + } + break; + case 3: + if(point.x > maxPullDistance || point.x < 0.0) { + return; + } + break; + default: + throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge)); + } + stage.removeEventListener("touchMove",$bind(this,this.edgePuller_target_stage_touchMoveHandler2)); + stage.removeEventListener("touchEnd",$bind(this,this.edgePuller_target_stage_touchEndHandler2)); + this._touchPointID = null; + this._touchPointIsSimulated = false; + this.touchBegin(event.touchPointID,false,event.stageX,event.stageY); + } + ,edgePuller_target_stage_touchEndHandler2: function(event) { + if(this._touchPointID == null || event.touchPointID != this._touchPointID) { + return; + } + var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage); + stage.removeEventListener("touchMove",$bind(this,this.edgePuller_target_stage_touchMoveHandler2)); + stage.removeEventListener("touchEnd",$bind(this,this.edgePuller_target_stage_touchEndHandler2)); + this._touchPointID = null; + this._touchPointIsSimulated = false; + } + ,edgePuller_target_stage_mouseDownHandler: function(event) { + if(!this._opened || !this.enabled || this._touchPointID != null || !this.simulateTouch) { + return; + } + var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage); + var maxPullDistance = this.getMaxPullDistance(); + if(!this.isInActiveBorder(stage.get_mouseX(),stage.get_mouseY(),maxPullDistance)) { + this._touchPointID = feathers_utils_EdgePuller.POINTER_ID_MOUSE; + this._touchPointIsSimulated = true; + stage.addEventListener("mouseMove",$bind(this,this.edgePuller_target_stage_mouseMoveHandler2),false,0,true); + stage.addEventListener("mouseUp",$bind(this,this.edgePuller_target_stage_mouseUpHandler2),false,0,true); + return; + } + this.touchBegin(feathers_utils_EdgePuller.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY()); + } + ,edgePuller_target_stage_mouseMoveHandler2: function(event) { + if(!this._touchPointIsSimulated || this._touchPointID == null || feathers_utils_EdgePuller.POINTER_ID_MOUSE != this._touchPointID) { + return; + } + var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage); + var maxPullDistance = this.getMaxPullDistance(); + var point = new openfl_geom_Point(stage.get_mouseX(),stage.get_mouseY()); + point = this._target.globalToLocal(point); + switch(this._pullableEdge._hx_index) { + case 0: + if(point.y > maxPullDistance || point.y < 0.0) { + return; + } + break; + case 1: + if(point.x < this._target.get_width() - maxPullDistance || point.x > this._target.get_width()) { + return; + } + break; + case 2: + if(point.y < this._target.get_height() - maxPullDistance || point.y > this._target.get_height()) { + return; + } + break; + case 3: + if(point.x > maxPullDistance || point.x < 0.0) { + return; + } + break; + default: + throw new openfl_errors_ArgumentError("Unknown pullable edge position: " + Std.string(this._pullableEdge)); + } + stage.removeEventListener("mouseMove",$bind(this,this.edgePuller_target_stage_mouseMoveHandler2)); + stage.removeEventListener("mouseUp",$bind(this,this.edgePuller_target_stage_mouseUpHandler2)); + this._touchPointID = null; + this._touchPointIsSimulated = false; + this.touchBegin(feathers_utils_EdgePuller.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY()); + } + ,edgePuller_target_stage_mouseUpHandler2: function(event) { + if(!this._touchPointIsSimulated || this._touchPointID == null || feathers_utils_EdgePuller.POINTER_ID_MOUSE != this._touchPointID) { + return; + } + var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage); + stage.removeEventListener("mouseMove",$bind(this,this.edgePuller_target_stage_mouseMoveHandler2)); + stage.removeEventListener("mouseUp",$bind(this,this.edgePuller_target_stage_mouseUpHandler2)); + this._touchPointID = null; + this._touchPointIsSimulated = false; + } + ,__class__: feathers_utils_EdgePuller + ,__properties__: {get_touchPointIsSimulated:"get_touchPointIsSimulated",get_touchPointID:"get_touchPointID",set_snapDuration:"set_snapDuration",get_snapDuration:"get_snapDuration",set_opened:"set_opened",get_opened:"get_opened",set_pullableEdge:"set_pullableEdge",get_pullableEdge:"get_pullableEdge",set_activeBorderSize:"set_activeBorderSize",get_activeBorderSize:"get_activeBorderSize",get_pullDistance:"get_pullDistance",set_maxPullDistance:"set_maxPullDistance",get_maxPullDistance:"get_maxPullDistance",set_target:"set_target",get_target:"get_target",get_dragging:"get_dragging",get_active:"get_active"} +}); +var feathers_utils_ExclusivePointer = function(stage) { + this._touchClaims = new haxe_ds_IntMap(); + this._mouseClaim = null; + this._stageListenerCount = 0; + if(stage == null) { + throw new openfl_errors_ArgumentError("Stage cannot be null."); + } + this._stage = stage; +}; +$hxClasses["feathers.utils.ExclusivePointer"] = feathers_utils_ExclusivePointer; +feathers_utils_ExclusivePointer.__name__ = "feathers.utils.ExclusivePointer"; +feathers_utils_ExclusivePointer.forStage = function(stage) { + if(stage == null) { + throw new openfl_errors_ArgumentError("Stage cannot be null."); + } + var exclusivePointer = feathers_utils_ExclusivePointer.stageToObject.h[stage.__id__]; + if(exclusivePointer != null) { + return exclusivePointer; + } + exclusivePointer = new feathers_utils_ExclusivePointer(stage); + feathers_utils_ExclusivePointer.stageToObject.set(stage,exclusivePointer); + return exclusivePointer; +}; +feathers_utils_ExclusivePointer.disposeForStage = function(stage) { + var exclusivePointer = feathers_utils_ExclusivePointer.stageToObject.h[stage.__id__]; + if(exclusivePointer == null) { + return; + } + exclusivePointer.dispose(); + feathers_utils_ExclusivePointer.stageToObject.remove(stage); +}; +feathers_utils_ExclusivePointer.prototype = { + claimTouch: function(touchPointID,target) { + if(target == null) { + throw new openfl_errors_ArgumentError("Target cannot be null."); + } + if(target.stage != this._stage) { + throw new openfl_errors_ArgumentError("Target cannot claim a pointer on the selected stage because it appears on a different stage."); + } + var existingTarget = this._touchClaims.h[touchPointID]; + if(existingTarget != null) { + return false; + } + this._touchClaims.h[touchPointID] = target; + target.addEventListener("removedFromStage",$bind(this,this.exclusivePointer_target_removedFromStageHandler),false,0,true); + if(this._stageListenerCount == 0) { + this._stage.addEventListener("mouseUp",$bind(this,this.exclusivePointer_stage_mouseUpHandler),false,0,true); + this._stage.addEventListener("touchEnd",$bind(this,this.exclusivePointer_stage_touchEndHandler),false,0,true); + } + this._stageListenerCount++; + return true; + } + ,claimMouse: function(target) { + if(target == null) { + throw new openfl_errors_ArgumentError("Target cannot be null."); + } + if(target.stage != this._stage) { + throw new openfl_errors_ArgumentError("Target cannot claim a pointer on the selected stage because it appears on a different stage."); + } + if(this._mouseClaim != null) { + return false; + } + this._mouseClaim = target; + target.addEventListener("removedFromStage",$bind(this,this.exclusivePointer_target_removedFromStageHandler),false,0,true); + if(this._stageListenerCount == 0) { + this._stage.addEventListener("mouseUp",$bind(this,this.exclusivePointer_stage_mouseUpHandler),false,0,true); + this._stage.addEventListener("touchEnd",$bind(this,this.exclusivePointer_stage_touchEndHandler),false,0,true); + } + this._stageListenerCount++; + return true; + } + ,removeTouchClaim: function(touchPointID) { + var existingTarget = this._touchClaims.h[touchPointID]; + if(existingTarget == null) { + return; + } + this._touchClaims.remove(touchPointID); + if(!this.hasClaimOn(existingTarget)) { + existingTarget.removeEventListener("removedFromStage",$bind(this,this.exclusivePointer_target_removedFromStageHandler)); + } + this._stageListenerCount--; + if(this._stageListenerCount == 0) { + this._stage.removeEventListener("mouseUp",$bind(this,this.exclusivePointer_stage_mouseUpHandler)); + this._stage.removeEventListener("touchEnd",$bind(this,this.exclusivePointer_stage_touchEndHandler)); + } + } + ,removeMouseClaim: function() { + var existingTarget = this._mouseClaim; + if(existingTarget == null) { + return; + } + this._mouseClaim = null; + if(!this.hasClaimOn(existingTarget)) { + existingTarget.removeEventListener("removedFromStage",$bind(this,this.exclusivePointer_target_removedFromStageHandler)); + } + this._stageListenerCount--; + if(this._stageListenerCount == 0) { + this._stage.removeEventListener("mouseUp",$bind(this,this.exclusivePointer_stage_mouseUpHandler)); + this._stage.removeEventListener("touchEnd",$bind(this,this.exclusivePointer_stage_touchEndHandler)); + } + } + ,hasClaim: function() { + if(this._mouseClaim != null) { + return true; + } + var touchPointID = this._touchClaims.keys(); + while(touchPointID.hasNext()) { + var touchPointID1 = touchPointID.next(); + return true; + } + return false; + } + ,getTouchClaim: function(touchPointID) { + return this._touchClaims.h[touchPointID]; + } + ,getMouseClaim: function() { + return this._mouseClaim; + } + ,removeAllClaims: function() { + var touchPointID = this._touchClaims.keys(); + while(touchPointID.hasNext()) { + var touchPointID1 = touchPointID.next(); + this.removeTouchClaim(touchPointID1); + } + this.removeMouseClaim(); + } + ,dispose: function() { + this.removeAllClaims(); + } + ,hasClaimOn: function(target) { + if(this._mouseClaim == target) { + return true; + } + var map = this._touchClaims; + var _g_map = map; + var _g_keys = map.keys(); + while(_g_keys.hasNext()) { + var key = _g_keys.next(); + var _g_value = _g_map.get(key); + var _g_key = key; + var touchPointID = _g_key; + var existingTarget = _g_value; + if(existingTarget == target) { + return true; + } + } + return false; + } + ,exclusivePointer_target_removedFromStageHandler: function(event) { + var target = js_Boot.__cast(event.currentTarget , openfl_display_DisplayObject); + if(this._mouseClaim == target) { + this.removeMouseClaim(); + } + var map = this._touchClaims; + var _g_map = map; + var _g_keys = map.keys(); + while(_g_keys.hasNext()) { + var key = _g_keys.next(); + var _g_value = _g_map.get(key); + var _g_key = key; + var touchPointID = _g_key; + var existingTarget = _g_value; + if(existingTarget == target) { + this.removeTouchClaim(touchPointID); + } + } + } + ,exclusivePointer_stage_mouseUpHandler: function(event) { + this.removeMouseClaim(); + } + ,exclusivePointer_stage_touchEndHandler: function(event) { + this.removeTouchClaim(event.touchPointID); + } + ,__class__: feathers_utils_ExclusivePointer +}; +var feathers_utils_FocusUtil = function() { }; +$hxClasses["feathers.utils.FocusUtil"] = feathers_utils_FocusUtil; +feathers_utils_FocusUtil.__name__ = "feathers.utils.FocusUtil"; +feathers_utils_FocusUtil.findAllFocusableObjects = function(target,result) { + if(result == null) { + result = []; + } + if(js_Boot.__implements(target,feathers_core_IFocusObject)) { + var focusableObject = target; + if(focusableObject.get_focusEnabled()) { + result.push(focusableObject); + } + } + if(js_Boot.__implements(target,feathers_core_IFocusExtras)) { + var focusExtras = target; + var extras = focusExtras.get_focusExtrasBefore(); + if(extras != null) { + var _g = 0; + var _g1 = extras.length; + while(_g < _g1) { + var i = _g++; + var childOfTarget = extras[i]; + feathers_utils_FocusUtil.findAllFocusableObjects(childOfTarget,result); + } + } + } + if(js_Boot.__implements(target,feathers_core_IFocusObject)) { + if(js_Boot.__implements(target,feathers_core_IFocusContainer) && target.get_childFocusEnabled()) { + var otherContainer = js_Boot.__cast(target , openfl_display_DisplayObjectContainer); + var _g = 0; + var _g1 = otherContainer.get_numChildren(); + while(_g < _g1) { + var i = _g++; + var childOfTarget = otherContainer.getChildAt(i); + feathers_utils_FocusUtil.findAllFocusableObjects(childOfTarget,result); + } + } + } else if(((target) instanceof openfl_display_DisplayObjectContainer)) { + var otherContainer = target; + var _g = 0; + var _g1 = otherContainer.get_numChildren(); + while(_g < _g1) { + var i = _g++; + var childOfTarget = otherContainer.getChildAt(i); + feathers_utils_FocusUtil.findAllFocusableObjects(childOfTarget,result); + } + } + if(js_Boot.__implements(target,feathers_core_IFocusExtras)) { + var focusExtras = target; + var extras = focusExtras.get_focusExtrasAfter(); + if(extras != null) { + var _g = 0; + var _g1 = extras.length; + while(_g < _g1) { + var i = _g++; + var childOfTarget = extras[i]; + feathers_utils_FocusUtil.findAllFocusableObjects(childOfTarget,result); + } + } + } + return result; +}; +var feathers_utils_KeyToState = function(target,callback,upState,downState) { + this._downKeyCode = null; + this._enabled = true; + this._downState = null; + this._upState = null; + this._callback = null; + this._target = null; + this.set_target(target); + if(upState != null) { + this._upState = upState; + } + if(downState != null) { + this.set_downState(downState); + } + this._currentState = this._upState; + this.set_callback(callback); +}; +$hxClasses["feathers.utils.KeyToState"] = feathers_utils_KeyToState; +feathers_utils_KeyToState.__name__ = "feathers.utils.KeyToState"; +feathers_utils_KeyToState.prototype = { + get_target: function() { + return this._target; + } + ,set_target: function(value) { + if(this._target == value) { + return this._target; + } + if(this._target != null) { + this._target.removeEventListener("removedFromStage",$bind(this,this.keyToState_target_removedFromStageHandler)); + this._target.removeEventListener("focusOut",$bind(this,this.keyToState_target_focusOutHandler)); + this._target.removeEventListener("keyDown",$bind(this,this.keyToState_target_keyDownHandler)); + this._target.removeEventListener("keyUp",$bind(this,this.keyToState_target_keyUpHandler)); + } + this._target = value; + if(this._target != null) { + this._currentState = this._upState; + this._target.addEventListener("removedFromStage",$bind(this,this.keyToState_target_removedFromStageHandler)); + this._target.addEventListener("focusOut",$bind(this,this.keyToState_target_focusOutHandler)); + this._target.addEventListener("keyDown",$bind(this,this.keyToState_target_keyDownHandler)); + this._target.addEventListener("keyUp",$bind(this,this.keyToState_target_keyUpHandler)); + } + return this._target; + } + ,get_callback: function() { + return this._callback; + } + ,set_callback: function(value) { + if(this._callback == value) { + return this._callback; + } + this._callback = value; + if(this._callback != null) { + this._callback(this._currentState); + } + return this._callback; + } + ,get_currentState: function() { + return this._currentState; + } + ,get_upState: function() { + return this._upState; + } + ,set_upState: function(value) { + this._upState = value; + return this._upState; + } + ,get_downState: function() { + return this._downState; + } + ,set_downState: function(value) { + this._downState = value; + return this._downState; + } + ,get_enabled: function() { + return this._enabled; + } + ,set_enabled: function(value) { + if(this._enabled == value) { + return this._enabled; + } + this._enabled = value; + if(!this._enabled) { + this.resetKeyState(); + } + return this._enabled; + } + ,changeState: function(value) { + var oldState = this._currentState; + if(js_Boot.__implements(this._target,feathers_core_IStateContext)) { + oldState = this._target.get_currentState(); + } + this._currentState = value; + if(oldState == value) { + return; + } + if(this._callback != null) { + this._callback(value); + } + } + ,resetKeyState: function() { + if(this._downKeyCode == null) { + return; + } + this._downKeyCode = null; + this.changeState(this._upState); + } + ,keyToState_target_removedFromStageHandler: function(event) { + this.resetKeyState(); + } + ,keyToState_target_focusOutHandler: function(event) { + this.resetKeyState(); + } + ,keyToState_target_keyDownHandler: function(event) { + if(js_Boot.__implements(this._target,feathers_core_IFocusObject)) { + var focusObject = this._target; + var focusManager = focusObject.get_focusManager(); + if(focusManager != null && focusManager.get_focus() != focusObject) { + return; + } + } + if(!this._enabled || this._downKeyCode != null || event.keyCode != 32 && event.keyCode != 13) { + return; + } + this._downKeyCode = event.keyCode; + this.changeState(this._downState); + } + ,keyToState_target_keyUpHandler: function(event) { + if(event.keyCode != this._downKeyCode) { + return; + } + this.resetKeyState(); + } + ,__class__: feathers_utils_KeyToState + ,__properties__: {set_enabled:"set_enabled",get_enabled:"get_enabled",set_downState:"set_downState",get_downState:"get_downState",set_upState:"set_upState",get_upState:"get_upState",get_currentState:"get_currentState",set_callback:"set_callback",get_callback:"get_callback",set_target:"set_target",get_target:"get_target"} +}; +var feathers_utils_MathUtil = function() { }; +$hxClasses["feathers.utils.MathUtil"] = feathers_utils_MathUtil; +feathers_utils_MathUtil.__name__ = "feathers.utils.MathUtil"; +feathers_utils_MathUtil.roundDownToNearest = function(number,nearest) { + if(nearest == null) { + nearest = 1.0; + } + if(nearest == 0) { + return number; + } + return Math.floor(feathers_utils_MathUtil.roundToPrecision(number / nearest,10)) * nearest; +}; +feathers_utils_MathUtil.roundUpToNearest = function(number,nearest) { + if(nearest == null) { + nearest = 1.0; + } + if(nearest == 0) { + return number; + } + return Math.ceil(feathers_utils_MathUtil.roundToPrecision(number / nearest,10)) * nearest; +}; +feathers_utils_MathUtil.roundToNearest = function(number,nearest) { + if(nearest == null) { + nearest = 1.0; + } + if(nearest == 0) { + return number; + } + return Math.round(feathers_utils_MathUtil.roundToPrecision(number / nearest,10)) * nearest; +}; +feathers_utils_MathUtil.roundToPrecision = function(number,precision) { + if(precision == null) { + precision = 0; + } + var decimalPlaces = Math.pow(10,precision); + return Math.round(decimalPlaces * number) / decimalPlaces; +}; +feathers_utils_MathUtil.fuzzyEquals = function(n1,n2,maxDifference) { + if(maxDifference == null) { + maxDifference = 0.000001; + } + return Math.abs(n1 - n2) <= maxDifference; +}; +var feathers_utils_MeasurementsUtil = function() { }; +$hxClasses["feathers.utils.MeasurementsUtil"] = feathers_utils_MeasurementsUtil; +feathers_utils_MeasurementsUtil.__name__ = "feathers.utils.MeasurementsUtil"; +feathers_utils_MeasurementsUtil.resetFluidlyWithParentValues = function(measurements,target,parentExplicitWidth,parentExplicitHeight,parentExplicitMinWidth,parentExplicitMinHeight,parentExplicitMaxWidth,parentExplicitMaxHeight) { + if(target == null) { + return; + } + if(js_Boot.__implements(target,feathers_core_IMeasureObject)) { + var measureTarget = target; + var width = parentExplicitWidth; + if(width == null) { + width = measurements.width; + } + if(width == null) { + measureTarget.resetWidth(); + } else { + measureTarget.set_width(width); + } + var height = parentExplicitHeight; + if(height == null) { + height = measurements.height; + } + if(height == null) { + measureTarget.resetHeight(); + } else { + measureTarget.set_height(height); + } + var minWidth = parentExplicitMinWidth; + if(minWidth == null || measureTarget.get_explicitMinWidth() != null && measureTarget.get_explicitMinWidth() > minWidth) { + minWidth = measureTarget.get_explicitMinWidth(); + } + if(minWidth == null) { + minWidth = 0.0; + } + measureTarget.set_minWidth(minWidth); + var minHeight = parentExplicitMinHeight; + if(minHeight == null || measureTarget.get_explicitMinHeight() != null && measureTarget.get_explicitMinHeight() > minHeight) { + minHeight = measureTarget.get_explicitMinHeight(); + } + if(minHeight == null) { + minHeight = 0.0; + } + measureTarget.set_minHeight(minHeight); + var maxWidth = parentExplicitMaxWidth; + if(maxWidth == null || measureTarget.get_explicitMaxWidth() != null && measureTarget.get_explicitMaxWidth() < maxWidth) { + maxWidth = measureTarget.get_explicitMaxWidth(); + } + if(maxWidth == null) { + maxWidth = 1.0 / 0.0; + } + measureTarget.set_maxWidth(maxWidth); + var maxHeight = parentExplicitMaxHeight; + if(maxHeight == null || measureTarget.get_explicitMaxHeight() != null && measureTarget.get_explicitMaxHeight() < maxHeight) { + maxHeight = measureTarget.get_explicitMaxHeight(); + } + if(maxHeight == null) { + maxHeight = 1.0 / 0.0; + } + measureTarget.set_maxHeight(maxHeight); + return; + } + if(parentExplicitWidth != null) { + target.set_width(parentExplicitWidth); + } else if(measurements.width != null) { + target.set_width(measurements.width); + } + if(parentExplicitHeight != null) { + target.set_height(parentExplicitHeight); + } else if(measurements.height != null) { + target.set_height(measurements.height); + } +}; +feathers_utils_MeasurementsUtil.resetFluidlyWithParent = function(measurements,target,parent) { + feathers_utils_MeasurementsUtil.resetFluidlyWithParentValues(measurements,target,parent.get_explicitWidth(),parent.get_explicitHeight(),parent.get_explicitMinWidth(),parent.get_explicitMinHeight(),parent.get_explicitMaxWidth(),parent.get_explicitMaxHeight()); +}; +var feathers_utils_PointerToState = function(target,callback,upState,downState,hoverState) { + this._down = false; + this._hoverBeforeDown = false; + this._keepDownStateOnRollOut = false; + this._enabled = true; + this._hoverState = null; + this._downState = null; + this._upState = null; + this._callback = null; + this._stateContext = null; + this._target = null; + this.set_target(target); + if(upState != null) { + this.set_upState(upState); + } + if(downState != null) { + this.set_downState(downState); + } + if(hoverState != null) { + this.set_hoverState(hoverState); + } + this._currentState = this._upState; + this.set_callback(callback); +}; +$hxClasses["feathers.utils.PointerToState"] = feathers_utils_PointerToState; +feathers_utils_PointerToState.__name__ = "feathers.utils.PointerToState"; +feathers_utils_PointerToState.prototype = { + get_target: function() { + return this._target; + } + ,set_target: function(value) { + if(this._target == value) { + return this._target; + } + if(this._target != null) { + this._target.removeEventListener("removedFromStage",$bind(this,this.pointerToState_target_removedFromStageHandler)); + this._target.removeEventListener("rollOver",$bind(this,this.pointerToState_target_rollOverHandler)); + this._target.removeEventListener("rollOut",$bind(this,this.pointerToState_target_rollOutHandler)); + this._target.removeEventListener("mouseDown",$bind(this,this.pointerToState_target_mouseDownHandler)); + } + this._target = value; + if(this._target != null) { + this._currentState = this._upState; + this._target.addEventListener("removedFromStage",$bind(this,this.pointerToState_target_removedFromStageHandler)); + this._target.addEventListener("rollOver",$bind(this,this.pointerToState_target_rollOverHandler)); + this._target.addEventListener("rollOut",$bind(this,this.pointerToState_target_rollOutHandler)); + this._target.addEventListener("mouseDown",$bind(this,this.pointerToState_target_mouseDownHandler)); + } + return this._target; + } + ,get_stateContext: function() { + return this._stateContext; + } + ,set_stateContext: function(value) { + if(this._stateContext == value) { + return this._stateContext; + } + this._stateContext = value; + return this._stateContext; + } + ,get_callback: function() { + return this._callback; + } + ,set_callback: function(value) { + if(this._callback == value) { + return this._callback; + } + this._callback = value; + if(this._callback != null) { + this._callback(this._currentState); + } + return this._callback; + } + ,get_currentState: function() { + return this._currentState; + } + ,get_upState: function() { + return this._upState; + } + ,set_upState: function(value) { + this._upState = value; + return this._upState; + } + ,get_downState: function() { + return this._downState; + } + ,set_downState: function(value) { + this._downState = value; + return this._downState; + } + ,get_hoverState: function() { + return this._hoverState; + } + ,set_hoverState: function(value) { + this._hoverState = value; + return this._hoverState; + } + ,get_enabled: function() { + return this._enabled; + } + ,set_enabled: function(value) { + this._enabled = value; + return this._enabled; + } + ,get_keepDownStateOnRollOut: function() { + return this._keepDownStateOnRollOut; + } + ,set_keepDownStateOnRollOut: function(value) { + this._keepDownStateOnRollOut = value; + return this._keepDownStateOnRollOut; + } + ,get_customHitTest: function() { + return this._customHitTest; + } + ,set_customHitTest: function(value) { + this._customHitTest = value; + return this._customHitTest; + } + ,changeState: function(value) { + var oldState = this._currentState; + var targetStateContext = this._stateContext; + if(targetStateContext == null && js_Boot.__implements(this._target,feathers_core_IStateContext)) { + targetStateContext = this._target; + } + if(targetStateContext != null) { + oldState = targetStateContext.get_currentState(); + } + this._currentState = value; + if(oldState == value) { + return; + } + if(this._callback != null) { + this._callback(value); + } + } + ,resetTouchState: function() { + this._hoverBeforeDown = false; + this.changeState(this._upState); + } + ,pointerToState_target_removedFromStageHandler: function(event) { + if(this._target.stage != null) { + this._target.stage.removeEventListener("mouseUp",$bind(this,this.pointerToState_stage_mouseUpHandler)); + } + this.resetTouchState(); + } + ,pointerToState_target_rollOverHandler: function(event) { + if(!this._enabled) { + return; + } + if(this._customHitTest != null && !this._customHitTest(event.stageX,event.stageY)) { + return; + } + this._hoverBeforeDown = true; + if(this._down) { + this.changeState(this._downState); + } else { + this.changeState(this._hoverState); + } + } + ,pointerToState_target_rollOutHandler: function(event) { + if(!this._enabled) { + return; + } + this._hoverBeforeDown = false; + if(this._keepDownStateOnRollOut && this._down) { + this.changeState(this._downState); + return; + } + this.changeState(this._upState); + } + ,pointerToState_target_mouseDownHandler: function(event) { + if(!this._enabled || this._target.stage == null) { + return; + } + if(this._customHitTest != null && !this._customHitTest(event.stageX,event.stageY)) { + return; + } + this._down = true; + this._target.stage.addEventListener("mouseUp",$bind(this,this.pointerToState_stage_mouseUpHandler),false,0,true); + this.changeState(this._downState); + } + ,pointerToState_stage_mouseUpHandler: function(event) { + var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage); + this._down = false; + stage.removeEventListener("mouseUp",$bind(this,this.pointerToState_stage_mouseUpHandler)); + if(this._hoverBeforeDown && this._target.hitTestPoint(event.stageX,event.stageY)) { + this.changeState(this._hoverState); + } else { + this.resetTouchState(); + } + } + ,__class__: feathers_utils_PointerToState + ,__properties__: {set_customHitTest:"set_customHitTest",get_customHitTest:"get_customHitTest",set_keepDownStateOnRollOut:"set_keepDownStateOnRollOut",get_keepDownStateOnRollOut:"get_keepDownStateOnRollOut",set_enabled:"set_enabled",get_enabled:"get_enabled",set_hoverState:"set_hoverState",get_hoverState:"get_hoverState",set_downState:"set_downState",get_downState:"get_downState",set_upState:"set_upState",get_upState:"get_upState",get_currentState:"get_currentState",set_callback:"set_callback",get_callback:"get_callback",set_stateContext:"set_stateContext",get_stateContext:"get_stateContext",set_target:"set_target",get_target:"get_target"} +}; +var feathers_utils_PointerTrigger = function(target,eventFactory) { + this._enabled = true; + this._eventFactory = null; + this._target = null; + this.set_target(target); + this.set_eventFactory(eventFactory); +}; +$hxClasses["feathers.utils.PointerTrigger"] = feathers_utils_PointerTrigger; +feathers_utils_PointerTrigger.__name__ = "feathers.utils.PointerTrigger"; +feathers_utils_PointerTrigger.prototype = { + get_target: function() { + return this._target; + } + ,set_target: function(value) { + if(this._target == value) { + return this._target; + } + if(this._target != null) { + this._target.removeEventListener("click",$bind(this,this.pointerTrigger_target_clickHandler)); + this._target.removeEventListener("touchTap",$bind(this,this.pointerTrigger_target_touchTapHandler)); + } + this._target = value; + if(this._target != null) { + this._target.addEventListener("click",$bind(this,this.pointerTrigger_target_clickHandler)); + this._target.addEventListener("touchTap",$bind(this,this.pointerTrigger_target_touchTapHandler)); + } + return this._target; + } + ,get_eventFactory: function() { + return this._eventFactory; + } + ,set_eventFactory: function(value) { + if(this._eventFactory == value) { + return this._eventFactory; + } + this._eventFactory = value; + return this._eventFactory; + } + ,get_enabled: function() { + return this._enabled; + } + ,set_enabled: function(value) { + this._enabled = value; + return this._enabled; + } + ,get_customHitTest: function() { + return this._customHitTest; + } + ,set_customHitTest: function(value) { + this._customHitTest = value; + return this._customHitTest; + } + ,pointerTrigger_target_clickHandler: function(event) { + if(!this._enabled) { + return; + } + if(this._customHitTest != null && !this._customHitTest(event.stageX,event.stageY)) { + return; + } + if(this._eventFactory != null) { + this._target.dispatchEvent(this._eventFactory()); + return; + } + feathers_events_TriggerEvent.dispatchFromMouseEvent(this._target,event); + } + ,pointerTrigger_target_touchTapHandler: function(event) { + if(!this._enabled) { + return; + } + if(event.isPrimaryTouchPoint) { + return; + } + if(this._customHitTest != null && !this._customHitTest(event.stageX,event.stageY)) { + return; + } + if(this._eventFactory != null) { + this._target.dispatchEvent(this._eventFactory()); + return; + } + feathers_events_TriggerEvent.dispatchFromTouchEvent(this._target,event); + } + ,__class__: feathers_utils_PointerTrigger + ,__properties__: {set_customHitTest:"set_customHitTest",get_customHitTest:"get_customHitTest",set_enabled:"set_enabled",get_enabled:"get_enabled",set_eventFactory:"set_eventFactory",get_eventFactory:"get_eventFactory",set_target:"set_target",get_target:"get_target"} +}; +var feathers_utils_PopUpUtil = function() { }; +$hxClasses["feathers.utils.PopUpUtil"] = feathers_utils_PopUpUtil; +feathers_utils_PopUpUtil.__name__ = "feathers.utils.PopUpUtil"; +feathers_utils_PopUpUtil.isTopLevelPopUpOrIsContainedByTopLevelPopUp = function(target) { + if(target.stage == null) { + return false; + } + var popUpManager = feathers_core_PopUpManager.forStage(target.stage); + var _g = popUpManager.get_popUpCount() - popUpManager.get_topLevelPopUpCount(); + var _g1 = popUpManager.get_popUpCount(); + while(_g < _g1) { + var i = _g++; + var popUp = popUpManager.getPopUpAt(i); + if(target == popUp) { + return true; + } + if(((popUp) instanceof openfl_display_DisplayObjectContainer)) { + var popUpContainer = popUp; + if(popUpContainer.contains(target)) { + return true; + } + } + } + return false; +}; +var feathers_utils_ScreenDensityScaleCalculator = function() { + this._buckets = []; +}; +$hxClasses["feathers.utils.ScreenDensityScaleCalculator"] = feathers_utils_ScreenDensityScaleCalculator; +feathers_utils_ScreenDensityScaleCalculator.__name__ = "feathers.utils.ScreenDensityScaleCalculator"; +feathers_utils_ScreenDensityScaleCalculator.prototype = { + addScaleForDensity: function(density,scale) { + var i = this._buckets.length; + var _g = 0; + var _g1 = this._buckets; + while(_g < _g1.length) { + var bucket = _g1[_g]; + ++_g; + if(bucket.density > density) { + break; + } + if(bucket.density == density) { + throw new openfl_errors_ArgumentError("Screen density cannot be added more than once: " + density); + } + } + var _this = this._buckets; + var x = new feathers_utils__$ScreenDensityScaleCalculator_ScreenDensityBucket(density,scale); + _this.splice(i,0,x); + } + ,removeScaleForDensity: function(density) { + var _g = 0; + var _g1 = this._buckets; + while(_g < _g1.length) { + var bucket = _g1[_g]; + ++_g; + if(bucket.density == density) { + HxOverrides.remove(this._buckets,bucket); + return; + } + } + } + ,getScale: function(density) { + if(this._buckets.length == 0) { + throw new openfl_errors_IllegalOperationError("Cannot choose scale because none have been added"); + } + var bucket = this._buckets[0]; + if(density <= bucket.density) { + return bucket.scale; + } + var previousBucket = bucket; + var _g = 1; + var _g1 = this._buckets.length; + while(_g < _g1) { + var i = _g++; + bucket = this._buckets[i]; + if(density > bucket.density) { + previousBucket = bucket; + continue; + } + var midDPI = (bucket.density + previousBucket.density) / 2.0; + if(density < midDPI) { + return previousBucket.scale; + } + return bucket.scale; + } + return bucket.scale; + } + ,__class__: feathers_utils_ScreenDensityScaleCalculator +}; +var feathers_utils__$ScreenDensityScaleCalculator_ScreenDensityBucket = function(density,scale) { + this.density = density; + this.scale = scale; +}; +$hxClasses["feathers.utils._ScreenDensityScaleCalculator.ScreenDensityBucket"] = feathers_utils__$ScreenDensityScaleCalculator_ScreenDensityBucket; +feathers_utils__$ScreenDensityScaleCalculator_ScreenDensityBucket.__name__ = "feathers.utils._ScreenDensityScaleCalculator.ScreenDensityBucket"; +feathers_utils__$ScreenDensityScaleCalculator_ScreenDensityBucket.prototype = { + __class__: feathers_utils__$ScreenDensityScaleCalculator_ScreenDensityBucket +}; +var feathers_utils_Scroller = function(target) { + this._touchPointIsSimulated = false; + this._touchPointID = null; + this._previousTouchPointID = null; + this.snappingToEdge = false; + this.targetScrollY = 0.0; + this.targetScrollX = 0.0; + this.animateScrollYEndRatio = 1.0; + this.animateScrollXEndRatio = 1.0; + this.animateScrollY = null; + this.animateScrollX = null; + this.savedScrollMoves = []; + this.startScrollY = 0.0; + this.startScrollX = 0.0; + this.startTouchY = 0.0; + this.startTouchX = 0.0; + this.restoreMouseChildren = false; + this._fixedThrowDuration = 2.996998998998728; + this._logDecelerationRate = -0.0020020026706730793; + this.snapPositionsY = null; + this.snapPositionsX = null; + this._decelerationRate = 0.998; + this.simulateTouch = false; + this.mouseWheelDuration = 0.0; + this._mouseWheelDeltaMode = 1; + this.mouseWheelYScrollsX = false; + this.mouseWheelDeltaY = 10.0; + this.mouseWheelDeltaX = 10.0; + this.bounceEase = null; + this.ease = motion_easing_Quart.easeOut; + this.elasticSnapDuration = 0.5; + this.throwElasticity = 0.05; + this.elasticity = 0.33; + this.forceElasticLeft = false; + this.forceElasticBottom = false; + this.forceElasticRight = false; + this.forceElasticTop = false; + this.elasticEdges = true; + this.minDragDistance = 6.0; + this._draggingY = false; + this._draggingX = false; + this._scrolling = false; + this._contentHeight = 0.0; + this._contentWidth = 0.0; + this._visibleHeight = 0.0; + this._visibleWidth = 0.0; + this._maxScrollY = 0.0; + this._maxScrollX = 0.0; + this._minScrollY = 0.0; + this._minScrollX = 0.0; + this._scrollY = 0.0; + this._scrollX = 0.0; + this.enabledY = true; + this.enabledX = true; + openfl_events_EventDispatcher.call(this); + this.set_target(target); +}; +$hxClasses["feathers.utils.Scroller"] = feathers_utils_Scroller; +feathers_utils_Scroller.__name__ = "feathers.utils.Scroller"; +feathers_utils_Scroller.__super__ = openfl_events_EventDispatcher; +feathers_utils_Scroller.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + get_scrollX: function() { + return this._scrollX; + } + ,set_scrollX: function(value) { + if(this._scrollX == value) { + return this._scrollX; + } + this._scrollX = value; + feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._scrollX,this._scrollY); + return this._scrollX; + } + ,get_scrollY: function() { + return this._scrollY; + } + ,set_scrollY: function(value) { + if(this._scrollY == value) { + return this._scrollY; + } + this._scrollY = value; + feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._scrollX,this._scrollY); + return this._scrollY; + } + ,get_restrictedScrollX: function() { + return this._scrollX; + } + ,set_restrictedScrollX: function(value) { + if(value < this._minScrollX) { + value = this._minScrollX; + } else if(value > this._maxScrollX) { + value = this._maxScrollX; + } + if(this._scrollX == value) { + return this._scrollX; + } + this._scrollX = value; + feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._scrollX,this._scrollY); + return this._scrollX; + } + ,get_restrictedScrollY: function() { + return this._scrollY; + } + ,set_restrictedScrollY: function(value) { + if(value < this._minScrollY) { + value = this._minScrollY; + } else if(value > this._maxScrollY) { + value = this._maxScrollY; + } + if(this._scrollY == value) { + return this._scrollY; + } + this._scrollY = value; + feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._scrollX,this._scrollY); + return this._scrollY; + } + ,get_minScrollX: function() { + return this._minScrollX; + } + ,get_minScrollY: function() { + return this._minScrollY; + } + ,get_maxScrollX: function() { + return this._maxScrollX; + } + ,get_maxScrollY: function() { + return this._maxScrollY; + } + ,get_visibleWidth: function() { + return this._visibleWidth; + } + ,get_visibleHeight: function() { + return this._visibleHeight; + } + ,get_contentWidth: function() { + return this._contentWidth; + } + ,get_contentHeight: function() { + return this._contentHeight; + } + ,get_scrolling: function() { + return this._scrolling; + } + ,get_draggingX: function() { + return this._draggingX; + } + ,get_draggingY: function() { + return this._draggingY; + } + ,get_decelerationRate: function() { + return this._decelerationRate; + } + ,set_decelerationRate: function(value) { + if(this._decelerationRate == value) { + return this._decelerationRate; + } + this._decelerationRate = value; + this._logDecelerationRate = Math.log(this._decelerationRate); + this._fixedThrowDuration = -0.1 / Math.log(Math.pow(this._decelerationRate,16.6666666666666679)); + return this._decelerationRate; + } + ,get_target: function() { + return this._target; + } + ,set_target: function(value) { + if(this._target == value) { + return this._target; + } + if(this._target != null) { + this.cleanupAfterDrag(); + this._target.removeEventListener("removedFromStage",$bind(this,this.scroller_target_removedFromStageHandler)); + this._target.removeEventListener("mouseDown",$bind(this,this.scroller_target_mouseDownHandler)); + this._target.removeEventListener("mouseDown",$bind(this,this.scroller_target_mouseDownCaptureHandler),true); + this._target.removeEventListener("mouseWheel",$bind(this,this.scroller_target_mouseWheelHandler)); + var $window = js_Boot.__cast($global , Window); + $window.removeEventListener("wheel",$bind(this,this.scroller_window_wheelCaptureHandler),{ capture : true}); + this._target.removeEventListener("touchBegin",$bind(this,this.scroller_target_touchBeginHandler)); + this._target.removeEventListener("touchBegin",$bind(this,this.scroller_target_touchBeginCaptureHandler),true); + this._target.removeEventListener("click",$bind(this,this.scroller_target_clickCaptureHandler),true); + this._target.removeEventListener("touchTap",$bind(this,this.scroller_target_touchTapCaptureHandler),true); + } + this._target = value; + if(this._target != null) { + this._target.addEventListener("mouseDown",$bind(this,this.scroller_target_mouseDownHandler),false,0,true); + this._target.addEventListener("mouseDown",$bind(this,this.scroller_target_mouseDownCaptureHandler),true,0,true); + this._target.addEventListener("mouseWheel",$bind(this,this.scroller_target_mouseWheelHandler),false,0,true); + var $window = js_Boot.__cast($global , Window); + $window.addEventListener("wheel",$bind(this,this.scroller_window_wheelCaptureHandler),{ capture : true}); + this._target.addEventListener("touchBegin",$bind(this,this.scroller_target_touchBeginHandler),false,0,true); + this._target.addEventListener("touchBegin",$bind(this,this.scroller_target_touchBeginCaptureHandler),true,0,true); + this._target.addEventListener("click",$bind(this,this.scroller_target_clickCaptureHandler),true,0,true); + this._target.addEventListener("touchTap",$bind(this,this.scroller_target_touchTapCaptureHandler),true,0,true); + } + return this._target; + } + ,get_touchPointID: function() { + return this._touchPointID; + } + ,get_touchPointIsSimulated: function() { + return this._touchPointIsSimulated; + } + ,setDimensions: function(visibleWidth,visibleHeight,contentWidth,contentHeight) { + this._visibleWidth = visibleWidth != null ? visibleWidth : 0.0; + this._visibleHeight = visibleHeight != null ? visibleHeight : 0.0; + this._contentWidth = contentWidth != null ? contentWidth : 0.0; + this._contentHeight = contentHeight != null ? contentHeight : 0.0; + this.calculateMinAndMax(); + } + ,applyScrollRestrictions: function() { + var scrollChanged = false; + if(this._scrollX < this._minScrollX) { + this._scrollX = this._minScrollX; + scrollChanged = true; + } else if(this._scrollX > this._maxScrollX) { + this._scrollX = this._maxScrollX; + scrollChanged = true; + } + if(this._scrollY < this._minScrollY) { + this._scrollY = this._minScrollY; + scrollChanged = true; + } else if(this._scrollY > this._maxScrollY) { + this._scrollY = this._maxScrollY; + scrollChanged = true; + } + if(scrollChanged) { + feathers_events_ScrollEvent.dispatch(this,"scroll",false,false,this._scrollX,this._scrollY); + } + } + ,stop: function() { + if(this.animateScrollX != null) { + motion_Actuate.stop(this.animateScrollX,null,false,false); + this.animateScrollX = null; + } + if(this.animateScrollY != null) { + motion_Actuate.stop(this.animateScrollY,null,false,false); + this.animateScrollY = null; + } + this.cleanupAfterDrag(); + this._draggingX = false; + this._draggingY = false; + this.completeScroll(); + } + ,applyLayoutShift: function(x,y) { + if(x != null) { + var animateScrollX = this.animateScrollX; + this.animateScrollX = null; + if(animateScrollX != null) { + motion_Actuate.stop(animateScrollX,null,false,false); + } + this.startScrollX += x; + this.set_scrollX(this.get_scrollX() + x); + var i = 0; + while(i < this.savedScrollMoves.length) { + this.savedScrollMoves[i] += x; + i += 3; + } + if(animateScrollX != null) { + var newTargetScrollX = this.targetScrollX + x; + var position = openfl_Lib.getTimer() / 1000.0 - animateScrollX.startTime; + var newDuration = animateScrollX.duration - position; + this.throwTo(newTargetScrollX,null,newDuration,animateScrollX._ease); + } + } + if(y != null) { + var animateScrollY = this.animateScrollY; + this.animateScrollY = null; + if(animateScrollY != null) { + motion_Actuate.stop(animateScrollY,null,false,false); + } + this.startScrollY += y; + this.set_scrollY(this.get_scrollY() + y); + var i = 1; + while(i < this.savedScrollMoves.length) { + this.savedScrollMoves[i] += y; + i += 3; + } + if(animateScrollY != null) { + var newTargetScrollY = this.targetScrollY + y; + var position = openfl_Lib.getTimer() / 1000.0 - animateScrollY.startTime; + var newDuration = animateScrollY.duration - position; + this.throwTo(null,newTargetScrollY,newDuration,animateScrollY._ease); + } + } + } + ,throwTo: function(scrollX,scrollY,duration,ease) { + var _gthis = this; + if(duration == null) { + duration = this._fixedThrowDuration; + } + if(ease == null) { + ease = this.ease; + } + var scrollChanged = false; + if(scrollX != null) { + if(this.animateScrollX != null) { + motion_Actuate.stop(this.animateScrollX,null,false,false); + this.animateScrollX = null; + } + if(this._scrollX != scrollX) { + scrollChanged = true; + this.startScroll(); + if(duration == 0.0) { + this.set_scrollX(scrollX); + } else { + this.startScrollX = this._scrollX; + this.targetScrollX = scrollX; + var tween = motion_Actuate.update(function(scrollX) { + if(scrollX == null) { + scrollX = _gthis.targetScrollX; + } + return _gthis.set_scrollX(scrollX); + },duration,[this._scrollX],[this.targetScrollX],true); + this.animateScrollX = tween; + this.animateScrollX.ease(ease); + this.animateScrollX.onComplete($bind(this,this.animateScrollX_onComplete)); + this.refreshAnimateScrollXEndRatio(); + } + } else { + this.finishScrollX(); + } + } + if(scrollY != null) { + if(this.animateScrollY != null) { + motion_Actuate.stop(this.animateScrollY,null,false,false); + this.animateScrollY = null; + } + if(this._scrollY != scrollY) { + scrollChanged = true; + this.startScroll(); + if(duration == 0.0) { + this.set_scrollY(scrollY); + } else { + this.startScrollY = this._scrollY; + this.targetScrollY = scrollY; + var tween = motion_Actuate.update(function(scrollY) { + if(scrollY == null) { + scrollY = _gthis.targetScrollY; + } + return _gthis.set_scrollY(scrollY); + },duration,[this._scrollY],[this.targetScrollY],true); + this.animateScrollY = tween; + this.animateScrollY.ease(ease); + this.animateScrollY.onComplete($bind(this,this.animateScrollY_onComplete)); + this.refreshAnimateScrollYEndRatio(); + } + } else { + this.finishScrollY(); + } + } + if(scrollChanged && duration == 0.0) { + this.completeScroll(); + } + } + ,throwWithVelocity: function(velocityX,velocityY) { + var targetX = null; + var targetY = null; + if(velocityX != null) { + if(Math.abs(velocityX) <= feathers_utils_Scroller.MINIMUM_VELOCITY) { + this.finishScrollX(); + } else if(this.snapPositionsX != null) { + var _g = 0; + var _g1 = this.snapPositionsX.length; + while(_g < _g1) { + var i = _g++; + var posX = this.snapPositionsX[i]; + if(velocityX < 0.0) { + targetX = posX; + if(posX > this._scrollX) { + break; + } + } + if(velocityX > 0.0) { + targetX = i == 0 ? posX : this.snapPositionsX[i - 1]; + if(posX >= this._scrollX) { + break; + } + } + } + } else { + targetX = this._scrollX + this.calculateDistanceFromVelocity(velocityX); + } + } + if(velocityY != null) { + if(Math.abs(velocityY) <= feathers_utils_Scroller.MINIMUM_VELOCITY) { + this.finishScrollY(); + } else if(this.snapPositionsY != null) { + var _g = 0; + var _g1 = this.snapPositionsY.length; + while(_g < _g1) { + var i = _g++; + var posY = this.snapPositionsY[i]; + if(velocityY < 0.0) { + targetY = posY; + if(posY > this._scrollY) { + break; + } + } + if(velocityY > 0.0) { + targetY = i == 0 ? posY : this.snapPositionsY[i - 1]; + if(posY >= this._scrollY) { + break; + } + } + } + } else { + targetY = this._scrollY + this.calculateDistanceFromVelocity(velocityY); + } + } + this.throwTo(targetX,targetY,this._fixedThrowDuration); + } + ,calculateDistanceFromVelocity: function(velocity) { + return (velocity - feathers_utils_Scroller.MINIMUM_VELOCITY) / this._logDecelerationRate; + } + ,refreshAnimateScrollXEndRatio: function() { + var distance = Math.abs(this.targetScrollX - this.startScrollX); + var ratioOutOfBounds = 0.0; + if(this.targetScrollX > this._maxScrollX) { + ratioOutOfBounds = (this.targetScrollX - this._maxScrollX) / distance; + } else if(this.targetScrollX < this._minScrollX) { + ratioOutOfBounds = (this._minScrollX - this.targetScrollX) / distance; + } + if(ratioOutOfBounds > 0.0) { + if(this.elasticEdges) { + this.animateScrollXEndRatio = 1.0 - ratioOutOfBounds + ratioOutOfBounds * this.throwElasticity; + } else { + this.animateScrollXEndRatio = 1.0 - ratioOutOfBounds; + } + } else { + this.animateScrollXEndRatio = 1.0; + } + if(this.animateScrollX != null) { + if(this.animateScrollXEndRatio < 1.0) { + this.animateScrollX.onUpdate($bind(this,this.animateScrollX_endRatio_onUpdate)); + } else { + this.animateScrollX.onUpdate(null); + } + } + } + ,refreshAnimateScrollYEndRatio: function() { + var distance = Math.abs(this.targetScrollY - this.startScrollY); + var ratioOutOfBounds = 0.0; + if(this.targetScrollY > this._maxScrollY) { + ratioOutOfBounds = (this.targetScrollY - this._maxScrollY) / distance; + } else if(this.targetScrollY < this._minScrollY) { + ratioOutOfBounds = (this._minScrollY - this.targetScrollY) / distance; + } + if(ratioOutOfBounds > 0.0) { + if(this.elasticEdges) { + this.animateScrollYEndRatio = 1.0 - ratioOutOfBounds + ratioOutOfBounds * this.throwElasticity; + } else { + this.animateScrollYEndRatio = 1.0 - ratioOutOfBounds; + } + } else { + this.animateScrollYEndRatio = 1.0; + } + if(this.animateScrollY != null) { + if(this.animateScrollYEndRatio < 1.0) { + this.animateScrollY.onUpdate($bind(this,this.animateScrollY_endRatio_onUpdate)); + } else { + this.animateScrollY.onUpdate(null); + } + } + } + ,calculateMinAndMax: function() { + var oldMinScrollX = this._minScrollX; + var oldMaxScrollX = this._maxScrollX; + var oldMinScrollY = this._minScrollY; + var oldMaxScrollY = this._maxScrollY; + this._minScrollX = 0.0; + this._minScrollY = 0.0; + this._maxScrollX = Math.max(this._contentWidth,this._visibleWidth) - this._visibleWidth; + this._maxScrollY = Math.max(this._contentHeight,this._visibleHeight) - this._visibleHeight; + if(oldMinScrollX != this._minScrollX || oldMaxScrollX != this._maxScrollX) { + this.refreshAnimateScrollXEndRatio(); + } + if(oldMinScrollY != this._minScrollY || oldMaxScrollY != this._maxScrollY) { + this.refreshAnimateScrollYEndRatio(); + } + } + ,startScroll: function() { + if(this._scrolling) { + return; + } + this._scrolling = true; + if(((this._target) instanceof openfl_display_DisplayObjectContainer)) { + var container = this._target; + this.restoreMouseChildren = container.mouseChildren; + container.mouseChildren = false; + } + feathers_events_ScrollEvent.dispatch(this,"scrollStart",false,false,this._scrollX,this._scrollY); + } + ,completeScroll: function() { + if(!this._scrolling || this._draggingX || this._draggingY || this.animateScrollX != null || this.animateScrollY != null) { + return; + } + this._scrolling = false; + if(((this._target) instanceof openfl_display_DisplayObjectContainer)) { + var container = this._target; + container.mouseChildren = this.restoreMouseChildren; + } + feathers_events_ScrollEvent.dispatch(this,"scrollComplete",false,false,this._scrollX,this._scrollY); + } + ,finishScrollX: function() { + this._draggingX = false; + var targetScrollX = null; + if(this.snapPositionsX != null) { + var minOffsetX = Infinity; + var _g = 0; + var _g1 = this.snapPositionsX; + while(_g < _g1.length) { + var snapX = _g1[_g]; + ++_g; + var offsetX = Math.abs(snapX - this._scrollX); + if(minOffsetX > offsetX) { + minOffsetX = offsetX; + targetScrollX = snapX; + } + } + if(targetScrollX == this._scrollX) { + targetScrollX = null; + } + } + if(this._scrollX < this._minScrollX) { + targetScrollX = this._minScrollX; + } else if(this._scrollX > this._maxScrollX) { + targetScrollX = this._maxScrollX; + } + if(targetScrollX == null) { + this.completeScroll(); + } else { + var duration = Math.abs(this._scrollX - targetScrollX) >= 1.0 ? this.elasticSnapDuration : 0.0; + this.throwTo(targetScrollX,null,duration,this.bounceEase); + } + } + ,finishScrollY: function() { + this._draggingY = false; + var targetScrollY = null; + if(this.snapPositionsY != null) { + var minOffsetY = Infinity; + var _g = 0; + var _g1 = this.snapPositionsY; + while(_g < _g1.length) { + var snapY = _g1[_g]; + ++_g; + var offsetY = Math.abs(snapY - this._scrollY); + if(minOffsetY > offsetY) { + minOffsetY = offsetY; + targetScrollY = snapY; + } + } + if(targetScrollY == this._scrollY) { + targetScrollY = null; + } + } + if(this._scrollY < this._minScrollY) { + targetScrollY = this._minScrollY; + } else if(this._scrollY > this._maxScrollY) { + targetScrollY = this._maxScrollY; + } + if(targetScrollY == null) { + this.completeScroll(); + } else { + var duration = Math.abs(this._scrollY - targetScrollY) >= 1.0 ? this.elasticSnapDuration : 0.0; + this.throwTo(null,targetScrollY,duration,this.bounceEase); + } + } + ,animateScrollX_endRatio_onUpdate: function() { + var time = openfl_Lib.getTimer() / 1000.0; + var currentTime = time - this.animateScrollX.startTime; + var ratio = currentTime / this.animateScrollX.duration; + var ease = this.animateScrollX._ease; + if(ease != null) { + ratio = ease.calculate(ratio); + } + if(ratio >= this.animateScrollXEndRatio && currentTime < this.animateScrollX.duration) { + if(!this.elasticEdges) { + if(this._scrollX < this._minScrollX) { + this.set_scrollX(this._minScrollX); + } else if(this._scrollX > this._maxScrollX) { + this.set_scrollX(this._maxScrollX); + } + } + motion_Actuate.stop(this.animateScrollX,null,false,false); + this.animateScrollX = null; + this.finishScrollX(); + return; + } + } + ,animateScrollX_onComplete: function() { + this.animateScrollX = null; + this.finishScrollX(); + } + ,animateScrollY_endRatio_onUpdate: function() { + var time = openfl_Lib.getTimer() / 1000.0; + var currentTime = time - this.animateScrollY.startTime; + var ratio = currentTime / this.animateScrollY.duration; + var ease = this.animateScrollY._ease; + if(ease != null) { + ratio = ease.calculate(ratio); + } + if(ratio >= this.animateScrollYEndRatio && currentTime < this.animateScrollY.duration) { + if(!this.elasticEdges) { + if(this._scrollY < this._minScrollY) { + this.set_scrollY(this._minScrollY); + } else if(this._scrollY > this._maxScrollY) { + this.set_scrollY(this._maxScrollY); + } + } + motion_Actuate.stop(this.animateScrollY,null,false,false); + this.animateScrollY = null; + this.finishScrollY(); + return; + } + } + ,animateScrollY_onComplete: function() { + this.animateScrollY = null; + this.finishScrollY(); + } + ,cleanupAfterDrag: function() { + if(this._touchPointID == null) { + return; + } + this._previousTouchPointID = this._scrolling ? this._touchPointID : null; + this._touchPointID = null; + this._touchPointIsSimulated = false; + this._target.removeEventListener("removedFromStage",$bind(this,this.scroller_target_removedFromStageHandler)); + if(this._target.stage != null) { + this._target.stage.removeEventListener("mouseMove",$bind(this,this.scroller_target_stage_mouseMoveHandler)); + this._target.stage.removeEventListener("mouseUp",$bind(this,this.scroller_target_stage_mouseUpHandler)); + this._target.stage.removeEventListener("touchMove",$bind(this,this.scroller_target_stage_touchMoveHandler)); + this._target.stage.removeEventListener("touchEnd",$bind(this,this.scroller_target_stage_touchEndHandler)); + } + } + ,scroller_target_removedFromStageHandler: function(event) { + this.cleanupAfterDrag(); + } + ,touchBegin: function(touchPointID,simulatedTouch,stageX,stageY) { + if(simulatedTouch && !this.simulateTouch) { + return; + } + if(this._touchPointID != null) { + return; + } + if(this.animateScrollX != null) { + motion_Actuate.stop(this.animateScrollX,null,false,false); + this.animateScrollX = null; + } + if(this.animateScrollY != null) { + motion_Actuate.stop(this.animateScrollY,null,false,false); + this.animateScrollY = null; + } + this._target.addEventListener("removedFromStage",$bind(this,this.scroller_target_removedFromStageHandler),false,0,true); + this._target.stage.addEventListener("mouseMove",$bind(this,this.scroller_target_stage_mouseMoveHandler),false,0,true); + this._target.stage.addEventListener("mouseUp",$bind(this,this.scroller_target_stage_mouseUpHandler),false,0,true); + this._target.stage.addEventListener("touchMove",$bind(this,this.scroller_target_stage_touchMoveHandler),false,0,true); + this._target.stage.addEventListener("touchEnd",$bind(this,this.scroller_target_stage_touchEndHandler),false,0,true); + if(((this._target) instanceof openfl_display_DisplayObjectContainer)) { + var container = this._target; + if(this._scrolling) { + container.mouseChildren = false; + } + } + this._previousTouchPointID = null; + this._touchPointID = touchPointID; + this._touchPointIsSimulated = simulatedTouch; + this.startTouchX = stageX; + this.startTouchY = stageY; + this.startScrollX = this._scrollX; + this.startScrollY = this._scrollY; + this.savedScrollMoves.length = 0; + } + ,touchMove: function(touchPointID,simulatedTouch,stageX,stageY) { + if(this._touchPointID == null) { + return; + } + if(this._touchPointID != touchPointID) { + return; + } + if(this._touchPointIsSimulated != simulatedTouch) { + return; + } + var touchOffsetX = stageX - this.startTouchX; + var touchOffsetY = stageY - this.startTouchY; + var scaleX = 1.0; + var scaleY = 1.0; + var current = this._target; + while(current != current.stage) { + scaleX /= current.get_scaleX(); + scaleY /= current.get_scaleY(); + current = current.parent; + } + touchOffsetX *= scaleX; + touchOffsetY *= scaleY; + var canDragX = this.canDragX(); + var canDragY = this.canDragY(); + if(!this._draggingX && canDragX && Math.abs(touchOffsetX) > this.minDragDistance) { + this.startTouchX = stageX; + touchOffsetX = 0.0; + this._draggingX = true; + if(!this._draggingY) { + this.startScroll(); + if(this._touchPointID == null) { + return; + } + } + } + if(!this._draggingY && canDragY && Math.abs(touchOffsetY) > this.minDragDistance) { + this.startTouchY = stageY; + touchOffsetY = 0.0; + this._draggingY = true; + if(!this._draggingX) { + this.startScroll(); + if(this._touchPointID == null) { + return; + } + } + } + if(!this._draggingX && !this._draggingY) { + return; + } + var scrollX = this.startScrollX; + if(canDragX) { + scrollX -= touchOffsetX; + if(this.elasticEdges) { + var minElasticScrollX = this._minScrollX; + if(minElasticScrollX > this.startScrollX) { + minElasticScrollX = this.startScrollX; + } + var maxElasticScrollX = this._maxScrollX; + if(maxElasticScrollX < this.startScrollX) { + maxElasticScrollX = this.startScrollX; + } + if(scrollX < this._minScrollX) { + if(this._maxScrollX > this._minScrollX || this.forceElasticLeft) { + scrollX -= (scrollX - minElasticScrollX) * (1.0 - this.elasticity); + } else { + scrollX = this._minScrollX; + } + } else if(scrollX > this._maxScrollX) { + if(this._maxScrollX > this._minScrollX || this.forceElasticRight) { + scrollX -= (scrollX - maxElasticScrollX) * (1.0 - this.elasticity); + } else { + scrollX = this._maxScrollX; + } + } + } else if(scrollX < this._minScrollX) { + scrollX = this._minScrollX; + } else if(scrollX > this._maxScrollX) { + scrollX = this._maxScrollX; + } + } + var scrollY = this.startScrollY; + if(canDragY) { + scrollY -= touchOffsetY; + if(this.elasticEdges) { + var minElasticScrollY = this._minScrollY; + if(minElasticScrollY > this.startScrollY) { + minElasticScrollY = this.startScrollY; + } + var maxElasticScrollY = this._maxScrollY; + if(maxElasticScrollY < this.startScrollY) { + maxElasticScrollY = this.startScrollY; + } + if(scrollY < this._minScrollY) { + if(this._maxScrollY > this._minScrollY || this.forceElasticTop) { + scrollY -= (scrollY - minElasticScrollY) * (1.0 - this.elasticity); + } else { + scrollY = this._minScrollY; + } + } else if(scrollY > this._maxScrollY) { + if(this._maxScrollY > this._minScrollY || this.forceElasticBottom) { + scrollY -= (scrollY - maxElasticScrollY) * (1.0 - this.elasticity); + } else { + scrollY = this._maxScrollY; + } + } + } else if(scrollY < this._minScrollY) { + scrollY = this._minScrollY; + } else if(scrollY > this._maxScrollY) { + scrollY = this._maxScrollY; + } + } + this.set_scrollX(scrollX); + this.set_scrollY(scrollY); + if(this.savedScrollMoves.length > 60) { + this.savedScrollMoves.length = 30; + } + this.savedScrollMoves.push(scrollX); + this.savedScrollMoves.push(scrollY); + this.savedScrollMoves.push(openfl_Lib.getTimer()); + } + ,touchEnd: function(touchPointID,simulatedTouch) { + if(this._touchPointID == null) { + return; + } + if(this._touchPointID != touchPointID) { + return; + } + if(this._touchPointIsSimulated != simulatedTouch) { + return; + } + this.cleanupAfterDrag(); + var finishingX = !this.canDragX(); + var finishingY = !this.canDragY(); + if(this._scrollX < this._minScrollX || this._scrollX > this._maxScrollX) { + finishingX = true; + this.finishScrollX(); + } + if(this._scrollY < this._minScrollY || this._scrollY > this._maxScrollY) { + finishingY = true; + this.finishScrollY(); + } + if(finishingX && finishingY) { + return; + } + if(!this._draggingX && !this._draggingY) { + return; + } + var targetTime = openfl_Lib.getTimer() - 100; + var endIndex = this.savedScrollMoves.length - 1; + var startIndex = endIndex; + var i = endIndex; + while(endIndex > 0 && this.savedScrollMoves[i] > targetTime) { + startIndex = i; + i -= 3; + } + if(startIndex == endIndex) { + if(!finishingX && this._draggingX) { + this.finishScrollX(); + } + if(!finishingY && this._draggingY) { + this.finishScrollY(); + } + return; + } + var timeOffset = this.savedScrollMoves[endIndex] - this.savedScrollMoves[startIndex]; + var velocityX = null; + var velocityY = null; + if(timeOffset > 0.0) { + if(!finishingX && this._draggingX) { + var movedX = this._scrollX - this.savedScrollMoves[startIndex - 2]; + velocityX = -movedX / timeOffset; + } + if(!finishingY && this._draggingY) { + var movedY = this._scrollY - this.savedScrollMoves[startIndex - 1]; + velocityY = -movedY / timeOffset; + } + } + if(velocityX != null || velocityY != null) { + this.throwWithVelocity(velocityX,velocityY); + } + if(velocityX == null && this._draggingX) { + this.finishScrollX(); + } + if(velocityY == null && this._draggingY) { + this.finishScrollY(); + } + } + ,canDragX: function() { + if(this.enabledX) { + if(!(this._maxScrollX > this._minScrollX || this.forceElasticLeft)) { + return this.forceElasticRight; + } else { + return true; + } + } else { + return false; + } + } + ,canDragY: function() { + if(this.enabledY) { + if(!(this._maxScrollY > this._minScrollY || this.forceElasticTop)) { + return this.forceElasticBottom; + } else { + return true; + } + } else { + return false; + } + } + ,scroller_target_touchBeginCaptureHandler: function(event) { + if(!this._scrolling) { + return; + } + event.stopImmediatePropagation(); + this.scroller_target_touchBeginHandler(event); + } + ,scroller_target_touchBeginHandler: function(event) { + if(this.simulateTouch && event.isPrimaryTouchPoint) { + return; + } + this.touchBegin(event.touchPointID,false,event.stageX,event.stageY); + } + ,scroller_target_mouseDownCaptureHandler: function(event) { + if(!this._scrolling) { + return; + } + event.stopImmediatePropagation(); + this.scroller_target_mouseDownHandler(event); + } + ,scroller_target_mouseDownHandler: function(event) { + var stage = this._target.stage; + if(stage == null) { + return; + } + this.touchBegin(feathers_utils_Scroller.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY()); + } + ,scroller_target_stage_touchMoveHandler: function(event) { + this.touchMove(event.touchPointID,false,event.stageX,event.stageY); + } + ,scroller_target_stage_mouseMoveHandler: function(event) { + var stage = js_Boot.__cast(event.currentTarget , openfl_display_Stage); + this.touchMove(feathers_utils_Scroller.POINTER_ID_MOUSE,true,stage.get_mouseX(),stage.get_mouseY()); + } + ,scroller_target_stage_touchEndHandler: function(event) { + this.touchEnd(event.touchPointID,false); + } + ,scroller_target_clickCaptureHandler: function(event) { + if(this._previousTouchPointID == null) { + return; + } + this._previousTouchPointID = null; + event.stopImmediatePropagation(); + } + ,scroller_target_touchTapCaptureHandler: function(event) { + if(this._previousTouchPointID == null || this._previousTouchPointID != event.touchPointID) { + return; + } + if(event.isPrimaryTouchPoint) { + this._previousTouchPointID = feathers_utils_Scroller.POINTER_ID_MOUSE; + return; + } + this._previousTouchPointID = null; + event.stopImmediatePropagation(); + } + ,scroller_target_stage_mouseUpHandler: function(event) { + this.touchEnd(feathers_utils_Scroller.POINTER_ID_MOUSE,true); + } + ,scroller_window_wheelCaptureHandler: function(event) { + this._mouseWheelDeltaMode = event.deltaMode; + } + ,scroller_target_mouseWheelHandler: function(event) { + if(this._scrolling) { + event.stopImmediatePropagation(); + this.stop(); + } + var deltaLines = event.delta; + switch(this._mouseWheelDeltaMode) { + case 0: + if(deltaLines < 0) { + deltaLines = Math.min(-1.0,deltaLines / 40) | 0; + } else { + deltaLines = Math.max(1.0,deltaLines / 40) | 0; + } + break; + case 2: + deltaLines *= 16; + break; + } + var newScrollX = null; + var newScrollY = null; + if(this.mouseWheelYScrollsX) { + var targetScrollX = this._scrollX; + if(this.animateScrollX != null) { + targetScrollX = this.targetScrollX; + } + newScrollX = targetScrollX - deltaLines * this.mouseWheelDeltaX; + if(newScrollX < this._minScrollX) { + newScrollX = this._minScrollX; + } else if(newScrollX > this._maxScrollX) { + newScrollX = this._maxScrollX; + } + } else { + var targetScrollY = this._scrollY; + if(this.animateScrollY != null) { + targetScrollY = this.targetScrollY; + } + newScrollY = targetScrollY - deltaLines * this.mouseWheelDeltaY; + if(newScrollY < this._minScrollY) { + newScrollY = this._minScrollY; + } else if(newScrollY > this._maxScrollY) { + newScrollY = this._maxScrollY; + } + } + if((newScrollX == null || newScrollX == this._scrollX) && (newScrollY == null || newScrollY == this._scrollY)) { + return; + } + event.preventDefault(); + if(!this._scrolling) { + event.stopImmediatePropagation(); + this.stop(); + } + if(newScrollX != null) { + this._draggingX = true; + } + if(newScrollY != null) { + this._draggingY = true; + } + if(this.mouseWheelDuration > 0.0) { + this.throwTo(newScrollX,newScrollY,this.mouseWheelDuration,this.ease); + } else { + this.startScroll(); + if(newScrollX != null) { + this.set_scrollX(newScrollX); + } + if(newScrollY != null) { + this.set_scrollY(newScrollY); + } + this._draggingX = false; + this._draggingY = false; + this.completeScroll(); + } + } + ,__class__: feathers_utils_Scroller + ,__properties__: {get_touchPointIsSimulated:"get_touchPointIsSimulated",get_touchPointID:"get_touchPointID",set_target:"set_target",get_target:"get_target",set_decelerationRate:"set_decelerationRate",get_decelerationRate:"get_decelerationRate",get_draggingY:"get_draggingY",get_draggingX:"get_draggingX",get_scrolling:"get_scrolling",get_contentHeight:"get_contentHeight",get_contentWidth:"get_contentWidth",get_visibleHeight:"get_visibleHeight",get_visibleWidth:"get_visibleWidth",get_maxScrollY:"get_maxScrollY",get_maxScrollX:"get_maxScrollX",get_minScrollY:"get_minScrollY",get_minScrollX:"get_minScrollX",set_restrictedScrollY:"set_restrictedScrollY",get_restrictedScrollY:"get_restrictedScrollY",set_restrictedScrollX:"set_restrictedScrollX",get_restrictedScrollX:"get_restrictedScrollX",set_scrollY:"set_scrollY",get_scrollY:"get_scrollY",set_scrollX:"set_scrollX",get_scrollX:"get_scrollX"} +}); +var feathers_utils_TextFormatUtil = function() { }; +$hxClasses["feathers.utils.TextFormatUtil"] = feathers_utils_TextFormatUtil; +feathers_utils_TextFormatUtil.__name__ = "feathers.utils.TextFormatUtil"; +feathers_utils_TextFormatUtil.clone = function(original) { + var clone = new openfl_text_TextFormat(original.font,original.size,original.color,original.bold,original.italic,original.underline,original.url,original.target,original.align,original.leftMargin,original.rightMargin,original.indent,original.leading); + clone.blockIndent = original.blockIndent; + clone.bullet = original.bullet; + clone.kerning = original.kerning; + clone.letterSpacing = original.letterSpacing; + clone.tabStops = original.tabStops; + return clone; +}; +var haxe_StackItem = $hxEnums["haxe.StackItem"] = { __ename__:"haxe.StackItem",__constructs__:null + ,CFunction: {_hx_name:"CFunction",_hx_index:0,__enum__:"haxe.StackItem",toString:$estr} + ,Module: ($_=function(m) { return {_hx_index:1,m:m,__enum__:"haxe.StackItem",toString:$estr}; },$_._hx_name="Module",$_.__params__ = ["m"],$_) + ,FilePos: ($_=function(s,file,line,column) { return {_hx_index:2,s:s,file:file,line:line,column:column,__enum__:"haxe.StackItem",toString:$estr}; },$_._hx_name="FilePos",$_.__params__ = ["s","file","line","column"],$_) + ,Method: ($_=function(classname,method) { return {_hx_index:3,classname:classname,method:method,__enum__:"haxe.StackItem",toString:$estr}; },$_._hx_name="Method",$_.__params__ = ["classname","method"],$_) + ,LocalFunction: ($_=function(v) { return {_hx_index:4,v:v,__enum__:"haxe.StackItem",toString:$estr}; },$_._hx_name="LocalFunction",$_.__params__ = ["v"],$_) +}; +haxe_StackItem.__constructs__ = [haxe_StackItem.CFunction,haxe_StackItem.Module,haxe_StackItem.FilePos,haxe_StackItem.Method,haxe_StackItem.LocalFunction]; +var haxe_CallStack = {}; +haxe_CallStack.callStack = function() { + return haxe_NativeStackTrace.toHaxe(haxe_NativeStackTrace.callStack()); +}; +haxe_CallStack.exceptionStack = function(fullStack) { + if(fullStack == null) { + fullStack = false; + } + var eStack = haxe_NativeStackTrace.toHaxe(haxe_NativeStackTrace.exceptionStack()); + return fullStack ? eStack : haxe_CallStack.subtract(eStack,haxe_CallStack.callStack()); +}; +haxe_CallStack.toString = function(stack) { + var b = new StringBuf(); + var _g = 0; + var _g1 = stack; + while(_g < _g1.length) { + var s = _g1[_g]; + ++_g; + b.b += "\nCalled from "; + haxe_CallStack.itemToString(b,s); + } + return b.b; +}; +haxe_CallStack.subtract = function(this1,stack) { + var startIndex = -1; + var i = -1; + while(++i < this1.length) { + var _g = 0; + var _g1 = stack.length; + while(_g < _g1) { + var j = _g++; + if(haxe_CallStack.equalItems(this1[i],stack[j])) { + if(startIndex < 0) { + startIndex = i; + } + ++i; + if(i >= this1.length) { + break; + } + } else { + startIndex = -1; + } + } + if(startIndex >= 0) { + break; + } + } + if(startIndex >= 0) { + return this1.slice(0,startIndex); + } else { + return this1; + } +}; +haxe_CallStack.equalItems = function(item1,item2) { + if(item1 == null) { + if(item2 == null) { + return true; + } else { + return false; + } + } else { + switch(item1._hx_index) { + case 0: + if(item2 == null) { + return false; + } else if(item2._hx_index == 0) { + return true; + } else { + return false; + } + break; + case 1: + if(item2 == null) { + return false; + } else if(item2._hx_index == 1) { + var m2 = item2.m; + var m1 = item1.m; + return m1 == m2; + } else { + return false; + } + break; + case 2: + if(item2 == null) { + return false; + } else if(item2._hx_index == 2) { + var item21 = item2.s; + var file2 = item2.file; + var line2 = item2.line; + var col2 = item2.column; + var col1 = item1.column; + var line1 = item1.line; + var file1 = item1.file; + var item11 = item1.s; + if(file1 == file2 && line1 == line2 && col1 == col2) { + return haxe_CallStack.equalItems(item11,item21); + } else { + return false; + } + } else { + return false; + } + break; + case 3: + if(item2 == null) { + return false; + } else if(item2._hx_index == 3) { + var class2 = item2.classname; + var method2 = item2.method; + var method1 = item1.method; + var class1 = item1.classname; + if(class1 == class2) { + return method1 == method2; + } else { + return false; + } + } else { + return false; + } + break; + case 4: + if(item2 == null) { + return false; + } else if(item2._hx_index == 4) { + var v2 = item2.v; + var v1 = item1.v; + return v1 == v2; + } else { + return false; + } + break; + } + } +}; +haxe_CallStack.itemToString = function(b,s) { + switch(s._hx_index) { + case 0: + b.b += "a C function"; + break; + case 1: + var m = s.m; + b.b += "module "; + b.b += m == null ? "null" : "" + m; + break; + case 2: + var s1 = s.s; + var file = s.file; + var line = s.line; + var col = s.column; + if(s1 != null) { + haxe_CallStack.itemToString(b,s1); + b.b += " ("; + } + b.b += file == null ? "null" : "" + file; + b.b += " line "; + b.b += line == null ? "null" : "" + line; + if(col != null) { + b.b += " column "; + b.b += col == null ? "null" : "" + col; + } + if(s1 != null) { + b.b += ")"; + } + break; + case 3: + var cname = s.classname; + var meth = s.method; + b.b += Std.string(cname == null ? "" : cname); + b.b += "."; + b.b += meth == null ? "null" : "" + meth; + break; + case 4: + var n = s.v; + b.b += "local function #"; + b.b += n == null ? "null" : "" + n; + break; + } +}; +var haxe_Exception = function(message,previous,native) { + Error.call(this,message); + this.message = message; + this.__previousException = previous; + this.__nativeException = native != null ? native : this; + this.__skipStack = 0; + var old = Error.prepareStackTrace; + Error.prepareStackTrace = function(e) { return e.stack; } + if(((native) instanceof Error)) { + this.stack = native.stack; + } else { + var e = null; + if(Error.captureStackTrace) { + Error.captureStackTrace(this,haxe_Exception); + e = this; + } else { + e = new Error(); + if(typeof(e.stack) == "undefined") { + try { throw e; } catch(_) {} + this.__skipStack++; + } + } + this.stack = e.stack; + } + Error.prepareStackTrace = old; +}; +$hxClasses["haxe.Exception"] = haxe_Exception; +haxe_Exception.__name__ = "haxe.Exception"; +haxe_Exception.caught = function(value) { + if(((value) instanceof haxe_Exception)) { + return value; + } else if(((value) instanceof Error)) { + return new haxe_Exception(value.message,null,value); + } else { + return new haxe_ValueException(value,null,value); + } +}; +haxe_Exception.thrown = function(value) { + if(((value) instanceof haxe_Exception)) { + return value.get_native(); + } else if(((value) instanceof Error)) { + return value; + } else { + var e = new haxe_ValueException(value); + e.__skipStack++; + return e; + } +}; +haxe_Exception.__super__ = Error; +haxe_Exception.prototype = $extend(Error.prototype,{ + unwrap: function() { + return this.__nativeException; + } + ,toString: function() { + return this.get_message(); + } + ,__shiftStack: function() { + this.__skipStack++; + } + ,get_message: function() { + return this.message; + } + ,get_native: function() { + return this.__nativeException; + } + ,get_stack: function() { + var _g = this.__exceptionStack; + if(_g == null) { + var value = haxe_NativeStackTrace.toHaxe(haxe_NativeStackTrace.normalize(this.stack),this.__skipStack); + this.setProperty("__exceptionStack",value); + return value; + } else { + var s = _g; + return s; + } + } + ,setProperty: function(name,value) { + try { + Object.defineProperty(this,name,{ value : value}); + } catch( _g ) { + this[name] = value; + } + } + ,__class__: haxe_Exception + ,__properties__: {get_native:"get_native",get_stack:"get_stack",get_message:"get_message"} +}); +var haxe__$Int64__$_$_$Int64 = function(high,low) { + this.high = high; + this.low = low; +}; +$hxClasses["haxe._Int64.___Int64"] = haxe__$Int64__$_$_$Int64; +haxe__$Int64__$_$_$Int64.__name__ = "haxe._Int64.___Int64"; +haxe__$Int64__$_$_$Int64.prototype = { + __class__: haxe__$Int64__$_$_$Int64 +}; +var haxe_Log = function() { }; +$hxClasses["haxe.Log"] = haxe_Log; +haxe_Log.__name__ = "haxe.Log"; +haxe_Log.formatOutput = function(v,infos) { + var str = Std.string(v); + if(infos == null) { + return str; + } + var pstr = infos.fileName + ":" + infos.lineNumber; + if(infos.customParams != null) { + var _g = 0; + var _g1 = infos.customParams; + while(_g < _g1.length) { + var v = _g1[_g]; + ++_g; + str += ", " + Std.string(v); + } + } + return pstr + ": " + str; +}; +haxe_Log.trace = function(v,infos) { + var str = haxe_Log.formatOutput(v,infos); + if(typeof(console) != "undefined" && console.log != null) { + console.log(str); + } +}; +var haxe_NativeStackTrace = function() { }; +$hxClasses["haxe.NativeStackTrace"] = haxe_NativeStackTrace; +haxe_NativeStackTrace.__name__ = "haxe.NativeStackTrace"; +haxe_NativeStackTrace.saveStack = function(e) { + haxe_NativeStackTrace.lastError = e; +}; +haxe_NativeStackTrace.callStack = function() { + var e = new Error(""); + var stack = haxe_NativeStackTrace.tryHaxeStack(e); + if(typeof(stack) == "undefined") { + try { + throw e; + } catch( _g ) { + } + stack = e.stack; + } + return haxe_NativeStackTrace.normalize(stack,2); +}; +haxe_NativeStackTrace.exceptionStack = function() { + return haxe_NativeStackTrace.normalize(haxe_NativeStackTrace.tryHaxeStack(haxe_NativeStackTrace.lastError)); +}; +haxe_NativeStackTrace.toHaxe = function(s,skip) { + if(skip == null) { + skip = 0; + } + if(s == null) { + return []; + } else if(typeof(s) == "string") { + var stack = s.split("\n"); + if(stack[0] == "Error") { + stack.shift(); + } + var m = []; + var _g = 0; + var _g1 = stack.length; + while(_g < _g1) { + var i = _g++; + if(skip > i) { + continue; + } + var line = stack[i]; + var matched = line.match(/^ at ([$A-Za-z0-9_. ]+) \(([^)]+):([0-9]+):([0-9]+)\)$/); + if(matched != null) { + var path = matched[1].split("."); + if(path[0] == "$hxClasses") { + path.shift(); + } + var meth = path.pop(); + var file = matched[2]; + var line1 = Std.parseInt(matched[3]); + var column = Std.parseInt(matched[4]); + m.push(haxe_StackItem.FilePos(meth == "Anonymous function" ? haxe_StackItem.LocalFunction() : meth == "Global code" ? null : haxe_StackItem.Method(path.join("."),meth),file,line1,column)); + } else { + m.push(haxe_StackItem.Module(StringTools.trim(line))); + } + } + return m; + } else if(skip > 0 && Array.isArray(s)) { + return s.slice(skip); + } else { + return s; + } +}; +haxe_NativeStackTrace.tryHaxeStack = function(e) { + if(e == null) { + return []; + } + var oldValue = Error.prepareStackTrace; + Error.prepareStackTrace = haxe_NativeStackTrace.prepareHxStackTrace; + var stack = e.stack; + Error.prepareStackTrace = oldValue; + return stack; +}; +haxe_NativeStackTrace.prepareHxStackTrace = function(e,callsites) { + var stack = []; + var _g = 0; + while(_g < callsites.length) { + var site = callsites[_g]; + ++_g; + if(haxe_NativeStackTrace.wrapCallSite != null) { + site = haxe_NativeStackTrace.wrapCallSite(site); + } + var method = null; + var fullName = site.getFunctionName(); + if(fullName != null) { + var idx = fullName.lastIndexOf("."); + if(idx >= 0) { + var className = fullName.substring(0,idx); + var methodName = fullName.substring(idx + 1); + method = haxe_StackItem.Method(className,methodName); + } else { + method = haxe_StackItem.Method(null,fullName); + } + } + var fileName = site.getFileName(); + var fileAddr = fileName == null ? -1 : fileName.indexOf("file:"); + if(haxe_NativeStackTrace.wrapCallSite != null && fileAddr > 0) { + fileName = fileName.substring(fileAddr + 6); + } + stack.push(haxe_StackItem.FilePos(method,fileName,site.getLineNumber(),site.getColumnNumber())); + } + return stack; +}; +haxe_NativeStackTrace.normalize = function(stack,skipItems) { + if(skipItems == null) { + skipItems = 0; + } + if(Array.isArray(stack) && skipItems > 0) { + return stack.slice(skipItems); + } else if(typeof(stack) == "string") { + switch(stack.substring(0,6)) { + case "Error\n":case "Error:": + ++skipItems; + break; + default: + } + return haxe_NativeStackTrace.skipLines(stack,skipItems); + } else { + return stack; + } +}; +haxe_NativeStackTrace.skipLines = function(stack,skip,pos) { + if(pos == null) { + pos = 0; + } + if(skip > 0) { + pos = stack.indexOf("\n",pos); + if(pos < 0) { + return ""; + } else { + return haxe_NativeStackTrace.skipLines(stack,--skip,pos + 1); + } + } else { + return stack.substring(pos); + } +}; +var haxe_Serializer = function() { + this.buf = new StringBuf(); + this.cache = []; + this.useCache = haxe_Serializer.USE_CACHE; + this.useEnumIndex = haxe_Serializer.USE_ENUM_INDEX; + this.shash = new haxe_ds_StringMap(); + this.scount = 0; +}; +$hxClasses["haxe.Serializer"] = haxe_Serializer; +haxe_Serializer.__name__ = "haxe.Serializer"; +haxe_Serializer.run = function(v) { + var s = new haxe_Serializer(); + s.serialize(v); + return s.toString(); +}; +haxe_Serializer.prototype = { + toString: function() { + return this.buf.b; + } + ,serializeString: function(s) { + var x = this.shash.h[s]; + if(x != null) { + this.buf.b += "R"; + this.buf.b += x == null ? "null" : "" + x; + return; + } + this.shash.h[s] = this.scount++; + this.buf.b += "y"; + s = encodeURIComponent(s); + this.buf.b += Std.string(s.length); + this.buf.b += ":"; + this.buf.b += s == null ? "null" : "" + s; + } + ,serializeRef: function(v) { + var vt = typeof(v); + var _g = 0; + var _g1 = this.cache.length; + while(_g < _g1) { + var i = _g++; + var ci = this.cache[i]; + if(typeof(ci) == vt && ci == v) { + this.buf.b += "r"; + this.buf.b += i == null ? "null" : "" + i; + return true; + } + } + this.cache.push(v); + return false; + } + ,serializeFields: function(v) { + var _g = 0; + var _g1 = Reflect.fields(v); + while(_g < _g1.length) { + var f = _g1[_g]; + ++_g; + this.serializeString(f); + this.serialize(Reflect.field(v,f)); + } + this.buf.b += "g"; + } + ,serialize: function(v) { + var _g = Type.typeof(v); + switch(_g._hx_index) { + case 0: + this.buf.b += "n"; + break; + case 1: + var v1 = v; + if(v1 == 0) { + this.buf.b += "z"; + return; + } + this.buf.b += "i"; + this.buf.b += v1 == null ? "null" : "" + v1; + break; + case 2: + var v1 = v; + if(isNaN(v1)) { + this.buf.b += "k"; + } else if(!isFinite(v1)) { + this.buf.b += v1 < 0 ? "m" : "p"; + } else { + this.buf.b += "d"; + this.buf.b += v1 == null ? "null" : "" + v1; + } + break; + case 3: + this.buf.b += v ? "t" : "f"; + break; + case 4: + if(js_Boot.__instanceof(v,Class)) { + var className = v.__name__; + this.buf.b += "A"; + this.serializeString(className); + } else if(js_Boot.__instanceof(v,Enum)) { + this.buf.b += "B"; + this.serializeString(v.__ename__); + } else { + if(this.useCache && this.serializeRef(v)) { + return; + } + this.buf.b += "o"; + this.serializeFields(v); + } + break; + case 5: + throw haxe_Exception.thrown("Cannot serialize function"); + case 6: + var c = _g.c; + if(c == String) { + this.serializeString(v); + return; + } + if(this.useCache && this.serializeRef(v)) { + return; + } + switch(c) { + case Array: + var ucount = 0; + this.buf.b += "a"; + var l = v["length"]; + var _g1 = 0; + var _g2 = l; + while(_g1 < _g2) { + var i = _g1++; + if(v[i] == null) { + ++ucount; + } else { + if(ucount > 0) { + if(ucount == 1) { + this.buf.b += "n"; + } else { + this.buf.b += "u"; + this.buf.b += ucount == null ? "null" : "" + ucount; + } + ucount = 0; + } + this.serialize(v[i]); + } + } + if(ucount > 0) { + if(ucount == 1) { + this.buf.b += "n"; + } else { + this.buf.b += "u"; + this.buf.b += ucount == null ? "null" : "" + ucount; + } + } + this.buf.b += "h"; + break; + case Date: + var d = v; + this.buf.b += "v"; + this.buf.b += Std.string(d.getTime()); + break; + case haxe_ds_IntMap: + this.buf.b += "q"; + var v1 = v; + var k = v1.keys(); + while(k.hasNext()) { + var k1 = k.next(); + this.buf.b += ":"; + this.buf.b += k1 == null ? "null" : "" + k1; + this.serialize(v1.h[k1]); + } + this.buf.b += "h"; + break; + case haxe_ds_List: + this.buf.b += "l"; + var v1 = v; + var _g_head = v1.h; + while(_g_head != null) { + var val = _g_head.item; + _g_head = _g_head.next; + var i = val; + this.serialize(i); + } + this.buf.b += "h"; + break; + case haxe_ds_ObjectMap: + this.buf.b += "M"; + var v1 = v; + var k = v1.keys(); + while(k.hasNext()) { + var k1 = k.next(); + var id = Reflect.field(k1,"__id__"); + Reflect.deleteField(k1,"__id__"); + this.serialize(k1); + k1["__id__"] = id; + this.serialize(v1.h[k1.__id__]); + } + this.buf.b += "h"; + break; + case haxe_ds_StringMap: + this.buf.b += "b"; + var v1 = v; + var h = v1.h; + var _g_h = h; + var _g_keys = Object.keys(h); + var _g_length = _g_keys.length; + var _g_current = 0; + while(_g_current < _g_length) { + var k = _g_keys[_g_current++]; + this.serializeString(k); + this.serialize(v1.h[k]); + } + this.buf.b += "h"; + break; + case haxe_io_Bytes: + var v1 = v; + this.buf.b += "s"; + this.buf.b += Std.string(Math.ceil(v1.length * 8 / 6)); + this.buf.b += ":"; + var i = 0; + var max = v1.length - 2; + var b64 = haxe_Serializer.BASE64_CODES; + if(b64 == null) { + b64 = new Array(haxe_Serializer.BASE64.length); + var _g1 = 0; + var _g2 = haxe_Serializer.BASE64.length; + while(_g1 < _g2) { + var i1 = _g1++; + b64[i1] = HxOverrides.cca(haxe_Serializer.BASE64,i1); + } + haxe_Serializer.BASE64_CODES = b64; + } + while(i < max) { + var b1 = v1.b[i++]; + var b2 = v1.b[i++]; + var b3 = v1.b[i++]; + this.buf.b += String.fromCodePoint(b64[b1 >> 2]); + this.buf.b += String.fromCodePoint(b64[(b1 << 4 | b2 >> 4) & 63]); + this.buf.b += String.fromCodePoint(b64[(b2 << 2 | b3 >> 6) & 63]); + this.buf.b += String.fromCodePoint(b64[b3 & 63]); + } + if(i == max) { + var b1 = v1.b[i++]; + var b2 = v1.b[i++]; + this.buf.b += String.fromCodePoint(b64[b1 >> 2]); + this.buf.b += String.fromCodePoint(b64[(b1 << 4 | b2 >> 4) & 63]); + this.buf.b += String.fromCodePoint(b64[b2 << 2 & 63]); + } else if(i == max + 1) { + var b1 = v1.b[i++]; + this.buf.b += String.fromCodePoint(b64[b1 >> 2]); + this.buf.b += String.fromCodePoint(b64[b1 << 4 & 63]); + } + break; + default: + if(this.useCache) { + this.cache.pop(); + } + if(v.hxSerialize != null) { + this.buf.b += "C"; + this.serializeString(c.__name__); + if(this.useCache) { + this.cache.push(v); + } + v.hxSerialize(this); + this.buf.b += "g"; + } else { + this.buf.b += "c"; + this.serializeString(c.__name__); + if(this.useCache) { + this.cache.push(v); + } + this.serializeFields(v); + } + } + break; + case 7: + var e = _g.e; + if(this.useCache) { + if(this.serializeRef(v)) { + return; + } + this.cache.pop(); + } + this.buf.b += Std.string(this.useEnumIndex ? "j" : "w"); + this.serializeString(e.__ename__); + if(this.useEnumIndex) { + this.buf.b += ":"; + this.buf.b += Std.string(v._hx_index); + } else { + var e = v; + this.serializeString($hxEnums[e.__enum__].__constructs__[e._hx_index]._hx_name); + } + this.buf.b += ":"; + var params = Type.enumParameters(v); + this.buf.b += Std.string(params.length); + var _g = 0; + while(_g < params.length) { + var p = params[_g]; + ++_g; + this.serialize(p); + } + if(this.useCache) { + this.cache.push(v); + } + break; + default: + throw haxe_Exception.thrown("Cannot serialize " + Std.string(v)); + } + } + ,__class__: haxe_Serializer +}; +var haxe_Timer = function(time_ms) { + var me = this; + this.id = setInterval(function() { + me.run(); + },time_ms); +}; +$hxClasses["haxe.Timer"] = haxe_Timer; +haxe_Timer.__name__ = "haxe.Timer"; +haxe_Timer.delay = function(f,time_ms) { + var t = new haxe_Timer(time_ms); + t.run = function() { + t.stop(); + f(); + }; + return t; +}; +haxe_Timer.measure = function(f,pos) { + var t0 = new Date().getTime() / 1000; + var r = f(); + haxe_Log.trace(new Date().getTime() / 1000 - t0 + "s",pos); + return r; +}; +haxe_Timer.stamp = function() { + return new Date().getTime() / 1000; +}; +haxe_Timer.prototype = { + stop: function() { + if(this.id == null) { + return; + } + clearInterval(this.id); + this.id = null; + } + ,run: function() { + } + ,__class__: haxe_Timer +}; +var haxe__$Unserializer_DefaultResolver = function() { +}; +$hxClasses["haxe._Unserializer.DefaultResolver"] = haxe__$Unserializer_DefaultResolver; +haxe__$Unserializer_DefaultResolver.__name__ = "haxe._Unserializer.DefaultResolver"; +haxe__$Unserializer_DefaultResolver.prototype = { + resolveClass: function(name) { + return $hxClasses[name]; + } + ,resolveEnum: function(name) { + return $hxEnums[name]; + } + ,__class__: haxe__$Unserializer_DefaultResolver +}; +var haxe_Unserializer = function(buf) { + this.buf = buf; + this.length = this.buf.length; + this.pos = 0; + this.scache = []; + this.cache = []; + var r = haxe_Unserializer.DEFAULT_RESOLVER; + if(r == null) { + r = new haxe__$Unserializer_DefaultResolver(); + haxe_Unserializer.DEFAULT_RESOLVER = r; + } + this.resolver = r; +}; +$hxClasses["haxe.Unserializer"] = haxe_Unserializer; +haxe_Unserializer.__name__ = "haxe.Unserializer"; +haxe_Unserializer.initCodes = function() { + var codes = []; + var _g = 0; + var _g1 = haxe_Unserializer.BASE64.length; + while(_g < _g1) { + var i = _g++; + codes[haxe_Unserializer.BASE64.charCodeAt(i)] = i; + } + return codes; +}; +haxe_Unserializer.run = function(v) { + return new haxe_Unserializer(v).unserialize(); +}; +haxe_Unserializer.prototype = { + readDigits: function() { + var k = 0; + var s = false; + var fpos = this.pos; + while(true) { + var c = this.buf.charCodeAt(this.pos); + if(c != c) { + break; + } + if(c == 45) { + if(this.pos != fpos) { + break; + } + s = true; + this.pos++; + continue; + } + if(c < 48 || c > 57) { + break; + } + k = k * 10 + (c - 48); + this.pos++; + } + if(s) { + k *= -1; + } + return k; + } + ,readFloat: function() { + var p1 = this.pos; + while(true) { + var c = this.buf.charCodeAt(this.pos); + if(c != c) { + break; + } + if(c >= 43 && c < 58 || c == 101 || c == 69) { + this.pos++; + } else { + break; + } + } + return parseFloat(HxOverrides.substr(this.buf,p1,this.pos - p1)); + } + ,unserializeObject: function(o) { + while(true) { + if(this.pos >= this.length) { + throw haxe_Exception.thrown("Invalid object"); + } + if(this.buf.charCodeAt(this.pos) == 103) { + break; + } + var k = this.unserialize(); + if(typeof(k) != "string") { + throw haxe_Exception.thrown("Invalid object key"); + } + var v = this.unserialize(); + o[k] = v; + } + this.pos++; + } + ,unserializeEnum: function(edecl,tag) { + if(this.buf.charCodeAt(this.pos++) != 58) { + throw haxe_Exception.thrown("Invalid enum format"); + } + var nargs = this.readDigits(); + if(nargs == 0) { + return Type.createEnum(edecl,tag); + } + var args = []; + while(nargs-- > 0) args.push(this.unserialize()); + return Type.createEnum(edecl,tag,args); + } + ,unserialize: function() { + switch(this.buf.charCodeAt(this.pos++)) { + case 65: + var name = this.unserialize(); + var cl = this.resolver.resolveClass(name); + if(cl == null) { + throw haxe_Exception.thrown("Class not found " + name); + } + return cl; + case 66: + var name = this.unserialize(); + var e = this.resolver.resolveEnum(name); + if(e == null) { + throw haxe_Exception.thrown("Enum not found " + name); + } + return e; + case 67: + var name = this.unserialize(); + var cl = this.resolver.resolveClass(name); + if(cl == null) { + throw haxe_Exception.thrown("Class not found " + name); + } + var o = Object.create(cl.prototype); + this.cache.push(o); + o.hxUnserialize(this); + if(this.buf.charCodeAt(this.pos++) != 103) { + throw haxe_Exception.thrown("Invalid custom data"); + } + return o; + case 77: + var h = new haxe_ds_ObjectMap(); + this.cache.push(h); + var buf = this.buf; + while(this.buf.charCodeAt(this.pos) != 104) { + var s = this.unserialize(); + h.set(s,this.unserialize()); + } + this.pos++; + return h; + case 82: + var n = this.readDigits(); + if(n < 0 || n >= this.scache.length) { + throw haxe_Exception.thrown("Invalid string reference"); + } + return this.scache[n]; + case 97: + var buf = this.buf; + var a = []; + this.cache.push(a); + while(true) { + var c = this.buf.charCodeAt(this.pos); + if(c == 104) { + this.pos++; + break; + } + if(c == 117) { + this.pos++; + var n = this.readDigits(); + a[a.length + n - 1] = null; + } else { + a.push(this.unserialize()); + } + } + return a; + case 98: + var h = new haxe_ds_StringMap(); + this.cache.push(h); + var buf = this.buf; + while(this.buf.charCodeAt(this.pos) != 104) { + var s = this.unserialize(); + var value = this.unserialize(); + h.h[s] = value; + } + this.pos++; + return h; + case 99: + var name = this.unserialize(); + var cl = this.resolver.resolveClass(name); + if(cl == null) { + throw haxe_Exception.thrown("Class not found " + name); + } + var o = Object.create(cl.prototype); + this.cache.push(o); + this.unserializeObject(o); + return o; + case 100: + return this.readFloat(); + case 102: + return false; + case 105: + return this.readDigits(); + case 106: + var name = this.unserialize(); + var edecl = this.resolver.resolveEnum(name); + if(edecl == null) { + throw haxe_Exception.thrown("Enum not found " + name); + } + this.pos++; + var index = this.readDigits(); + var _this = edecl.__constructs__; + var result = new Array(_this.length); + var _g = 0; + var _g1 = _this.length; + while(_g < _g1) { + var i = _g++; + result[i] = _this[i]._hx_name; + } + var tag = result[index]; + if(tag == null) { + throw haxe_Exception.thrown("Unknown enum index " + name + "@" + index); + } + var e = this.unserializeEnum(edecl,tag); + this.cache.push(e); + return e; + case 107: + return NaN; + case 108: + var l = new haxe_ds_List(); + this.cache.push(l); + var buf = this.buf; + while(this.buf.charCodeAt(this.pos) != 104) l.add(this.unserialize()); + this.pos++; + return l; + case 109: + return -Infinity; + case 110: + return null; + case 111: + var o = { }; + this.cache.push(o); + this.unserializeObject(o); + return o; + case 112: + return Infinity; + case 113: + var h = new haxe_ds_IntMap(); + this.cache.push(h); + var buf = this.buf; + var c = this.buf.charCodeAt(this.pos++); + while(c == 58) { + var i = this.readDigits(); + var value = this.unserialize(); + h.h[i] = value; + c = this.buf.charCodeAt(this.pos++); + } + if(c != 104) { + throw haxe_Exception.thrown("Invalid IntMap format"); + } + return h; + case 114: + var n = this.readDigits(); + if(n < 0 || n >= this.cache.length) { + throw haxe_Exception.thrown("Invalid reference"); + } + return this.cache[n]; + case 115: + var len = this.readDigits(); + var buf = this.buf; + if(this.buf.charCodeAt(this.pos++) != 58 || this.length - this.pos < len) { + throw haxe_Exception.thrown("Invalid bytes length"); + } + var codes = haxe_Unserializer.CODES; + if(codes == null) { + codes = haxe_Unserializer.initCodes(); + haxe_Unserializer.CODES = codes; + } + var i = this.pos; + var rest = len & 3; + var size = (len >> 2) * 3 + (rest >= 2 ? rest - 1 : 0); + var max = i + (len - rest); + var bytes = new haxe_io_Bytes(new ArrayBuffer(size)); + var bpos = 0; + while(i < max) { + var c1 = codes[buf.charCodeAt(i++)]; + var c2 = codes[buf.charCodeAt(i++)]; + bytes.b[bpos++] = (c1 << 2 | c2 >> 4) & 255; + var c3 = codes[buf.charCodeAt(i++)]; + bytes.b[bpos++] = (c2 << 4 | c3 >> 2) & 255; + var c4 = codes[buf.charCodeAt(i++)]; + bytes.b[bpos++] = (c3 << 6 | c4) & 255; + } + if(rest >= 2) { + var c1 = codes[buf.charCodeAt(i++)]; + var c2 = codes[buf.charCodeAt(i++)]; + bytes.b[bpos++] = (c1 << 2 | c2 >> 4) & 255; + if(rest == 3) { + var c3 = codes[buf.charCodeAt(i++)]; + bytes.b[bpos++] = (c2 << 4 | c3 >> 2) & 255; + } + } + this.pos += len; + this.cache.push(bytes); + return bytes; + case 116: + return true; + case 118: + var d; + if(this.buf.charCodeAt(this.pos) >= 48 && this.buf.charCodeAt(this.pos) <= 57 && this.buf.charCodeAt(this.pos + 1) >= 48 && this.buf.charCodeAt(this.pos + 1) <= 57 && this.buf.charCodeAt(this.pos + 2) >= 48 && this.buf.charCodeAt(this.pos + 2) <= 57 && this.buf.charCodeAt(this.pos + 3) >= 48 && this.buf.charCodeAt(this.pos + 3) <= 57 && this.buf.charCodeAt(this.pos + 4) == 45) { + d = HxOverrides.strDate(HxOverrides.substr(this.buf,this.pos,19)); + this.pos += 19; + } else { + d = new Date(this.readFloat()); + } + this.cache.push(d); + return d; + case 119: + var name = this.unserialize(); + var edecl = this.resolver.resolveEnum(name); + if(edecl == null) { + throw haxe_Exception.thrown("Enum not found " + name); + } + var e = this.unserializeEnum(edecl,this.unserialize()); + this.cache.push(e); + return e; + case 120: + throw haxe_Exception.thrown(this.unserialize()); + case 121: + var len = this.readDigits(); + if(this.buf.charCodeAt(this.pos++) != 58 || this.length - this.pos < len) { + throw haxe_Exception.thrown("Invalid string length"); + } + var s = HxOverrides.substr(this.buf,this.pos,len); + this.pos += len; + s = decodeURIComponent(s.split("+").join(" ")); + this.scache.push(s); + return s; + case 122: + return 0; + default: + } + this.pos--; + throw haxe_Exception.thrown("Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos); + } + ,__class__: haxe_Unserializer +}; +var haxe_ValueException = function(value,previous,native) { + haxe_Exception.call(this,String(value),previous,native); + this.value = value; + this.__skipStack++; +}; +$hxClasses["haxe.ValueException"] = haxe_ValueException; +haxe_ValueException.__name__ = "haxe.ValueException"; +haxe_ValueException.__super__ = haxe_Exception; +haxe_ValueException.prototype = $extend(haxe_Exception.prototype,{ + unwrap: function() { + return this.value; + } + ,__class__: haxe_ValueException +}); +var haxe_crypto_Adler32 = function() { + this.a1 = 1; + this.a2 = 0; +}; +$hxClasses["haxe.crypto.Adler32"] = haxe_crypto_Adler32; +haxe_crypto_Adler32.__name__ = "haxe.crypto.Adler32"; +haxe_crypto_Adler32.read = function(i) { + var a = new haxe_crypto_Adler32(); + var a2a = i.readByte(); + var a2b = i.readByte(); + var a1a = i.readByte(); + var a1b = i.readByte(); + a.a1 = a1a << 8 | a1b; + a.a2 = a2a << 8 | a2b; + return a; +}; +haxe_crypto_Adler32.prototype = { + update: function(b,pos,len) { + var a1 = this.a1; + var a2 = this.a2; + var _g = pos; + var _g1 = pos + len; + while(_g < _g1) { + var p = _g++; + var c = b.b[p]; + a1 = (a1 + c) % 65521; + a2 = (a2 + a1) % 65521; + } + this.a1 = a1; + this.a2 = a2; + } + ,equals: function(a) { + if(a.a1 == this.a1) { + return a.a2 == this.a2; + } else { + return false; + } + } + ,__class__: haxe_crypto_Adler32 +}; +var haxe_io_Bytes = function(data) { + this.length = data.byteLength; + this.b = new Uint8Array(data); + this.b.bufferValue = data; + data.hxBytes = this; + data.bytes = this.b; +}; +$hxClasses["haxe.io.Bytes"] = haxe_io_Bytes; +haxe_io_Bytes.__name__ = "haxe.io.Bytes"; +haxe_io_Bytes.alloc = function(length) { + return new haxe_io_Bytes(new ArrayBuffer(length)); +}; +haxe_io_Bytes.ofString = function(s,encoding) { + var a = []; + var i = 0; + while(i < s.length) { + var c = s.charCodeAt(i++); + if(55296 <= c && c <= 56319) { + c = c - 55232 << 10 | s.charCodeAt(i++) & 1023; + } + if(c <= 127) { + a.push(c); + } else if(c <= 2047) { + a.push(192 | c >> 6); + a.push(128 | c & 63); + } else if(c <= 65535) { + a.push(224 | c >> 12); + a.push(128 | c >> 6 & 63); + a.push(128 | c & 63); + } else { + a.push(240 | c >> 18); + a.push(128 | c >> 12 & 63); + a.push(128 | c >> 6 & 63); + a.push(128 | c & 63); + } + } + return new haxe_io_Bytes(new Uint8Array(a).buffer); +}; +haxe_io_Bytes.ofData = function(b) { + var hb = b.hxBytes; + if(hb != null) { + return hb; + } + return new haxe_io_Bytes(b); +}; +haxe_io_Bytes.ofHex = function(s) { + if((s.length & 1) != 0) { + throw haxe_Exception.thrown("Not a hex string (odd number of digits)"); + } + var a = []; + var i = 0; + var len = s.length >> 1; + while(i < len) { + var high = s.charCodeAt(i * 2); + var low = s.charCodeAt(i * 2 + 1); + high = (high & 15) + ((high & 64) >> 6) * 9; + low = (low & 15) + ((low & 64) >> 6) * 9; + a.push((high << 4 | low) & 255); + ++i; + } + return new haxe_io_Bytes(new Uint8Array(a).buffer); +}; +haxe_io_Bytes.fastGet = function(b,pos) { + return b.bytes[pos]; +}; +haxe_io_Bytes.prototype = { + get: function(pos) { + return this.b[pos]; + } + ,set: function(pos,v) { + this.b[pos] = v & 255; + } + ,blit: function(pos,src,srcpos,len) { + if(pos < 0 || srcpos < 0 || len < 0 || pos + len > this.length || srcpos + len > src.length) { + throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds); + } + if(srcpos == 0 && len == src.b.byteLength) { + this.b.set(src.b,pos); + } else { + this.b.set(src.b.subarray(srcpos,srcpos + len),pos); + } + } + ,fill: function(pos,len,value) { + var _g = 0; + var _g1 = len; + while(_g < _g1) { + var i = _g++; + this.b[pos++] = value & 255; + } + } + ,sub: function(pos,len) { + if(pos < 0 || len < 0 || pos + len > this.length) { + throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds); + } + return new haxe_io_Bytes(this.b.buffer.slice(pos + this.b.byteOffset,pos + this.b.byteOffset + len)); + } + ,compare: function(other) { + var b1 = this.b; + var b2 = other.b; + var len = this.length < other.length ? this.length : other.length; + var _g = 0; + var _g1 = len; + while(_g < _g1) { + var i = _g++; + if(b1[i] != b2[i]) { + return b1[i] - b2[i]; + } + } + return this.length - other.length; + } + ,initData: function() { + if(this.data == null) { + this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength); + } + } + ,getDouble: function(pos) { + if(this.data == null) { + this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength); + } + return this.data.getFloat64(pos,true); + } + ,getFloat: function(pos) { + if(this.data == null) { + this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength); + } + return this.data.getFloat32(pos,true); + } + ,setDouble: function(pos,v) { + if(this.data == null) { + this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength); + } + this.data.setFloat64(pos,v,true); + } + ,setFloat: function(pos,v) { + if(this.data == null) { + this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength); + } + this.data.setFloat32(pos,v,true); + } + ,getUInt16: function(pos) { + if(this.data == null) { + this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength); + } + return this.data.getUint16(pos,true); + } + ,setUInt16: function(pos,v) { + if(this.data == null) { + this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength); + } + this.data.setUint16(pos,v,true); + } + ,getInt32: function(pos) { + if(this.data == null) { + this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength); + } + return this.data.getInt32(pos,true); + } + ,setInt32: function(pos,v) { + if(this.data == null) { + this.data = new DataView(this.b.buffer,this.b.byteOffset,this.b.byteLength); + } + this.data.setInt32(pos,v,true); + } + ,getInt64: function(pos) { + return new haxe__$Int64__$_$_$Int64(this.getInt32(pos + 4),this.getInt32(pos)); + } + ,setInt64: function(pos,v) { + this.setInt32(pos,v.low); + this.setInt32(pos + 4,v.high); + } + ,getString: function(pos,len,encoding) { + if(pos < 0 || len < 0 || pos + len > this.length) { + throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds); + } + var s = ""; + var b = this.b; + var fcc = _$String_String_$Impl_$.fromCharCode; + var i = pos; + var max = pos + len; + while(i < max) { + var c = b[i++]; + if(c < 128) { + if(c == 0) { + break; + } + s += fcc(c); + } else if(c < 224) { + s += fcc((c & 63) << 6 | b[i++] & 127); + } else if(c < 240) { + var c2 = b[i++]; + s += fcc((c & 31) << 12 | (c2 & 127) << 6 | b[i++] & 127); + } else { + var c21 = b[i++]; + var c3 = b[i++]; + var u = (c & 15) << 18 | (c21 & 127) << 12 | (c3 & 127) << 6 | b[i++] & 127; + s += fcc((u >> 10) + 55232); + s += fcc(u & 1023 | 56320); + } + } + return s; + } + ,readString: function(pos,len) { + return this.getString(pos,len); + } + ,toString: function() { + return this.getString(0,this.length); + } + ,toHex: function() { + var s_b = ""; + var chars = []; + var str = "0123456789abcdef"; + var _g = 0; + var _g1 = str.length; + while(_g < _g1) { + var i = _g++; + chars.push(HxOverrides.cca(str,i)); + } + var _g = 0; + var _g1 = this.length; + while(_g < _g1) { + var i = _g++; + var c = this.b[i]; + s_b += String.fromCodePoint(chars[c >> 4]); + s_b += String.fromCodePoint(chars[c & 15]); + } + return s_b; + } + ,getData: function() { + return this.b.bufferValue; + } + ,__class__: haxe_io_Bytes +}; +var haxe_crypto_Base64 = function() { }; +$hxClasses["haxe.crypto.Base64"] = haxe_crypto_Base64; +haxe_crypto_Base64.__name__ = "haxe.crypto.Base64"; +haxe_crypto_Base64.decode = function(str,complement) { + if(complement == null) { + complement = true; + } + if(complement) { + while(HxOverrides.cca(str,str.length - 1) == 61) str = HxOverrides.substr(str,0,-1); + } + return new haxe_crypto_BaseCode(haxe_crypto_Base64.BYTES).decodeBytes(haxe_io_Bytes.ofString(str)); +}; +var haxe_crypto_BaseCode = function(base) { + var len = base.length; + var nbits = 1; + while(len > 1 << nbits) ++nbits; + if(nbits > 8 || len != 1 << nbits) { + throw haxe_Exception.thrown("BaseCode : base length must be a power of two."); + } + this.base = base; + this.nbits = nbits; +}; +$hxClasses["haxe.crypto.BaseCode"] = haxe_crypto_BaseCode; +haxe_crypto_BaseCode.__name__ = "haxe.crypto.BaseCode"; +haxe_crypto_BaseCode.prototype = { + initTable: function() { + var tbl = []; + var _g = 0; + while(_g < 256) { + var i = _g++; + tbl[i] = -1; + } + var _g = 0; + var _g1 = this.base.length; + while(_g < _g1) { + var i = _g++; + tbl[this.base.b[i]] = i; + } + this.tbl = tbl; + } + ,decodeBytes: function(b) { + var nbits = this.nbits; + var base = this.base; + if(this.tbl == null) { + this.initTable(); + } + var tbl = this.tbl; + var size = b.length * nbits >> 3; + var out = new haxe_io_Bytes(new ArrayBuffer(size)); + var buf = 0; + var curbits = 0; + var pin = 0; + var pout = 0; + while(pout < size) { + while(curbits < 8) { + curbits += nbits; + buf <<= nbits; + var i = tbl[b.b[pin++]]; + if(i == -1) { + throw haxe_Exception.thrown("BaseCode : invalid encoded char"); + } + buf |= i; + } + curbits -= 8; + out.b[pout++] = buf >> curbits & 255 & 255; + } + return out; + } + ,__class__: haxe_crypto_BaseCode +}; +var haxe_ds_ArraySort = function() { }; +$hxClasses["haxe.ds.ArraySort"] = haxe_ds_ArraySort; +haxe_ds_ArraySort.__name__ = "haxe.ds.ArraySort"; +haxe_ds_ArraySort.sort = function(a,cmp) { + haxe_ds_ArraySort.rec(a,cmp,0,a.length); +}; +haxe_ds_ArraySort.rec = function(a,cmp,from,to) { + var middle = from + to >> 1; + if(to - from < 12) { + if(to <= from) { + return; + } + var _g = from + 1; + var _g1 = to; + while(_g < _g1) { + var i = _g++; + var j = i; + while(j > from) { + if(cmp(a[j],a[j - 1]) < 0) { + haxe_ds_ArraySort.swap(a,j - 1,j); + } else { + break; + } + --j; + } + } + return; + } + haxe_ds_ArraySort.rec(a,cmp,from,middle); + haxe_ds_ArraySort.rec(a,cmp,middle,to); + haxe_ds_ArraySort.doMerge(a,cmp,from,middle,to,middle - from,to - middle); +}; +haxe_ds_ArraySort.doMerge = function(a,cmp,from,pivot,to,len1,len2) { + var first_cut; + var second_cut; + var len11; + var len22; + if(len1 == 0 || len2 == 0) { + return; + } + if(len1 + len2 == 2) { + if(cmp(a[pivot],a[from]) < 0) { + haxe_ds_ArraySort.swap(a,pivot,from); + } + return; + } + if(len1 > len2) { + len11 = len1 >> 1; + first_cut = from + len11; + second_cut = haxe_ds_ArraySort.lower(a,cmp,pivot,to,first_cut); + len22 = second_cut - pivot; + } else { + len22 = len2 >> 1; + second_cut = pivot + len22; + first_cut = haxe_ds_ArraySort.upper(a,cmp,from,pivot,second_cut); + len11 = first_cut - from; + } + haxe_ds_ArraySort.rotate(a,cmp,first_cut,pivot,second_cut); + var new_mid = first_cut + len22; + haxe_ds_ArraySort.doMerge(a,cmp,from,first_cut,new_mid,len11,len22); + haxe_ds_ArraySort.doMerge(a,cmp,new_mid,second_cut,to,len1 - len11,len2 - len22); +}; +haxe_ds_ArraySort.rotate = function(a,cmp,from,mid,to) { + if(from == mid || mid == to) { + return; + } + var n = haxe_ds_ArraySort.gcd(to - from,mid - from); + while(n-- != 0) { + var val = a[from + n]; + var shift = mid - from; + var p1 = from + n; + var p2 = from + n + shift; + while(p2 != from + n) { + a[p1] = a[p2]; + p1 = p2; + if(to - p2 > shift) { + p2 += shift; + } else { + p2 = from + (shift - (to - p2)); + } + } + a[p1] = val; + } +}; +haxe_ds_ArraySort.gcd = function(m,n) { + while(n != 0) { + var t = m % n; + m = n; + n = t; + } + return m; +}; +haxe_ds_ArraySort.upper = function(a,cmp,from,to,val) { + var len = to - from; + var half; + var mid; + while(len > 0) { + half = len >> 1; + mid = from + half; + if(cmp(a[val],a[mid]) < 0) { + len = half; + } else { + from = mid + 1; + len = len - half - 1; + } + } + return from; +}; +haxe_ds_ArraySort.lower = function(a,cmp,from,to,val) { + var len = to - from; + var half; + var mid; + while(len > 0) { + half = len >> 1; + mid = from + half; + if(cmp(a[mid],a[val]) < 0) { + from = mid + 1; + len = len - half - 1; + } else { + len = half; + } + } + return from; +}; +haxe_ds_ArraySort.swap = function(a,i,j) { + var tmp = a[i]; + a[i] = a[j]; + a[j] = tmp; +}; +var haxe_ds_BalancedTree = function() { +}; +$hxClasses["haxe.ds.BalancedTree"] = haxe_ds_BalancedTree; +haxe_ds_BalancedTree.__name__ = "haxe.ds.BalancedTree"; +haxe_ds_BalancedTree.__interfaces__ = [haxe_IMap]; +haxe_ds_BalancedTree.iteratorLoop = function(node,acc) { + if(node != null) { + haxe_ds_BalancedTree.iteratorLoop(node.left,acc); + acc.push(node.value); + haxe_ds_BalancedTree.iteratorLoop(node.right,acc); + } +}; +haxe_ds_BalancedTree.prototype = { + set: function(key,value) { + this.root = this.setLoop(key,value,this.root); + } + ,get: function(key) { + var node = this.root; + while(node != null) { + var c = this.compare(key,node.key); + if(c == 0) { + return node.value; + } + if(c < 0) { + node = node.left; + } else { + node = node.right; + } + } + return null; + } + ,remove: function(key) { + try { + this.root = this.removeLoop(key,this.root); + return true; + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + if(typeof(haxe_Exception.caught(_g).unwrap()) == "string") { + return false; + } else { + throw _g; + } + } + } + ,exists: function(key) { + var node = this.root; + while(node != null) { + var c = this.compare(key,node.key); + if(c == 0) { + return true; + } else if(c < 0) { + node = node.left; + } else { + node = node.right; + } + } + return false; + } + ,iterator: function() { + var ret = []; + haxe_ds_BalancedTree.iteratorLoop(this.root,ret); + return new haxe_iterators_ArrayIterator(ret); + } + ,keyValueIterator: function() { + return new haxe_iterators_MapKeyValueIterator(this); + } + ,keys: function() { + var ret = []; + this.keysLoop(this.root,ret); + return new haxe_iterators_ArrayIterator(ret); + } + ,setLoop: function(k,v,node) { + if(node == null) { + return new haxe_ds_TreeNode(null,k,v,null); + } + var c = this.compare(k,node.key); + if(c == 0) { + return new haxe_ds_TreeNode(node.left,k,v,node.right,node == null ? 0 : node._height); + } else if(c < 0) { + var nl = this.setLoop(k,v,node.left); + return this.balance(nl,node.key,node.value,node.right); + } else { + var nr = this.setLoop(k,v,node.right); + return this.balance(node.left,node.key,node.value,nr); + } + } + ,removeLoop: function(k,node) { + if(node == null) { + throw haxe_Exception.thrown("Not_found"); + } + var c = this.compare(k,node.key); + if(c == 0) { + return this.merge(node.left,node.right); + } else if(c < 0) { + return this.balance(this.removeLoop(k,node.left),node.key,node.value,node.right); + } else { + return this.balance(node.left,node.key,node.value,this.removeLoop(k,node.right)); + } + } + ,keysLoop: function(node,acc) { + if(node != null) { + this.keysLoop(node.left,acc); + acc.push(node.key); + this.keysLoop(node.right,acc); + } + } + ,merge: function(t1,t2) { + if(t1 == null) { + return t2; + } + if(t2 == null) { + return t1; + } + var t = this.minBinding(t2); + return this.balance(t1,t.key,t.value,this.removeMinBinding(t2)); + } + ,minBinding: function(t) { + if(t == null) { + throw haxe_Exception.thrown("Not_found"); + } else if(t.left == null) { + return t; + } else { + return this.minBinding(t.left); + } + } + ,removeMinBinding: function(t) { + if(t.left == null) { + return t.right; + } else { + return this.balance(this.removeMinBinding(t.left),t.key,t.value,t.right); + } + } + ,balance: function(l,k,v,r) { + var hl = l == null ? 0 : l._height; + var hr = r == null ? 0 : r._height; + if(hl > hr + 2) { + var _this = l.left; + var _this1 = l.right; + if((_this == null ? 0 : _this._height) >= (_this1 == null ? 0 : _this1._height)) { + return new haxe_ds_TreeNode(l.left,l.key,l.value,new haxe_ds_TreeNode(l.right,k,v,r)); + } else { + return new haxe_ds_TreeNode(new haxe_ds_TreeNode(l.left,l.key,l.value,l.right.left),l.right.key,l.right.value,new haxe_ds_TreeNode(l.right.right,k,v,r)); + } + } else if(hr > hl + 2) { + var _this = r.right; + var _this1 = r.left; + if((_this == null ? 0 : _this._height) > (_this1 == null ? 0 : _this1._height)) { + return new haxe_ds_TreeNode(new haxe_ds_TreeNode(l,k,v,r.left),r.key,r.value,r.right); + } else { + return new haxe_ds_TreeNode(new haxe_ds_TreeNode(l,k,v,r.left.left),r.left.key,r.left.value,new haxe_ds_TreeNode(r.left.right,r.key,r.value,r.right)); + } + } else { + return new haxe_ds_TreeNode(l,k,v,r,(hl > hr ? hl : hr) + 1); + } + } + ,compare: function(k1,k2) { + return Reflect.compare(k1,k2); + } + ,clear: function() { + this.root = null; + } + ,__class__: haxe_ds_BalancedTree +}; +var haxe_ds_TreeNode = function(l,k,v,r,h) { + if(h == null) { + h = -1; + } + this.left = l; + this.key = k; + this.value = v; + this.right = r; + if(h == -1) { + var tmp; + var _this = this.left; + var _this1 = this.right; + if((_this == null ? 0 : _this._height) > (_this1 == null ? 0 : _this1._height)) { + var _this = this.left; + tmp = _this == null ? 0 : _this._height; + } else { + var _this = this.right; + tmp = _this == null ? 0 : _this._height; + } + this._height = tmp + 1; + } else { + this._height = h; + } +}; +$hxClasses["haxe.ds.TreeNode"] = haxe_ds_TreeNode; +haxe_ds_TreeNode.__name__ = "haxe.ds.TreeNode"; +haxe_ds_TreeNode.prototype = { + __class__: haxe_ds_TreeNode +}; +var haxe_ds_EnumValueMap = function() { + haxe_ds_BalancedTree.call(this); +}; +$hxClasses["haxe.ds.EnumValueMap"] = haxe_ds_EnumValueMap; +haxe_ds_EnumValueMap.__name__ = "haxe.ds.EnumValueMap"; +haxe_ds_EnumValueMap.__interfaces__ = [haxe_IMap]; +haxe_ds_EnumValueMap.__super__ = haxe_ds_BalancedTree; +haxe_ds_EnumValueMap.prototype = $extend(haxe_ds_BalancedTree.prototype,{ + compare: function(k1,k2) { + var d = k1._hx_index - k2._hx_index; + if(d != 0) { + return d; + } + var p1 = Type.enumParameters(k1); + var p2 = Type.enumParameters(k2); + if(p1.length == 0 && p2.length == 0) { + return 0; + } + return this.compareArgs(p1,p2); + } + ,compareArgs: function(a1,a2) { + var ld = a1.length - a2.length; + if(ld != 0) { + return ld; + } + var _g = 0; + var _g1 = a1.length; + while(_g < _g1) { + var i = _g++; + var d = this.compareArg(a1[i],a2[i]); + if(d != 0) { + return d; + } + } + return 0; + } + ,compareArg: function(v1,v2) { + if(Reflect.isEnumValue(v1) && Reflect.isEnumValue(v2)) { + return this.compare(v1,v2); + } else if(((v1) instanceof Array) && ((v2) instanceof Array)) { + return this.compareArgs(v1,v2); + } else { + return Reflect.compare(v1,v2); + } + } + ,__class__: haxe_ds_EnumValueMap +}); +var haxe_ds_IntMap = function() { + this.h = { }; +}; +$hxClasses["haxe.ds.IntMap"] = haxe_ds_IntMap; +haxe_ds_IntMap.__name__ = "haxe.ds.IntMap"; +haxe_ds_IntMap.__interfaces__ = [haxe_IMap]; +haxe_ds_IntMap.prototype = { + set: function(key,value) { + this.h[key] = value; + } + ,get: function(key) { + return this.h[key]; + } + ,exists: function(key) { + return this.h.hasOwnProperty(key); + } + ,remove: function(key) { + if(!this.h.hasOwnProperty(key)) { + return false; + } + delete(this.h[key]); + return true; + } + ,keys: function() { + var a = []; + for( var key in this.h ) if(this.h.hasOwnProperty(key)) a.push(+key); + return new haxe_iterators_ArrayIterator(a); + } + ,iterator: function() { + return { ref : this.h, it : this.keys(), hasNext : function() { + return this.it.hasNext(); + }, next : function() { + var i = this.it.next(); + return this.ref[i]; + }}; + } + ,keyValueIterator: function() { + return new haxe_iterators_MapKeyValueIterator(this); + } + ,__class__: haxe_ds_IntMap +}; +var haxe_ds__$List_ListNode = function(item,next) { + this.item = item; + this.next = next; +}; +$hxClasses["haxe.ds._List.ListNode"] = haxe_ds__$List_ListNode; +haxe_ds__$List_ListNode.__name__ = "haxe.ds._List.ListNode"; +haxe_ds__$List_ListNode.prototype = { + __class__: haxe_ds__$List_ListNode +}; +var haxe_ds__$List_ListIterator = function(head) { + this.head = head; +}; +$hxClasses["haxe.ds._List.ListIterator"] = haxe_ds__$List_ListIterator; +haxe_ds__$List_ListIterator.__name__ = "haxe.ds._List.ListIterator"; +haxe_ds__$List_ListIterator.prototype = { + hasNext: function() { + return this.head != null; + } + ,next: function() { + var val = this.head.item; + this.head = this.head.next; + return val; + } + ,__class__: haxe_ds__$List_ListIterator +}; +var haxe_ds_StringMap = function() { + this.h = Object.create(null); +}; +$hxClasses["haxe.ds.StringMap"] = haxe_ds_StringMap; +haxe_ds_StringMap.__name__ = "haxe.ds.StringMap"; +haxe_ds_StringMap.__interfaces__ = [haxe_IMap]; +haxe_ds_StringMap.stringify = function(h) { + var s = "["; + var first = true; + for (var key in h) { + if (first) first = false; else s += ','; + s += key + ' => ' + Std.string(h[key]); + } + return s + "]"; +}; +haxe_ds_StringMap.prototype = { + exists: function(key) { + return Object.prototype.hasOwnProperty.call(this.h,key); + } + ,get: function(key) { + return this.h[key]; + } + ,set: function(key,value) { + this.h[key] = value; + } + ,remove: function(key) { + if(Object.prototype.hasOwnProperty.call(this.h,key)) { + delete(this.h[key]); + return true; + } else { + return false; + } + } + ,keys: function() { + return new haxe_ds__$StringMap_StringMapKeyIterator(this.h); + } + ,iterator: function() { + return new haxe_ds__$StringMap_StringMapValueIterator(this.h); + } + ,keyValueIterator: function() { + return new haxe_ds__$StringMap_StringMapKeyValueIterator(this.h); + } + ,__class__: haxe_ds_StringMap +}; +var haxe_ds__$StringMap_StringMapKeyIterator = function(h) { + this.h = h; + this.keys = Object.keys(h); + this.length = this.keys.length; + this.current = 0; +}; +$hxClasses["haxe.ds._StringMap.StringMapKeyIterator"] = haxe_ds__$StringMap_StringMapKeyIterator; +haxe_ds__$StringMap_StringMapKeyIterator.__name__ = "haxe.ds._StringMap.StringMapKeyIterator"; +haxe_ds__$StringMap_StringMapKeyIterator.prototype = { + hasNext: function() { + return this.current < this.length; + } + ,next: function() { + return this.keys[this.current++]; + } + ,__class__: haxe_ds__$StringMap_StringMapKeyIterator +}; +var haxe_ds__$StringMap_StringMapValueIterator = function(h) { + this.h = h; + this.keys = Object.keys(h); + this.length = this.keys.length; + this.current = 0; +}; +$hxClasses["haxe.ds._StringMap.StringMapValueIterator"] = haxe_ds__$StringMap_StringMapValueIterator; +haxe_ds__$StringMap_StringMapValueIterator.__name__ = "haxe.ds._StringMap.StringMapValueIterator"; +haxe_ds__$StringMap_StringMapValueIterator.prototype = { + hasNext: function() { + return this.current < this.length; + } + ,next: function() { + return this.h[this.keys[this.current++]]; + } + ,__class__: haxe_ds__$StringMap_StringMapValueIterator +}; +var haxe_ds__$StringMap_StringMapKeyValueIterator = function(h) { + this.h = h; + this.keys = Object.keys(h); + this.length = this.keys.length; + this.current = 0; +}; +$hxClasses["haxe.ds._StringMap.StringMapKeyValueIterator"] = haxe_ds__$StringMap_StringMapKeyValueIterator; +haxe_ds__$StringMap_StringMapKeyValueIterator.__name__ = "haxe.ds._StringMap.StringMapKeyValueIterator"; +haxe_ds__$StringMap_StringMapKeyValueIterator.prototype = { + hasNext: function() { + return this.current < this.length; + } + ,next: function() { + var key = this.keys[this.current++]; + return { key : key, value : this.h[key]}; + } + ,__class__: haxe_ds__$StringMap_StringMapKeyValueIterator +}; +var haxe_exceptions_PosException = function(message,previous,pos) { + haxe_Exception.call(this,message,previous); + if(pos == null) { + this.posInfos = { fileName : "(unknown)", lineNumber : 0, className : "(unknown)", methodName : "(unknown)"}; + } else { + this.posInfos = pos; + } + this.__skipStack++; +}; +$hxClasses["haxe.exceptions.PosException"] = haxe_exceptions_PosException; +haxe_exceptions_PosException.__name__ = "haxe.exceptions.PosException"; +haxe_exceptions_PosException.__super__ = haxe_Exception; +haxe_exceptions_PosException.prototype = $extend(haxe_Exception.prototype,{ + toString: function() { + return "" + haxe_Exception.prototype.toString.call(this) + " in " + this.posInfos.className + "." + this.posInfos.methodName + " at " + this.posInfos.fileName + ":" + this.posInfos.lineNumber; + } + ,__class__: haxe_exceptions_PosException +}); +var haxe_exceptions_NotImplementedException = function(message,previous,pos) { + if(message == null) { + message = "Not implemented"; + } + haxe_exceptions_PosException.call(this,message,previous,pos); + this.__skipStack++; +}; +$hxClasses["haxe.exceptions.NotImplementedException"] = haxe_exceptions_NotImplementedException; +haxe_exceptions_NotImplementedException.__name__ = "haxe.exceptions.NotImplementedException"; +haxe_exceptions_NotImplementedException.__super__ = haxe_exceptions_PosException; +haxe_exceptions_NotImplementedException.prototype = $extend(haxe_exceptions_PosException.prototype,{ + __class__: haxe_exceptions_NotImplementedException +}); +var haxe_io_BytesBuffer = function() { + this.pos = 0; + this.size = 0; +}; +$hxClasses["haxe.io.BytesBuffer"] = haxe_io_BytesBuffer; +haxe_io_BytesBuffer.__name__ = "haxe.io.BytesBuffer"; +haxe_io_BytesBuffer.prototype = { + addByte: function(byte) { + if(this.pos == this.size) { + this.grow(1); + } + this.view.setUint8(this.pos++,byte); + } + ,add: function(src) { + if(this.pos + src.length > this.size) { + this.grow(src.length); + } + if(this.size == 0) { + return; + } + var sub = new Uint8Array(src.b.buffer,src.b.byteOffset,src.length); + this.u8.set(sub,this.pos); + this.pos += src.length; + } + ,addBytes: function(src,pos,len) { + if(pos < 0 || len < 0 || pos + len > src.length) { + throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds); + } + if(this.pos + len > this.size) { + this.grow(len); + } + if(this.size == 0) { + return; + } + var sub = new Uint8Array(src.b.buffer,src.b.byteOffset + pos,len); + this.u8.set(sub,this.pos); + this.pos += len; + } + ,grow: function(delta) { + var req = this.pos + delta; + var nsize = this.size == 0 ? 16 : this.size; + while(nsize < req) nsize = nsize * 3 >> 1; + var nbuf = new ArrayBuffer(nsize); + var nu8 = new Uint8Array(nbuf); + if(this.size > 0) { + nu8.set(this.u8); + } + this.size = nsize; + this.buffer = nbuf; + this.u8 = nu8; + this.view = new DataView(this.buffer); + } + ,getBytes: function() { + if(this.size == 0) { + return new haxe_io_Bytes(new ArrayBuffer(0)); + } + var b = new haxe_io_Bytes(this.buffer); + b.length = this.pos; + return b; + } + ,__class__: haxe_io_BytesBuffer +}; +var haxe_io_Input = function() { }; +$hxClasses["haxe.io.Input"] = haxe_io_Input; +haxe_io_Input.__name__ = "haxe.io.Input"; +haxe_io_Input.prototype = { + readByte: function() { + throw new haxe_exceptions_NotImplementedException(null,null,{ fileName : "haxe/io/Input.hx", lineNumber : 53, className : "haxe.io.Input", methodName : "readByte"}); + } + ,readBytes: function(s,pos,len) { + var k = len; + var b = s.b; + if(pos < 0 || len < 0 || pos + len > s.length) { + throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds); + } + try { + while(k > 0) { + b[pos] = this.readByte(); + ++pos; + --k; + } + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + if(!((haxe_Exception.caught(_g).unwrap()) instanceof haxe_io_Eof)) { + throw _g; + } + } + return len - k; + } + ,set_bigEndian: function(b) { + this.bigEndian = b; + return b; + } + ,readFullBytes: function(s,pos,len) { + while(len > 0) { + var k = this.readBytes(s,pos,len); + if(k == 0) { + throw haxe_Exception.thrown(haxe_io_Error.Blocked); + } + pos += k; + len -= k; + } + } + ,read: function(nbytes) { + var s = new haxe_io_Bytes(new ArrayBuffer(nbytes)); + var p = 0; + while(nbytes > 0) { + var k = this.readBytes(s,p,nbytes); + if(k == 0) { + throw haxe_Exception.thrown(haxe_io_Error.Blocked); + } + p += k; + nbytes -= k; + } + return s; + } + ,readFloat: function() { + return haxe_io_FPHelper.i32ToFloat(this.readInt32()); + } + ,readDouble: function() { + var i1 = this.readInt32(); + var i2 = this.readInt32(); + if(this.bigEndian) { + return haxe_io_FPHelper.i64ToDouble(i2,i1); + } else { + return haxe_io_FPHelper.i64ToDouble(i1,i2); + } + } + ,readInt16: function() { + var ch1 = this.readByte(); + var ch2 = this.readByte(); + var n = this.bigEndian ? ch2 | ch1 << 8 : ch1 | ch2 << 8; + if((n & 32768) != 0) { + return n - 65536; + } + return n; + } + ,readUInt16: function() { + var ch1 = this.readByte(); + var ch2 = this.readByte(); + if(this.bigEndian) { + return ch2 | ch1 << 8; + } else { + return ch1 | ch2 << 8; + } + } + ,readInt32: function() { + var ch1 = this.readByte(); + var ch2 = this.readByte(); + var ch3 = this.readByte(); + var ch4 = this.readByte(); + if(this.bigEndian) { + return ch4 | ch3 << 8 | ch2 << 16 | ch1 << 24; + } else { + return ch1 | ch2 << 8 | ch3 << 16 | ch4 << 24; + } + } + ,readString: function(len,encoding) { + var b = new haxe_io_Bytes(new ArrayBuffer(len)); + this.readFullBytes(b,0,len); + return b.getString(0,len,encoding); + } + ,__class__: haxe_io_Input + ,__properties__: {set_bigEndian:"set_bigEndian"} +}; +var haxe_io_BytesInput = function(b,pos,len) { + if(pos == null) { + pos = 0; + } + if(len == null) { + len = b.length - pos; + } + if(pos < 0 || len < 0 || pos + len > b.length) { + throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds); + } + this.b = b.b; + this.pos = pos; + this.len = len; + this.totlen = len; +}; +$hxClasses["haxe.io.BytesInput"] = haxe_io_BytesInput; +haxe_io_BytesInput.__name__ = "haxe.io.BytesInput"; +haxe_io_BytesInput.__super__ = haxe_io_Input; +haxe_io_BytesInput.prototype = $extend(haxe_io_Input.prototype,{ + readByte: function() { + if(this.len == 0) { + throw haxe_Exception.thrown(new haxe_io_Eof()); + } + this.len--; + return this.b[this.pos++]; + } + ,readBytes: function(buf,pos,len) { + if(pos < 0 || len < 0 || pos + len > buf.length) { + throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds); + } + if(this.len == 0 && len > 0) { + throw haxe_Exception.thrown(new haxe_io_Eof()); + } + if(this.len < len) { + len = this.len; + } + var b1 = this.b; + var b2 = buf.b; + var _g = 0; + var _g1 = len; + while(_g < _g1) { + var i = _g++; + b2[pos + i] = b1[this.pos + i]; + } + this.pos += len; + this.len -= len; + return len; + } + ,__class__: haxe_io_BytesInput +}); +var haxe_io_Output = function() { }; +$hxClasses["haxe.io.Output"] = haxe_io_Output; +haxe_io_Output.__name__ = "haxe.io.Output"; +haxe_io_Output.prototype = { + writeByte: function(c) { + throw new haxe_exceptions_NotImplementedException(null,null,{ fileName : "haxe/io/Output.hx", lineNumber : 47, className : "haxe.io.Output", methodName : "writeByte"}); + } + ,writeBytes: function(s,pos,len) { + if(pos < 0 || len < 0 || pos + len > s.length) { + throw haxe_Exception.thrown(haxe_io_Error.OutsideBounds); + } + var b = s.b; + var k = len; + while(k > 0) { + this.writeByte(b[pos]); + ++pos; + --k; + } + return len; + } + ,set_bigEndian: function(b) { + this.bigEndian = b; + return b; + } + ,write: function(s) { + var l = s.length; + var p = 0; + while(l > 0) { + var k = this.writeBytes(s,p,l); + if(k == 0) { + throw haxe_Exception.thrown(haxe_io_Error.Blocked); + } + p += k; + l -= k; + } + } + ,writeFullBytes: function(s,pos,len) { + while(len > 0) { + var k = this.writeBytes(s,pos,len); + pos += k; + len -= k; + } + } + ,writeDouble: function(x) { + var i64 = haxe_io_FPHelper.doubleToI64(x); + if(this.bigEndian) { + this.writeInt32(i64.high); + this.writeInt32(i64.low); + } else { + this.writeInt32(i64.low); + this.writeInt32(i64.high); + } + } + ,writeUInt16: function(x) { + if(x < 0 || x >= 65536) { + throw haxe_Exception.thrown(haxe_io_Error.Overflow); + } + if(this.bigEndian) { + this.writeByte(x >> 8); + this.writeByte(x & 255); + } else { + this.writeByte(x & 255); + this.writeByte(x >> 8); + } + } + ,writeInt32: function(x) { + if(this.bigEndian) { + this.writeByte(x >>> 24); + this.writeByte(x >> 16 & 255); + this.writeByte(x >> 8 & 255); + this.writeByte(x & 255); + } else { + this.writeByte(x & 255); + this.writeByte(x >> 8 & 255); + this.writeByte(x >> 16 & 255); + this.writeByte(x >>> 24); + } + } + ,writeString: function(s,encoding) { + var b = haxe_io_Bytes.ofString(s,encoding); + this.writeFullBytes(b,0,b.length); + } + ,__class__: haxe_io_Output + ,__properties__: {set_bigEndian:"set_bigEndian"} +}; +var haxe_io_BytesOutput = function() { + this.b = new haxe_io_BytesBuffer(); +}; +$hxClasses["haxe.io.BytesOutput"] = haxe_io_BytesOutput; +haxe_io_BytesOutput.__name__ = "haxe.io.BytesOutput"; +haxe_io_BytesOutput.__super__ = haxe_io_Output; +haxe_io_BytesOutput.prototype = $extend(haxe_io_Output.prototype,{ + writeByte: function(c) { + this.b.addByte(c); + } + ,writeBytes: function(buf,pos,len) { + this.b.addBytes(buf,pos,len); + return len; + } + ,getBytes: function() { + return this.b.getBytes(); + } + ,__class__: haxe_io_BytesOutput +}); +var haxe_io_Encoding = $hxEnums["haxe.io.Encoding"] = { __ename__:"haxe.io.Encoding",__constructs__:null + ,UTF8: {_hx_name:"UTF8",_hx_index:0,__enum__:"haxe.io.Encoding",toString:$estr} + ,RawNative: {_hx_name:"RawNative",_hx_index:1,__enum__:"haxe.io.Encoding",toString:$estr} +}; +haxe_io_Encoding.__constructs__ = [haxe_io_Encoding.UTF8,haxe_io_Encoding.RawNative]; +var haxe_io_Eof = function() { +}; +$hxClasses["haxe.io.Eof"] = haxe_io_Eof; +haxe_io_Eof.__name__ = "haxe.io.Eof"; +haxe_io_Eof.prototype = { + toString: function() { + return "Eof"; + } + ,__class__: haxe_io_Eof +}; +var haxe_io_Error = $hxEnums["haxe.io.Error"] = { __ename__:"haxe.io.Error",__constructs__:null + ,Blocked: {_hx_name:"Blocked",_hx_index:0,__enum__:"haxe.io.Error",toString:$estr} + ,Overflow: {_hx_name:"Overflow",_hx_index:1,__enum__:"haxe.io.Error",toString:$estr} + ,OutsideBounds: {_hx_name:"OutsideBounds",_hx_index:2,__enum__:"haxe.io.Error",toString:$estr} + ,Custom: ($_=function(e) { return {_hx_index:3,e:e,__enum__:"haxe.io.Error",toString:$estr}; },$_._hx_name="Custom",$_.__params__ = ["e"],$_) +}; +haxe_io_Error.__constructs__ = [haxe_io_Error.Blocked,haxe_io_Error.Overflow,haxe_io_Error.OutsideBounds,haxe_io_Error.Custom]; +var haxe_io_FPHelper = function() { }; +$hxClasses["haxe.io.FPHelper"] = haxe_io_FPHelper; +haxe_io_FPHelper.__name__ = "haxe.io.FPHelper"; +haxe_io_FPHelper.i32ToFloat = function(i) { + haxe_io_FPHelper.helper.setInt32(0,i,true); + return haxe_io_FPHelper.helper.getFloat32(0,true); +}; +haxe_io_FPHelper.floatToI32 = function(f) { + haxe_io_FPHelper.helper.setFloat32(0,f,true); + return haxe_io_FPHelper.helper.getInt32(0,true); +}; +haxe_io_FPHelper.i64ToDouble = function(low,high) { + haxe_io_FPHelper.helper.setInt32(0,low,true); + haxe_io_FPHelper.helper.setInt32(4,high,true); + return haxe_io_FPHelper.helper.getFloat64(0,true); +}; +haxe_io_FPHelper.doubleToI64 = function(v) { + var i64 = haxe_io_FPHelper.i64tmp; + haxe_io_FPHelper.helper.setFloat64(0,v,true); + i64.low = haxe_io_FPHelper.helper.getInt32(0,true); + i64.high = haxe_io_FPHelper.helper.getInt32(4,true); + return i64; +}; +var haxe_io_Float32Array = {}; +haxe_io_Float32Array.fromBytes = function(bytes,bytePos,length) { + if(bytePos == null) { + bytePos = 0; + } + if(length == null) { + length = bytes.length - bytePos >> 2; + } + return new Float32Array(bytes.b.bufferValue,bytePos,length); +}; +var haxe_io_Path = function(path) { + switch(path) { + case ".":case "..": + this.dir = path; + this.file = ""; + return; + } + var c1 = path.lastIndexOf("/"); + var c2 = path.lastIndexOf("\\"); + if(c1 < c2) { + this.dir = HxOverrides.substr(path,0,c2); + path = HxOverrides.substr(path,c2 + 1,null); + this.backslash = true; + } else if(c2 < c1) { + this.dir = HxOverrides.substr(path,0,c1); + path = HxOverrides.substr(path,c1 + 1,null); + } else { + this.dir = null; + } + var cp = path.lastIndexOf("."); + if(cp != -1) { + this.ext = HxOverrides.substr(path,cp + 1,null); + this.file = HxOverrides.substr(path,0,cp); + } else { + this.ext = null; + this.file = path; + } +}; +$hxClasses["haxe.io.Path"] = haxe_io_Path; +haxe_io_Path.__name__ = "haxe.io.Path"; +haxe_io_Path.directory = function(path) { + var s = new haxe_io_Path(path); + if(s.dir == null) { + return ""; + } + return s.dir; +}; +haxe_io_Path.prototype = { + __class__: haxe_io_Path +}; +var haxe_iterators_ArrayIterator = function(array) { + this.current = 0; + this.array = array; +}; +$hxClasses["haxe.iterators.ArrayIterator"] = haxe_iterators_ArrayIterator; +haxe_iterators_ArrayIterator.__name__ = "haxe.iterators.ArrayIterator"; +haxe_iterators_ArrayIterator.prototype = { + hasNext: function() { + return this.current < this.array.length; + } + ,next: function() { + return this.array[this.current++]; + } + ,__class__: haxe_iterators_ArrayIterator +}; +var haxe_iterators_MapKeyValueIterator = function(map) { + this.map = map; + this.keys = map.keys(); +}; +$hxClasses["haxe.iterators.MapKeyValueIterator"] = haxe_iterators_MapKeyValueIterator; +haxe_iterators_MapKeyValueIterator.__name__ = "haxe.iterators.MapKeyValueIterator"; +haxe_iterators_MapKeyValueIterator.prototype = { + hasNext: function() { + return this.keys.hasNext(); + } + ,next: function() { + var key = this.keys.next(); + return { value : this.map.get(key), key : key}; + } + ,__class__: haxe_iterators_MapKeyValueIterator +}; +var haxe_xml_XmlParserException = function(message,xml,position) { + this.xml = xml; + this.message = message; + this.position = position; + this.lineNumber = 1; + this.positionAtLine = 0; + var _g = 0; + var _g1 = position; + while(_g < _g1) { + var i = _g++; + var c = xml.charCodeAt(i); + if(c == 10) { + this.lineNumber++; + this.positionAtLine = 0; + } else if(c != 13) { + this.positionAtLine++; + } + } +}; +$hxClasses["haxe.xml.XmlParserException"] = haxe_xml_XmlParserException; +haxe_xml_XmlParserException.__name__ = "haxe.xml.XmlParserException"; +haxe_xml_XmlParserException.prototype = { + toString: function() { + var c = js_Boot.getClass(this); + return c.__name__ + ": " + this.message + " at line " + this.lineNumber + " char " + this.positionAtLine; + } + ,__class__: haxe_xml_XmlParserException +}; +var haxe_xml_Parser = function() { }; +$hxClasses["haxe.xml.Parser"] = haxe_xml_Parser; +haxe_xml_Parser.__name__ = "haxe.xml.Parser"; +haxe_xml_Parser.parse = function(str,strict) { + if(strict == null) { + strict = false; + } + var doc = Xml.createDocument(); + haxe_xml_Parser.doParse(str,strict,0,doc); + return doc; +}; +haxe_xml_Parser.doParse = function(str,strict,p,parent) { + if(p == null) { + p = 0; + } + var xml = null; + var state = 1; + var next = 1; + var aname = null; + var start = 0; + var nsubs = 0; + var nbrackets = 0; + var buf = new StringBuf(); + var escapeNext = 1; + var attrValQuote = -1; + while(p < str.length) { + var c = str.charCodeAt(p); + switch(state) { + case 0: + switch(c) { + case 9:case 10:case 13:case 32: + break; + default: + state = next; + continue; + } + break; + case 1: + if(c == 60) { + state = 0; + next = 2; + } else { + start = p; + state = 13; + continue; + } + break; + case 2: + switch(c) { + case 33: + if(str.charCodeAt(p + 1) == 91) { + p += 2; + if(HxOverrides.substr(str,p,6).toUpperCase() != "CDATA[") { + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected = 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) { + if(p == start) { + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected node name",str,p)); + } + xml = Xml.createElement(HxOverrides.substr(str,start,p - start)); + parent.addChild(xml); + ++nsubs; + state = 0; + next = 4; + continue; + } + break; + case 4: + switch(c) { + case 47: + state = 11; + break; + case 62: + state = 9; + break; + default: + state = 5; + start = p; + continue; + } + break; + case 5: + if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) { + if(start == p) { + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected attribute name",str,p)); + } + var tmp = HxOverrides.substr(str,start,p - start); + aname = tmp; + if(xml.exists(aname)) { + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Duplicate attribute [" + aname + "]",str,p)); + } + state = 0; + next = 6; + continue; + } + break; + case 6: + if(c == 61) { + state = 0; + next = 7; + } else { + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected =",str,p)); + } + break; + case 7: + switch(c) { + case 34:case 39: + buf = new StringBuf(); + state = 8; + start = p + 1; + attrValQuote = c; + break; + default: + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected \"",str,p)); + } + break; + case 8: + switch(c) { + case 38: + var len = p - start; + buf.b += len == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len); + state = 18; + escapeNext = 8; + start = p + 1; + break; + case 60:case 62: + if(strict) { + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Invalid unescaped " + String.fromCodePoint(c) + " in attribute value",str,p)); + } else if(c == attrValQuote) { + var len1 = p - start; + buf.b += len1 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len1); + var val = buf.b; + buf = new StringBuf(); + xml.set(aname,val); + state = 0; + next = 4; + } + break; + default: + if(c == attrValQuote) { + var len2 = p - start; + buf.b += len2 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len2); + var val1 = buf.b; + buf = new StringBuf(); + xml.set(aname,val1); + state = 0; + next = 4; + } + } + break; + case 9: + p = haxe_xml_Parser.doParse(str,strict,p,xml); + start = p; + state = 1; + break; + case 10: + if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45)) { + if(start == p) { + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected node name",str,p)); + } + var v = HxOverrides.substr(str,start,p - start); + if(parent == null || parent.nodeType != 0) { + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Unexpected , tag is not open",str,p)); + } + if(parent.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element but found " + (parent.nodeType == null ? "null" : XmlType.toString(parent.nodeType))); + } + if(v != parent.nodeName) { + if(parent.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element but found " + (parent.nodeType == null ? "null" : XmlType.toString(parent.nodeType))); + } + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected ",str,p)); + } + state = 0; + next = 12; + continue; + } + break; + case 11: + if(c == 62) { + state = 1; + } else { + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected >",str,p)); + } + break; + case 12: + if(c == 62) { + if(nsubs == 0) { + parent.addChild(Xml.createPCData("")); + } + return p; + } else { + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Expected >",str,p)); + } + break; + case 13: + if(c == 60) { + var len3 = p - start; + buf.b += len3 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len3); + var child = Xml.createPCData(buf.b); + buf = new StringBuf(); + parent.addChild(child); + ++nsubs; + state = 0; + next = 2; + } else if(c == 38) { + var len4 = p - start; + buf.b += len4 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len4); + state = 18; + escapeNext = 13; + start = p + 1; + } + break; + case 14: + if(c == 63 && str.charCodeAt(p + 1) == 62) { + ++p; + var str1 = HxOverrides.substr(str,start + 1,p - start - 2); + parent.addChild(Xml.createProcessingInstruction(str1)); + ++nsubs; + state = 1; + } + break; + case 15: + if(c == 45 && str.charCodeAt(p + 1) == 45 && str.charCodeAt(p + 2) == 62) { + parent.addChild(Xml.createComment(HxOverrides.substr(str,start,p - start))); + ++nsubs; + p += 2; + state = 1; + } + break; + case 16: + if(c == 91) { + ++nbrackets; + } else if(c == 93) { + --nbrackets; + } else if(c == 62 && nbrackets == 0) { + parent.addChild(Xml.createDocType(HxOverrides.substr(str,start,p - start))); + ++nsubs; + state = 1; + } + break; + case 17: + if(c == 93 && str.charCodeAt(p + 1) == 93 && str.charCodeAt(p + 2) == 62) { + var child1 = Xml.createCData(HxOverrides.substr(str,start,p - start)); + parent.addChild(child1); + ++nsubs; + p += 2; + state = 1; + } + break; + case 18: + if(c == 59) { + var s = HxOverrides.substr(str,start,p - start); + if(s.charCodeAt(0) == 35) { + var c1 = s.charCodeAt(1) == 120 ? Std.parseInt("0" + HxOverrides.substr(s,1,s.length - 1)) : Std.parseInt(HxOverrides.substr(s,1,s.length - 1)); + buf.b += String.fromCodePoint(c1); + } else if(!Object.prototype.hasOwnProperty.call(haxe_xml_Parser.escapes.h,s)) { + if(strict) { + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Undefined entity: " + s,str,p)); + } + buf.b += Std.string("&" + s + ";"); + } else { + buf.b += Std.string(haxe_xml_Parser.escapes.h[s]); + } + start = p + 1; + state = escapeNext; + } else if(!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c == 58 || c == 46 || c == 95 || c == 45) && c != 35) { + if(strict) { + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Invalid character in entity: " + String.fromCodePoint(c),str,p)); + } + buf.b += String.fromCodePoint(38); + var len5 = p - start; + buf.b += len5 == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len5); + --p; + start = p + 1; + state = escapeNext; + } + break; + } + ++p; + } + if(state == 1) { + start = p; + state = 13; + } + if(state == 13) { + if(parent.nodeType == 0) { + if(parent.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element but found " + (parent.nodeType == null ? "null" : XmlType.toString(parent.nodeType))); + } + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Unclosed node <" + parent.nodeName + ">",str,p)); + } + if(p != start || nsubs == 0) { + var len = p - start; + buf.b += len == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len); + parent.addChild(Xml.createPCData(buf.b)); + ++nsubs; + } + return p; + } + if(!strict && state == 18 && escapeNext == 13) { + buf.b += String.fromCodePoint(38); + var len = p - start; + buf.b += len == null ? HxOverrides.substr(str,start,null) : HxOverrides.substr(str,start,len); + parent.addChild(Xml.createPCData(buf.b)); + ++nsubs; + return p; + } + throw haxe_Exception.thrown(new haxe_xml_XmlParserException("Unexpected end",str,p)); +}; +var haxe_xml_Printer = function(pretty) { + this.output = new StringBuf(); + this.pretty = pretty; +}; +$hxClasses["haxe.xml.Printer"] = haxe_xml_Printer; +haxe_xml_Printer.__name__ = "haxe.xml.Printer"; +haxe_xml_Printer.print = function(xml,pretty) { + if(pretty == null) { + pretty = false; + } + var printer = new haxe_xml_Printer(pretty); + printer.writeNode(xml,""); + return printer.output.b; +}; +haxe_xml_Printer.prototype = { + writeNode: function(value,tabs) { + switch(value.nodeType) { + case 0: + this.output.b += Std.string(tabs + "<"); + if(value.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType))); + } + this.output.b += Std.string(value.nodeName); + var attribute = value.attributes(); + while(attribute.hasNext()) { + var attribute1 = attribute.next(); + this.output.b += Std.string(" " + attribute1 + "=\""); + var input = StringTools.htmlEscape(value.get(attribute1),true); + this.output.b += Std.string(input); + this.output.b += "\""; + } + if(this.hasChildren(value)) { + this.output.b += ">"; + if(this.pretty) { + this.output.b += "\n"; + } + if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType))); + } + var _g_current = 0; + var _g_array = value.children; + while(_g_current < _g_array.length) { + var child = _g_array[_g_current++]; + this.writeNode(child,this.pretty ? tabs + "\t" : tabs); + } + this.output.b += Std.string(tabs + ""; + if(this.pretty) { + this.output.b += "\n"; + } + } else { + this.output.b += "/>"; + if(this.pretty) { + this.output.b += "\n"; + } + } + break; + case 1: + if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) { + throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType))); + } + var nodeValue = value.nodeValue; + if(nodeValue.length != 0) { + var input = tabs + StringTools.htmlEscape(nodeValue); + this.output.b += Std.string(input); + if(this.pretty) { + this.output.b += "\n"; + } + } + break; + case 2: + this.output.b += Std.string(tabs + ""; + if(this.pretty) { + this.output.b += "\n"; + } + break; + case 3: + if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) { + throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType))); + } + var commentContent = value.nodeValue; + var _this_r = new RegExp("[\n\r\t]+","g".split("u").join("")); + commentContent = commentContent.replace(_this_r,""); + commentContent = ""; + this.output.b += tabs == null ? "null" : "" + tabs; + var input = StringTools.trim(commentContent); + this.output.b += Std.string(input); + if(this.pretty) { + this.output.b += "\n"; + } + break; + case 4: + if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) { + throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType))); + } + this.output.b += Std.string(""); + if(this.pretty) { + this.output.b += "\n"; + } + break; + case 5: + if(value.nodeType == Xml.Document || value.nodeType == Xml.Element) { + throw haxe_Exception.thrown("Bad node type, unexpected " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType))); + } + this.output.b += Std.string(""); + if(this.pretty) { + this.output.b += "\n"; + } + break; + case 6: + if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType))); + } + var _g_current = 0; + var _g_array = value.children; + while(_g_current < _g_array.length) { + var child = _g_array[_g_current++]; + this.writeNode(child,tabs); + } + break; + } + } + ,hasChildren: function(value) { + if(value.nodeType != Xml.Document && value.nodeType != Xml.Element) { + throw haxe_Exception.thrown("Bad node type, expected Element or Document but found " + (value.nodeType == null ? "null" : XmlType.toString(value.nodeType))); + } + var _g_current = 0; + var _g_array = value.children; + while(_g_current < _g_array.length) { + var child = _g_array[_g_current++]; + switch(child.nodeType) { + case 0:case 1: + return true; + case 2:case 3: + if(child.nodeType == Xml.Document || child.nodeType == Xml.Element) { + throw haxe_Exception.thrown("Bad node type, unexpected " + (child.nodeType == null ? "null" : XmlType.toString(child.nodeType))); + } + if(StringTools.ltrim(child.nodeValue).length != 0) { + return true; + } + break; + default: + } + } + return false; + } + ,__class__: haxe_xml_Printer +}; +var haxe_zip_ExtraField = $hxEnums["haxe.zip.ExtraField"] = { __ename__:"haxe.zip.ExtraField",__constructs__:null + ,FUnknown: ($_=function(tag,bytes) { return {_hx_index:0,tag:tag,bytes:bytes,__enum__:"haxe.zip.ExtraField",toString:$estr}; },$_._hx_name="FUnknown",$_.__params__ = ["tag","bytes"],$_) + ,FInfoZipUnicodePath: ($_=function(name,crc) { return {_hx_index:1,name:name,crc:crc,__enum__:"haxe.zip.ExtraField",toString:$estr}; },$_._hx_name="FInfoZipUnicodePath",$_.__params__ = ["name","crc"],$_) + ,FUtf8: {_hx_name:"FUtf8",_hx_index:2,__enum__:"haxe.zip.ExtraField",toString:$estr} +}; +haxe_zip_ExtraField.__constructs__ = [haxe_zip_ExtraField.FUnknown,haxe_zip_ExtraField.FInfoZipUnicodePath,haxe_zip_ExtraField.FUtf8]; +var haxe_zip_Huffman = $hxEnums["haxe.zip.Huffman"] = { __ename__:"haxe.zip.Huffman",__constructs__:null + ,Found: ($_=function(i) { return {_hx_index:0,i:i,__enum__:"haxe.zip.Huffman",toString:$estr}; },$_._hx_name="Found",$_.__params__ = ["i"],$_) + ,NeedBit: ($_=function(left,right) { return {_hx_index:1,left:left,right:right,__enum__:"haxe.zip.Huffman",toString:$estr}; },$_._hx_name="NeedBit",$_.__params__ = ["left","right"],$_) + ,NeedBits: ($_=function(n,table) { return {_hx_index:2,n:n,table:table,__enum__:"haxe.zip.Huffman",toString:$estr}; },$_._hx_name="NeedBits",$_.__params__ = ["n","table"],$_) +}; +haxe_zip_Huffman.__constructs__ = [haxe_zip_Huffman.Found,haxe_zip_Huffman.NeedBit,haxe_zip_Huffman.NeedBits]; +var haxe_zip_HuffTools = function() { +}; +$hxClasses["haxe.zip.HuffTools"] = haxe_zip_HuffTools; +haxe_zip_HuffTools.__name__ = "haxe.zip.HuffTools"; +haxe_zip_HuffTools.prototype = { + treeDepth: function(t) { + switch(t._hx_index) { + case 0: + var _g = t.i; + return 0; + case 1: + var a = t.left; + var b = t.right; + var da = this.treeDepth(a); + var db = this.treeDepth(b); + return 1 + (da < db ? da : db); + case 2: + var _g = t.n; + var _g = t.table; + throw haxe_Exception.thrown("assert"); + } + } + ,treeCompress: function(t) { + var d = this.treeDepth(t); + if(d == 0) { + return t; + } + if(d == 1) { + if(t._hx_index == 1) { + var a = t.left; + var b = t.right; + return haxe_zip_Huffman.NeedBit(this.treeCompress(a),this.treeCompress(b)); + } else { + throw haxe_Exception.thrown("assert"); + } + } + var size = 1 << d; + var table = []; + var _g = 0; + var _g1 = size; + while(_g < _g1) { + var i = _g++; + table.push(haxe_zip_Huffman.Found(-1)); + } + this.treeWalk(table,0,0,d,t); + return haxe_zip_Huffman.NeedBits(d,table); + } + ,treeWalk: function(table,p,cd,d,t) { + if(t._hx_index == 1) { + var a = t.left; + var b = t.right; + if(d > 0) { + this.treeWalk(table,p,cd + 1,d - 1,a); + this.treeWalk(table,p | 1 << cd,cd + 1,d - 1,b); + } else { + table[p] = this.treeCompress(t); + } + } else { + table[p] = this.treeCompress(t); + } + } + ,treeMake: function(bits,maxbits,v,len) { + if(len > maxbits) { + throw haxe_Exception.thrown("Invalid huffman"); + } + var idx = v << 5 | len; + if(bits.h.hasOwnProperty(idx)) { + return haxe_zip_Huffman.Found(bits.h[idx]); + } + v <<= 1; + ++len; + return haxe_zip_Huffman.NeedBit(this.treeMake(bits,maxbits,v,len),this.treeMake(bits,maxbits,v | 1,len)); + } + ,make: function(lengths,pos,nlengths,maxbits) { + if(nlengths == 1) { + return haxe_zip_Huffman.NeedBit(haxe_zip_Huffman.Found(0),haxe_zip_Huffman.Found(0)); + } + var counts = []; + var tmp = []; + if(maxbits > 32) { + throw haxe_Exception.thrown("Invalid huffman"); + } + var _g = 0; + var _g1 = maxbits; + while(_g < _g1) { + var i = _g++; + counts.push(0); + tmp.push(0); + } + var _g = 0; + var _g1 = nlengths; + while(_g < _g1) { + var i = _g++; + var p = lengths[i + pos]; + if(p >= maxbits) { + throw haxe_Exception.thrown("Invalid huffman"); + } + counts[p]++; + } + var code = 0; + var _g = 1; + var _g1 = maxbits - 1; + while(_g < _g1) { + var i = _g++; + code = code + counts[i] << 1; + tmp[i] = code; + } + var bits = new haxe_ds_IntMap(); + var _g = 0; + var _g1 = nlengths; + while(_g < _g1) { + var i = _g++; + var l = lengths[i + pos]; + if(l != 0) { + var n = tmp[l - 1]; + tmp[l - 1] = n + 1; + bits.h[n << 5 | l] = i; + } + } + return this.treeCompress(haxe_zip_Huffman.NeedBit(this.treeMake(bits,maxbits,0,1),this.treeMake(bits,maxbits,1,1))); + } + ,__class__: haxe_zip_HuffTools +}; +var haxe_zip__$InflateImpl_Window = function(hasCrc) { + this.buffer = new haxe_io_Bytes(new ArrayBuffer(65536)); + this.pos = 0; + if(hasCrc) { + this.crc = new haxe_crypto_Adler32(); + } +}; +$hxClasses["haxe.zip._InflateImpl.Window"] = haxe_zip__$InflateImpl_Window; +haxe_zip__$InflateImpl_Window.__name__ = "haxe.zip._InflateImpl.Window"; +haxe_zip__$InflateImpl_Window.prototype = { + slide: function() { + if(this.crc != null) { + this.crc.update(this.buffer,0,32768); + } + var b = new haxe_io_Bytes(new ArrayBuffer(65536)); + this.pos -= 32768; + b.blit(0,this.buffer,32768,this.pos); + this.buffer = b; + } + ,addBytes: function(b,p,len) { + if(this.pos + len > 65536) { + this.slide(); + } + this.buffer.blit(this.pos,b,p,len); + this.pos += len; + } + ,addByte: function(c) { + if(this.pos == 65536) { + this.slide(); + } + this.buffer.b[this.pos] = c & 255; + this.pos++; + } + ,getLastChar: function() { + return this.buffer.b[this.pos - 1]; + } + ,available: function() { + return this.pos; + } + ,checksum: function() { + if(this.crc != null) { + this.crc.update(this.buffer,0,this.pos); + } + return this.crc; + } + ,__class__: haxe_zip__$InflateImpl_Window +}; +var haxe_zip__$InflateImpl_State = $hxEnums["haxe.zip._InflateImpl.State"] = { __ename__:"haxe.zip._InflateImpl.State",__constructs__:null + ,Head: {_hx_name:"Head",_hx_index:0,__enum__:"haxe.zip._InflateImpl.State",toString:$estr} + ,Block: {_hx_name:"Block",_hx_index:1,__enum__:"haxe.zip._InflateImpl.State",toString:$estr} + ,CData: {_hx_name:"CData",_hx_index:2,__enum__:"haxe.zip._InflateImpl.State",toString:$estr} + ,Flat: {_hx_name:"Flat",_hx_index:3,__enum__:"haxe.zip._InflateImpl.State",toString:$estr} + ,Crc: {_hx_name:"Crc",_hx_index:4,__enum__:"haxe.zip._InflateImpl.State",toString:$estr} + ,Dist: {_hx_name:"Dist",_hx_index:5,__enum__:"haxe.zip._InflateImpl.State",toString:$estr} + ,DistOne: {_hx_name:"DistOne",_hx_index:6,__enum__:"haxe.zip._InflateImpl.State",toString:$estr} + ,Done: {_hx_name:"Done",_hx_index:7,__enum__:"haxe.zip._InflateImpl.State",toString:$estr} +}; +haxe_zip__$InflateImpl_State.__constructs__ = [haxe_zip__$InflateImpl_State.Head,haxe_zip__$InflateImpl_State.Block,haxe_zip__$InflateImpl_State.CData,haxe_zip__$InflateImpl_State.Flat,haxe_zip__$InflateImpl_State.Crc,haxe_zip__$InflateImpl_State.Dist,haxe_zip__$InflateImpl_State.DistOne,haxe_zip__$InflateImpl_State.Done]; +var haxe_zip_InflateImpl = function(i,header,crc) { + if(crc == null) { + crc = true; + } + if(header == null) { + header = true; + } + this.isFinal = false; + this.htools = new haxe_zip_HuffTools(); + this.huffman = this.buildFixedHuffman(); + this.huffdist = null; + this.len = 0; + this.dist = 0; + this.state = header ? haxe_zip__$InflateImpl_State.Head : haxe_zip__$InflateImpl_State.Block; + this.input = i; + this.bits = 0; + this.nbits = 0; + this.needed = 0; + this.output = null; + this.outpos = 0; + this.lengths = []; + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.lengths.push(-1); + this.window = new haxe_zip__$InflateImpl_Window(crc); +}; +$hxClasses["haxe.zip.InflateImpl"] = haxe_zip_InflateImpl; +haxe_zip_InflateImpl.__name__ = "haxe.zip.InflateImpl"; +haxe_zip_InflateImpl.prototype = { + buildFixedHuffman: function() { + if(haxe_zip_InflateImpl.FIXED_HUFFMAN != null) { + return haxe_zip_InflateImpl.FIXED_HUFFMAN; + } + var a = []; + var _g = 0; + while(_g < 288) { + var n = _g++; + a.push(n <= 143 ? 8 : n <= 255 ? 9 : n <= 279 ? 7 : 8); + } + haxe_zip_InflateImpl.FIXED_HUFFMAN = this.htools.make(a,0,288,10); + return haxe_zip_InflateImpl.FIXED_HUFFMAN; + } + ,readBytes: function(b,pos,len) { + this.needed = len; + this.outpos = pos; + this.output = b; + if(len > 0) { + while(this.inflateLoop()) { + } + } + return len - this.needed; + } + ,getBits: function(n) { + while(this.nbits < n) { + this.bits |= this.input.readByte() << this.nbits; + this.nbits += 8; + } + var b = this.bits & (1 << n) - 1; + this.nbits -= n; + this.bits >>= n; + return b; + } + ,getBit: function() { + if(this.nbits == 0) { + this.nbits = 8; + this.bits = this.input.readByte(); + } + var b = (this.bits & 1) == 1; + this.nbits--; + this.bits >>= 1; + return b; + } + ,getRevBits: function(n) { + if(n == 0) { + return 0; + } else if(this.getBit()) { + return 1 << n - 1 | this.getRevBits(n - 1); + } else { + return this.getRevBits(n - 1); + } + } + ,resetBits: function() { + this.bits = 0; + this.nbits = 0; + } + ,addBytes: function(b,p,len) { + this.window.addBytes(b,p,len); + this.output.blit(this.outpos,b,p,len); + this.needed -= len; + this.outpos += len; + } + ,addByte: function(b) { + this.window.addByte(b); + this.output.b[this.outpos] = b & 255; + this.needed--; + this.outpos++; + } + ,addDistOne: function(n) { + var c = this.window.getLastChar(); + var _g = 0; + var _g1 = n; + while(_g < _g1) { + var i = _g++; + this.addByte(c); + } + } + ,addDist: function(d,len) { + this.addBytes(this.window.buffer,this.window.pos - d,len); + } + ,applyHuffman: function(h) { + switch(h._hx_index) { + case 0: + var n = h.i; + return n; + case 1: + var a = h.left; + var b = h.right; + return this.applyHuffman(this.getBit() ? b : a); + case 2: + var n = h.n; + var tbl = h.table; + return this.applyHuffman(tbl[this.getBits(n)]); + } + } + ,inflateLengths: function(a,max) { + var i = 0; + var prev = 0; + while(i < max) { + var n = this.applyHuffman(this.huffman); + switch(n) { + case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15: + prev = n; + a[i] = n; + ++i; + break; + case 16: + var end = i + 3 + this.getBits(2); + if(end > max) { + throw haxe_Exception.thrown("Invalid data"); + } + while(i < end) { + a[i] = prev; + ++i; + } + break; + case 17: + i += 3 + this.getBits(3); + if(i > max) { + throw haxe_Exception.thrown("Invalid data"); + } + break; + case 18: + i += 11 + this.getBits(7); + if(i > max) { + throw haxe_Exception.thrown("Invalid data"); + } + break; + default: + throw haxe_Exception.thrown("Invalid data"); + } + } + } + ,inflateLoop: function() { + switch(this.state._hx_index) { + case 0: + var cmf = this.input.readByte(); + var cm = cmf & 15; + var cinfo = cmf >> 4; + if(cm != 8) { + throw haxe_Exception.thrown("Invalid data"); + } + var flg = this.input.readByte(); + var fdict = (flg & 32) != 0; + if(((cmf << 8) + flg) % 31 != 0) { + throw haxe_Exception.thrown("Invalid data"); + } + if(fdict) { + throw haxe_Exception.thrown("Unsupported dictionary"); + } + this.state = haxe_zip__$InflateImpl_State.Block; + return true; + case 1: + this.isFinal = this.getBit(); + switch(this.getBits(2)) { + case 0: + this.len = this.input.readUInt16(); + var nlen = this.input.readUInt16(); + if(nlen != 65535 - this.len) { + throw haxe_Exception.thrown("Invalid data"); + } + this.state = haxe_zip__$InflateImpl_State.Flat; + var r = this.inflateLoop(); + this.resetBits(); + return r; + case 1: + this.huffman = this.buildFixedHuffman(); + this.huffdist = null; + this.state = haxe_zip__$InflateImpl_State.CData; + return true; + case 2: + var hlit = this.getBits(5) + 257; + var hdist = this.getBits(5) + 1; + var hclen = this.getBits(4) + 4; + var _g = 0; + var _g1 = hclen; + while(_g < _g1) { + var i = _g++; + this.lengths[haxe_zip_InflateImpl.CODE_LENGTHS_POS[i]] = this.getBits(3); + } + var _g = hclen; + var _g1 = 19; + while(_g < _g1) { + var i = _g++; + this.lengths[haxe_zip_InflateImpl.CODE_LENGTHS_POS[i]] = 0; + } + this.huffman = this.htools.make(this.lengths,0,19,8); + var lengths = []; + var _g = 0; + var _g1 = hlit + hdist; + while(_g < _g1) { + var i = _g++; + lengths.push(0); + } + this.inflateLengths(lengths,hlit + hdist); + this.huffdist = this.htools.make(lengths,hlit,hdist,16); + this.huffman = this.htools.make(lengths,0,hlit,16); + this.state = haxe_zip__$InflateImpl_State.CData; + return true; + default: + throw haxe_Exception.thrown("Invalid data"); + } + break; + case 2: + var n = this.applyHuffman(this.huffman); + if(n < 256) { + this.addByte(n); + return this.needed > 0; + } else if(n == 256) { + this.state = this.isFinal ? haxe_zip__$InflateImpl_State.Crc : haxe_zip__$InflateImpl_State.Block; + return true; + } else { + n -= 257; + var extra_bits = haxe_zip_InflateImpl.LEN_EXTRA_BITS_TBL[n]; + if(extra_bits == -1) { + throw haxe_Exception.thrown("Invalid data"); + } + this.len = haxe_zip_InflateImpl.LEN_BASE_VAL_TBL[n] + this.getBits(extra_bits); + var dist_code = this.huffdist == null ? this.getRevBits(5) : this.applyHuffman(this.huffdist); + extra_bits = haxe_zip_InflateImpl.DIST_EXTRA_BITS_TBL[dist_code]; + if(extra_bits == -1) { + throw haxe_Exception.thrown("Invalid data"); + } + this.dist = haxe_zip_InflateImpl.DIST_BASE_VAL_TBL[dist_code] + this.getBits(extra_bits); + if(this.dist > this.window.available()) { + throw haxe_Exception.thrown("Invalid data"); + } + this.state = this.dist == 1 ? haxe_zip__$InflateImpl_State.DistOne : haxe_zip__$InflateImpl_State.Dist; + return true; + } + break; + case 3: + var rlen = this.len < this.needed ? this.len : this.needed; + var bytes = this.input.read(rlen); + this.len -= rlen; + this.addBytes(bytes,0,rlen); + if(this.len == 0) { + this.state = this.isFinal ? haxe_zip__$InflateImpl_State.Crc : haxe_zip__$InflateImpl_State.Block; + } + return this.needed > 0; + case 4: + var calc = this.window.checksum(); + if(calc == null) { + this.state = haxe_zip__$InflateImpl_State.Done; + return true; + } + var crc = haxe_crypto_Adler32.read(this.input); + if(!calc.equals(crc)) { + throw haxe_Exception.thrown("Invalid CRC"); + } + this.state = haxe_zip__$InflateImpl_State.Done; + return true; + case 5: + while(this.len > 0 && this.needed > 0) { + var rdist = this.len < this.dist ? this.len : this.dist; + var rlen = this.needed < rdist ? this.needed : rdist; + this.addDist(this.dist,rlen); + this.len -= rlen; + } + if(this.len == 0) { + this.state = haxe_zip__$InflateImpl_State.CData; + } + return this.needed > 0; + case 6: + var rlen = this.len < this.needed ? this.len : this.needed; + this.addDistOne(rlen); + this.len -= rlen; + if(this.len == 0) { + this.state = haxe_zip__$InflateImpl_State.CData; + } + return this.needed > 0; + case 7: + return false; + } + } + ,__class__: haxe_zip_InflateImpl +}; +var haxe_zip_Reader = function(i) { + this.i = i; +}; +$hxClasses["haxe.zip.Reader"] = haxe_zip_Reader; +haxe_zip_Reader.__name__ = "haxe.zip.Reader"; +haxe_zip_Reader.readZip = function(i) { + var r = new haxe_zip_Reader(i); + return r.read(); +}; +haxe_zip_Reader.prototype = { + readZipDate: function() { + var t = this.i.readUInt16(); + var hour = t >> 11 & 31; + var min = t >> 5 & 63; + var sec = t & 31; + var d = this.i.readUInt16(); + var year = d >> 9; + var month = d >> 5 & 15; + var day = d & 31; + return new Date(year + 1980,month - 1,day,hour,min,sec << 1); + } + ,readExtraFields: function(length) { + var fields = new haxe_ds_List(); + while(length > 0) { + if(length < 4) { + throw haxe_Exception.thrown("Invalid extra fields data"); + } + var tag = this.i.readUInt16(); + var len = this.i.readUInt16(); + if(length < len) { + throw haxe_Exception.thrown("Invalid extra fields data"); + } + if(tag == 28789) { + var version = this.i.readByte(); + if(version != 1) { + var data = new haxe_io_BytesBuffer(); + data.addByte(version); + data.add(this.i.read(len - 1)); + fields.add(haxe_zip_ExtraField.FUnknown(tag,data.getBytes())); + } else { + var crc = this.i.readInt32(); + var name = this.i.read(len - 5).toString(); + fields.add(haxe_zip_ExtraField.FInfoZipUnicodePath(name,crc)); + } + } else { + fields.add(haxe_zip_ExtraField.FUnknown(tag,this.i.read(len))); + } + length -= 4 + len; + } + return fields; + } + ,readEntryHeader: function() { + var i = this.i; + var h = i.readInt32(); + if(h == 33639248 || h == 101010256) { + return null; + } + if(h != 67324752) { + throw haxe_Exception.thrown("Invalid Zip Data"); + } + var version = i.readUInt16(); + var flags = i.readUInt16(); + var utf8 = (flags & 2048) != 0; + if((flags & 63473) != 0) { + throw haxe_Exception.thrown("Unsupported flags " + flags); + } + var compression = i.readUInt16(); + var compressed = compression != 0; + if(compressed && compression != 8) { + throw haxe_Exception.thrown("Unsupported compression " + compression); + } + var mtime = this.readZipDate(); + var crc32 = i.readInt32(); + var csize = i.readInt32(); + var usize = i.readInt32(); + var fnamelen = i.readInt16(); + var elen = i.readInt16(); + var fname = i.readString(fnamelen); + var fields = this.readExtraFields(elen); + if(utf8) { + fields.push(haxe_zip_ExtraField.FUtf8); + } + var data = null; + if((flags & 8) != 0) { + crc32 = null; + } + return { fileName : fname, fileSize : usize, fileTime : mtime, compressed : compressed, dataSize : csize, data : data, crc32 : crc32, extraFields : fields}; + } + ,read: function() { + var l = new haxe_ds_List(); + var buf = null; + var tmp = null; + while(true) { + var e = this.readEntryHeader(); + if(e == null) { + break; + } + if(e.crc32 == null) { + if(e.compressed) { + var bufSize = 65536; + if(tmp == null) { + tmp = new haxe_io_Bytes(new ArrayBuffer(bufSize)); + } + var out = new haxe_io_BytesBuffer(); + var z = new haxe_zip_InflateImpl(this.i,false,false); + while(true) { + var n = z.readBytes(tmp,0,bufSize); + out.addBytes(tmp,0,n); + if(n < bufSize) { + break; + } + } + e.data = out.getBytes(); + } else { + e.data = this.i.read(e.dataSize); + } + e.crc32 = this.i.readInt32(); + if(e.crc32 == 134695760) { + e.crc32 = this.i.readInt32(); + } + e.dataSize = this.i.readInt32(); + e.fileSize = this.i.readInt32(); + e.dataSize = e.fileSize; + e.compressed = false; + } else { + e.data = this.i.read(e.dataSize); + } + l.add(e); + } + return l; + } + ,__class__: haxe_zip_Reader +}; +var js_Browser = function() { }; +$hxClasses["js.Browser"] = js_Browser; +js_Browser.__name__ = "js.Browser"; +js_Browser.__properties__ = {get_supported:"get_supported"}; +js_Browser.get_supported = function() { + if(typeof(window) != "undefined" && typeof(window.location) != "undefined") { + return typeof(window.location.protocol) == "string"; + } else { + return false; + } +}; +var js_html__$CanvasElement_CanvasUtil = function() { }; +$hxClasses["js.html._CanvasElement.CanvasUtil"] = js_html__$CanvasElement_CanvasUtil; +js_html__$CanvasElement_CanvasUtil.__name__ = "js.html._CanvasElement.CanvasUtil"; +js_html__$CanvasElement_CanvasUtil.getContextWebGL = function(canvas,attribs) { + var name = "webgl"; + var ctx = canvas.getContext(name,attribs); + if(ctx != null) { + return ctx; + } + var name = "experimental-webgl"; + var ctx = canvas.getContext(name,attribs); + if(ctx != null) { + return ctx; + } + return null; +}; +var js_lib__$ArrayBuffer_ArrayBufferCompat = function() { }; +$hxClasses["js.lib._ArrayBuffer.ArrayBufferCompat"] = js_lib__$ArrayBuffer_ArrayBufferCompat; +js_lib__$ArrayBuffer_ArrayBufferCompat.__name__ = "js.lib._ArrayBuffer.ArrayBufferCompat"; +js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl = function(begin,end) { + var u = new Uint8Array(this,begin,end == null ? null : end - begin); + var resultArray = new Uint8Array(u.byteLength); + resultArray.set(u); + return resultArray.buffer; +}; +var lime__$internal_backend_html5_GameDeviceData = function() { + this.connected = true; + this.buttons = []; + this.axes = []; +}; +$hxClasses["lime._internal.backend.html5.GameDeviceData"] = lime__$internal_backend_html5_GameDeviceData; +lime__$internal_backend_html5_GameDeviceData.__name__ = "lime._internal.backend.html5.GameDeviceData"; +lime__$internal_backend_html5_GameDeviceData.prototype = { + __class__: lime__$internal_backend_html5_GameDeviceData +}; +var lime__$internal_backend_html5_HTML5AudioSource = function(parent) { + this.parent = parent; + this.id = -1; + this.gain = 1; + this.position = new lime_math_Vector4(); +}; +$hxClasses["lime._internal.backend.html5.HTML5AudioSource"] = lime__$internal_backend_html5_HTML5AudioSource; +lime__$internal_backend_html5_HTML5AudioSource.__name__ = "lime._internal.backend.html5.HTML5AudioSource"; +lime__$internal_backend_html5_HTML5AudioSource.prototype = { + dispose: function() { + } + ,init: function() { + } + ,play: function() { + if(this.playing || this.parent.buffer == null || this.parent.buffer.__srcHowl == null) { + return; + } + this.playing = true; + var time = this.getCurrentTime(); + this.completed = false; + var cacheVolume = this.parent.buffer.__srcHowl._volume; + this.parent.buffer.__srcHowl._volume = this.parent.get_gain(); + this.id = this.parent.buffer.__srcHowl.play(); + this.parent.buffer.__srcHowl._volume = cacheVolume; + this.setPosition(this.parent.get_position()); + this.parent.buffer.__srcHowl.on("end",$bind(this,this.howl_onEnd),this.id); + this.setCurrentTime(time); + } + ,pause: function() { + this.playing = false; + if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) { + this.parent.buffer.__srcHowl.pause(this.id); + } + } + ,stop: function() { + this.playing = false; + if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) { + this.parent.buffer.__srcHowl.stop(this.id); + this.parent.buffer.__srcHowl.off("end",$bind(this,this.howl_onEnd),this.id); + } + } + ,howl_onEnd: function() { + this.playing = false; + if(this.loops > 0) { + this.loops--; + this.stop(); + this.play(); + return; + } else if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) { + this.parent.buffer.__srcHowl.stop(this.id); + this.parent.buffer.__srcHowl.off("end",$bind(this,this.howl_onEnd),this.id); + } + this.completed = true; + this.parent.onComplete.dispatch(); + } + ,getCurrentTime: function() { + if(this.id == -1) { + return 0; + } + if(this.completed) { + return this.getLength(); + } else if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) { + var time = (this.parent.buffer.__srcHowl.seek(this.id) * 1000 | 0) - this.parent.offset; + if(time < 0) { + return 0; + } + return time; + } + return 0; + } + ,setCurrentTime: function(value) { + if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) { + var pos = (value + this.parent.offset) / 1000; + if(pos < 0) { + pos = 0; + } + this.parent.buffer.__srcHowl.seek(pos,this.id); + } + return value; + } + ,getGain: function() { + return this.gain; + } + ,setGain: function(value) { + if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null && this.id != -1) { + this.parent.buffer.__srcHowl.volume(value,this.id); + } + return this.gain = value; + } + ,getLength: function() { + if(this.length != 0) { + return this.length; + } + if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null) { + return this.parent.buffer.__srcHowl.duration() * 1000 | 0; + } + return 0; + } + ,setLength: function(value) { + return this.length = value; + } + ,getLoops: function() { + return this.loops; + } + ,setLoops: function(value) { + return this.loops = value; + } + ,getPitch: function() { + return this.parent.buffer.__srcHowl.rate(); + } + ,setPitch: function(value) { + this.parent.buffer.__srcHowl.rate(value); + return this.getPitch(); + } + ,getPosition: function() { + return this.position; + } + ,setPosition: function(value) { + this.position.x = value.x; + this.position.y = value.y; + this.position.z = value.z; + this.position.w = value.w; + if(this.parent.buffer != null && this.parent.buffer.__srcHowl != null && this.parent.buffer.__srcHowl.pos != null) { + this.parent.buffer.__srcHowl.pos(this.position.x,this.position.y,this.position.z,this.id); + } + return this.position; + } + ,__class__: lime__$internal_backend_html5_HTML5AudioSource +}; +var lime__$internal_backend_html5_HTML5HTTPRequest = function() { + this.validStatus0 = new EReg("Tizen","gi").match(window.navigator.userAgent); +}; +$hxClasses["lime._internal.backend.html5.HTML5HTTPRequest"] = lime__$internal_backend_html5_HTML5HTTPRequest; +lime__$internal_backend_html5_HTML5HTTPRequest.__name__ = "lime._internal.backend.html5.HTML5HTTPRequest"; +lime__$internal_backend_html5_HTML5HTTPRequest.loadImage = function(uri) { + var promise = new lime_app_Promise(); + if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit) { + lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++; + lime__$internal_backend_html5_HTML5HTTPRequest.__loadImage(uri,promise,0); + } else { + lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.add({ instance : null, uri : uri, promise : promise, type : "IMAGE", options : 0}); + } + return promise.future; +}; +lime__$internal_backend_html5_HTML5HTTPRequest.loadImageFromBytes = function(bytes,type) { + var uri = URL.createObjectURL(new Blob([bytes.b.bufferValue],{ type : type})); + if(uri != null) { + var promise = new lime_app_Promise(); + if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit) { + lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++; + lime__$internal_backend_html5_HTML5HTTPRequest.__loadImage(uri,promise,1); + } else { + lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.add({ instance : null, uri : uri, promise : promise, type : "IMAGE", options : 1}); + } + return promise.future; + } else { + return lime__$internal_backend_html5_HTML5HTTPRequest.loadImage("data:" + type + ";base64," + lime__$internal_format_Base64.encode(bytes)); + } +}; +lime__$internal_backend_html5_HTML5HTTPRequest.processQueue = function() { + if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit && lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.length > 0) { + lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++; + var queueItem = lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.pop(); + switch(queueItem.type) { + case "BINARY": + queueItem.instance.__loadData(queueItem.uri,queueItem.promise); + break; + case "IMAGE": + lime__$internal_backend_html5_HTML5HTTPRequest.__loadImage(queueItem.uri,queueItem.promise,queueItem.options); + break; + case "TEXT": + queueItem.instance.__loadText(queueItem.uri,queueItem.promise); + break; + default: + lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--; + } + } +}; +lime__$internal_backend_html5_HTML5HTTPRequest.__createBlobURIFromBytes = function(bytes,type) { + return URL.createObjectURL(new Blob([bytes.b.bufferValue],{ type : type})); +}; +lime__$internal_backend_html5_HTML5HTTPRequest.__fixHostname = function(hostname) { + if(hostname == null) { + return ""; + } else { + return hostname; + } +}; +lime__$internal_backend_html5_HTML5HTTPRequest.__fixPort = function(port,protocol) { + if(port == null || port == "") { + switch(protocol) { + case "ftp:": + return "21"; + case "gopher:": + return "70"; + case "http:": + return "80"; + case "https:": + return "443"; + case "ws:": + return "80"; + case "wss:": + return "443"; + default: + return ""; + } + } + return port; +}; +lime__$internal_backend_html5_HTML5HTTPRequest.__fixProtocol = function(protocol) { + if(protocol == null || protocol == "") { + return "http:"; + } else { + return protocol; + } +}; +lime__$internal_backend_html5_HTML5HTTPRequest.__isInMemoryURI = function(uri) { + if(!StringTools.startsWith(uri,"data:")) { + return StringTools.startsWith(uri,"blob:"); + } else { + return true; + } +}; +lime__$internal_backend_html5_HTML5HTTPRequest.__isSameOrigin = function(path) { + if(path == null || path == "") { + return true; + } + if(lime__$internal_backend_html5_HTML5HTTPRequest.__isInMemoryURI(path)) { + return true; + } + if(lime__$internal_backend_html5_HTML5HTTPRequest.originElement == null) { + lime__$internal_backend_html5_HTML5HTTPRequest.originElement = window.document.createElement("a"); + lime__$internal_backend_html5_HTML5HTTPRequest.originHostname = lime__$internal_backend_html5_HTML5HTTPRequest.__fixHostname($global.location.hostname); + lime__$internal_backend_html5_HTML5HTTPRequest.originProtocol = lime__$internal_backend_html5_HTML5HTTPRequest.__fixProtocol($global.location.protocol); + lime__$internal_backend_html5_HTML5HTTPRequest.originPort = lime__$internal_backend_html5_HTML5HTTPRequest.__fixPort($global.location.port,lime__$internal_backend_html5_HTML5HTTPRequest.originProtocol); + } + var a = lime__$internal_backend_html5_HTML5HTTPRequest.originElement; + a.href = path; + if(a.hostname == "") { + a.href = a.href; + } + var hostname = lime__$internal_backend_html5_HTML5HTTPRequest.__fixHostname(a.hostname); + var protocol = lime__$internal_backend_html5_HTML5HTTPRequest.__fixProtocol(a.protocol); + var port = lime__$internal_backend_html5_HTML5HTTPRequest.__fixPort(a.port,protocol); + var sameHost = hostname == "" || hostname == lime__$internal_backend_html5_HTML5HTTPRequest.originHostname; + var samePort = port == "" || port == lime__$internal_backend_html5_HTML5HTTPRequest.originPort; + if(protocol != "file:" && sameHost) { + return samePort; + } else { + return false; + } +}; +lime__$internal_backend_html5_HTML5HTTPRequest.__loadImage = function(uri,promise,options) { + var image = new window.Image (); + if(!lime__$internal_backend_html5_HTML5HTTPRequest.__isSameOrigin(uri)) { + image.crossOrigin = "Anonymous"; + } + if(lime__$internal_backend_html5_HTML5HTTPRequest.supportsImageProgress == null) { + lime__$internal_backend_html5_HTML5HTTPRequest.supportsImageProgress = 'onprogress' in image; + } + if(lime__$internal_backend_html5_HTML5HTTPRequest.supportsImageProgress || lime__$internal_backend_html5_HTML5HTTPRequest.__isInMemoryURI(uri)) { + image.addEventListener("load",function(event) { + lime__$internal_backend_html5_HTML5HTTPRequest.__revokeBlobURI(uri,options); + var buffer = new lime_graphics_ImageBuffer(null,image.width,image.height); + buffer.__srcImage = image; + lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--; + lime__$internal_backend_html5_HTML5HTTPRequest.processQueue(); + promise.complete(new lime_graphics_Image(buffer)); + },false); + image.addEventListener("progress",function(event) { + promise.progress(event.loaded,event.total); + },false); + image.addEventListener("error",function(event) { + lime__$internal_backend_html5_HTML5HTTPRequest.__revokeBlobURI(uri,options); + lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--; + lime__$internal_backend_html5_HTML5HTTPRequest.processQueue(); + promise.error(new lime_net__$HTTPRequestErrorResponse(event.detail,null)); + },false); + image.src = uri; + } else { + var request = new XMLHttpRequest(); + request.onload = function(_) { + lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--; + lime__$internal_backend_html5_HTML5HTTPRequest.processQueue(); + var img = new lime_graphics_Image(); + img.__fromBytes(haxe_io_Bytes.ofData(request.response),function(img) { + promise.complete(img); + }); + }; + request.onerror = function(event) { + promise.error(new lime_net__$HTTPRequestErrorResponse(event.message,null)); + }; + request.onprogress = function(event) { + if(event.lengthComputable) { + promise.progress(event.loaded,event.total); + } + }; + request.open("GET",uri,true); + request.responseType = "arraybuffer"; + request.overrideMimeType("text/plain; charset=x-user-defined"); + request.send(null); + } +}; +lime__$internal_backend_html5_HTML5HTTPRequest.__revokeBlobURI = function(uri,options) { + if((options & 1) != 0) { + URL.revokeObjectURL(uri); + } +}; +lime__$internal_backend_html5_HTML5HTTPRequest.prototype = { + cancel: function() { + if(this.request != null) { + this.request.abort(); + } + } + ,init: function(parent) { + this.parent = parent; + } + ,load: function(uri,progress,readyStateChange) { + this.request = new XMLHttpRequest(); + if(this.parent.method == "POST") { + if(this.request.upload != null) { + this.request.upload.addEventListener("progress",progress,false); + } + } else { + this.request.addEventListener("progress",progress,false); + } + this.request.onreadystatechange = readyStateChange; + var query = ""; + if(this.parent.data == null) { + var h = this.parent.formData.h; + var key_h = h; + var key_keys = Object.keys(h); + var key_length = key_keys.length; + var key_current = 0; + while(key_current < key_length) { + var key = key_keys[key_current++]; + if(query.length > 0) { + query += "&"; + } + var value = this.parent.formData.h[key]; + if(key.indexOf("[]") > -1 && ((value) instanceof Array)) { + var _g = []; + var x = $getIterator(value); + while(x.hasNext()) { + var x1 = x.next(); + _g.push(encodeURIComponent(x1)); + } + var arrayValue = _g.join("&" + key + "="); + query += encodeURIComponent(key) + "=" + arrayValue; + } else { + var query1 = encodeURIComponent(key) + "="; + var s = Std.string(value); + query += query1 + encodeURIComponent(s); + } + } + if(this.parent.method == "GET" && query != "") { + if(uri.indexOf("?") > -1) { + uri += "&" + query; + } else { + uri += "?" + query; + } + query = ""; + } + } + this.request.open(Std.string(this.parent.method),uri,true); + if(this.parent.timeout > 0) { + this.request.timeout = this.parent.timeout; + } + if(this.binary) { + this.request.responseType = "arraybuffer"; + } + var contentType = null; + var _g = 0; + var _g1 = this.parent.headers; + while(_g < _g1.length) { + var header = _g1[_g]; + ++_g; + if(header.name == "Content-Type") { + contentType = header.value; + } else { + this.request.setRequestHeader(header.name,header.value); + } + } + if(this.parent.contentType != null) { + contentType = this.parent.contentType; + } + if(contentType == null) { + if(this.parent.data != null) { + contentType = "application/octet-stream"; + } else if(query != "") { + contentType = "application/x-www-form-urlencoded"; + } + } + if(contentType != null) { + this.request.setRequestHeader("Content-Type",contentType); + } + if(this.parent.withCredentials) { + this.request.withCredentials = true; + } + if(this.parent.data != null) { + this.request.send(this.parent.data.b.bufferValue); + } else { + this.request.send(query); + } + } + ,loadData: function(uri) { + var promise = new lime_app_Promise(); + if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit) { + lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++; + this.__loadData(uri,promise); + } else { + lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.add({ instance : this, uri : uri, promise : promise, type : "BINARY", options : 0}); + } + return promise.future; + } + ,loadText: function(uri) { + var promise = new lime_app_Promise(); + if(lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests < lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit) { + lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests++; + this.__loadText(uri,promise); + } else { + lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue.add({ instance : this, uri : uri, promise : promise, type : "TEXT", options : 0}); + } + return promise.future; + } + ,processResponse: function() { + if(this.parent.enableResponseHeaders) { + this.parent.responseHeaders = []; + var name; + var value; + var _g = 0; + var _g1 = this.request.getAllResponseHeaders().split("\n"); + while(_g < _g1.length) { + var line = _g1[_g]; + ++_g; + name = StringTools.trim(HxOverrides.substr(line,0,line.indexOf(":"))); + value = StringTools.trim(HxOverrides.substr(line,line.indexOf(":") + 1,null)); + if(name != "") { + this.parent.responseHeaders.push(new lime_net_HTTPRequestHeader(name,value)); + } + } + } + this.parent.responseStatus = this.request.status; + } + ,__loadData: function(uri,promise) { + var _gthis = this; + var progress = function(event) { + promise.progress(event.loaded,event.total); + }; + var readyStateChange = function(event) { + if(_gthis.request.readyState != 4) { + return; + } + var bytes = null; + if(_gthis.request.responseType == "") { + if(_gthis.request.responseText != null) { + bytes = haxe_io_Bytes.ofString(_gthis.request.responseText); + } + } else if(_gthis.request.response != null) { + bytes = haxe_io_Bytes.ofData(_gthis.request.response); + } + if(_gthis.request.status != null && (_gthis.request.status >= 200 && _gthis.request.status < 400 || _gthis.validStatus0 && _gthis.request.status == 0)) { + _gthis.processResponse(); + promise.complete(bytes); + } else { + _gthis.processResponse(); + promise.error(new lime_net__$HTTPRequestErrorResponse(_gthis.request.status,bytes)); + } + _gthis.request = null; + lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--; + lime__$internal_backend_html5_HTML5HTTPRequest.processQueue(); + }; + this.binary = true; + this.load(uri,progress,readyStateChange); + } + ,__loadText: function(uri,promise) { + var _gthis = this; + var progress = function(event) { + promise.progress(event.loaded,event.total); + }; + var readyStateChange = function(event) { + if(_gthis.request.readyState != 4) { + return; + } + if(_gthis.request.status != null && (_gthis.request.status >= 200 && _gthis.request.status < 400 || _gthis.validStatus0 && _gthis.request.status == 0)) { + _gthis.processResponse(); + promise.complete(_gthis.request.responseText); + } else { + _gthis.processResponse(); + promise.error(new lime_net__$HTTPRequestErrorResponse(_gthis.request.status,_gthis.request.responseText)); + } + _gthis.request = null; + lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests--; + lime__$internal_backend_html5_HTML5HTTPRequest.processQueue(); + }; + this.binary = false; + this.load(uri,progress,readyStateChange); + } + ,__class__: lime__$internal_backend_html5_HTML5HTTPRequest +}; +var lime_app__$Event_$Dynamic_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_Dynamic_Void"] = lime_app__$Event_$Dynamic_$Void; +lime_app__$Event_$Dynamic_$Void.__name__ = "lime.app._Event_Dynamic_Void"; +lime_app__$Event_$Dynamic_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$Dynamic_$Void +}; +var lime__$internal_backend_html5_Message = {}; +lime__$internal_backend_html5_Message.skip = function(object) { + if(!(object == null || !((object) instanceof Object) || Reflect.field(object,"__skipPrototype__") == true)) { + if(object.byteLength != null && object.byteOffset != null && object.buffer != null) { + return ((object.buffer) instanceof ArrayBuffer); + } else { + return false; + } + } else { + return true; + } +}; +lime__$internal_backend_html5_Message.disablePreserveClasses = function(object) { + if(object == null || !((object) instanceof Object) || Reflect.field(object,"__skipPrototype__") == true || object.byteLength != null && object.byteOffset != null && object.buffer != null && ((object.buffer) instanceof ArrayBuffer)) { + return; + } + object["__skipPrototype__"] = true; +}; +lime__$internal_backend_html5_Message.preserveClasses = function(this1) { + if(this1 == null || !((this1) instanceof Object) || Reflect.field(this1,"__skipPrototype__") == true || this1.byteLength != null && this1.byteOffset != null && this1.buffer != null && ((this1.buffer) instanceof ArrayBuffer) || Object.prototype.hasOwnProperty.call(this1,"__prototype__")) { + return; + } + if(!((this1) instanceof Array)) { + try { + if(this1.__class__ != null) { + this1["__prototype__"] = this1.__class__.__name__; + } else { + this1["__prototype__"] = null; + } + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + return; + } + if(typeof this1.toString == "function") { + Reflect.deleteField(this1,"toString"); + } + } + var _g = 0; + var _g1 = Object.values(this1); + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + lime__$internal_backend_html5_Message.preserveClasses(child); + } +}; +lime__$internal_backend_html5_Message.restoreClasses = function(this1,flag) { + if(flag == null) { + flag = Math.random() * 2147483647 | 0; + if(Reflect.field(this1,"__restoreFlag__") == flag) { + ++flag; + } + } + if(this1 == null || !((this1) instanceof Object) || Reflect.field(this1,"__skipPrototype__") == true || this1.byteLength != null && this1.byteOffset != null && this1.buffer != null && ((this1.buffer) instanceof ArrayBuffer) || Reflect.field(this1,"__restoreFlag__") == flag) { + return; + } + try { + this1["__restoreFlag__"] = flag; + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + return; + } + if(Reflect.field(this1,"__prototype__") != null) { + try { + Object.setPrototypeOf(this1,$hxClasses[Reflect.field(this1,"__prototype__")].prototype); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + } + } + var _g = 0; + var _g1 = Object.values(this1); + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + lime__$internal_backend_html5_Message.restoreClasses(child,flag); + } +}; +var lime__$internal_backend_html5_WorkFunction = {}; +lime__$internal_backend_html5_WorkFunction.__properties__ = {get_portable:"get_portable"}; +lime__$internal_backend_html5_WorkFunction.toFunction = function(this1) { + if(this1.func != null) { + return this1.func; + } else if(this1.classPath != null && this1.functionName != null) { + this1.func = $hxClasses[this1.classPath][this1.functionName]; + return this1.func; + } else if(this1.sourceCode != null) { + this1.func = new Function("return " + this1.sourceCode)(); + return this1.func; + } + throw haxe_Exception.thrown("Object is not a valid WorkFunction: " + Std.string(this1)); +}; +lime__$internal_backend_html5_WorkFunction.makePortable = function(this1,throwError) { + if(throwError == null) { + throwError = true; + } + if(this1.func != null) { + if(this1.classPath != null || this1.functionName != null) { + var func = $hxClasses[this1.classPath] && $hxClasses[this1.classPath][this1.functionName]; + if(func != this1.func) { + throw haxe_Exception.thrown("Could not make " + this1.functionName + " portable. Either " + this1.functionName + " isn't static, or " + this1.classPath + " is something other than a class."); + } else { + this1.func = null; + return true; + } + } else { + this1.sourceCode = this1.func.toString(); + if(this1.sourceCode.indexOf("[native code]") < 0) { + this1.func = null; + return true; + } else { + this1.sourceCode = null; + } + throw haxe_Exception.thrown("Only static class functions can be made portable. Set -Dlime-warn-portability to see which line caused this."); + } + } + return this1.func == null; +}; +lime__$internal_backend_html5_WorkFunction.get_portable = function(this1) { + return this1.func == null; +}; +var lime__$internal_backend_html5_HTML5Thread = function(href,worker) { + this.__href = href; + if(worker != null) { + this.__worker = worker; + this.__worker.onmessage = $bind(this,this.dispatchMessage); + this.onMessage = new lime_app__$Event_$Dynamic_$Void(); + } + lime__$internal_backend_html5_Message.disablePreserveClasses(this); +}; +$hxClasses["lime._internal.backend.html5.HTML5Thread"] = lime__$internal_backend_html5_HTML5Thread; +lime__$internal_backend_html5_HTML5Thread.__name__ = "lime._internal.backend.html5.HTML5Thread"; +lime__$internal_backend_html5_HTML5Thread.current = function() { + return lime__$internal_backend_html5_HTML5Thread.__current; +}; +lime__$internal_backend_html5_HTML5Thread.create = function(job) { + var url = new URL(lime__$internal_backend_html5_HTML5Thread.__current.__href); + url.pathname = HxOverrides.substr(url.pathname,0,url.pathname.lastIndexOf("/") + 1) + lime_app_Application.current.meta.h["file"] + ".js"; + if(url.hash.length > 0) { + url.hash += "_"; + } + url.hash += lime__$internal_backend_html5_HTML5Thread.__workerCount; + lime__$internal_backend_html5_HTML5Thread.__workerCount++; + lime__$internal_backend_html5_WorkFunction.makePortable(job); + var thread = new lime__$internal_backend_html5_HTML5Thread(url.href,new Worker(url.href)); + thread.sendMessage(job); + return thread; +}; +lime__$internal_backend_html5_HTML5Thread.zeroDelay = function() { + return new Promise(function(resolve,_) { + $global.setTimeout(resolve); + }); +}; +lime__$internal_backend_html5_HTML5Thread.returnMessage = function(message,transferList,preserveClasses) { + if(preserveClasses == null) { + preserveClasses = true; + } + if(lime__$internal_backend_html5_HTML5Thread.__isWorker) { + if(preserveClasses) { + lime__$internal_backend_html5_Message.preserveClasses(message); + } + $global.postMessage(message,transferList); + } +}; +lime__$internal_backend_html5_HTML5Thread.equals = function(a,b) { + return a.__href == b.__href; +}; +lime__$internal_backend_html5_HTML5Thread.prototype = { + sendMessage: function(message,transferList,preserveClasses) { + if(preserveClasses == null) { + preserveClasses = true; + } + if(this.__worker != null) { + if(preserveClasses) { + lime__$internal_backend_html5_Message.preserveClasses(message); + } + this.__worker.postMessage(message,transferList); + } else { + lime__$internal_backend_html5_HTML5Thread.__messages.add(message); + } + } + ,dispatchMessage: function(event) { + var message = event.data; + lime__$internal_backend_html5_Message.restoreClasses(message); + if(this.onMessage != null) { + this.onMessage.dispatch(message); + } + if(lime__$internal_backend_html5_HTML5Thread.__resolveMethods.isEmpty()) { + lime__$internal_backend_html5_HTML5Thread.__messages.add(message); + } else { + (lime__$internal_backend_html5_HTML5Thread.__resolveMethods.pop())(message); + } + } + ,destroy: function() { + if(this.__worker != null) { + this.__worker.terminate(); + } else if(lime__$internal_backend_html5_HTML5Thread.__isWorker) { + try { + $global.close(); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + } + } + } + ,isWorker: function() { + if(this.__worker == null) { + return lime__$internal_backend_html5_HTML5Thread.__isWorker; + } else { + return true; + } + } + ,__class__: lime__$internal_backend_html5_HTML5Thread +}; +var lime__$internal_backend_html5_HTML5Window = function(parent) { + this.imeCompositionActive = false; + this.unusedTouchesPool = new haxe_ds_List(); + this.scale = 1.0; + this.currentTouches = new haxe_ds_IntMap(); + this.parent = parent; + this.cursor = lime_ui_MouseCursor.DEFAULT; + this.cacheMouseX = 0; + this.cacheMouseY = 0; + var attributes = parent.__attributes; + if(!Object.prototype.hasOwnProperty.call(attributes,"context")) { + attributes.context = { }; + } + this.renderType = attributes.context.type; + if(Object.prototype.hasOwnProperty.call(attributes,"element")) { + parent.element = attributes.element; + } + var element = parent.element; + if(Object.prototype.hasOwnProperty.call(attributes,"allowHighDPI") && attributes.allowHighDPI && this.renderType != "dom") { + this.scale = window.devicePixelRatio; + } + parent.__scale = this.scale; + this.setWidth = Object.prototype.hasOwnProperty.call(attributes,"width") ? attributes.width : 0; + this.setHeight = Object.prototype.hasOwnProperty.call(attributes,"height") ? attributes.height : 0; + parent.__width = this.setWidth; + parent.__height = this.setHeight; + parent.id = lime__$internal_backend_html5_HTML5Window.windowID++; + if(((element) instanceof HTMLCanvasElement)) { + this.canvas = element; + } else if(this.renderType == "dom") { + this.div = window.document.createElement("div"); + } else { + this.canvas = window.document.createElement("canvas"); + } + if(this.canvas != null) { + var style = this.canvas.style; + style.setProperty("-webkit-transform","translateZ(0)",null); + style.setProperty("transform","translateZ(0)",null); + } else if(this.div != null) { + var style = this.div.style; + style.setProperty("-webkit-transform","translate3D(0,0,0)",null); + style.setProperty("transform","translate3D(0,0,0)",null); + style.position = "relative"; + style.overflow = "hidden"; + style.setProperty("-webkit-user-select","none",null); + style.setProperty("-moz-user-select","none",null); + style.setProperty("-ms-user-select","none",null); + style.setProperty("-o-user-select","none",null); + } + if(parent.__width == 0 && parent.__height == 0) { + if(element != null) { + parent.__width = element.clientWidth; + parent.__height = element.clientHeight; + } else { + parent.__width = window.innerWidth; + parent.__height = window.innerHeight; + } + this.cacheElementWidth = parent.__width; + this.cacheElementHeight = parent.__height; + this.resizeElement = true; + } + if(this.canvas != null) { + this.canvas.width = Math.round(parent.__width * this.scale); + this.canvas.height = Math.round(parent.__height * this.scale); + this.canvas.style.width = parent.__width + "px"; + this.canvas.style.height = parent.__height + "px"; + } else { + this.div.style.width = parent.__width + "px"; + this.div.style.height = parent.__height + "px"; + } + if(Object.prototype.hasOwnProperty.call(attributes,"resizable") && attributes.resizable || !Object.prototype.hasOwnProperty.call(attributes,"width") && this.setWidth == 0 && this.setHeight == 0) { + parent.__resizable = true; + } + this.updateSize(); + if(element != null) { + if(this.canvas != null) { + if(element != this.canvas) { + element.appendChild(this.canvas); + } + } else { + element.appendChild(this.div); + } + var events = ["mousedown","mouseenter","mouseleave","mousemove","mouseup","wheel"]; + var _g = 0; + while(_g < events.length) { + var event = events[_g]; + ++_g; + element.addEventListener(event,$bind(this,this.handleMouseEvent),true); + } + element.addEventListener("contextmenu",$bind(this,this.handleContextMenuEvent),true); + element.addEventListener("dragstart",$bind(this,this.handleDragEvent),true); + element.addEventListener("dragover",$bind(this,this.handleDragEvent),true); + element.addEventListener("drop",$bind(this,this.handleDragEvent),true); + element.addEventListener("touchstart",$bind(this,this.handleTouchEvent),true); + element.addEventListener("touchmove",$bind(this,this.handleTouchEvent),true); + element.addEventListener("touchend",$bind(this,this.handleTouchEvent),true); + element.addEventListener("touchcancel",$bind(this,this.handleTouchEvent),true); + element.addEventListener("gamepadconnected",$bind(this,this.handleGamepadEvent),true); + element.addEventListener("gamepaddisconnected",$bind(this,this.handleGamepadEvent),true); + } + this.createContext(); + if(parent.context.type == "webgl") { + this.canvas.addEventListener("webglcontextlost",$bind(this,this.handleContextEvent),false); + this.canvas.addEventListener("webglcontextrestored",$bind(this,this.handleContextEvent),false); + } +}; +$hxClasses["lime._internal.backend.html5.HTML5Window"] = lime__$internal_backend_html5_HTML5Window; +lime__$internal_backend_html5_HTML5Window.__name__ = "lime._internal.backend.html5.HTML5Window"; +lime__$internal_backend_html5_HTML5Window.prototype = { + alert: function(message,title) { + if(message != null) { + window.alert(Std.string(message)); + } + } + ,close: function() { + var element = this.parent.element; + if(element != null) { + if(this.canvas != null) { + if(element != this.canvas) { + element.removeChild(this.canvas); + } + this.canvas = null; + } else if(this.div != null) { + element.removeChild(this.div); + this.div = null; + } + var events = ["mousedown","mouseenter","mouseleave","mousemove","mouseup","wheel"]; + var _g = 0; + while(_g < events.length) { + var event = events[_g]; + ++_g; + element.removeEventListener(event,$bind(this,this.handleMouseEvent),true); + } + element.removeEventListener("contextmenu",$bind(this,this.handleContextMenuEvent),true); + element.removeEventListener("dragstart",$bind(this,this.handleDragEvent),true); + element.removeEventListener("dragover",$bind(this,this.handleDragEvent),true); + element.removeEventListener("drop",$bind(this,this.handleDragEvent),true); + element.removeEventListener("touchstart",$bind(this,this.handleTouchEvent),true); + element.removeEventListener("touchmove",$bind(this,this.handleTouchEvent),true); + element.removeEventListener("touchend",$bind(this,this.handleTouchEvent),true); + element.removeEventListener("touchcancel",$bind(this,this.handleTouchEvent),true); + element.removeEventListener("gamepadconnected",$bind(this,this.handleGamepadEvent),true); + element.removeEventListener("gamepaddisconnected",$bind(this,this.handleGamepadEvent),true); + } + this.parent.application.__removeWindow(this.parent); + } + ,createContext: function() { + var context = new lime_graphics_RenderContext(); + var contextAttributes = this.parent.__attributes.context; + context.window = this.parent; + context.attributes = contextAttributes; + if(this.div != null) { + context.dom = this.div; + context.type = "dom"; + context.version = ""; + } else if(this.canvas != null) { + var webgl = null; + var forceCanvas = this.renderType == "canvas"; + var forceWebGL = this.renderType == "opengl" || this.renderType == "opengles" || this.renderType == "webgl"; + var allowWebGL2 = !Object.prototype.hasOwnProperty.call(contextAttributes,"version") || contextAttributes.version != "1"; + var isWebGL2 = false; + if(forceWebGL || !forceCanvas && (!Object.prototype.hasOwnProperty.call(contextAttributes,"hardware") || contextAttributes.hardware)) { + var transparentBackground = Object.prototype.hasOwnProperty.call(contextAttributes,"background") && contextAttributes.background == null; + var colorDepth = Object.prototype.hasOwnProperty.call(contextAttributes,"colorDepth") ? contextAttributes.colorDepth : 16; + var options = Object.prototype.hasOwnProperty.call(contextAttributes,"antialiasing") && contextAttributes.antialiasing > 0; + var options1 = Object.prototype.hasOwnProperty.call(contextAttributes,"depth") ? contextAttributes.depth : true; + var options2 = Object.prototype.hasOwnProperty.call(contextAttributes,"stencil") && contextAttributes.stencil; + var options3 = Object.prototype.hasOwnProperty.call(contextAttributes,"preserveDrawingBuffer") && contextAttributes.preserveDrawingBuffer; + var options4 = { alpha : transparentBackground || colorDepth > 16, antialias : options, depth : options1, premultipliedAlpha : true, stencil : options2, preserveDrawingBuffer : options3, failIfMajorPerformanceCaveat : false}; + var glContextType = ["webgl","experimental-webgl"]; + if(allowWebGL2) { + glContextType.unshift("webgl2"); + } + var _g = 0; + while(_g < glContextType.length) { + var name = glContextType[_g]; + ++_g; + webgl = this.canvas.getContext(name,options4); + if(webgl != null && name == "webgl2") { + isWebGL2 = true; + } + if(webgl != null) { + break; + } + } + } + if(webgl == null) { + context.canvas2D = this.canvas.getContext("2d"); + context.type = "canvas"; + context.version = ""; + } else { + context.webgl = lime_graphics_WebGLRenderContext.fromWebGL2RenderContext(webgl); + if(isWebGL2) { + context.webgl2 = webgl; + } + if(lime_graphics_opengl_GL.context == null) { + lime_graphics_opengl_GL.context = webgl; + lime_graphics_opengl_GL.type = "webgl"; + lime_graphics_opengl_GL.version = isWebGL2 ? 2 : 1; + } + context.type = "webgl"; + context.version = isWebGL2 ? "2" : "1"; + } + } + this.parent.context = context; + } + ,focus: function() { + } + ,focusTextInput: function() { + var _gthis = this; + if(this.__focusPending) { + return; + } + this.__focusPending = true; + haxe_Timer.delay(function() { + _gthis.__focusPending = false; + if(_gthis.textInputEnabled) { + lime__$internal_backend_html5_HTML5Window.textInput.focus(); + } + },20); + } + ,getCursor: function() { + return this.cursor; + } + ,getDisplay: function() { + return lime_system_System.getDisplay(0); + } + ,getDisplayMode: function() { + return lime_system_System.getDisplay(0).currentMode; + } + ,getFrameRate: function() { + if(this.parent.application == null) { + return 0; + } + if(this.parent.application.__backend.framePeriod < 0) { + return 60; + } else if(this.parent.application.__backend.framePeriod == 1000) { + return 0; + } else { + return 1000 / this.parent.application.__backend.framePeriod; + } + } + ,getMouseLock: function() { + return false; + } + ,getOpacity: function() { + return 1.0; + } + ,getTextInputEnabled: function() { + return this.textInputEnabled; + } + ,handleContextEvent: function(event) { + switch(event.type) { + case "webglcontextlost": + if(event.cancelable) { + event.preventDefault(); + } + var tmp = lime_graphics_opengl_GL.context != null; + this.parent.context = null; + this.parent.onRenderContextLost.dispatch(); + break; + case "webglcontextrestored": + this.createContext(); + this.parent.onRenderContextRestored.dispatch(this.parent.context); + break; + default: + } + } + ,handleContextMenuEvent: function(event) { + if((this.parent.onMouseUp.canceled || this.parent.onMouseDown.canceled) && event.cancelable) { + event.preventDefault(); + } + } + ,handleCutOrCopyEvent: function(event) { + var text = lime_system_Clipboard.get_text(); + if(text == null) { + text = ""; + } + event.clipboardData.setData("text/plain",text); + if(event.cancelable) { + event.preventDefault(); + } + } + ,handleDragEvent: function(event) { + switch(event.type) { + case "dragover": + event.preventDefault(); + return false; + case "dragstart": + if((js_Boot.__cast(event.target , HTMLElement)).nodeName.toLowerCase() == "img" && event.cancelable) { + event.preventDefault(); + return false; + } + break; + case "drop": + if(event.dataTransfer != null && event.dataTransfer.files.length > 0) { + this.parent.onDropFile.dispatch(event.dataTransfer.files); + event.preventDefault(); + return false; + } + break; + } + return true; + } + ,handleFocusEvent: function(event) { + if(this.textInputEnabled) { + if(event.relatedTarget == null || this.isDescendent(event.relatedTarget)) { + this.focusTextInput(); + } + } + } + ,handleFullscreenEvent: function(event) { + var fullscreenElement = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement; + if(fullscreenElement != null) { + this.isFullscreen = true; + this.parent.__fullscreen = true; + if(this.requestedFullscreen) { + this.requestedFullscreen = false; + this.parent.onFullscreen.dispatch(); + } + } else { + this.isFullscreen = false; + this.parent.__fullscreen = false; + this.parent.onRestore.dispatch(); + var changeEvents = ["fullscreenchange","mozfullscreenchange","webkitfullscreenchange","MSFullscreenChange"]; + var errorEvents = ["fullscreenerror","mozfullscreenerror","webkitfullscreenerror","MSFullscreenError"]; + var _g = 0; + var _g1 = changeEvents.length; + while(_g < _g1) { + var i = _g++; + window.document.removeEventListener(changeEvents[i],$bind(this,this.handleFullscreenEvent),false); + window.document.removeEventListener(errorEvents[i],$bind(this,this.handleFullscreenEvent),false); + } + } + } + ,handleGamepadEvent: function(event) { + switch(event.type) { + case "gamepadconnected": + lime_ui_Joystick.__connect(event.gamepad.index); + if(event.gamepad.mapping == "standard") { + lime_ui_Gamepad.__connect(event.gamepad.index); + } + break; + case "gamepaddisconnected": + lime_ui_Joystick.__disconnect(event.gamepad.index); + lime_ui_Gamepad.__disconnect(event.gamepad.index); + break; + default: + } + } + ,handleInputEvent: function(event) { + if(this.imeCompositionActive) { + return; + } + if(lime__$internal_backend_html5_HTML5Window.textInput.value != lime__$internal_backend_html5_HTML5Window.dummyCharacter) { + var value = StringTools.replace(lime__$internal_backend_html5_HTML5Window.textInput.value,lime__$internal_backend_html5_HTML5Window.dummyCharacter,""); + if(value.length > 0) { + this.parent.onTextInput.dispatch(value); + } + lime__$internal_backend_html5_HTML5Window.textInput.value = lime__$internal_backend_html5_HTML5Window.dummyCharacter; + } + } + ,handleMouseEvent: function(event) { + var x = 0.0; + var y = 0.0; + if(event.type != "wheel") { + if(this.parent.element != null) { + if(this.canvas != null) { + var rect = this.canvas.getBoundingClientRect(); + x = (event.clientX - rect.left) * (this.parent.__width / rect.width); + y = (event.clientY - rect.top) * (this.parent.__height / rect.height); + } else if(this.div != null) { + var rect = this.div.getBoundingClientRect(); + x = event.clientX - rect.left; + y = event.clientY - rect.top; + } else { + var rect = this.parent.element.getBoundingClientRect(); + x = (event.clientX - rect.left) * (this.parent.__width / rect.width); + y = (event.clientY - rect.top) * (this.parent.__height / rect.height); + } + } else { + x = event.clientX; + y = event.clientY; + } + switch(event.type) { + case "mousedown": + if(event.currentTarget == this.parent.element) { + window.addEventListener("mouseup",$bind(this,this.handleMouseEvent)); + } + this.parent.clickCount = event.detail; + this.parent.onMouseDown.dispatch(x,y,event.button); + this.parent.clickCount = 0; + if(this.parent.onMouseDown.canceled && event.cancelable) { + event.preventDefault(); + } + break; + case "mouseenter": + if(event.target == this.parent.element) { + this.parent.onEnter.dispatch(); + if(this.parent.onEnter.canceled && event.cancelable) { + event.preventDefault(); + } + } + break; + case "mouseleave": + if(event.target == this.parent.element) { + this.parent.onLeave.dispatch(); + if(this.parent.onLeave.canceled && event.cancelable) { + event.preventDefault(); + } + } + break; + case "mousemove": + if(x != this.cacheMouseX || y != this.cacheMouseY) { + this.parent.onMouseMove.dispatch(x,y); + this.parent.onMouseMoveRelative.dispatch(x - this.cacheMouseX,y - this.cacheMouseY); + if((this.parent.onMouseMove.canceled || this.parent.onMouseMoveRelative.canceled) && event.cancelable) { + event.preventDefault(); + } + } + break; + case "mouseup": + window.removeEventListener("mouseup",$bind(this,this.handleMouseEvent)); + if(event.currentTarget == this.parent.element) { + event.stopPropagation(); + } + this.parent.clickCount = event.detail; + this.parent.onMouseUp.dispatch(x,y,event.button); + this.parent.clickCount = 0; + if(this.parent.onMouseUp.canceled && event.cancelable) { + event.preventDefault(); + } + break; + default: + } + this.cacheMouseX = x; + this.cacheMouseY = y; + } else { + var deltaMode; + switch(event.deltaMode) { + case 0: + deltaMode = lime_ui_MouseWheelMode.PIXELS; + break; + case 1: + deltaMode = lime_ui_MouseWheelMode.LINES; + break; + case 2: + deltaMode = lime_ui_MouseWheelMode.PAGES; + break; + default: + deltaMode = lime_ui_MouseWheelMode.UNKNOWN; + } + this.parent.onMouseWheel.dispatch(event.deltaX,-event.deltaY,deltaMode); + if(this.parent.onMouseWheel.canceled && event.cancelable) { + event.preventDefault(); + } + } + } + ,handlePasteEvent: function(event) { + if(event.clipboardData.types.indexOf("text/plain") > -1) { + var text = event.clipboardData.getData("text/plain"); + lime_system_Clipboard.set_text(text); + if(this.textInputEnabled) { + this.parent.onTextInput.dispatch(text); + } + if(event.cancelable) { + event.preventDefault(); + } + } + } + ,handleResizeEvent: function(event) { + this.primaryTouch = null; + this.updateSize(); + } + ,handleTouchEvent: function(event) { + if(event.cancelable) { + event.preventDefault(); + } + var rect = null; + if(this.parent.element != null) { + if(this.canvas != null) { + rect = this.canvas.getBoundingClientRect(); + } else if(this.div != null) { + rect = this.div.getBoundingClientRect(); + } else { + rect = this.parent.element.getBoundingClientRect(); + } + } + var windowWidth = this.setWidth; + var windowHeight = this.setHeight; + if(windowWidth == 0 || windowHeight == 0) { + if(rect != null) { + windowWidth = rect.width; + windowHeight = rect.height; + } else { + windowWidth = 1; + windowHeight = 1; + } + } + var touch; + var x; + var y; + var cacheX; + var cacheY; + var _g = 0; + var _g1 = event.changedTouches; + while(_g < _g1.length) { + var data = _g1[_g]; + ++_g; + x = 0.0; + y = 0.0; + if(rect != null) { + x = (data.clientX - rect.left) * (windowWidth / rect.width); + y = (data.clientY - rect.top) * (windowHeight / rect.height); + } else { + x = data.clientX; + y = data.clientY; + } + if(event.type == "touchstart") { + touch = this.unusedTouchesPool.pop(); + if(touch == null) { + touch = new lime_ui_Touch(x / windowWidth,y / windowHeight,data.identifier,0,0,data.force,this.parent.id); + } else { + touch.x = x / windowWidth; + touch.y = y / windowHeight; + touch.id = data.identifier; + touch.dx = 0; + touch.dy = 0; + touch.pressure = data.force; + touch.device = this.parent.id; + } + this.currentTouches.h[data.identifier] = touch; + lime_ui_Touch.onStart.dispatch(touch); + if(this.primaryTouch == null) { + this.primaryTouch = touch; + } + if(touch == this.primaryTouch) { + this.parent.onMouseDown.dispatch(x,y,0); + } + } else { + touch = this.currentTouches.h[data.identifier]; + if(touch != null) { + cacheX = touch.x; + cacheY = touch.y; + touch.x = x / windowWidth; + touch.y = y / windowHeight; + touch.dx = touch.x - cacheX; + touch.dy = touch.y - cacheY; + touch.pressure = data.force; + switch(event.type) { + case "touchcancel": + lime_ui_Touch.onCancel.dispatch(touch); + this.currentTouches.remove(data.identifier); + this.unusedTouchesPool.add(touch); + if(touch == this.primaryTouch) { + this.primaryTouch = null; + } + break; + case "touchend": + lime_ui_Touch.onEnd.dispatch(touch); + this.currentTouches.remove(data.identifier); + this.unusedTouchesPool.add(touch); + if(touch == this.primaryTouch) { + this.parent.onMouseUp.dispatch(x,y,0); + this.primaryTouch = null; + } + break; + case "touchmove": + lime_ui_Touch.onMove.dispatch(touch); + if(touch == this.primaryTouch) { + this.parent.onMouseMove.dispatch(x,y); + } + break; + default: + } + } + } + } + } + ,isDescendent: function(node) { + if(node == this.parent.element) { + return true; + } + while(node != null) { + if(node.parentNode == this.parent.element) { + return true; + } + node = node.parentNode; + } + return false; + } + ,move: function(x,y) { + } + ,readPixels: function(rect) { + if(this.canvas != null) { + var stageRect = new lime_math_Rectangle(0,0,this.canvas.width,this.canvas.height); + if(rect == null) { + rect = stageRect; + } else { + rect.intersection(stageRect,rect); + } + if(rect.width > 0 && rect.height > 0) { + var canvas2 = window.document.createElement("canvas"); + canvas2.width = rect.width | 0; + canvas2.height = rect.height | 0; + var context = canvas2.getContext("2d"); + context.drawImage(this.canvas,-rect.x,-rect.y); + return lime_graphics_Image.fromCanvas(canvas2); + } + } + return null; + } + ,resize: function(width,height) { + } + ,setMinSize: function(width,height) { + } + ,setMaxSize: function(width,height) { + } + ,setBorderless: function(value) { + return value; + } + ,setClipboard: function(value) { + if(lime__$internal_backend_html5_HTML5Window.textArea == null) { + lime__$internal_backend_html5_HTML5Window.textArea = window.document.createElement("textarea"); + lime__$internal_backend_html5_HTML5Window.textArea.style.height = "0px"; + lime__$internal_backend_html5_HTML5Window.textArea.style.left = "-100px"; + lime__$internal_backend_html5_HTML5Window.textArea.style.opacity = "0"; + lime__$internal_backend_html5_HTML5Window.textArea.style.position = "fixed"; + lime__$internal_backend_html5_HTML5Window.textArea.style.top = "-100px"; + lime__$internal_backend_html5_HTML5Window.textArea.style.width = "0px"; + window.document.body.appendChild(lime__$internal_backend_html5_HTML5Window.textArea); + } + lime__$internal_backend_html5_HTML5Window.textArea.value = value; + lime__$internal_backend_html5_HTML5Window.textArea.focus(); + lime__$internal_backend_html5_HTML5Window.textArea.select(); + if(window.document.queryCommandEnabled("copy")) { + window.document.execCommand("copy"); + } + if(this.textInputEnabled) { + this.focusTextInput(); + } + } + ,setCursor: function(value) { + if(this.cursor != value) { + if(value == null) { + this.parent.element.style.cursor = "none"; + } else { + var tmp; + switch(value._hx_index) { + case 0: + tmp = "default"; + break; + case 1: + tmp = "crosshair"; + break; + case 3: + tmp = "move"; + break; + case 4: + tmp = "pointer"; + break; + case 5: + tmp = "nesw-resize"; + break; + case 6: + tmp = "ns-resize"; + break; + case 7: + tmp = "nwse-resize"; + break; + case 8: + tmp = "ew-resize"; + break; + case 9: + tmp = "text"; + break; + case 10: + tmp = "wait"; + break; + case 11: + tmp = "wait"; + break; + default: + tmp = "auto"; + } + this.parent.element.style.cursor = tmp; + } + this.cursor = value; + } + return this.cursor; + } + ,setDisplayMode: function(value) { + return value; + } + ,setFrameRate: function(value) { + if(this.parent.application != null) { + if(value >= 60) { + if(this.parent == this.parent.application.__window) { + this.parent.application.__backend.framePeriod = -1; + } + } else if(value > 0) { + if(this.parent == this.parent.application.__window) { + this.parent.application.__backend.framePeriod = 1000 / value; + } + } else if(this.parent == this.parent.application.__window) { + this.parent.application.__backend.framePeriod = 1000; + } + } + return value; + } + ,setFullscreen: function(value) { + if(value) { + if(!this.requestedFullscreen && !this.isFullscreen) { + this.requestedFullscreen = true; + if(($_=this.parent.element,$bind($_,$_.requestFullscreen))) { + document.addEventListener("fullscreenchange",$bind(this,this.handleFullscreenEvent),false); + document.addEventListener("fullscreenerror",$bind(this,this.handleFullscreenEvent),false); + this.parent.element.requestFullscreen(); + } else if(this.parent.element.mozRequestFullScreen) { + document.addEventListener("mozfullscreenchange",$bind(this,this.handleFullscreenEvent),false); + document.addEventListener("mozfullscreenerror",$bind(this,this.handleFullscreenEvent),false); + this.parent.element.mozRequestFullScreen(); + } else if(this.parent.element.webkitRequestFullscreen) { + document.addEventListener("webkitfullscreenchange",$bind(this,this.handleFullscreenEvent),false); + document.addEventListener("webkitfullscreenerror",$bind(this,this.handleFullscreenEvent),false); + this.parent.element.webkitRequestFullscreen(); + } else if(this.parent.element.msRequestFullscreen) { + document.addEventListener("MSFullscreenChange",$bind(this,this.handleFullscreenEvent),false); + document.addEventListener("MSFullscreenError",$bind(this,this.handleFullscreenEvent),false); + this.parent.element.msRequestFullscreen(); + } + } + } else if(this.isFullscreen) { + this.requestedFullscreen = false; + if(document.exitFullscreen) { + document.exitFullscreen(); + } else if(document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } else if(document.webkitExitFullscreen) { + document.webkitExitFullscreen(); + } else if(document.msExitFullscreen) { + document.msExitFullscreen(); + } + } + return value; + } + ,setIcon: function(image) { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image); + var link = window.document.querySelector("link[rel*='icon']"); + if(link == null) { + link = window.document.createElement("link"); + } + link.type = "image/x-icon"; + link.rel = "shortcut icon"; + link.href = image.buffer.get_src().toDataURL("image/x-icon"); + window.document.getElementsByTagName("head")[0].appendChild(link); + } + ,setMaximized: function(value) { + return false; + } + ,setMinimized: function(value) { + return false; + } + ,setMouseLock: function(value) { + } + ,setOpacity: function(value) { + } + ,setResizable: function(value) { + return value; + } + ,setTextInputEnabled: function(value) { + if(value) { + if(lime__$internal_backend_html5_HTML5Window.textInput == null) { + lime__$internal_backend_html5_HTML5Window.textInput = window.document.createElement("input"); + var tmp = $global.navigator.userAgent.indexOf("Android") >= 0 ? "password" : "text"; + lime__$internal_backend_html5_HTML5Window.textInput.type = tmp; + lime__$internal_backend_html5_HTML5Window.textInput.style.position = "absolute"; + lime__$internal_backend_html5_HTML5Window.textInput.style.opacity = "0"; + lime__$internal_backend_html5_HTML5Window.textInput.style.color = "transparent"; + lime__$internal_backend_html5_HTML5Window.textInput.value = lime__$internal_backend_html5_HTML5Window.dummyCharacter; + lime__$internal_backend_html5_HTML5Window.textInput.autocapitalize = "off"; + lime__$internal_backend_html5_HTML5Window.textInput.autocorrect = "off"; + lime__$internal_backend_html5_HTML5Window.textInput.autocomplete = "off"; + lime__$internal_backend_html5_HTML5Window.textInput.style.left = "0px"; + lime__$internal_backend_html5_HTML5Window.textInput.style.top = "50%"; + if(new EReg("(iPad|iPhone|iPod).*OS 8_","gi").match(window.navigator.userAgent)) { + lime__$internal_backend_html5_HTML5Window.textInput.style.fontSize = "0px"; + lime__$internal_backend_html5_HTML5Window.textInput.style.width = "0px"; + lime__$internal_backend_html5_HTML5Window.textInput.style.height = "0px"; + } else { + lime__$internal_backend_html5_HTML5Window.textInput.style.width = "1px"; + lime__$internal_backend_html5_HTML5Window.textInput.style.height = "1px"; + } + lime__$internal_backend_html5_HTML5Window.textInput.style.pointerEvents = "none"; + lime__$internal_backend_html5_HTML5Window.textInput.style.zIndex = "-10000000"; + } + if(lime__$internal_backend_html5_HTML5Window.textInput.parentNode == null) { + this.parent.element.appendChild(lime__$internal_backend_html5_HTML5Window.textInput); + } + if(!this.textInputEnabled) { + lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("input",$bind(this,this.handleInputEvent),true); + lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("blur",$bind(this,this.handleFocusEvent),true); + lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("cut",$bind(this,this.handleCutOrCopyEvent),true); + lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("copy",$bind(this,this.handleCutOrCopyEvent),true); + lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("paste",$bind(this,this.handlePasteEvent),true); + lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("compositionstart",$bind(this,this.handleCompositionstartEvent),true); + lime__$internal_backend_html5_HTML5Window.textInput.addEventListener("compositionend",$bind(this,this.handleCompositionendEvent),true); + } + lime__$internal_backend_html5_HTML5Window.textInput.focus(); + lime__$internal_backend_html5_HTML5Window.textInput.select(); + } else if(lime__$internal_backend_html5_HTML5Window.textInput != null) { + lime__$internal_backend_html5_HTML5Window.textInput.blur(); + lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("input",$bind(this,this.handleInputEvent),true); + lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("blur",$bind(this,this.handleFocusEvent),true); + lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("cut",$bind(this,this.handleCutOrCopyEvent),true); + lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("copy",$bind(this,this.handleCutOrCopyEvent),true); + lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("paste",$bind(this,this.handlePasteEvent),true); + lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("compositionstart",$bind(this,this.handleCompositionstartEvent),true); + lime__$internal_backend_html5_HTML5Window.textInput.removeEventListener("compositionend",$bind(this,this.handleCompositionendEvent),true); + } + return this.textInputEnabled = value; + } + ,setTextInputRect: function(value) { + return this.textInputRect = value; + } + ,handleCompositionstartEvent: function(e) { + this.imeCompositionActive = true; + } + ,handleCompositionendEvent: function(e) { + this.imeCompositionActive = false; + this.handleInputEvent(e); + } + ,setTitle: function(value) { + if(value != null) { + window.document.title = value; + } + return value; + } + ,setVisible: function(value) { + return value; + } + ,updateSize: function() { + if(!this.parent.__resizable) { + return; + } + var elementWidth; + var elementHeight; + if(this.parent.element != null) { + elementWidth = this.parent.element.clientWidth; + elementHeight = this.parent.element.clientHeight; + } else { + elementWidth = window.innerWidth; + elementHeight = window.innerHeight; + } + if(elementWidth != this.cacheElementWidth || elementHeight != this.cacheElementHeight) { + this.cacheElementWidth = elementWidth; + this.cacheElementHeight = elementHeight; + var stretch = this.resizeElement || this.setWidth == 0 && this.setHeight == 0; + if(this.parent.element != null && (this.div == null || this.div != null && stretch)) { + if(stretch) { + if(this.parent.__width != elementWidth || this.parent.__height != elementHeight) { + this.parent.__width = elementWidth; + this.parent.__height = elementHeight; + if(this.canvas != null) { + if(this.parent.element != this.canvas) { + this.canvas.width = Math.round(elementWidth * this.scale); + this.canvas.height = Math.round(elementHeight * this.scale); + this.canvas.style.width = elementWidth + "px"; + this.canvas.style.height = elementHeight + "px"; + } + } else { + this.div.style.width = elementWidth + "px"; + this.div.style.height = elementHeight + "px"; + } + this.parent.onResize.dispatch(elementWidth,elementHeight); + } + } else { + var scaleX = this.setWidth != 0 ? elementWidth / this.setWidth : 1; + var scaleY = this.setHeight != 0 ? elementHeight / this.setHeight : 1; + var targetWidth = elementWidth; + var targetHeight = elementHeight; + var marginLeft = 0; + var marginTop = 0; + if(scaleX < scaleY) { + targetHeight = Math.floor(this.setHeight * scaleX); + marginTop = Math.floor((elementHeight - targetHeight) / 2); + } else { + targetWidth = Math.floor(this.setWidth * scaleY); + marginLeft = Math.floor((elementWidth - targetWidth) / 2); + } + if(this.canvas != null) { + if(this.parent.element != this.canvas) { + this.canvas.style.width = targetWidth + "px"; + this.canvas.style.height = targetHeight + "px"; + this.canvas.style.marginLeft = marginLeft + "px"; + this.canvas.style.marginTop = marginTop + "px"; + } + } else { + this.div.style.width = targetWidth + "px"; + this.div.style.height = targetHeight + "px"; + this.div.style.marginLeft = marginLeft + "px"; + this.div.style.marginTop = marginTop + "px"; + } + } + } + } + } + ,warpMouse: function(x,y) { + } + ,__class__: lime__$internal_backend_html5_HTML5Window +}; +var lime__$internal_backend_native_NativeCFFI = function() { }; +$hxClasses["lime._internal.backend.native.NativeCFFI"] = lime__$internal_backend_native_NativeCFFI; +lime__$internal_backend_native_NativeCFFI.__name__ = "lime._internal.backend.native.NativeCFFI"; +var lime__$internal_format_BMP = function() { }; +$hxClasses["lime._internal.format.BMP"] = lime__$internal_format_BMP; +lime__$internal_format_BMP.__name__ = "lime._internal.format.BMP"; +lime__$internal_format_BMP.encode = function(image,type) { + if(image.get_premultiplied() || image.get_format() != 0) { + image = image.clone(); + image.set_premultiplied(false); + image.set_format(0); + } + if(type == null) { + type = lime__$internal_format_BMPType.RGB; + } + var fileHeaderLength = 14; + var infoHeaderLength = 40; + var pixelValuesLength = image.width * image.height * 4; + if(type != null) { + switch(type._hx_index) { + case 0: + pixelValuesLength = (image.width * 3 + image.width * 3 % 4) * image.height; + break; + case 1: + infoHeaderLength = 108; + break; + case 2: + fileHeaderLength = 0; + pixelValuesLength += image.width * image.height; + break; + } + } + var data = new haxe_io_Bytes(new ArrayBuffer(fileHeaderLength + infoHeaderLength + pixelValuesLength)); + var position = 0; + if(fileHeaderLength > 0) { + data.b[position++] = 66; + data.b[position++] = 77; + data.setInt32(position,data.length); + position += 4; + data.setUInt16(position,0); + position += 2; + data.setUInt16(position,0); + position += 2; + data.setInt32(position,fileHeaderLength + infoHeaderLength); + position += 4; + } + data.setInt32(position,infoHeaderLength); + position += 4; + data.setInt32(position,image.width); + position += 4; + data.setInt32(position,type == lime__$internal_format_BMPType.ICO ? image.height * 2 : image.height); + position += 4; + data.setUInt16(position,1); + position += 2; + data.setUInt16(position,type == lime__$internal_format_BMPType.RGB ? 24 : 32); + position += 2; + data.setInt32(position,type == lime__$internal_format_BMPType.BITFIELD ? 3 : 0); + position += 4; + data.setInt32(position,pixelValuesLength); + position += 4; + data.setInt32(position,11824); + position += 4; + data.setInt32(position,11824); + position += 4; + data.setInt32(position,0); + position += 4; + data.setInt32(position,0); + position += 4; + if(type == lime__$internal_format_BMPType.BITFIELD) { + data.setInt32(position,16711680); + position += 4; + data.setInt32(position,65280); + position += 4; + data.setInt32(position,255); + position += 4; + data.setInt32(position,-16777216); + position += 4; + data.b[position++] = 32; + data.b[position++] = 110; + data.b[position++] = 105; + data.b[position++] = 87; + var _g = 0; + while(_g < 48) { + var i = _g++; + data.b[position++] = 0; + } + } + var pixels = image.getPixels(new lime_math_Rectangle(0,0,image.width,image.height),1); + var readPosition = 0; + var a; + var r; + var g; + var b; + if(type != null) { + switch(type._hx_index) { + case 0: + var _g = 0; + var _g1 = image.height; + while(_g < _g1) { + var y = _g++; + readPosition = (image.height - 1 - y) * 4 * image.width; + var _g2 = 0; + var _g3 = image.width; + while(_g2 < _g3) { + var x = _g2++; + a = pixels.b[readPosition++]; + r = pixels.b[readPosition++]; + g = pixels.b[readPosition++]; + b = pixels.b[readPosition++]; + data.b[position++] = b & 255; + data.b[position++] = g & 255; + data.b[position++] = r & 255; + } + var _g4 = 0; + var _g5 = image.width * 3 % 4; + while(_g4 < _g5) { + var i = _g4++; + data.b[position++] = 0; + } + } + break; + case 1: + var _g = 0; + var _g1 = image.height; + while(_g < _g1) { + var y = _g++; + readPosition = (image.height - 1 - y) * 4 * image.width; + var _g2 = 0; + var _g3 = image.width; + while(_g2 < _g3) { + var x = _g2++; + a = pixels.b[readPosition++]; + r = pixels.b[readPosition++]; + g = pixels.b[readPosition++]; + b = pixels.b[readPosition++]; + data.b[position++] = b & 255; + data.b[position++] = g & 255; + data.b[position++] = r & 255; + data.b[position++] = a & 255; + } + } + break; + case 2: + var andMask = new haxe_io_Bytes(new ArrayBuffer(image.width * image.height)); + var maskPosition = 0; + var _g = 0; + var _g1 = image.height; + while(_g < _g1) { + var y = _g++; + readPosition = (image.height - 1 - y) * 4 * image.width; + var _g2 = 0; + var _g3 = image.width; + while(_g2 < _g3) { + var x = _g2++; + a = pixels.b[readPosition++]; + r = pixels.b[readPosition++]; + g = pixels.b[readPosition++]; + b = pixels.b[readPosition++]; + data.b[position++] = b & 255; + data.b[position++] = g & 255; + data.b[position++] = r & 255; + data.b[position++] = a & 255; + andMask.b[maskPosition++] = 0; + } + } + data.blit(position,andMask,0,image.width * image.height); + break; + } + } + return data; +}; +var lime__$internal_format_BMPType = $hxEnums["lime._internal.format.BMPType"] = { __ename__:"lime._internal.format.BMPType",__constructs__:null + ,RGB: {_hx_name:"RGB",_hx_index:0,__enum__:"lime._internal.format.BMPType",toString:$estr} + ,BITFIELD: {_hx_name:"BITFIELD",_hx_index:1,__enum__:"lime._internal.format.BMPType",toString:$estr} + ,ICO: {_hx_name:"ICO",_hx_index:2,__enum__:"lime._internal.format.BMPType",toString:$estr} +}; +lime__$internal_format_BMPType.__constructs__ = [lime__$internal_format_BMPType.RGB,lime__$internal_format_BMPType.BITFIELD,lime__$internal_format_BMPType.ICO]; +var lime__$internal_format_Base64 = function() { }; +$hxClasses["lime._internal.format.Base64"] = lime__$internal_format_Base64; +lime__$internal_format_Base64.__name__ = "lime._internal.format.Base64"; +lime__$internal_format_Base64.decode = function(source) { + return haxe_crypto_Base64.decode(source); +}; +lime__$internal_format_Base64.encode = function(source) { + var result = []; + var dictionary = lime__$internal_format_Base64.DICTIONARY; + var extendedDictionary = lime__$internal_format_Base64.EXTENDED_DICTIONARY; + var numBytes = source.length; + var numInputTriplets = Math.floor(numBytes / 3); + var numChunksToWrite = numInputTriplets * 2; + result.length = Math.ceil(numBytes / 3) * 2; + var numBytesRead = 0; + var numChunksWritten = 0; + var inputTriplet; + while(numChunksWritten < numChunksToWrite) { + inputTriplet = source.b[numBytesRead] << 16 | source.b[numBytesRead + 1] << 8 | source.b[numBytesRead + 2]; + result[numChunksWritten] = extendedDictionary[inputTriplet >> 12 & 4095]; + result[numChunksWritten + 1] = extendedDictionary[inputTriplet & 4095]; + numBytesRead += 3; + numChunksWritten += 2; + } + switch(numBytes - numInputTriplets * 3) { + case 1: + inputTriplet = source.b[numBytesRead] << 16; + result[numChunksWritten] = extendedDictionary[inputTriplet >> 12 & 4095]; + result[numChunksWritten + 1] = "=="; + break; + case 2: + inputTriplet = source.b[numBytesRead] << 16 | source.b[numBytesRead + 1] << 8; + result[numChunksWritten] = extendedDictionary[inputTriplet >> 12 & 4095]; + result[numChunksWritten + 1] = dictionary[inputTriplet >> 6 & 63] + "="; + break; + default: + } + return result.join(""); +}; +var lime__$internal_format_Deflate = function() { }; +$hxClasses["lime._internal.format.Deflate"] = lime__$internal_format_Deflate; +lime__$internal_format_Deflate.__name__ = "lime._internal.format.Deflate"; +lime__$internal_format_Deflate.compress = function(bytes) { + var data = pako.deflateRaw(bytes.b.bufferValue); + return haxe_io_Bytes.ofData(data); +}; +lime__$internal_format_Deflate.decompress = function(bytes) { + var data = pako.inflateRaw(bytes.b.bufferValue); + return haxe_io_Bytes.ofData(data); +}; +var lime__$internal_format_GZip = function() { }; +$hxClasses["lime._internal.format.GZip"] = lime__$internal_format_GZip; +lime__$internal_format_GZip.__name__ = "lime._internal.format.GZip"; +lime__$internal_format_GZip.compress = function(bytes) { + var data = pako.gzip(bytes.b.bufferValue); + return haxe_io_Bytes.ofData(data); +}; +lime__$internal_format_GZip.decompress = function(bytes) { + var data = pako.ungzip(bytes.b.bufferValue); + return haxe_io_Bytes.ofData(data); +}; +var lime__$internal_format_JPEG = function() { }; +$hxClasses["lime._internal.format.JPEG"] = lime__$internal_format_JPEG; +lime__$internal_format_JPEG.__name__ = "lime._internal.format.JPEG"; +lime__$internal_format_JPEG.decodeBytes = function(bytes,decodeData) { + if(decodeData == null) { + decodeData = true; + } + return null; +}; +lime__$internal_format_JPEG.decodeFile = function(path,decodeData) { + if(decodeData == null) { + decodeData = true; + } + return null; +}; +lime__$internal_format_JPEG.encode = function(image,quality) { + if(image.get_premultiplied() || image.get_format() != 0) { + image = image.clone(); + image.set_premultiplied(false); + image.set_format(0); + } + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,false); + if(image.buffer.__srcCanvas != null) { + var data = image.buffer.__srcCanvas.toDataURL("image/jpeg",quality / 100); + var buffer = window.atob(data.split(";base64,")[1]); + var bytes = new haxe_io_Bytes(new ArrayBuffer(buffer.length)); + var _g = 0; + var _g1 = buffer.length; + while(_g < _g1) { + var i = _g++; + bytes.b[i] = HxOverrides.cca(buffer,i) & 255; + } + return bytes; + } + return null; +}; +var lime__$internal_format_LZMA = function() { }; +$hxClasses["lime._internal.format.LZMA"] = lime__$internal_format_LZMA; +lime__$internal_format_LZMA.__name__ = "lime._internal.format.LZMA"; +lime__$internal_format_LZMA.compress = function(bytes) { + var data = LZMA.compress; + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytes.b.bufferValue; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,0); + } else { + this1 = new Uint8Array(buffer,0,len); + } + } else { + this1 = null; + } + var data1 = data(this1,5); + if(typeof(data1) == "string") { + return haxe_io_Bytes.ofString(data1); + } else { + return haxe_io_Bytes.ofData(data1); + } +}; +lime__$internal_format_LZMA.decompress = function(bytes) { + var data = LZMA.decompress; + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytes.b.bufferValue; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,0); + } else { + this1 = new Uint8Array(buffer,0,len); + } + } else { + this1 = null; + } + var data1 = data(this1); + if(typeof(data1) == "string") { + return haxe_io_Bytes.ofString(data1); + } else { + return haxe_io_Bytes.ofData(data1); + } +}; +var lime__$internal_format_PNG = function() { }; +$hxClasses["lime._internal.format.PNG"] = lime__$internal_format_PNG; +lime__$internal_format_PNG.__name__ = "lime._internal.format.PNG"; +lime__$internal_format_PNG.decodeBytes = function(bytes,decodeData) { + if(decodeData == null) { + decodeData = true; + } + return null; +}; +lime__$internal_format_PNG.decodeFile = function(path,decodeData) { + if(decodeData == null) { + decodeData = true; + } + return null; +}; +lime__$internal_format_PNG.encode = function(image) { + if(image.get_premultiplied() || image.get_format() != 0) { + image = image.clone(); + image.set_premultiplied(false); + image.set_format(0); + } + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,false); + if(image.buffer.__srcCanvas != null) { + var data = image.buffer.__srcCanvas.toDataURL("image/png"); + var buffer = window.atob(data.split(";base64,")[1]); + var bytes = new haxe_io_Bytes(new ArrayBuffer(buffer.length)); + var _g = 0; + var _g1 = buffer.length; + while(_g < _g1) { + var i = _g++; + bytes.b[i] = HxOverrides.cca(buffer,i) & 255; + } + return bytes; + } + return null; +}; +var lime__$internal_format_Zlib = function() { }; +$hxClasses["lime._internal.format.Zlib"] = lime__$internal_format_Zlib; +lime__$internal_format_Zlib.__name__ = "lime._internal.format.Zlib"; +lime__$internal_format_Zlib.compress = function(bytes) { + var data = pako.deflate(bytes.b.bufferValue); + return haxe_io_Bytes.ofData(data); +}; +lime__$internal_format_Zlib.decompress = function(bytes) { + var data = pako.inflate(bytes.b.bufferValue); + return haxe_io_Bytes.ofData(data); +}; +var lime__$internal_graphics_ImageCanvasUtil = function() { }; +$hxClasses["lime._internal.graphics.ImageCanvasUtil"] = lime__$internal_graphics_ImageCanvasUtil; +lime__$internal_graphics_ImageCanvasUtil.__name__ = "lime._internal.graphics.ImageCanvasUtil"; +lime__$internal_graphics_ImageCanvasUtil.colorTransform = function(image,rect,colorMatrix) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(image); + lime__$internal_graphics_ImageDataUtil.colorTransform(image,rect,colorMatrix); +}; +lime__$internal_graphics_ImageCanvasUtil.convertToCanvas = function(image,clear) { + if(clear == null) { + clear = false; + } + var buffer = image.buffer; + if(buffer.__srcImage != null) { + if(buffer.__srcCanvas == null) { + lime__$internal_graphics_ImageCanvasUtil.createCanvas(image,buffer.__srcImage.width,buffer.__srcImage.height); + buffer.__srcContext.drawImage(buffer.__srcImage,0,0); + } + buffer.__srcImage = null; + } else if(buffer.__srcCanvas == null && buffer.data != null) { + image.set_transparent(true); + lime__$internal_graphics_ImageCanvasUtil.createCanvas(image,buffer.width,buffer.height); + lime__$internal_graphics_ImageCanvasUtil.createImageData(image); + buffer.__srcContext.putImageData(buffer.__srcImageData,0,0); + } else if(image.type == lime_graphics_ImageType.DATA && buffer.__srcImageData != null && image.dirty) { + buffer.__srcContext.putImageData(buffer.__srcImageData,0,0); + image.dirty = false; + } + if(clear) { + buffer.data = null; + buffer.__srcImageData = null; + } else if(buffer.data == null && buffer.__srcImageData != null) { + buffer.data = buffer.__srcImageData.data; + } + image.type = lime_graphics_ImageType.CANVAS; +}; +lime__$internal_graphics_ImageCanvasUtil.convertToData = function(image,clear) { + if(clear == null) { + clear = false; + } + var buffer = image.buffer; + if(buffer.__srcImage != null) { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image); + } + if(buffer.__srcCanvas != null && buffer.data == null) { + lime__$internal_graphics_ImageCanvasUtil.createImageData(image); + if(image.type == lime_graphics_ImageType.CANVAS) { + image.dirty = false; + } + } else if(image.type == lime_graphics_ImageType.CANVAS && buffer.__srcCanvas != null && image.dirty) { + if(buffer.__srcImageData == null) { + lime__$internal_graphics_ImageCanvasUtil.createImageData(image); + } else { + buffer.__srcImageData = buffer.__srcContext.getImageData(0,0,buffer.width,buffer.height); + var elements = buffer.__srcImageData.data.buffer; + var array = null; + var vector = null; + var view = null; + var buffer1 = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer1 != null) { + if(len == null) { + this1 = new Uint8Array(buffer1,0); + } else { + this1 = new Uint8Array(buffer1,0,len); + } + } else { + this1 = null; + } + buffer.data = this1; + } + image.dirty = false; + } + if(clear) { + image.buffer.__srcCanvas = null; + image.buffer.__srcContext = null; + } + image.type = lime_graphics_ImageType.DATA; +}; +lime__$internal_graphics_ImageCanvasUtil.copyChannel = function(image,sourceImage,sourceRect,destPoint,sourceChannel,destChannel) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage); + lime__$internal_graphics_ImageCanvasUtil.convertToData(image); + lime__$internal_graphics_ImageDataUtil.copyChannel(image,sourceImage,sourceRect,destPoint,sourceChannel,destChannel); +}; +lime__$internal_graphics_ImageCanvasUtil.copyPixels = function(image,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha) { + if(mergeAlpha == null) { + mergeAlpha = false; + } + if(destPoint == null || destPoint.x >= image.width || destPoint.y >= image.height || sourceRect == null || sourceRect.width < 1 || sourceRect.height < 1) { + return; + } + if(alphaImage != null && alphaImage.get_transparent()) { + if(alphaPoint == null) { + alphaPoint = new lime_math_Vector2(); + } + var tempData = sourceImage.clone(); + tempData.copyChannel(alphaImage,new lime_math_Rectangle(sourceRect.x + alphaPoint.x,sourceRect.y + alphaPoint.y,sourceRect.width,sourceRect.height),new lime_math_Vector2(sourceRect.x,sourceRect.y),lime_graphics_ImageChannel.ALPHA,lime_graphics_ImageChannel.ALPHA); + sourceImage = tempData; + } + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,true); + if(!mergeAlpha) { + if(image.get_transparent() && sourceImage.get_transparent()) { + image.buffer.__srcContext.clearRect(destPoint.x + image.offsetX,destPoint.y + image.offsetY,sourceRect.width + image.offsetX,sourceRect.height + image.offsetY); + } + } + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(sourceImage); + if(sourceImage.buffer.get_src() != null) { + image.buffer.__srcContext.globalCompositeOperation = "source-over"; + image.buffer.__srcContext.drawImage(sourceImage.buffer.get_src(),sourceRect.x + sourceImage.offsetX | 0,sourceRect.y + sourceImage.offsetY | 0,sourceRect.width | 0,sourceRect.height | 0,destPoint.x + image.offsetX | 0,destPoint.y + image.offsetY | 0,sourceRect.width | 0,sourceRect.height | 0); + } + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageCanvasUtil.createCanvas = function(image,width,height) { + var buffer = image.buffer; + if(buffer.__srcCanvas == null) { + buffer.__srcCanvas = window.document.createElement("canvas"); + buffer.__srcCanvas.width = width; + buffer.__srcCanvas.height = height; + if(!image.get_transparent()) { + buffer.__srcCanvas.setAttribute("moz-opaque","true"); + } + buffer.__srcContext = buffer.__srcCanvas.getContext("2d",{ alpha : image.get_transparent()}); + } +}; +lime__$internal_graphics_ImageCanvasUtil.createImageData = function(image) { + var buffer = image.buffer; + if(buffer.__srcImageData == null) { + if(buffer.data == null) { + buffer.__srcImageData = buffer.__srcContext.getImageData(0,0,buffer.width,buffer.height); + } else { + buffer.__srcImageData = buffer.__srcContext.createImageData(buffer.width,buffer.height); + buffer.__srcImageData.data.set(buffer.data); + } + var elements = buffer.__srcImageData.data.buffer; + var array = null; + var vector = null; + var view = null; + var buffer1 = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer1 != null) { + if(len == null) { + this1 = new Uint8Array(buffer1,0); + } else { + this1 = new Uint8Array(buffer1,0,len); + } + } else { + this1 = null; + } + buffer.data = this1; + } +}; +lime__$internal_graphics_ImageCanvasUtil.fillRect = function(image,rect,color,format) { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image); + var r; + var g; + var b; + var a; + if(format == 1) { + r = color >> 16 & 255; + g = color >> 8 & 255; + b = color & 255; + a = image.get_transparent() ? color >> 24 & 255 : 255; + } else { + r = color >> 24 & 255; + g = color >> 16 & 255; + b = color >> 8 & 255; + a = image.get_transparent() ? color & 255 : 255; + } + if(rect.x == 0 && rect.y == 0 && rect.width == image.width && rect.height == image.height) { + if(image.get_transparent() && a == 0) { + image.buffer.__srcCanvas.width = image.buffer.width; + return; + } + } + if(a < 255) { + image.buffer.__srcContext.clearRect(rect.x + image.offsetX,rect.y + image.offsetY,rect.width + image.offsetX,rect.height + image.offsetY); + } + if(a > 0) { + image.buffer.__srcContext.fillStyle = "rgba(" + r + ", " + g + ", " + b + ", " + a / 255 + ")"; + image.buffer.__srcContext.fillRect(rect.x + image.offsetX,rect.y + image.offsetY,rect.width + image.offsetX,rect.height + image.offsetY); + } + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageCanvasUtil.floodFill = function(image,x,y,color,format) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(image); + lime__$internal_graphics_ImageDataUtil.floodFill(image,x,y,color,format); +}; +lime__$internal_graphics_ImageCanvasUtil.getPixel = function(image,x,y,format) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(image); + return lime__$internal_graphics_ImageDataUtil.getPixel(image,x,y,format); +}; +lime__$internal_graphics_ImageCanvasUtil.getPixel32 = function(image,x,y,format) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(image); + return lime__$internal_graphics_ImageDataUtil.getPixel32(image,x,y,format); +}; +lime__$internal_graphics_ImageCanvasUtil.getPixels = function(image,rect,format) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(image); + return lime__$internal_graphics_ImageDataUtil.getPixels(image,rect,format); +}; +lime__$internal_graphics_ImageCanvasUtil.merge = function(image,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage); + lime__$internal_graphics_ImageCanvasUtil.convertToData(image); + lime__$internal_graphics_ImageDataUtil.merge(image,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier); +}; +lime__$internal_graphics_ImageCanvasUtil.resize = function(image,newWidth,newHeight) { + var buffer = image.buffer; + if(buffer.__srcCanvas == null) { + lime__$internal_graphics_ImageCanvasUtil.createCanvas(image,newWidth,newHeight); + buffer.__srcContext.drawImage(buffer.get_src(),0,0,newWidth,newHeight); + } else { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,true); + var sourceCanvas = buffer.__srcCanvas; + buffer.__srcCanvas = null; + lime__$internal_graphics_ImageCanvasUtil.createCanvas(image,newWidth,newHeight); + buffer.__srcContext.drawImage(sourceCanvas,0,0,newWidth,newHeight); + } + buffer.__srcImageData = null; + buffer.data = null; + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageCanvasUtil.scroll = function(image,x,y) { + if(x % image.width == 0 && y % image.height == 0) { + return; + } + var copy = image.clone(); + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,true); + image.buffer.__srcContext.clearRect(x,y,image.width,image.height); + image.buffer.__srcContext.drawImage(copy.get_src(),x,y); + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageCanvasUtil.setPixel = function(image,x,y,color,format) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(image); + lime__$internal_graphics_ImageDataUtil.setPixel(image,x,y,color,format); +}; +lime__$internal_graphics_ImageCanvasUtil.setPixel32 = function(image,x,y,color,format) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(image); + lime__$internal_graphics_ImageDataUtil.setPixel32(image,x,y,color,format); +}; +lime__$internal_graphics_ImageCanvasUtil.setPixels = function(image,rect,bytePointer,format,endian) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(image); + lime__$internal_graphics_ImageDataUtil.setPixels(image,rect,bytePointer,format,endian); +}; +lime__$internal_graphics_ImageCanvasUtil.sync = function(image,clear) { + if(image == null) { + return; + } + if(image.type == lime_graphics_ImageType.CANVAS && (image.buffer.__srcCanvas != null || image.buffer.data != null)) { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image,clear); + } else if(image.type == lime_graphics_ImageType.DATA) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(image,clear); + } +}; +var lime__$internal_graphics_ImageDataUtil = function() { }; +$hxClasses["lime._internal.graphics.ImageDataUtil"] = lime__$internal_graphics_ImageDataUtil; +lime__$internal_graphics_ImageDataUtil.__name__ = "lime._internal.graphics.ImageDataUtil"; +lime__$internal_graphics_ImageDataUtil.displaceMap = function(target,source,map,mapPoint,componentX,componentY,smooth) { + var targetData = target.buffer.data; + var sourceData = source.buffer.data; + var mapData = map.buffer.data; + var targetFormat = target.buffer.format; + var sourceFormat = source.buffer.format; + var mapFormat = map.buffer.format; + var targetPremultiplied = target.get_premultiplied(); + var sourcePremultiplied = source.get_premultiplied(); + var mapPremultiplied = map.get_premultiplied(); + var sourceView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(source); + var mapView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(map); + var row; + var sourceOffset; + var sourcePixel = 0; + var mapPixel = 0; + var targetPixel = 0; + var mapPixelX; + var mapPixelY; + var mapPixelA; + var s1 = 0; + var s2 = 0; + var s3 = 0; + var s4 = 0; + var mPointXFloor; + var mPointYFloor; + var disOffsetXFloor; + var disOffsetYFloor; + var disX; + var disY; + var _g = 0; + var _g1 = sourceView.height; + while(_g < _g1) { + var y = _g++; + row = sourceView.byteOffset + sourceView.stride * y; + var _g2 = 0; + var _g3 = sourceView.width; + while(_g2 < _g3) { + var x = _g2++; + sourceOffset = row + x * 4; + mPointXFloor = mapPoint.x | 0; + mPointYFloor = mapPoint.y | 0; + if(smooth) { + var offset = sourceView.byteOffset + sourceView.stride * (y - mPointYFloor + 1) + (x - mPointXFloor) * 4; + var format = mapFormat; + var premultiplied = mapPremultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + switch(format) { + case 0: + s1 = (mapData[offset] & 255) << 24 | (mapData[offset + 1] & 255) << 16 | (mapData[offset + 2] & 255) << 8 | mapData[offset + 3] & 255; + break; + case 1: + s1 = (mapData[offset + 1] & 255) << 24 | (mapData[offset + 2] & 255) << 16 | (mapData[offset + 3] & 255) << 8 | mapData[offset] & 255; + break; + case 2: + s1 = (mapData[offset + 2] & 255) << 24 | (mapData[offset + 1] & 255) << 16 | (mapData[offset] & 255) << 8 | mapData[offset + 3] & 255; + break; + } + if(premultiplied) { + if((s1 & 255) != 0 && (s1 & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (s1 & 255); + s1 = (lime_math_RGBA.__clamp[Math.round((s1 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s1 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s1 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s1 & 255 & 255; + } + } + var offset1 = sourceView.byteOffset + sourceView.stride * (y - mPointYFloor) + (x - mPointXFloor + 1) * 4; + var format1 = mapFormat; + var premultiplied1 = mapPremultiplied; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + s2 = (mapData[offset1] & 255) << 24 | (mapData[offset1 + 1] & 255) << 16 | (mapData[offset1 + 2] & 255) << 8 | mapData[offset1 + 3] & 255; + break; + case 1: + s2 = (mapData[offset1 + 1] & 255) << 24 | (mapData[offset1 + 2] & 255) << 16 | (mapData[offset1 + 3] & 255) << 8 | mapData[offset1] & 255; + break; + case 2: + s2 = (mapData[offset1 + 2] & 255) << 24 | (mapData[offset1 + 1] & 255) << 16 | (mapData[offset1] & 255) << 8 | mapData[offset1 + 3] & 255; + break; + } + if(premultiplied1) { + if((s2 & 255) != 0 && (s2 & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (s2 & 255); + s2 = (lime_math_RGBA.__clamp[Math.round((s2 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s2 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s2 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s2 & 255 & 255; + } + } + var offset2 = sourceView.byteOffset + sourceView.stride * (y - mPointYFloor + 1) + (x - mPointXFloor + 1) * 4; + var format2 = mapFormat; + var premultiplied2 = mapPremultiplied; + if(premultiplied2 == null) { + premultiplied2 = false; + } + if(format2 == null) { + format2 = 0; + } + switch(format2) { + case 0: + s3 = (mapData[offset2] & 255) << 24 | (mapData[offset2 + 1] & 255) << 16 | (mapData[offset2 + 2] & 255) << 8 | mapData[offset2 + 3] & 255; + break; + case 1: + s3 = (mapData[offset2 + 1] & 255) << 24 | (mapData[offset2 + 2] & 255) << 16 | (mapData[offset2 + 3] & 255) << 8 | mapData[offset2] & 255; + break; + case 2: + s3 = (mapData[offset2 + 2] & 255) << 24 | (mapData[offset2 + 1] & 255) << 16 | (mapData[offset2] & 255) << 8 | mapData[offset2 + 3] & 255; + break; + } + if(premultiplied2) { + if((s3 & 255) != 0 && (s3 & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (s3 & 255); + s3 = (lime_math_RGBA.__clamp[Math.round((s3 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s3 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s3 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s3 & 255 & 255; + } + } + var offset3 = sourceView.byteOffset + sourceView.stride * (y - mPointYFloor) + (x - mPointXFloor) * 4; + var format3 = mapFormat; + var premultiplied3 = mapPremultiplied; + if(premultiplied3 == null) { + premultiplied3 = false; + } + if(format3 == null) { + format3 = 0; + } + switch(format3) { + case 0: + s4 = (mapData[offset3] & 255) << 24 | (mapData[offset3 + 1] & 255) << 16 | (mapData[offset3 + 2] & 255) << 8 | mapData[offset3 + 3] & 255; + break; + case 1: + s4 = (mapData[offset3 + 1] & 255) << 24 | (mapData[offset3 + 2] & 255) << 16 | (mapData[offset3 + 3] & 255) << 8 | mapData[offset3] & 255; + break; + case 2: + s4 = (mapData[offset3 + 2] & 255) << 24 | (mapData[offset3 + 1] & 255) << 16 | (mapData[offset3] & 255) << 8 | mapData[offset3 + 3] & 255; + break; + } + if(premultiplied3) { + if((s4 & 255) != 0 && (s4 & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (s4 & 255); + s4 = (lime_math_RGBA.__clamp[Math.round((s4 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s4 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s4 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s4 & 255 & 255; + } + } + mapPixel = lime__$internal_graphics_ImageDataUtil.bilinear(s1,s2,s3,s4,mapPoint.x - mPointXFloor,mapPoint.y - mPointYFloor); + } else { + var offset4 = mapView.byteOffset + mapView.stride * (y - mPointYFloor) + (x - mPointXFloor) * 4; + var format4 = mapFormat; + var premultiplied4 = mapPremultiplied; + if(premultiplied4 == null) { + premultiplied4 = false; + } + if(format4 == null) { + format4 = 0; + } + switch(format4) { + case 0: + mapPixel = (mapData[offset4] & 255) << 24 | (mapData[offset4 + 1] & 255) << 16 | (mapData[offset4 + 2] & 255) << 8 | mapData[offset4 + 3] & 255; + break; + case 1: + mapPixel = (mapData[offset4 + 1] & 255) << 24 | (mapData[offset4 + 2] & 255) << 16 | (mapData[offset4 + 3] & 255) << 8 | mapData[offset4] & 255; + break; + case 2: + mapPixel = (mapData[offset4 + 2] & 255) << 24 | (mapData[offset4 + 1] & 255) << 16 | (mapData[offset4] & 255) << 8 | mapData[offset4 + 3] & 255; + break; + } + if(premultiplied4) { + if((mapPixel & 255) != 0 && (mapPixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (mapPixel & 255); + mapPixel = (lime_math_RGBA.__clamp[Math.round((mapPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((mapPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((mapPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | mapPixel & 255 & 255; + } + } + } + mapPixelA = (mapPixel & 255) / 255.0; + mapPixelX = ((mapPixel >>> 24 & 255) - 128) / 255.0 * mapPixelA; + mapPixelY = ((mapPixel >>> 16 & 255) - 128) / 255.0 * mapPixelA; + disX = mapPixelX * componentX.x + mapPixelY * componentY.x; + disY = mapPixelX * componentX.y + mapPixelY * componentY.y; + disOffsetXFloor = Math.floor(disX * sourceView.width); + disOffsetYFloor = Math.floor(disY * sourceView.height); + if(smooth) { + var offset5 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor + 1) + (x + disOffsetXFloor) * 4; + var format5 = sourceFormat; + var premultiplied5 = sourcePremultiplied; + if(premultiplied5 == null) { + premultiplied5 = false; + } + if(format5 == null) { + format5 = 0; + } + switch(format5) { + case 0: + s1 = (sourceData[offset5] & 255) << 24 | (sourceData[offset5 + 1] & 255) << 16 | (sourceData[offset5 + 2] & 255) << 8 | sourceData[offset5 + 3] & 255; + break; + case 1: + s1 = (sourceData[offset5 + 1] & 255) << 24 | (sourceData[offset5 + 2] & 255) << 16 | (sourceData[offset5 + 3] & 255) << 8 | sourceData[offset5] & 255; + break; + case 2: + s1 = (sourceData[offset5 + 2] & 255) << 24 | (sourceData[offset5 + 1] & 255) << 16 | (sourceData[offset5] & 255) << 8 | sourceData[offset5 + 3] & 255; + break; + } + if(premultiplied5) { + if((s1 & 255) != 0 && (s1 & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (s1 & 255); + s1 = (lime_math_RGBA.__clamp[Math.round((s1 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s1 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s1 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s1 & 255 & 255; + } + } + var offset6 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor) + (x + disOffsetXFloor + 1) * 4; + var format6 = sourceFormat; + var premultiplied6 = sourcePremultiplied; + if(premultiplied6 == null) { + premultiplied6 = false; + } + if(format6 == null) { + format6 = 0; + } + switch(format6) { + case 0: + s2 = (sourceData[offset6] & 255) << 24 | (sourceData[offset6 + 1] & 255) << 16 | (sourceData[offset6 + 2] & 255) << 8 | sourceData[offset6 + 3] & 255; + break; + case 1: + s2 = (sourceData[offset6 + 1] & 255) << 24 | (sourceData[offset6 + 2] & 255) << 16 | (sourceData[offset6 + 3] & 255) << 8 | sourceData[offset6] & 255; + break; + case 2: + s2 = (sourceData[offset6 + 2] & 255) << 24 | (sourceData[offset6 + 1] & 255) << 16 | (sourceData[offset6] & 255) << 8 | sourceData[offset6 + 3] & 255; + break; + } + if(premultiplied6) { + if((s2 & 255) != 0 && (s2 & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (s2 & 255); + s2 = (lime_math_RGBA.__clamp[Math.round((s2 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s2 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s2 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s2 & 255 & 255; + } + } + var offset7 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor + 1) + (x + disOffsetXFloor + 1) * 4; + var format7 = sourceFormat; + var premultiplied7 = sourcePremultiplied; + if(premultiplied7 == null) { + premultiplied7 = false; + } + if(format7 == null) { + format7 = 0; + } + switch(format7) { + case 0: + s3 = (sourceData[offset7] & 255) << 24 | (sourceData[offset7 + 1] & 255) << 16 | (sourceData[offset7 + 2] & 255) << 8 | sourceData[offset7 + 3] & 255; + break; + case 1: + s3 = (sourceData[offset7 + 1] & 255) << 24 | (sourceData[offset7 + 2] & 255) << 16 | (sourceData[offset7 + 3] & 255) << 8 | sourceData[offset7] & 255; + break; + case 2: + s3 = (sourceData[offset7 + 2] & 255) << 24 | (sourceData[offset7 + 1] & 255) << 16 | (sourceData[offset7] & 255) << 8 | sourceData[offset7 + 3] & 255; + break; + } + if(premultiplied7) { + if((s3 & 255) != 0 && (s3 & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (s3 & 255); + s3 = (lime_math_RGBA.__clamp[Math.round((s3 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s3 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s3 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s3 & 255 & 255; + } + } + var offset8 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor) + (x + disOffsetXFloor) * 4; + var format8 = sourceFormat; + var premultiplied8 = sourcePremultiplied; + if(premultiplied8 == null) { + premultiplied8 = false; + } + if(format8 == null) { + format8 = 0; + } + switch(format8) { + case 0: + s4 = (sourceData[offset8] & 255) << 24 | (sourceData[offset8 + 1] & 255) << 16 | (sourceData[offset8 + 2] & 255) << 8 | sourceData[offset8 + 3] & 255; + break; + case 1: + s4 = (sourceData[offset8 + 1] & 255) << 24 | (sourceData[offset8 + 2] & 255) << 16 | (sourceData[offset8 + 3] & 255) << 8 | sourceData[offset8] & 255; + break; + case 2: + s4 = (sourceData[offset8 + 2] & 255) << 24 | (sourceData[offset8 + 1] & 255) << 16 | (sourceData[offset8] & 255) << 8 | sourceData[offset8 + 3] & 255; + break; + } + if(premultiplied8) { + if((s4 & 255) != 0 && (s4 & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (s4 & 255); + s4 = (lime_math_RGBA.__clamp[Math.round((s4 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((s4 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((s4 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | s4 & 255 & 255; + } + } + sourcePixel = lime__$internal_graphics_ImageDataUtil.bilinear(s1,s2,s3,s4,disX * sourceView.width - disOffsetXFloor,disY * sourceView.height - disOffsetYFloor); + } else { + var offset9 = sourceView.byteOffset + sourceView.stride * (y + disOffsetYFloor) + (x + disOffsetXFloor) * 4; + var format9 = sourceFormat; + var premultiplied9 = sourcePremultiplied; + if(premultiplied9 == null) { + premultiplied9 = false; + } + if(format9 == null) { + format9 = 0; + } + switch(format9) { + case 0: + sourcePixel = (sourceData[offset9] & 255) << 24 | (sourceData[offset9 + 1] & 255) << 16 | (sourceData[offset9 + 2] & 255) << 8 | sourceData[offset9 + 3] & 255; + break; + case 1: + sourcePixel = (sourceData[offset9 + 1] & 255) << 24 | (sourceData[offset9 + 2] & 255) << 16 | (sourceData[offset9 + 3] & 255) << 8 | sourceData[offset9] & 255; + break; + case 2: + sourcePixel = (sourceData[offset9 + 2] & 255) << 24 | (sourceData[offset9 + 1] & 255) << 16 | (sourceData[offset9] & 255) << 8 | sourceData[offset9 + 3] & 255; + break; + } + if(premultiplied9) { + if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255); + sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255; + } + } + } + var format10 = targetFormat; + var premultiplied10 = targetPremultiplied; + if(premultiplied10 == null) { + premultiplied10 = false; + } + if(format10 == null) { + format10 = 0; + } + if(premultiplied10) { + if((sourcePixel & 255) == 0) { + if(sourcePixel != 0) { + sourcePixel = 0; + } + } else if((sourcePixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[sourcePixel & 255]; + sourcePixel = ((sourcePixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((sourcePixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((sourcePixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | sourcePixel & 255 & 255; + } + } + switch(format10) { + case 0: + targetData[sourceOffset] = sourcePixel >>> 24 & 255; + targetData[sourceOffset + 1] = sourcePixel >>> 16 & 255; + targetData[sourceOffset + 2] = sourcePixel >>> 8 & 255; + targetData[sourceOffset + 3] = sourcePixel & 255; + break; + case 1: + targetData[sourceOffset] = sourcePixel & 255; + targetData[sourceOffset + 1] = sourcePixel >>> 24 & 255; + targetData[sourceOffset + 2] = sourcePixel >>> 16 & 255; + targetData[sourceOffset + 3] = sourcePixel >>> 8 & 255; + break; + case 2: + targetData[sourceOffset] = sourcePixel >>> 8 & 255; + targetData[sourceOffset + 1] = sourcePixel >>> 16 & 255; + targetData[sourceOffset + 2] = sourcePixel >>> 24 & 255; + targetData[sourceOffset + 3] = sourcePixel & 255; + break; + } + } + } + target.dirty = true; + target.version++; +}; +lime__$internal_graphics_ImageDataUtil.bilinear = function(s1,s2,s3,s4,su,sv) { + return lime__$internal_graphics_ImageDataUtil.lerpRGBA(lime__$internal_graphics_ImageDataUtil.lerpRGBA(s4,s2,su),lime__$internal_graphics_ImageDataUtil.lerpRGBA(s1,s3,su),sv); +}; +lime__$internal_graphics_ImageDataUtil.lerpRGBA = function(v0,v1,x) { + var result = 0; + var value = Math.floor(lime__$internal_graphics_ImageDataUtil.lerp(v0 >>> 24 & 255,v1 >>> 24 & 255,x)); + result = (value & 255) << 24 | (result >>> 16 & 255 & 255) << 16 | (result >>> 8 & 255 & 255) << 8 | result & 255 & 255; + var value = Math.floor(lime__$internal_graphics_ImageDataUtil.lerp(v0 >>> 16 & 255,v1 >>> 16 & 255,x)); + result = (result >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (result >>> 8 & 255 & 255) << 8 | result & 255 & 255; + var value = Math.floor(lime__$internal_graphics_ImageDataUtil.lerp(v0 >>> 8 & 255,v1 >>> 8 & 255,x)); + result = (result >>> 24 & 255 & 255) << 24 | (result >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | result & 255 & 255; + var value = Math.floor(lime__$internal_graphics_ImageDataUtil.lerp(v0 & 255,v1 & 255,x)); + result = (result >>> 24 & 255 & 255) << 24 | (result >>> 16 & 255 & 255) << 16 | (result >>> 8 & 255 & 255) << 8 | value & 255; + return result; +}; +lime__$internal_graphics_ImageDataUtil.lerp4f = function(v0,v1,x) { + return new lime_math_Vector4(lime__$internal_graphics_ImageDataUtil.lerp(v0.x,v1.x,x),lime__$internal_graphics_ImageDataUtil.lerp(v0.y,v1.y,x),lime__$internal_graphics_ImageDataUtil.lerp(v0.z,v1.z,x),lime__$internal_graphics_ImageDataUtil.lerp(v0.w,v1.w,x)); +}; +lime__$internal_graphics_ImageDataUtil.lerp = function(v0,v1,x) { + return (1.0 - x) * v0 + x * v1; +}; +lime__$internal_graphics_ImageDataUtil.colorTransform = function(image,rect,colorMatrix) { + var data = image.buffer.data; + if(data == null) { + return; + } + var format = image.buffer.format; + var premultiplied = image.buffer.premultiplied; + var dataView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,rect); + var alphaTable = lime_math_ColorMatrix.getAlphaTable(colorMatrix); + var redTable = lime_math_ColorMatrix.getRedTable(colorMatrix); + var greenTable = lime_math_ColorMatrix.getGreenTable(colorMatrix); + var blueTable = lime_math_ColorMatrix.getBlueTable(colorMatrix); + var row; + var offset; + var pixel = 0; + var _g = 0; + var _g1 = dataView.height; + while(_g < _g1) { + var y = _g++; + row = dataView.byteOffset + dataView.stride * y; + var _g2 = 0; + var _g3 = dataView.width; + while(_g2 < _g3) { + var x = _g2++; + offset = row + x * 4; + var format1 = format; + var premultiplied1 = premultiplied; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255; + break; + case 1: + pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255; + break; + case 2: + pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255; + break; + } + if(premultiplied1) { + if((pixel & 255) != 0 && (pixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (pixel & 255); + pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255; + } + } + pixel = (redTable[pixel >>> 24 & 255] & 255) << 24 | (greenTable[pixel >>> 16 & 255] & 255) << 16 | (blueTable[pixel >>> 8 & 255] & 255) << 8 | alphaTable[pixel & 255] & 255; + var format2 = format; + var premultiplied2 = premultiplied; + if(premultiplied2 == null) { + premultiplied2 = false; + } + if(format2 == null) { + format2 = 0; + } + if(premultiplied2) { + if((pixel & 255) == 0) { + if(pixel != 0) { + pixel = 0; + } + } else if((pixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255]; + pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255; + } + } + switch(format2) { + case 0: + data[offset] = pixel >>> 24 & 255; + data[offset + 1] = pixel >>> 16 & 255; + data[offset + 2] = pixel >>> 8 & 255; + data[offset + 3] = pixel & 255; + break; + case 1: + data[offset] = pixel & 255; + data[offset + 1] = pixel >>> 24 & 255; + data[offset + 2] = pixel >>> 16 & 255; + data[offset + 3] = pixel >>> 8 & 255; + break; + case 2: + data[offset] = pixel >>> 8 & 255; + data[offset + 1] = pixel >>> 16 & 255; + data[offset + 2] = pixel >>> 24 & 255; + data[offset + 3] = pixel & 255; + break; + } + } + } + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.copyChannel = function(image,sourceImage,sourceRect,destPoint,sourceChannel,destChannel) { + var destIdx; + switch(destChannel._hx_index) { + case 0: + destIdx = 0; + break; + case 1: + destIdx = 1; + break; + case 2: + destIdx = 2; + break; + case 3: + destIdx = 3; + break; + } + var srcIdx; + switch(sourceChannel._hx_index) { + case 0: + srcIdx = 0; + break; + case 1: + srcIdx = 1; + break; + case 2: + srcIdx = 2; + break; + case 3: + srcIdx = 3; + break; + } + var srcData = sourceImage.buffer.data; + var destData = image.buffer.data; + if(srcData == null || destData == null) { + return; + } + var srcView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(sourceImage,sourceRect); + var destView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,new lime_math_Rectangle(destPoint.x,destPoint.y,srcView.width,srcView.height)); + var srcFormat = sourceImage.buffer.format; + var destFormat = image.buffer.format; + var srcPremultiplied = sourceImage.buffer.premultiplied; + var destPremultiplied = image.buffer.premultiplied; + var srcPosition; + var destPosition; + var srcPixel = 0; + var destPixel = 0; + var value = 0; + var _g = 0; + var _g1 = destView.height; + while(_g < _g1) { + var y = _g++; + srcPosition = srcView.byteOffset + srcView.stride * y; + destPosition = destView.byteOffset + destView.stride * y; + var _g2 = 0; + var _g3 = destView.width; + while(_g2 < _g3) { + var x = _g2++; + var format = srcFormat; + var premultiplied = srcPremultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + switch(format) { + case 0: + srcPixel = (srcData[srcPosition] & 255) << 24 | (srcData[srcPosition + 1] & 255) << 16 | (srcData[srcPosition + 2] & 255) << 8 | srcData[srcPosition + 3] & 255; + break; + case 1: + srcPixel = (srcData[srcPosition + 1] & 255) << 24 | (srcData[srcPosition + 2] & 255) << 16 | (srcData[srcPosition + 3] & 255) << 8 | srcData[srcPosition] & 255; + break; + case 2: + srcPixel = (srcData[srcPosition + 2] & 255) << 24 | (srcData[srcPosition + 1] & 255) << 16 | (srcData[srcPosition] & 255) << 8 | srcData[srcPosition + 3] & 255; + break; + } + if(premultiplied) { + if((srcPixel & 255) != 0 && (srcPixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (srcPixel & 255); + srcPixel = (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | srcPixel & 255 & 255; + } + } + var format1 = destFormat; + var premultiplied1 = destPremultiplied; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + destPixel = (destData[destPosition] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition + 2] & 255) << 8 | destData[destPosition + 3] & 255; + break; + case 1: + destPixel = (destData[destPosition + 1] & 255) << 24 | (destData[destPosition + 2] & 255) << 16 | (destData[destPosition + 3] & 255) << 8 | destData[destPosition] & 255; + break; + case 2: + destPixel = (destData[destPosition + 2] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition] & 255) << 8 | destData[destPosition + 3] & 255; + break; + } + if(premultiplied1) { + if((destPixel & 255) != 0 && (destPixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (destPixel & 255); + destPixel = (lime_math_RGBA.__clamp[Math.round((destPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | destPixel & 255 & 255; + } + } + switch(srcIdx) { + case 0: + value = srcPixel >>> 24 & 255; + break; + case 1: + value = srcPixel >>> 16 & 255; + break; + case 2: + value = srcPixel >>> 8 & 255; + break; + case 3: + value = srcPixel & 255; + break; + } + switch(destIdx) { + case 0: + destPixel = (value & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255; + break; + case 1: + destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255; + break; + case 2: + destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | destPixel & 255 & 255; + break; + case 3: + destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | value & 255; + break; + } + var format2 = destFormat; + var premultiplied2 = destPremultiplied; + if(premultiplied2 == null) { + premultiplied2 = false; + } + if(format2 == null) { + format2 = 0; + } + if(premultiplied2) { + if((destPixel & 255) == 0) { + if(destPixel != 0) { + destPixel = 0; + } + } else if((destPixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[destPixel & 255]; + destPixel = ((destPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((destPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((destPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | destPixel & 255 & 255; + } + } + switch(format2) { + case 0: + destData[destPosition] = destPixel >>> 24 & 255; + destData[destPosition + 1] = destPixel >>> 16 & 255; + destData[destPosition + 2] = destPixel >>> 8 & 255; + destData[destPosition + 3] = destPixel & 255; + break; + case 1: + destData[destPosition] = destPixel & 255; + destData[destPosition + 1] = destPixel >>> 24 & 255; + destData[destPosition + 2] = destPixel >>> 16 & 255; + destData[destPosition + 3] = destPixel >>> 8 & 255; + break; + case 2: + destData[destPosition] = destPixel >>> 8 & 255; + destData[destPosition + 1] = destPixel >>> 16 & 255; + destData[destPosition + 2] = destPixel >>> 24 & 255; + destData[destPosition + 3] = destPixel & 255; + break; + } + srcPosition += 4; + destPosition += 4; + } + } + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.copyPixels = function(image,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha) { + if(mergeAlpha == null) { + mergeAlpha = false; + } + if(image.width == sourceImage.width && image.height == sourceImage.height && sourceRect.width == sourceImage.width && sourceRect.height == sourceImage.height && sourceRect.x == 0 && sourceRect.y == 0 && destPoint.x == 0 && destPoint.y == 0 && alphaImage == null && alphaPoint == null && mergeAlpha == false && image.get_format() == sourceImage.get_format()) { + image.buffer.data.set(sourceImage.buffer.data); + } else { + var sourceData = sourceImage.buffer.data; + var destData = image.buffer.data; + if(sourceData == null || destData == null) { + return; + } + var sourceView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(sourceImage,sourceRect); + var destRect = new lime_math_Rectangle(destPoint.x,destPoint.y,sourceView.width,sourceView.height); + var destView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,destRect); + var sourceFormat = sourceImage.buffer.format; + var destFormat = image.buffer.format; + var sourcePosition; + var destPosition; + var sourceAlpha; + var destAlpha; + var oneMinusSourceAlpha; + var blendAlpha; + var sourcePixel = 0; + var destPixel = 0; + var sourcePremultiplied = sourceImage.buffer.premultiplied; + var destPremultiplied = image.buffer.premultiplied; + var sourceBytesPerPixel = sourceImage.buffer.bitsPerPixel / 8 | 0; + var destBytesPerPixel = image.buffer.bitsPerPixel / 8 | 0; + var useAlphaImage = alphaImage != null && alphaImage.get_transparent(); + var blend = mergeAlpha || useAlphaImage && !image.get_transparent() || !mergeAlpha && !image.get_transparent() && sourceImage.get_transparent(); + if(!useAlphaImage) { + if(blend) { + var _g = 0; + var _g1 = destView.height; + while(_g < _g1) { + var y = _g++; + sourcePosition = sourceView.byteOffset + sourceView.stride * y; + destPosition = destView.byteOffset + destView.stride * y; + var _g2 = 0; + var _g3 = destView.width; + while(_g2 < _g3) { + var x = _g2++; + var format = sourceFormat; + var premultiplied = sourcePremultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + switch(format) { + case 0: + sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255; + break; + case 1: + sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255; + break; + case 2: + sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255; + break; + } + if(premultiplied) { + if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255); + sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255; + } + } + var format1 = destFormat; + var premultiplied1 = destPremultiplied; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + destPixel = (destData[destPosition] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition + 2] & 255) << 8 | destData[destPosition + 3] & 255; + break; + case 1: + destPixel = (destData[destPosition + 1] & 255) << 24 | (destData[destPosition + 2] & 255) << 16 | (destData[destPosition + 3] & 255) << 8 | destData[destPosition] & 255; + break; + case 2: + destPixel = (destData[destPosition + 2] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition] & 255) << 8 | destData[destPosition + 3] & 255; + break; + } + if(premultiplied1) { + if((destPixel & 255) != 0 && (destPixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (destPixel & 255); + destPixel = (lime_math_RGBA.__clamp[Math.round((destPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | destPixel & 255 & 255; + } + } + sourceAlpha = (sourcePixel & 255) / 255.0; + destAlpha = (destPixel & 255) / 255.0; + oneMinusSourceAlpha = 1 - sourceAlpha; + blendAlpha = sourceAlpha + destAlpha * oneMinusSourceAlpha; + if(blendAlpha == 0) { + destPixel = 0; + } else { + var value = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 24 & 255) * sourceAlpha + (destPixel >>> 24 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)]; + destPixel = (value & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255; + var value1 = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 16 & 255) * sourceAlpha + (destPixel >>> 16 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)]; + destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (value1 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255; + var value2 = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 8 & 255) * sourceAlpha + (destPixel >>> 8 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)]; + destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (value2 & 255) << 8 | destPixel & 255 & 255; + var value3 = lime_math_RGBA.__clamp[Math.round(blendAlpha * 255.0)]; + destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | value3 & 255; + } + var format2 = destFormat; + var premultiplied2 = destPremultiplied; + if(premultiplied2 == null) { + premultiplied2 = false; + } + if(format2 == null) { + format2 = 0; + } + if(premultiplied2) { + if((destPixel & 255) == 0) { + if(destPixel != 0) { + destPixel = 0; + } + } else if((destPixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[destPixel & 255]; + destPixel = ((destPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((destPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((destPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | destPixel & 255 & 255; + } + } + switch(format2) { + case 0: + destData[destPosition] = destPixel >>> 24 & 255; + destData[destPosition + 1] = destPixel >>> 16 & 255; + destData[destPosition + 2] = destPixel >>> 8 & 255; + destData[destPosition + 3] = destPixel & 255; + break; + case 1: + destData[destPosition] = destPixel & 255; + destData[destPosition + 1] = destPixel >>> 24 & 255; + destData[destPosition + 2] = destPixel >>> 16 & 255; + destData[destPosition + 3] = destPixel >>> 8 & 255; + break; + case 2: + destData[destPosition] = destPixel >>> 8 & 255; + destData[destPosition + 1] = destPixel >>> 16 & 255; + destData[destPosition + 2] = destPixel >>> 24 & 255; + destData[destPosition + 3] = destPixel & 255; + break; + } + sourcePosition += 4; + destPosition += 4; + } + } + } else if(sourceFormat == destFormat && sourcePremultiplied == destPremultiplied && sourceBytesPerPixel == destBytesPerPixel) { + var _g = 0; + var _g1 = destView.height; + while(_g < _g1) { + var y = _g++; + sourcePosition = sourceView.byteOffset + sourceView.stride * y; + destPosition = destView.byteOffset + destView.stride * y; + destData.set(sourceData.subarray(sourcePosition,sourcePosition + destView.width * destBytesPerPixel),destPosition); + } + } else { + var _g = 0; + var _g1 = destView.height; + while(_g < _g1) { + var y = _g++; + sourcePosition = sourceView.byteOffset + sourceView.stride * y; + destPosition = destView.byteOffset + destView.stride * y; + var _g2 = 0; + var _g3 = destView.width; + while(_g2 < _g3) { + var x = _g2++; + var format = sourceFormat; + var premultiplied = sourcePremultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + switch(format) { + case 0: + sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255; + break; + case 1: + sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255; + break; + case 2: + sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255; + break; + } + if(premultiplied) { + if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255); + sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255; + } + } + var format1 = destFormat; + var premultiplied1 = destPremultiplied; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + if(premultiplied1) { + if((sourcePixel & 255) == 0) { + if(sourcePixel != 0) { + sourcePixel = 0; + } + } else if((sourcePixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[sourcePixel & 255]; + sourcePixel = ((sourcePixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((sourcePixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((sourcePixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | sourcePixel & 255 & 255; + } + } + switch(format1) { + case 0: + destData[destPosition] = sourcePixel >>> 24 & 255; + destData[destPosition + 1] = sourcePixel >>> 16 & 255; + destData[destPosition + 2] = sourcePixel >>> 8 & 255; + destData[destPosition + 3] = sourcePixel & 255; + break; + case 1: + destData[destPosition] = sourcePixel & 255; + destData[destPosition + 1] = sourcePixel >>> 24 & 255; + destData[destPosition + 2] = sourcePixel >>> 16 & 255; + destData[destPosition + 3] = sourcePixel >>> 8 & 255; + break; + case 2: + destData[destPosition] = sourcePixel >>> 8 & 255; + destData[destPosition + 1] = sourcePixel >>> 16 & 255; + destData[destPosition + 2] = sourcePixel >>> 24 & 255; + destData[destPosition + 3] = sourcePixel & 255; + break; + } + sourcePosition += 4; + destPosition += 4; + } + } + } + } else { + var alphaData = alphaImage.buffer.data; + var alphaFormat = alphaImage.buffer.format; + var alphaPosition; + var alphaPixel = 0; + var alphaView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(alphaImage,new lime_math_Rectangle(sourceView.x + (alphaPoint == null ? 0 : alphaPoint.x),sourceView.y + (alphaPoint == null ? 0 : alphaPoint.y),sourceView.width,sourceView.height)); + destView.clip(destPoint.x | 0,destPoint.y | 0,alphaView.width,alphaView.height); + if(blend) { + var _g = 0; + var _g1 = destView.height; + while(_g < _g1) { + var y = _g++; + sourcePosition = sourceView.byteOffset + sourceView.stride * y; + destPosition = destView.byteOffset + destView.stride * y; + alphaPosition = alphaView.byteOffset + alphaView.stride * y; + var _g2 = 0; + var _g3 = destView.width; + while(_g2 < _g3) { + var x = _g2++; + var format = sourceFormat; + var premultiplied = sourcePremultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + switch(format) { + case 0: + sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255; + break; + case 1: + sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255; + break; + case 2: + sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255; + break; + } + if(premultiplied) { + if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255); + sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255; + } + } + var format1 = destFormat; + var premultiplied1 = destPremultiplied; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + destPixel = (destData[destPosition] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition + 2] & 255) << 8 | destData[destPosition + 3] & 255; + break; + case 1: + destPixel = (destData[destPosition + 1] & 255) << 24 | (destData[destPosition + 2] & 255) << 16 | (destData[destPosition + 3] & 255) << 8 | destData[destPosition] & 255; + break; + case 2: + destPixel = (destData[destPosition + 2] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition] & 255) << 8 | destData[destPosition + 3] & 255; + break; + } + if(premultiplied1) { + if((destPixel & 255) != 0 && (destPixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (destPixel & 255); + destPixel = (lime_math_RGBA.__clamp[Math.round((destPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | destPixel & 255 & 255; + } + } + var format2 = alphaFormat; + var premultiplied2 = false; + if(premultiplied2 == null) { + premultiplied2 = false; + } + if(format2 == null) { + format2 = 0; + } + switch(format2) { + case 0: + alphaPixel = (alphaData[alphaPosition] & 255) << 24 | (alphaData[alphaPosition + 1] & 255) << 16 | (alphaData[alphaPosition + 2] & 255) << 8 | alphaData[alphaPosition + 3] & 255; + break; + case 1: + alphaPixel = (alphaData[alphaPosition + 1] & 255) << 24 | (alphaData[alphaPosition + 2] & 255) << 16 | (alphaData[alphaPosition + 3] & 255) << 8 | alphaData[alphaPosition] & 255; + break; + case 2: + alphaPixel = (alphaData[alphaPosition + 2] & 255) << 24 | (alphaData[alphaPosition + 1] & 255) << 16 | (alphaData[alphaPosition] & 255) << 8 | alphaData[alphaPosition + 3] & 255; + break; + } + if(premultiplied2) { + if((alphaPixel & 255) != 0 && (alphaPixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (alphaPixel & 255); + alphaPixel = (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | alphaPixel & 255 & 255; + } + } + sourceAlpha = (alphaPixel & 255) / 255.0 * ((sourcePixel & 255) / 255.0); + if(sourceAlpha > 0) { + destAlpha = (destPixel & 255) / 255.0; + oneMinusSourceAlpha = 1 - sourceAlpha; + blendAlpha = sourceAlpha + destAlpha * oneMinusSourceAlpha; + var value = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 24 & 255) * sourceAlpha + (destPixel >>> 24 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)]; + destPixel = (value & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255; + var value1 = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 16 & 255) * sourceAlpha + (destPixel >>> 16 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)]; + destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (value1 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255; + var value2 = lime_math_RGBA.__clamp[Math.round(((sourcePixel >>> 8 & 255) * sourceAlpha + (destPixel >>> 8 & 255) * destAlpha * oneMinusSourceAlpha) / blendAlpha)]; + destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (value2 & 255) << 8 | destPixel & 255 & 255; + var value3 = lime_math_RGBA.__clamp[Math.round(blendAlpha * 255.0)]; + destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | value3 & 255; + var format3 = destFormat; + var premultiplied3 = destPremultiplied; + if(premultiplied3 == null) { + premultiplied3 = false; + } + if(format3 == null) { + format3 = 0; + } + if(premultiplied3) { + if((destPixel & 255) == 0) { + if(destPixel != 0) { + destPixel = 0; + } + } else if((destPixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[destPixel & 255]; + destPixel = ((destPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((destPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((destPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | destPixel & 255 & 255; + } + } + switch(format3) { + case 0: + destData[destPosition] = destPixel >>> 24 & 255; + destData[destPosition + 1] = destPixel >>> 16 & 255; + destData[destPosition + 2] = destPixel >>> 8 & 255; + destData[destPosition + 3] = destPixel & 255; + break; + case 1: + destData[destPosition] = destPixel & 255; + destData[destPosition + 1] = destPixel >>> 24 & 255; + destData[destPosition + 2] = destPixel >>> 16 & 255; + destData[destPosition + 3] = destPixel >>> 8 & 255; + break; + case 2: + destData[destPosition] = destPixel >>> 8 & 255; + destData[destPosition + 1] = destPixel >>> 16 & 255; + destData[destPosition + 2] = destPixel >>> 24 & 255; + destData[destPosition + 3] = destPixel & 255; + break; + } + } + sourcePosition += 4; + destPosition += 4; + alphaPosition += 4; + } + } + } else { + var _g = 0; + var _g1 = destView.height; + while(_g < _g1) { + var y = _g++; + sourcePosition = sourceView.byteOffset + sourceView.stride * y; + destPosition = destView.byteOffset + destView.stride * y; + alphaPosition = alphaView.byteOffset + alphaView.stride * y; + var _g2 = 0; + var _g3 = destView.width; + while(_g2 < _g3) { + var x = _g2++; + var format = sourceFormat; + var premultiplied = sourcePremultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + switch(format) { + case 0: + sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255; + break; + case 1: + sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255; + break; + case 2: + sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255; + break; + } + if(premultiplied) { + if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255); + sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255; + } + } + var format1 = alphaFormat; + var premultiplied1 = false; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + alphaPixel = (alphaData[alphaPosition] & 255) << 24 | (alphaData[alphaPosition + 1] & 255) << 16 | (alphaData[alphaPosition + 2] & 255) << 8 | alphaData[alphaPosition + 3] & 255; + break; + case 1: + alphaPixel = (alphaData[alphaPosition + 1] & 255) << 24 | (alphaData[alphaPosition + 2] & 255) << 16 | (alphaData[alphaPosition + 3] & 255) << 8 | alphaData[alphaPosition] & 255; + break; + case 2: + alphaPixel = (alphaData[alphaPosition + 2] & 255) << 24 | (alphaData[alphaPosition + 1] & 255) << 16 | (alphaData[alphaPosition] & 255) << 8 | alphaData[alphaPosition + 3] & 255; + break; + } + if(premultiplied1) { + if((alphaPixel & 255) != 0 && (alphaPixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (alphaPixel & 255); + alphaPixel = (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((alphaPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | alphaPixel & 255 & 255; + } + } + var value = Math.round((sourcePixel & 255) * ((alphaPixel & 255) / 255)); + sourcePixel = (sourcePixel >>> 24 & 255 & 255) << 24 | (sourcePixel >>> 16 & 255 & 255) << 16 | (sourcePixel >>> 8 & 255 & 255) << 8 | value & 255; + var format2 = destFormat; + var premultiplied2 = destPremultiplied; + if(premultiplied2 == null) { + premultiplied2 = false; + } + if(format2 == null) { + format2 = 0; + } + if(premultiplied2) { + if((sourcePixel & 255) == 0) { + if(sourcePixel != 0) { + sourcePixel = 0; + } + } else if((sourcePixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[sourcePixel & 255]; + sourcePixel = ((sourcePixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((sourcePixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((sourcePixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | sourcePixel & 255 & 255; + } + } + switch(format2) { + case 0: + destData[destPosition] = sourcePixel >>> 24 & 255; + destData[destPosition + 1] = sourcePixel >>> 16 & 255; + destData[destPosition + 2] = sourcePixel >>> 8 & 255; + destData[destPosition + 3] = sourcePixel & 255; + break; + case 1: + destData[destPosition] = sourcePixel & 255; + destData[destPosition + 1] = sourcePixel >>> 24 & 255; + destData[destPosition + 2] = sourcePixel >>> 16 & 255; + destData[destPosition + 3] = sourcePixel >>> 8 & 255; + break; + case 2: + destData[destPosition] = sourcePixel >>> 8 & 255; + destData[destPosition + 1] = sourcePixel >>> 16 & 255; + destData[destPosition + 2] = sourcePixel >>> 24 & 255; + destData[destPosition + 3] = sourcePixel & 255; + break; + } + sourcePosition += 4; + destPosition += 4; + alphaPosition += 4; + } + } + } + } + } + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.fillRect = function(image,rect,color,format) { + var fillColor; + switch(format) { + case 1: + var argb = color; + var rgba = 0; + rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255; + fillColor = rgba; + break; + case 2: + var bgra = color; + var rgba = 0; + rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255; + fillColor = rgba; + break; + default: + fillColor = color; + } + if(!image.get_transparent()) { + fillColor = (fillColor >>> 24 & 255 & 255) << 24 | (fillColor >>> 16 & 255 & 255) << 16 | (fillColor >>> 8 & 255 & 255) << 8 | 255; + } + var data = image.buffer.data; + if(data == null) { + return; + } + var format = image.buffer.format; + var premultiplied = image.buffer.premultiplied; + if(premultiplied) { + if((fillColor & 255) == 0) { + if(fillColor != 0) { + fillColor = 0; + } + } else if((fillColor & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[fillColor & 255]; + fillColor = ((fillColor >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((fillColor >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((fillColor >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | fillColor & 255 & 255; + } + } + var dataView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,rect); + var row; + var _g = 0; + var _g1 = dataView.height; + while(_g < _g1) { + var y = _g++; + row = dataView.byteOffset + dataView.stride * y; + var _g2 = 0; + var _g3 = dataView.width; + while(_g2 < _g3) { + var x = _g2++; + var offset = row + x * 4; + var format1 = format; + var premultiplied = false; + if(premultiplied == null) { + premultiplied = false; + } + if(format1 == null) { + format1 = 0; + } + if(premultiplied) { + if((fillColor & 255) == 0) { + if(fillColor != 0) { + fillColor = 0; + } + } else if((fillColor & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[fillColor & 255]; + fillColor = ((fillColor >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((fillColor >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((fillColor >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | fillColor & 255 & 255; + } + } + switch(format1) { + case 0: + data[offset] = fillColor >>> 24 & 255; + data[offset + 1] = fillColor >>> 16 & 255; + data[offset + 2] = fillColor >>> 8 & 255; + data[offset + 3] = fillColor & 255; + break; + case 1: + data[offset] = fillColor & 255; + data[offset + 1] = fillColor >>> 24 & 255; + data[offset + 2] = fillColor >>> 16 & 255; + data[offset + 3] = fillColor >>> 8 & 255; + break; + case 2: + data[offset] = fillColor >>> 8 & 255; + data[offset + 1] = fillColor >>> 16 & 255; + data[offset + 2] = fillColor >>> 24 & 255; + data[offset + 3] = fillColor & 255; + break; + } + } + } + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.floodFill = function(image,x,y,color,format) { + var data = image.buffer.data; + if(data == null) { + return; + } + if(format == 1) { + color = (color & 16777215) << 8 | color >> 24 & 255; + } + var format = image.buffer.format; + var premultiplied = image.buffer.premultiplied; + var fillColor = color; + var hitColor = 0; + var offset = (y + image.offsetY) * (image.buffer.width * 4) + (x + image.offsetX) * 4; + var format1 = format; + var premultiplied1 = premultiplied; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + hitColor = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255; + break; + case 1: + hitColor = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255; + break; + case 2: + hitColor = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255; + break; + } + if(premultiplied1) { + if((hitColor & 255) != 0 && (hitColor & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (hitColor & 255); + hitColor = (lime_math_RGBA.__clamp[Math.round((hitColor >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((hitColor >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((hitColor >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | hitColor & 255 & 255; + } + } + if(!image.get_transparent()) { + fillColor = (fillColor >>> 24 & 255 & 255) << 24 | (fillColor >>> 16 & 255 & 255) << 16 | (fillColor >>> 8 & 255 & 255) << 8 | 255; + hitColor = (hitColor >>> 24 & 255 & 255) << 24 | (hitColor >>> 16 & 255 & 255) << 16 | (hitColor >>> 8 & 255 & 255) << 8 | 255; + } + if(fillColor == hitColor) { + return; + } + if(premultiplied) { + if((fillColor & 255) == 0) { + if(fillColor != 0) { + fillColor = 0; + } + } else if((fillColor & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[fillColor & 255]; + fillColor = ((fillColor >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((fillColor >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((fillColor >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | fillColor & 255 & 255; + } + } + var dx = [0,-1,1,0]; + var dy = [-1,0,0,1]; + var minX = -image.offsetX; + var minY = -image.offsetY; + var maxX = minX + image.width; + var maxY = minY + image.height; + var queue = []; + queue.push(x); + queue.push(y); + var curPointX; + var curPointY; + var nextPointX; + var nextPointY; + var nextPointOffset; + var readColor = 0; + while(queue.length > 0) { + curPointY = queue.pop(); + curPointX = queue.pop(); + var _g = 0; + while(_g < 4) { + var i = _g++; + nextPointX = curPointX + dx[i]; + nextPointY = curPointY + dy[i]; + if(nextPointX < minX || nextPointY < minY || nextPointX >= maxX || nextPointY >= maxY) { + continue; + } + nextPointOffset = (nextPointY * image.width + nextPointX) * 4; + var format1 = format; + var premultiplied1 = premultiplied; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + readColor = (data[nextPointOffset] & 255) << 24 | (data[nextPointOffset + 1] & 255) << 16 | (data[nextPointOffset + 2] & 255) << 8 | data[nextPointOffset + 3] & 255; + break; + case 1: + readColor = (data[nextPointOffset + 1] & 255) << 24 | (data[nextPointOffset + 2] & 255) << 16 | (data[nextPointOffset + 3] & 255) << 8 | data[nextPointOffset] & 255; + break; + case 2: + readColor = (data[nextPointOffset + 2] & 255) << 24 | (data[nextPointOffset + 1] & 255) << 16 | (data[nextPointOffset] & 255) << 8 | data[nextPointOffset + 3] & 255; + break; + } + if(premultiplied1) { + if((readColor & 255) != 0 && (readColor & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (readColor & 255); + readColor = (lime_math_RGBA.__clamp[Math.round((readColor >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((readColor >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((readColor >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | readColor & 255 & 255; + } + } + if(readColor == hitColor) { + var format2 = format; + var premultiplied2 = false; + if(premultiplied2 == null) { + premultiplied2 = false; + } + if(format2 == null) { + format2 = 0; + } + if(premultiplied2) { + if((fillColor & 255) == 0) { + if(fillColor != 0) { + fillColor = 0; + } + } else if((fillColor & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[fillColor & 255]; + fillColor = ((fillColor >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((fillColor >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((fillColor >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | fillColor & 255 & 255; + } + } + switch(format2) { + case 0: + data[nextPointOffset] = fillColor >>> 24 & 255; + data[nextPointOffset + 1] = fillColor >>> 16 & 255; + data[nextPointOffset + 2] = fillColor >>> 8 & 255; + data[nextPointOffset + 3] = fillColor & 255; + break; + case 1: + data[nextPointOffset] = fillColor & 255; + data[nextPointOffset + 1] = fillColor >>> 24 & 255; + data[nextPointOffset + 2] = fillColor >>> 16 & 255; + data[nextPointOffset + 3] = fillColor >>> 8 & 255; + break; + case 2: + data[nextPointOffset] = fillColor >>> 8 & 255; + data[nextPointOffset + 1] = fillColor >>> 16 & 255; + data[nextPointOffset + 2] = fillColor >>> 24 & 255; + data[nextPointOffset + 3] = fillColor & 255; + break; + } + queue.push(nextPointX); + queue.push(nextPointY); + } + } + } + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.gaussianBlur = function(image,sourceImage,sourceRect,destPoint,blurX,blurY,quality,strength,color) { + if(strength == null) { + strength = 1; + } + if(quality == null) { + quality = 1; + } + if(blurY == null) { + blurY = 4; + } + if(blurX == null) { + blurX = 4; + } + var imagePremultiplied = image.get_premultiplied(); + if(imagePremultiplied) { + image.set_premultiplied(false); + } + lime__$internal_graphics_StackBlur.blur(image,sourceImage,sourceRect,destPoint,blurX,blurY,quality); + image.dirty = true; + image.version++; + if(imagePremultiplied) { + image.set_premultiplied(true); + } + return image; +}; +lime__$internal_graphics_ImageDataUtil.getColorBoundsRect = function(image,mask,color,findColor,format) { + var left = image.width + 1; + var right = 0; + var top = image.height + 1; + var bottom = 0; + var _color; + var _mask; + switch(format) { + case 1: + var argb = color; + var rgba = 0; + rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255; + _color = rgba; + var argb = mask; + var rgba = 0; + rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255; + _mask = rgba; + break; + case 2: + var bgra = color; + var rgba = 0; + rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255; + _color = rgba; + var bgra = mask; + var rgba = 0; + rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255; + _mask = rgba; + break; + default: + _color = color; + _mask = mask; + } + if(!image.get_transparent()) { + _color = (_color >>> 24 & 255 & 255) << 24 | (_color >>> 16 & 255 & 255) << 16 | (_color >>> 8 & 255 & 255) << 8 | 255; + _mask = (_mask >>> 24 & 255 & 255) << 24 | (_mask >>> 16 & 255 & 255) << 16 | (_mask >>> 8 & 255 & 255) << 8 | 255; + } + var pixel; + var hit; + var _g = 0; + var _g1 = image.width; + while(_g < _g1) { + var x = _g++; + hit = false; + var _g2 = 0; + var _g3 = image.height; + while(_g2 < _g3) { + var y = _g2++; + pixel = image.getPixel32(x,y,0); + hit = findColor ? (pixel & _mask) == _color : (pixel & _mask) != _color; + if(hit) { + if(x < left) { + left = x; + } + break; + } + } + if(hit) { + break; + } + } + var ix; + var _g = 0; + var _g1 = image.width; + while(_g < _g1) { + var x = _g++; + ix = image.width - 1 - x; + hit = false; + var _g2 = 0; + var _g3 = image.height; + while(_g2 < _g3) { + var y = _g2++; + pixel = image.getPixel32(ix,y,0); + hit = findColor ? (pixel & _mask) == _color : (pixel & _mask) != _color; + if(hit) { + if(ix > right) { + right = ix; + } + break; + } + } + if(hit) { + break; + } + } + var _g = 0; + var _g1 = image.height; + while(_g < _g1) { + var y = _g++; + hit = false; + var _g2 = 0; + var _g3 = image.width; + while(_g2 < _g3) { + var x = _g2++; + pixel = image.getPixel32(x,y,0); + hit = findColor ? (pixel & _mask) == _color : (pixel & _mask) != _color; + if(hit) { + if(y < top) { + top = y; + } + break; + } + } + if(hit) { + break; + } + } + var iy; + var _g = 0; + var _g1 = image.height; + while(_g < _g1) { + var y = _g++; + iy = image.height - 1 - y; + hit = false; + var _g2 = 0; + var _g3 = image.width; + while(_g2 < _g3) { + var x = _g2++; + pixel = image.getPixel32(x,iy,0); + hit = findColor ? (pixel & _mask) == _color : (pixel & _mask) != _color; + if(hit) { + if(iy > bottom) { + bottom = iy; + } + break; + } + } + if(hit) { + break; + } + } + var w = right - left; + var h = bottom - top; + if(w > 0) { + ++w; + } + if(h > 0) { + ++h; + } + if(w < 0) { + w = 0; + } + if(h < 0) { + h = 0; + } + if(left == right) { + w = 1; + } + if(top == bottom) { + h = 1; + } + if(left > image.width) { + left = 0; + } + if(top > image.height) { + top = 0; + } + return new lime_math_Rectangle(left,top,w,h); +}; +lime__$internal_graphics_ImageDataUtil.getPixel = function(image,x,y,format) { + var pixel = 0; + var data = image.buffer.data; + var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4; + var format1 = image.buffer.format; + var premultiplied = image.buffer.premultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255; + break; + case 1: + pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255; + break; + case 2: + pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255; + break; + } + if(premultiplied) { + if((pixel & 255) != 0 && (pixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (pixel & 255); + pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255; + } + } + pixel = (pixel >>> 24 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 8 & 255 & 255) << 8 | 0; + switch(format) { + case 1: + var argb = 0; + argb = (pixel & 255 & 255) << 24 | (pixel >>> 24 & 255 & 255) << 16 | (pixel >>> 16 & 255 & 255) << 8 | pixel >>> 8 & 255 & 255; + return argb; + case 2: + var bgra = 0; + bgra = (pixel >>> 8 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 24 & 255 & 255) << 8 | pixel & 255 & 255; + return bgra; + default: + return pixel; + } +}; +lime__$internal_graphics_ImageDataUtil.getPixel32 = function(image,x,y,format) { + var pixel = 0; + var data = image.buffer.data; + var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4; + var format1 = image.buffer.format; + var premultiplied = image.buffer.premultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255; + break; + case 1: + pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255; + break; + case 2: + pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255; + break; + } + if(premultiplied) { + if((pixel & 255) != 0 && (pixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (pixel & 255); + pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255; + } + } + switch(format) { + case 1: + var argb = 0; + argb = (pixel & 255 & 255) << 24 | (pixel >>> 24 & 255 & 255) << 16 | (pixel >>> 16 & 255 & 255) << 8 | pixel >>> 8 & 255 & 255; + return argb; + case 2: + var bgra = 0; + bgra = (pixel >>> 8 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 24 & 255 & 255) << 8 | pixel & 255 & 255; + return bgra; + default: + return pixel; + } +}; +lime__$internal_graphics_ImageDataUtil.getPixels = function(image,rect,format) { + if(image.buffer.data == null) { + return null; + } + var length = rect.width * rect.height | 0; + var bytes = new haxe_io_Bytes(new ArrayBuffer(length * 4)); + var data = image.buffer.data; + var sourceFormat = image.buffer.format; + var premultiplied = image.buffer.premultiplied; + var dataView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,rect); + var position; + var argb = 0; + var bgra = 0; + var pixel = 0; + var destPosition = 0; + var _g = 0; + var _g1 = dataView.height; + while(_g < _g1) { + var y = _g++; + position = dataView.byteOffset + dataView.stride * y; + var _g2 = 0; + var _g3 = dataView.width; + while(_g2 < _g3) { + var x = _g2++; + var format1 = sourceFormat; + var premultiplied1 = premultiplied; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + pixel = (data[position] & 255) << 24 | (data[position + 1] & 255) << 16 | (data[position + 2] & 255) << 8 | data[position + 3] & 255; + break; + case 1: + pixel = (data[position + 1] & 255) << 24 | (data[position + 2] & 255) << 16 | (data[position + 3] & 255) << 8 | data[position] & 255; + break; + case 2: + pixel = (data[position + 2] & 255) << 24 | (data[position + 1] & 255) << 16 | (data[position] & 255) << 8 | data[position + 3] & 255; + break; + } + if(premultiplied1) { + if((pixel & 255) != 0 && (pixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (pixel & 255); + pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255; + } + } + switch(format) { + case 1: + var argb1 = 0; + argb1 = (pixel & 255 & 255) << 24 | (pixel >>> 24 & 255 & 255) << 16 | (pixel >>> 16 & 255 & 255) << 8 | pixel >>> 8 & 255 & 255; + argb = argb1; + pixel = argb; + break; + case 2: + var bgra1 = 0; + bgra1 = (pixel >>> 8 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 24 & 255 & 255) << 8 | pixel & 255 & 255; + bgra = bgra1; + pixel = bgra; + break; + default: + } + bytes.b[destPosition++] = pixel >>> 24 & 255 & 255; + bytes.b[destPosition++] = pixel >>> 16 & 255 & 255; + bytes.b[destPosition++] = pixel >>> 8 & 255 & 255; + bytes.b[destPosition++] = pixel & 255 & 255; + position += 4; + } + } + return bytes; +}; +lime__$internal_graphics_ImageDataUtil.merge = function(image,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) { + if(image.buffer.data == null || sourceImage.buffer.data == null) { + return; + } + var sourceView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(sourceImage,sourceRect); + var destView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,new lime_math_Rectangle(destPoint.x,destPoint.y,sourceView.width,sourceView.height)); + var sourceData = sourceImage.buffer.data; + var destData = image.buffer.data; + var sourceFormat = sourceImage.buffer.format; + var destFormat = image.buffer.format; + var sourcePremultiplied = sourceImage.buffer.premultiplied; + var destPremultiplied = image.buffer.premultiplied; + var sourcePosition; + var destPosition; + var sourcePixel = 0; + var destPixel = 0; + var _g = 0; + var _g1 = destView.height; + while(_g < _g1) { + var y = _g++; + sourcePosition = sourceView.byteOffset + sourceView.stride * y; + destPosition = destView.byteOffset + destView.stride * y; + var _g2 = 0; + var _g3 = destView.width; + while(_g2 < _g3) { + var x = _g2++; + var format = sourceFormat; + var premultiplied = sourcePremultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + switch(format) { + case 0: + sourcePixel = (sourceData[sourcePosition] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition + 2] & 255) << 8 | sourceData[sourcePosition + 3] & 255; + break; + case 1: + sourcePixel = (sourceData[sourcePosition + 1] & 255) << 24 | (sourceData[sourcePosition + 2] & 255) << 16 | (sourceData[sourcePosition + 3] & 255) << 8 | sourceData[sourcePosition] & 255; + break; + case 2: + sourcePixel = (sourceData[sourcePosition + 2] & 255) << 24 | (sourceData[sourcePosition + 1] & 255) << 16 | (sourceData[sourcePosition] & 255) << 8 | sourceData[sourcePosition + 3] & 255; + break; + } + if(premultiplied) { + if((sourcePixel & 255) != 0 && (sourcePixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (sourcePixel & 255); + sourcePixel = (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((sourcePixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | sourcePixel & 255 & 255; + } + } + var format1 = destFormat; + var premultiplied1 = destPremultiplied; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + destPixel = (destData[destPosition] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition + 2] & 255) << 8 | destData[destPosition + 3] & 255; + break; + case 1: + destPixel = (destData[destPosition + 1] & 255) << 24 | (destData[destPosition + 2] & 255) << 16 | (destData[destPosition + 3] & 255) << 8 | destData[destPosition] & 255; + break; + case 2: + destPixel = (destData[destPosition + 2] & 255) << 24 | (destData[destPosition + 1] & 255) << 16 | (destData[destPosition] & 255) << 8 | destData[destPosition + 3] & 255; + break; + } + if(premultiplied1) { + if((destPixel & 255) != 0 && (destPixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (destPixel & 255); + destPixel = (lime_math_RGBA.__clamp[Math.round((destPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((destPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | destPixel & 255 & 255; + } + } + var value = ((sourcePixel >>> 24 & 255) * redMultiplier + (destPixel >>> 24 & 255) * (256 - redMultiplier)) / 256 | 0; + destPixel = (value & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255; + var value1 = ((sourcePixel >>> 16 & 255) * greenMultiplier + (destPixel >>> 16 & 255) * (256 - greenMultiplier)) / 256 | 0; + destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (value1 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | destPixel & 255 & 255; + var value2 = ((sourcePixel >>> 8 & 255) * blueMultiplier + (destPixel >>> 8 & 255) * (256 - blueMultiplier)) / 256 | 0; + destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (value2 & 255) << 8 | destPixel & 255 & 255; + var value3 = ((sourcePixel & 255) * alphaMultiplier + (destPixel & 255) * (256 - alphaMultiplier)) / 256 | 0; + destPixel = (destPixel >>> 24 & 255 & 255) << 24 | (destPixel >>> 16 & 255 & 255) << 16 | (destPixel >>> 8 & 255 & 255) << 8 | value3 & 255; + var format2 = destFormat; + var premultiplied2 = destPremultiplied; + if(premultiplied2 == null) { + premultiplied2 = false; + } + if(format2 == null) { + format2 = 0; + } + if(premultiplied2) { + if((destPixel & 255) == 0) { + if(destPixel != 0) { + destPixel = 0; + } + } else if((destPixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[destPixel & 255]; + destPixel = ((destPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((destPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((destPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | destPixel & 255 & 255; + } + } + switch(format2) { + case 0: + destData[destPosition] = destPixel >>> 24 & 255; + destData[destPosition + 1] = destPixel >>> 16 & 255; + destData[destPosition + 2] = destPixel >>> 8 & 255; + destData[destPosition + 3] = destPixel & 255; + break; + case 1: + destData[destPosition] = destPixel & 255; + destData[destPosition + 1] = destPixel >>> 24 & 255; + destData[destPosition + 2] = destPixel >>> 16 & 255; + destData[destPosition + 3] = destPixel >>> 8 & 255; + break; + case 2: + destData[destPosition] = destPixel >>> 8 & 255; + destData[destPosition + 1] = destPixel >>> 16 & 255; + destData[destPosition + 2] = destPixel >>> 24 & 255; + destData[destPosition + 3] = destPixel & 255; + break; + } + sourcePosition += 4; + destPosition += 4; + } + } + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.multiplyAlpha = function(image) { + var data = image.buffer.data; + if(data == null || !image.buffer.transparent) { + return; + } + var format = image.buffer.format; + var length = data.length / 4 | 0; + var pixel = 0; + var _g = 0; + var _g1 = length; + while(_g < _g1) { + var i = _g++; + var offset = i * 4; + var format1 = format; + var premultiplied = false; + if(premultiplied == null) { + premultiplied = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255; + break; + case 1: + pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255; + break; + case 2: + pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255; + break; + } + if(premultiplied) { + if((pixel & 255) != 0 && (pixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (pixel & 255); + pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255; + } + } + var offset1 = i * 4; + var format2 = format; + var premultiplied1 = true; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format2 == null) { + format2 = 0; + } + if(premultiplied1) { + if((pixel & 255) == 0) { + if(pixel != 0) { + pixel = 0; + } + } else if((pixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255]; + pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255; + } + } + switch(format2) { + case 0: + data[offset1] = pixel >>> 24 & 255; + data[offset1 + 1] = pixel >>> 16 & 255; + data[offset1 + 2] = pixel >>> 8 & 255; + data[offset1 + 3] = pixel & 255; + break; + case 1: + data[offset1] = pixel & 255; + data[offset1 + 1] = pixel >>> 24 & 255; + data[offset1 + 2] = pixel >>> 16 & 255; + data[offset1 + 3] = pixel >>> 8 & 255; + break; + case 2: + data[offset1] = pixel >>> 8 & 255; + data[offset1 + 1] = pixel >>> 16 & 255; + data[offset1 + 2] = pixel >>> 24 & 255; + data[offset1 + 3] = pixel & 255; + break; + } + } + image.buffer.premultiplied = true; + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.resize = function(image,newWidth,newHeight) { + var buffer = image.buffer; + if(buffer.width == newWidth && buffer.height == newHeight) { + return; + } + var elements = newWidth * newHeight * 4; + var array = null; + var vector = null; + var view = null; + var buffer1 = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer1 != null) { + if(len == null) { + this1 = new Uint8Array(buffer1,0); + } else { + this1 = new Uint8Array(buffer1,0,len); + } + } else { + this1 = null; + } + var newBuffer = new lime_graphics_ImageBuffer(this1,newWidth,newHeight); + var imageWidth = image.width; + var imageHeight = image.height; + var data = image.get_data(); + var newData = newBuffer.data; + var sourceIndex; + var sourceIndexX; + var sourceIndexY; + var sourceIndexXY; + var index; + var sourceX; + var sourceY; + var u; + var v; + var uRatio; + var vRatio; + var uOpposite; + var vOpposite; + var _g = 0; + var _g1 = newHeight; + while(_g < _g1) { + var y = _g++; + var _g2 = 0; + var _g3 = newWidth; + while(_g2 < _g3) { + var x = _g2++; + u = (x + 0.5) / newWidth * imageWidth - 0.5; + v = (y + 0.5) / newHeight * imageHeight - 0.5; + sourceX = u | 0; + sourceY = v | 0; + sourceIndex = (sourceY * imageWidth + sourceX) * 4; + sourceIndexX = sourceX < imageWidth - 1 ? sourceIndex + 4 : sourceIndex; + sourceIndexY = sourceY < imageHeight - 1 ? sourceIndex + imageWidth * 4 : sourceIndex; + sourceIndexXY = sourceIndexX != sourceIndex ? sourceIndexY + 4 : sourceIndexY; + index = (y * newWidth + x) * 4; + uRatio = u - sourceX; + vRatio = v - sourceY; + uOpposite = 1 - uRatio; + vOpposite = 1 - vRatio; + newData[index] = (UInt.toFloat(data[sourceIndex]) * uOpposite + UInt.toFloat(data[sourceIndexX]) * uRatio) * vOpposite + (UInt.toFloat(data[sourceIndexY]) * uOpposite + UInt.toFloat(data[sourceIndexXY]) * uRatio) * vRatio | 0; + newData[index + 1] = (UInt.toFloat(data[sourceIndex + 1]) * uOpposite + UInt.toFloat(data[sourceIndexX + 1]) * uRatio) * vOpposite + (UInt.toFloat(data[sourceIndexY + 1]) * uOpposite + UInt.toFloat(data[sourceIndexXY + 1]) * uRatio) * vRatio | 0; + newData[index + 2] = (UInt.toFloat(data[sourceIndex + 2]) * uOpposite + UInt.toFloat(data[sourceIndexX + 2]) * uRatio) * vOpposite + (UInt.toFloat(data[sourceIndexY + 2]) * uOpposite + UInt.toFloat(data[sourceIndexXY + 2]) * uRatio) * vRatio | 0; + if(data[sourceIndexX + 3] == 0 || data[sourceIndexY + 3] == 0 || data[sourceIndexXY + 3] == 0) { + newData[index + 3] = 0; + } else { + newData[index + 3] = data[sourceIndex + 3]; + } + } + } + buffer.data = newBuffer.data; + buffer.width = newWidth; + buffer.height = newHeight; + buffer.__srcImage = null; + buffer.__srcImageData = null; + buffer.__srcCanvas = null; + buffer.__srcContext = null; + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.resizeBuffer = function(image,newWidth,newHeight) { + var buffer = image.buffer; + var data = image.get_data(); + var elements = newWidth * newHeight * 4; + var array = null; + var vector = null; + var view = null; + var buffer1 = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer1 != null) { + if(len == null) { + this1 = new Uint8Array(buffer1,0); + } else { + this1 = new Uint8Array(buffer1,0,len); + } + } else { + this1 = null; + } + var newData = this1; + var sourceIndex; + var index; + var _g = 0; + var _g1 = buffer.height; + while(_g < _g1) { + var y = _g++; + var _g2 = 0; + var _g3 = buffer.width; + while(_g2 < _g3) { + var x = _g2++; + sourceIndex = (y * buffer.width + x) * 4; + index = (y * newWidth + x) * 4; + newData[index] = data[sourceIndex]; + newData[index + 1] = data[sourceIndex + 1]; + newData[index + 2] = data[sourceIndex + 2]; + newData[index + 3] = data[sourceIndex + 3]; + } + } + buffer.data = newData; + buffer.width = newWidth; + buffer.height = newHeight; + buffer.__srcImage = null; + buffer.__srcImageData = null; + buffer.__srcCanvas = null; + buffer.__srcContext = null; + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.setFormat = function(image,format) { + var data = image.buffer.data; + if(data == null) { + return; + } + var index; + var a16; + var length = data.length / 4 | 0; + var r1; + var g1; + var b1; + var a1; + var r2; + var g2; + var b2; + var a2; + var r; + var g; + var b; + var a; + switch(image.get_format()) { + case 0: + r1 = 0; + g1 = 1; + b1 = 2; + a1 = 3; + break; + case 1: + r1 = 1; + g1 = 2; + b1 = 3; + a1 = 0; + break; + case 2: + r1 = 2; + g1 = 1; + b1 = 0; + a1 = 3; + break; + } + switch(format) { + case 0: + r2 = 0; + g2 = 1; + b2 = 2; + a2 = 3; + break; + case 1: + r2 = 1; + g2 = 2; + b2 = 3; + a2 = 0; + break; + case 2: + r2 = 2; + g2 = 1; + b2 = 0; + a2 = 3; + break; + } + var _g = 0; + var _g1 = length; + while(_g < _g1) { + var i = _g++; + index = i * 4; + r = data[index + r1]; + g = data[index + g1]; + b = data[index + b1]; + a = data[index + a1]; + data[index + r2] = r; + data[index + g2] = g; + data[index + b2] = b; + data[index + a2] = a; + } + image.buffer.format = format; + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.setPixel = function(image,x,y,color,format) { + var pixel; + switch(format) { + case 1: + var argb = color; + var rgba = 0; + rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255; + pixel = rgba; + break; + case 2: + var bgra = color; + var rgba = 0; + rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255; + pixel = rgba; + break; + default: + pixel = color; + } + var source = 0; + var data = image.buffer.data; + var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4; + var format = image.buffer.format; + var premultiplied = image.buffer.premultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + switch(format) { + case 0: + source = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255; + break; + case 1: + source = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255; + break; + case 2: + source = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255; + break; + } + if(premultiplied) { + if((source & 255) != 0 && (source & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (source & 255); + source = (lime_math_RGBA.__clamp[Math.round((source >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((source >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((source >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | source & 255 & 255; + } + } + var value = source & 255; + pixel = (pixel >>> 24 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 8 & 255 & 255) << 8 | value & 255; + var data = image.buffer.data; + var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4; + var format = image.buffer.format; + var premultiplied = image.buffer.premultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + if(premultiplied) { + if((pixel & 255) == 0) { + if(pixel != 0) { + pixel = 0; + } + } else if((pixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255]; + pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255; + } + } + switch(format) { + case 0: + data[offset] = pixel >>> 24 & 255; + data[offset + 1] = pixel >>> 16 & 255; + data[offset + 2] = pixel >>> 8 & 255; + data[offset + 3] = pixel & 255; + break; + case 1: + data[offset] = pixel & 255; + data[offset + 1] = pixel >>> 24 & 255; + data[offset + 2] = pixel >>> 16 & 255; + data[offset + 3] = pixel >>> 8 & 255; + break; + case 2: + data[offset] = pixel >>> 8 & 255; + data[offset + 1] = pixel >>> 16 & 255; + data[offset + 2] = pixel >>> 24 & 255; + data[offset + 3] = pixel & 255; + break; + } + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.setPixel32 = function(image,x,y,color,format) { + var pixel; + switch(format) { + case 1: + var argb = color; + var rgba = 0; + rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255; + pixel = rgba; + break; + case 2: + var bgra = color; + var rgba = 0; + rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255; + pixel = rgba; + break; + default: + pixel = color; + } + if(!image.get_transparent()) { + pixel = (pixel >>> 24 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 8 & 255 & 255) << 8 | 255; + } + var data = image.buffer.data; + var offset = 4 * (y + image.offsetY) * image.buffer.width + (x + image.offsetX) * 4; + var format = image.buffer.format; + var premultiplied = image.buffer.premultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + if(premultiplied) { + if((pixel & 255) == 0) { + if(pixel != 0) { + pixel = 0; + } + } else if((pixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255]; + pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255; + } + } + switch(format) { + case 0: + data[offset] = pixel >>> 24 & 255; + data[offset + 1] = pixel >>> 16 & 255; + data[offset + 2] = pixel >>> 8 & 255; + data[offset + 3] = pixel & 255; + break; + case 1: + data[offset] = pixel & 255; + data[offset + 1] = pixel >>> 24 & 255; + data[offset + 2] = pixel >>> 16 & 255; + data[offset + 3] = pixel >>> 8 & 255; + break; + case 2: + data[offset] = pixel >>> 8 & 255; + data[offset + 1] = pixel >>> 16 & 255; + data[offset + 2] = pixel >>> 24 & 255; + data[offset + 3] = pixel & 255; + break; + } + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.setPixels = function(image,rect,bytePointer,format,endian) { + if(image.buffer.data == null) { + return; + } + var data = image.buffer.data; + var sourceFormat = image.buffer.format; + var premultiplied = image.buffer.premultiplied; + var dataView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,rect); + var row; + var color; + var pixel; + var transparent = image.get_transparent(); + var bytes = bytePointer.bytes; + var dataPosition = bytePointer.offset; + var littleEndian = endian != lime_system_Endian.BIG_ENDIAN; + var _g = 0; + var _g1 = dataView.height; + while(_g < _g1) { + var y = _g++; + row = dataView.byteOffset + dataView.stride * y; + var _g2 = 0; + var _g3 = dataView.width; + while(_g2 < _g3) { + var x = _g2++; + if(littleEndian) { + color = bytes.getInt32(dataPosition); + } else { + color = bytes.b[dataPosition + 3] | bytes.b[dataPosition + 2] << 8 | bytes.b[dataPosition + 1] << 16 | bytes.b[dataPosition] << 24; + } + dataPosition += 4; + switch(format) { + case 1: + var argb = color; + var rgba = 0; + rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255; + pixel = rgba; + break; + case 2: + var bgra = color; + var rgba1 = 0; + rgba1 = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255; + pixel = rgba1; + break; + default: + pixel = color; + } + if(!transparent) { + pixel = (pixel >>> 24 & 255 & 255) << 24 | (pixel >>> 16 & 255 & 255) << 16 | (pixel >>> 8 & 255 & 255) << 8 | 255; + } + var offset = row + x * 4; + var format1 = sourceFormat; + var premultiplied1 = premultiplied; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + if(premultiplied1) { + if((pixel & 255) == 0) { + if(pixel != 0) { + pixel = 0; + } + } else if((pixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255]; + pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255; + } + } + switch(format1) { + case 0: + data[offset] = pixel >>> 24 & 255; + data[offset + 1] = pixel >>> 16 & 255; + data[offset + 2] = pixel >>> 8 & 255; + data[offset + 3] = pixel & 255; + break; + case 1: + data[offset] = pixel & 255; + data[offset + 1] = pixel >>> 24 & 255; + data[offset + 2] = pixel >>> 16 & 255; + data[offset + 3] = pixel >>> 8 & 255; + break; + case 2: + data[offset] = pixel >>> 8 & 255; + data[offset + 1] = pixel >>> 16 & 255; + data[offset + 2] = pixel >>> 24 & 255; + data[offset + 3] = pixel & 255; + break; + } + } + } + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.threshold = function(image,sourceImage,sourceRect,destPoint,operation,threshold,color,mask,copySource,format) { + var _color; + var _mask; + var _threshold; + switch(format) { + case 1: + var argb = color; + var rgba = 0; + rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255; + _color = rgba; + var argb = mask; + var rgba = 0; + rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255; + _mask = rgba; + var argb = threshold; + var rgba = 0; + rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255; + _threshold = rgba; + break; + case 2: + var bgra = color; + var rgba = 0; + rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255; + _color = rgba; + var bgra = mask; + var rgba = 0; + rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255; + _mask = rgba; + var bgra = threshold; + var rgba = 0; + rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255; + _threshold = rgba; + break; + default: + _color = color; + _mask = mask; + _threshold = threshold; + } + var _operation; + switch(operation) { + case "!=": + _operation = 0; + break; + case "<": + _operation = 2; + break; + case "<=": + _operation = 3; + break; + case "==": + _operation = 1; + break; + case ">": + _operation = 4; + break; + case ">=": + _operation = 5; + break; + default: + _operation = -1; + } + if(_operation == -1) { + return 0; + } + var srcData = sourceImage.buffer.data; + var destData = image.buffer.data; + if(srcData == null || destData == null) { + return 0; + } + var hits = 0; + var srcView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(sourceImage,sourceRect); + var destView = new lime__$internal_graphics__$ImageDataUtil_ImageDataView(image,new lime_math_Rectangle(destPoint.x,destPoint.y,srcView.width,srcView.height)); + var srcFormat = sourceImage.buffer.format; + var destFormat = image.buffer.format; + var srcPremultiplied = sourceImage.buffer.premultiplied; + var destPremultiplied = image.buffer.premultiplied; + var srcPosition; + var destPosition; + var srcPixel = 0; + var destPixel = 0; + var pixelMask; + var test; + var value; + var _g = 0; + var _g1 = destView.height; + while(_g < _g1) { + var y = _g++; + srcPosition = srcView.byteOffset + srcView.stride * y; + destPosition = destView.byteOffset + destView.stride * y; + var _g2 = 0; + var _g3 = destView.width; + while(_g2 < _g3) { + var x = _g2++; + var format = srcFormat; + var premultiplied = srcPremultiplied; + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + switch(format) { + case 0: + srcPixel = (srcData[srcPosition] & 255) << 24 | (srcData[srcPosition + 1] & 255) << 16 | (srcData[srcPosition + 2] & 255) << 8 | srcData[srcPosition + 3] & 255; + break; + case 1: + srcPixel = (srcData[srcPosition + 1] & 255) << 24 | (srcData[srcPosition + 2] & 255) << 16 | (srcData[srcPosition + 3] & 255) << 8 | srcData[srcPosition] & 255; + break; + case 2: + srcPixel = (srcData[srcPosition + 2] & 255) << 24 | (srcData[srcPosition + 1] & 255) << 16 | (srcData[srcPosition] & 255) << 8 | srcData[srcPosition + 3] & 255; + break; + } + if(premultiplied) { + if((srcPixel & 255) != 0 && (srcPixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (srcPixel & 255); + srcPixel = (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((srcPixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | srcPixel & 255 & 255; + } + } + pixelMask = srcPixel & _mask; + var tmp1 = pixelMask >>> 24 & 255; + var tmp2 = _threshold >>> 24 & 255; + if(tmp1 != tmp2) { + value = UInt.gt(tmp1,tmp2) ? 1 : -1; + } else { + tmp1 = pixelMask >>> 16 & 255; + tmp2 = _threshold >>> 16 & 255; + if(tmp1 != tmp2) { + value = UInt.gt(tmp1,tmp2) ? 1 : -1; + } else { + tmp1 = pixelMask >>> 8 & 255; + tmp2 = _threshold >>> 8 & 255; + if(tmp1 != tmp2) { + value = UInt.gt(tmp1,tmp2) ? 1 : -1; + } else { + tmp1 = pixelMask & 255; + tmp2 = _threshold & 255; + value = tmp1 != tmp2 ? UInt.gt(tmp1,tmp2) ? 1 : -1 : 0; + } + } + } + switch(_operation) { + case 0: + test = value != 0; + break; + case 1: + test = value == 0; + break; + case 2: + test = value == -1; + break; + case 3: + test = value == 0 || value == -1; + break; + case 4: + test = value == 1; + break; + case 5: + test = value == 0 || value == 1; + break; + default: + test = false; + } + if(test) { + var format1 = destFormat; + var premultiplied1 = destPremultiplied; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format1 == null) { + format1 = 0; + } + if(premultiplied1) { + if((_color & 255) == 0) { + if(_color != 0) { + _color = 0; + } + } else if((_color & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[_color & 255]; + _color = ((_color >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((_color >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((_color >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | _color & 255 & 255; + } + } + switch(format1) { + case 0: + destData[destPosition] = _color >>> 24 & 255; + destData[destPosition + 1] = _color >>> 16 & 255; + destData[destPosition + 2] = _color >>> 8 & 255; + destData[destPosition + 3] = _color & 255; + break; + case 1: + destData[destPosition] = _color & 255; + destData[destPosition + 1] = _color >>> 24 & 255; + destData[destPosition + 2] = _color >>> 16 & 255; + destData[destPosition + 3] = _color >>> 8 & 255; + break; + case 2: + destData[destPosition] = _color >>> 8 & 255; + destData[destPosition + 1] = _color >>> 16 & 255; + destData[destPosition + 2] = _color >>> 24 & 255; + destData[destPosition + 3] = _color & 255; + break; + } + ++hits; + } else if(copySource) { + var format2 = destFormat; + var premultiplied2 = destPremultiplied; + if(premultiplied2 == null) { + premultiplied2 = false; + } + if(format2 == null) { + format2 = 0; + } + if(premultiplied2) { + if((srcPixel & 255) == 0) { + if(srcPixel != 0) { + srcPixel = 0; + } + } else if((srcPixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[srcPixel & 255]; + srcPixel = ((srcPixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((srcPixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((srcPixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | srcPixel & 255 & 255; + } + } + switch(format2) { + case 0: + destData[destPosition] = srcPixel >>> 24 & 255; + destData[destPosition + 1] = srcPixel >>> 16 & 255; + destData[destPosition + 2] = srcPixel >>> 8 & 255; + destData[destPosition + 3] = srcPixel & 255; + break; + case 1: + destData[destPosition] = srcPixel & 255; + destData[destPosition + 1] = srcPixel >>> 24 & 255; + destData[destPosition + 2] = srcPixel >>> 16 & 255; + destData[destPosition + 3] = srcPixel >>> 8 & 255; + break; + case 2: + destData[destPosition] = srcPixel >>> 8 & 255; + destData[destPosition + 1] = srcPixel >>> 16 & 255; + destData[destPosition + 2] = srcPixel >>> 24 & 255; + destData[destPosition + 3] = srcPixel & 255; + break; + } + } + srcPosition += 4; + destPosition += 4; + } + } + if(hits > 0) { + image.dirty = true; + image.version++; + } + return hits; +}; +lime__$internal_graphics_ImageDataUtil.unmultiplyAlpha = function(image) { + var data = image.buffer.data; + if(data == null) { + return; + } + var format = image.buffer.format; + var length = data.length / 4 | 0; + var pixel = 0; + var _g = 0; + var _g1 = length; + while(_g < _g1) { + var i = _g++; + var offset = i * 4; + var format1 = format; + var premultiplied = true; + if(premultiplied == null) { + premultiplied = false; + } + if(format1 == null) { + format1 = 0; + } + switch(format1) { + case 0: + pixel = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255; + break; + case 1: + pixel = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255; + break; + case 2: + pixel = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255; + break; + } + if(premultiplied) { + if((pixel & 255) != 0 && (pixel & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (pixel & 255); + pixel = (lime_math_RGBA.__clamp[Math.round((pixel >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((pixel >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | pixel & 255 & 255; + } + } + var offset1 = i * 4; + var format2 = format; + var premultiplied1 = false; + if(premultiplied1 == null) { + premultiplied1 = false; + } + if(format2 == null) { + format2 = 0; + } + if(premultiplied1) { + if((pixel & 255) == 0) { + if(pixel != 0) { + pixel = 0; + } + } else if((pixel & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[pixel & 255]; + pixel = ((pixel >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((pixel >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((pixel >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | pixel & 255 & 255; + } + } + switch(format2) { + case 0: + data[offset1] = pixel >>> 24 & 255; + data[offset1 + 1] = pixel >>> 16 & 255; + data[offset1 + 2] = pixel >>> 8 & 255; + data[offset1 + 3] = pixel & 255; + break; + case 1: + data[offset1] = pixel & 255; + data[offset1 + 1] = pixel >>> 24 & 255; + data[offset1 + 2] = pixel >>> 16 & 255; + data[offset1 + 3] = pixel >>> 8 & 255; + break; + case 2: + data[offset1] = pixel >>> 8 & 255; + data[offset1 + 1] = pixel >>> 16 & 255; + data[offset1 + 2] = pixel >>> 24 & 255; + data[offset1 + 3] = pixel & 255; + break; + } + } + image.buffer.premultiplied = false; + image.dirty = true; + image.version++; +}; +lime__$internal_graphics_ImageDataUtil.__boxBlur = function(imgA,imgB,w,h,bx,by) { + imgB.set(imgA); + var bx1 = bx | 0; + var by1 = by | 0; + lime__$internal_graphics_ImageDataUtil.__boxBlurH(imgB,imgA,w,h,bx1,0); + lime__$internal_graphics_ImageDataUtil.__boxBlurH(imgB,imgA,w,h,bx1,1); + lime__$internal_graphics_ImageDataUtil.__boxBlurH(imgB,imgA,w,h,bx1,2); + lime__$internal_graphics_ImageDataUtil.__boxBlurH(imgB,imgA,w,h,bx1,3); + var iarr = 1 / (by1 + by1 + 1); + var ws = w * 4; + var ti; + var li; + var ri; + var fv; + var lv; + var val; + var _g = 0; + var _g1 = w; + while(_g < _g1) { + var i = _g++; + ti = i * 4; + li = ti; + ri = ti + by1 * ws; + fv = imgA[ti]; + lv = imgA[ti + ws * (h - 1)]; + val = (by1 + 1) * fv; + var _g2 = 0; + var _g3 = by1; + while(_g2 < _g3) { + var j = _g2++; + val = val + imgA[ti + j * ws]; + } + var _g4 = 0; + var _g5 = by1 + 1; + while(_g4 < _g5) { + var j1 = _g4++; + val = val + (imgA[ri] - fv); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + ri += ws; + ti += ws; + } + var _g6 = by1 + 1; + var _g7 = h - by1; + while(_g6 < _g7) { + var j2 = _g6++; + val = val + (imgA[ri] - imgA[li]); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + li += ws; + ri += ws; + ti += ws; + } + var _g8 = h - by1; + var _g9 = h; + while(_g8 < _g9) { + var j3 = _g8++; + val = val + (lv - imgA[li]); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + li += ws; + ti += ws; + } + } + var iarr = 1 / (by1 + by1 + 1); + var ws = w * 4; + var ti; + var li; + var ri; + var fv; + var lv; + var val; + var _g = 0; + var _g1 = w; + while(_g < _g1) { + var i = _g++; + ti = i * 4 + 1; + li = ti; + ri = ti + by1 * ws; + fv = imgA[ti]; + lv = imgA[ti + ws * (h - 1)]; + val = (by1 + 1) * fv; + var _g2 = 0; + var _g3 = by1; + while(_g2 < _g3) { + var j = _g2++; + val = val + imgA[ti + j * ws]; + } + var _g4 = 0; + var _g5 = by1 + 1; + while(_g4 < _g5) { + var j1 = _g4++; + val = val + (imgA[ri] - fv); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + ri += ws; + ti += ws; + } + var _g6 = by1 + 1; + var _g7 = h - by1; + while(_g6 < _g7) { + var j2 = _g6++; + val = val + (imgA[ri] - imgA[li]); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + li += ws; + ri += ws; + ti += ws; + } + var _g8 = h - by1; + var _g9 = h; + while(_g8 < _g9) { + var j3 = _g8++; + val = val + (lv - imgA[li]); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + li += ws; + ti += ws; + } + } + var iarr = 1 / (by1 + by1 + 1); + var ws = w * 4; + var ti; + var li; + var ri; + var fv; + var lv; + var val; + var _g = 0; + var _g1 = w; + while(_g < _g1) { + var i = _g++; + ti = i * 4 + 2; + li = ti; + ri = ti + by1 * ws; + fv = imgA[ti]; + lv = imgA[ti + ws * (h - 1)]; + val = (by1 + 1) * fv; + var _g2 = 0; + var _g3 = by1; + while(_g2 < _g3) { + var j = _g2++; + val = val + imgA[ti + j * ws]; + } + var _g4 = 0; + var _g5 = by1 + 1; + while(_g4 < _g5) { + var j1 = _g4++; + val = val + (imgA[ri] - fv); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + ri += ws; + ti += ws; + } + var _g6 = by1 + 1; + var _g7 = h - by1; + while(_g6 < _g7) { + var j2 = _g6++; + val = val + (imgA[ri] - imgA[li]); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + li += ws; + ri += ws; + ti += ws; + } + var _g8 = h - by1; + var _g9 = h; + while(_g8 < _g9) { + var j3 = _g8++; + val = val + (lv - imgA[li]); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + li += ws; + ti += ws; + } + } + var iarr = 1 / (by1 + by1 + 1); + var ws = w * 4; + var ti; + var li; + var ri; + var fv; + var lv; + var val; + var _g = 0; + var _g1 = w; + while(_g < _g1) { + var i = _g++; + ti = i * 4 + 3; + li = ti; + ri = ti + by1 * ws; + fv = imgA[ti]; + lv = imgA[ti + ws * (h - 1)]; + val = (by1 + 1) * fv; + var _g2 = 0; + var _g3 = by1; + while(_g2 < _g3) { + var j = _g2++; + val = val + imgA[ti + j * ws]; + } + var _g4 = 0; + var _g5 = by1 + 1; + while(_g4 < _g5) { + var j1 = _g4++; + val = val + (imgA[ri] - fv); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + ri += ws; + ti += ws; + } + var _g6 = by1 + 1; + var _g7 = h - by1; + while(_g6 < _g7) { + var j2 = _g6++; + val = val + (imgA[ri] - imgA[li]); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + li += ws; + ri += ws; + ti += ws; + } + var _g8 = h - by1; + var _g9 = h; + while(_g8 < _g9) { + var j3 = _g8++; + val = val + (lv - imgA[li]); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + li += ws; + ti += ws; + } + } +}; +lime__$internal_graphics_ImageDataUtil.__boxBlurH = function(imgA,imgB,w,h,r,off) { + var iarr = 1 / (r + r + 1); + var ti; + var li; + var ri; + var fv; + var lv; + var val; + var _g = 0; + var _g1 = h; + while(_g < _g1) { + var i = _g++; + ti = i * w; + li = ti; + ri = ti + r; + fv = imgA[ti * 4 + off]; + lv = imgA[(ti + w - 1) * 4 + off]; + val = (r + 1) * fv; + var _g2 = 0; + var _g3 = r; + while(_g2 < _g3) { + var j = _g2++; + val = val + imgA[(ti + j) * 4 + off]; + } + var _g4 = 0; + var _g5 = r + 1; + while(_g4 < _g5) { + var j1 = _g4++; + val = val + (imgA[ri * 4 + off] - fv); + imgB[ti * 4 + off] = Math.round(UInt.toFloat(val) * iarr); + ++ri; + ++ti; + } + var _g6 = r + 1; + var _g7 = w - r; + while(_g6 < _g7) { + var j2 = _g6++; + val = val + (imgA[ri * 4 + off] - imgA[li * 4 + off]); + imgB[ti * 4 + off] = Math.round(UInt.toFloat(val) * iarr); + ++ri; + ++li; + ++ti; + } + var _g8 = w - r; + var _g9 = w; + while(_g8 < _g9) { + var j3 = _g8++; + val = val + (lv - imgA[li * 4 + off]); + imgB[ti * 4 + off] = Math.round(UInt.toFloat(val) * iarr); + ++li; + ++ti; + } + } +}; +lime__$internal_graphics_ImageDataUtil.__boxBlurT = function(imgA,imgB,w,h,r,off) { + var iarr = 1 / (r + r + 1); + var ws = w * 4; + var ti; + var li; + var ri; + var fv; + var lv; + var val; + var _g = 0; + var _g1 = w; + while(_g < _g1) { + var i = _g++; + ti = i * 4 + off; + li = ti; + ri = ti + r * ws; + fv = imgA[ti]; + lv = imgA[ti + ws * (h - 1)]; + val = (r + 1) * fv; + var _g2 = 0; + var _g3 = r; + while(_g2 < _g3) { + var j = _g2++; + val = val + imgA[ti + j * ws]; + } + var _g4 = 0; + var _g5 = r + 1; + while(_g4 < _g5) { + var j1 = _g4++; + val = val + (imgA[ri] - fv); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + ri += ws; + ti += ws; + } + var _g6 = r + 1; + var _g7 = h - r; + while(_g6 < _g7) { + var j2 = _g6++; + val = val + (imgA[ri] - imgA[li]); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + li += ws; + ri += ws; + ti += ws; + } + var _g8 = h - r; + var _g9 = h; + while(_g8 < _g9) { + var j3 = _g8++; + val = val + (lv - imgA[li]); + imgB[ti] = Math.round(UInt.toFloat(val) * iarr); + li += ws; + ti += ws; + } + } +}; +lime__$internal_graphics_ImageDataUtil.__calculateSourceOffset = function(sourceRect,destPoint,destX,destY) { + var sourceX = destX - (destPoint.x | 0); + var sourceY = destY - (destPoint.y | 0); + var offset = 0; + if(sourceX < 0 || sourceY < 0 || sourceX >= sourceRect.width || sourceY >= sourceRect.height) { + offset = -1; + } else { + offset = 4 * (sourceY * (sourceRect.width | 0) + sourceX); + } + return offset; +}; +lime__$internal_graphics_ImageDataUtil.__getBoxesForGaussianBlur = function(sigma,n) { + var wIdeal = Math.sqrt(12 * sigma * sigma / n + 1); + var wl = Math.floor(wIdeal); + if(wl % 2 == 0) { + --wl; + } + var wu = wl + 2; + var mIdeal = (12 * sigma * sigma - n * wl * wl - 4 * n * wl - 3 * n) / (-4 * wl - 4); + var m = Math.round(mIdeal); + var sizes = []; + var _g = 0; + var _g1 = n; + while(_g < _g1) { + var i = _g++; + sizes.push(i < m ? wl : wu); + } + return sizes; +}; +lime__$internal_graphics_ImageDataUtil.__pixelCompare = function(n1,n2) { + var tmp1 = n1 >>> 24 & 255; + var tmp2 = n2 >>> 24 & 255; + if(tmp1 != tmp2) { + if(UInt.gt(tmp1,tmp2)) { + return 1; + } else { + return -1; + } + } else { + tmp1 = n1 >>> 16 & 255; + tmp2 = n2 >>> 16 & 255; + if(tmp1 != tmp2) { + if(UInt.gt(tmp1,tmp2)) { + return 1; + } else { + return -1; + } + } else { + tmp1 = n1 >>> 8 & 255; + tmp2 = n2 >>> 8 & 255; + if(tmp1 != tmp2) { + if(UInt.gt(tmp1,tmp2)) { + return 1; + } else { + return -1; + } + } else { + tmp1 = n1 & 255; + tmp2 = n2 & 255; + if(tmp1 != tmp2) { + if(UInt.gt(tmp1,tmp2)) { + return 1; + } else { + return -1; + } + } else { + return 0; + } + } + } + } +}; +lime__$internal_graphics_ImageDataUtil.__translatePixel = function(imgB,sourceRect,destRect,destPoint,destX,destY,strength) { + var d = 4 * (destY * (destRect.width | 0) + destX); + var s = lime__$internal_graphics_ImageDataUtil.__calculateSourceOffset(sourceRect,destPoint,destX,destY); + if(s < 0) { + imgB[d] = imgB[d + 1] = imgB[d + 2] = imgB[d + 3] = 0; + } else { + imgB[d] = imgB[s]; + imgB[d + 1] = imgB[s + 1]; + imgB[d + 2] = imgB[s + 2]; + var a = UInt.toFloat(imgB[s + 3]) * strength | 0; + imgB[d + 3] = a < 0 ? 0 : a > 255 ? 255 : a; + } +}; +var lime__$internal_graphics__$ImageDataUtil_ImageDataView = function(image,rect) { + this.image = image; + if(rect == null) { + this.rect = image.get_rect(); + } else { + if(rect.x < 0) { + rect.x = 0; + } + if(rect.y < 0) { + rect.y = 0; + } + if(rect.x + rect.width > image.width) { + rect.width = image.width - rect.x; + } + if(rect.y + rect.height > image.height) { + rect.height = image.height - rect.y; + } + if(rect.width < 0) { + rect.width = 0; + } + if(rect.height < 0) { + rect.height = 0; + } + this.rect = rect; + } + this.stride = image.buffer.get_stride(); + this.__update(); +}; +$hxClasses["lime._internal.graphics._ImageDataUtil.ImageDataView"] = lime__$internal_graphics__$ImageDataUtil_ImageDataView; +lime__$internal_graphics__$ImageDataUtil_ImageDataView.__name__ = "lime._internal.graphics._ImageDataUtil.ImageDataView"; +lime__$internal_graphics__$ImageDataUtil_ImageDataView.prototype = { + clip: function(x,y,width,height) { + if(this.tempRect == null) { + this.tempRect = new lime_math_Rectangle(); + } + this.tempRect.setTo(x,y,width,height); + this.rect.intersection(this.tempRect,this.rect); + this.__update(); + } + ,hasRow: function(y) { + if(y >= 0) { + return y < this.height; + } else { + return false; + } + } + ,offset: function(x,y) { + if(x < 0) { + this.rect.x += x; + if(this.rect.x < 0) { + this.rect.x = 0; + } + } else { + this.rect.x += x; + this.rect.width -= x; + } + if(y < 0) { + this.rect.y += y; + if(this.rect.y < 0) { + this.rect.y = 0; + } + } else { + this.rect.y += y; + this.rect.height -= y; + } + this.__update(); + } + ,row: function(y) { + return this.byteOffset + this.stride * y; + } + ,__update: function() { + this.x = Math.ceil(this.rect.x); + this.y = Math.ceil(this.rect.y); + this.width = Math.floor(this.rect.width); + this.height = Math.floor(this.rect.height); + this.byteOffset = this.stride * (this.y + this.image.offsetY) + (this.x + this.image.offsetX) * 4; + } + ,__class__: lime__$internal_graphics__$ImageDataUtil_ImageDataView +}; +var lime__$internal_graphics_StackBlur = function() { }; +$hxClasses["lime._internal.graphics.StackBlur"] = lime__$internal_graphics_StackBlur; +lime__$internal_graphics_StackBlur.__name__ = "lime._internal.graphics.StackBlur"; +lime__$internal_graphics_StackBlur.blur = function(dest,source,sourceRect,destPoint,blurX,blurY,quality) { + dest.copyPixels(source,sourceRect,destPoint); + lime__$internal_graphics_StackBlur.__stackBlurCanvasRGBA(dest,sourceRect.width | 0,sourceRect.height | 0,blurX,blurY,quality); +}; +lime__$internal_graphics_StackBlur.__stackBlurCanvasRGBA = function(image,width,height,blurX,blurY,quality) { + var radiusX = Math.round(blurX) >> 1; + var radiusY = Math.round(blurY) >> 1; + if(lime__$internal_graphics_StackBlur.MUL_TABLE == null) { + return; + } + if(radiusX >= lime__$internal_graphics_StackBlur.MUL_TABLE.length) { + radiusX = lime__$internal_graphics_StackBlur.MUL_TABLE.length - 1; + } + if(radiusY >= lime__$internal_graphics_StackBlur.MUL_TABLE.length) { + radiusY = lime__$internal_graphics_StackBlur.MUL_TABLE.length - 1; + } + if(radiusX < 0 || radiusY < 0) { + return; + } + var iterations = quality; + if(iterations < 1) { + iterations = 1; + } + if(iterations > 3) { + iterations = 3; + } + var px = image.get_data(); + var x; + var y; + var i; + var p; + var yp; + var yi; + var yw; + var r; + var g; + var b; + var a; + var pr; + var pg; + var pb; + var pa; + var f; + var divx = radiusX + radiusX + 1; + var divy = radiusY + radiusY + 1; + var w = width; + var h = height; + var w1 = w - 1; + var h1 = h - 1; + var rxp1 = radiusX + 1; + var ryp1 = radiusY + 1; + var ssx = new lime__$internal_graphics_BlurStack(); + var sx = ssx; + var _g = 1; + var _g1 = divx; + while(_g < _g1) { + var i1 = _g++; + sx = sx.n = new lime__$internal_graphics_BlurStack(); + } + sx.n = ssx; + var ssy = new lime__$internal_graphics_BlurStack(); + var sy = ssy; + var _g = 1; + var _g1 = divy; + while(_g < _g1) { + var i1 = _g++; + sy = sy.n = new lime__$internal_graphics_BlurStack(); + } + sy.n = ssy; + var si = null; + var mtx = lime__$internal_graphics_StackBlur.MUL_TABLE[radiusX]; + var stx = lime__$internal_graphics_StackBlur.SHG_TABLE[radiusX]; + var mty = lime__$internal_graphics_StackBlur.MUL_TABLE[radiusY]; + var sty = lime__$internal_graphics_StackBlur.SHG_TABLE[radiusY]; + while(iterations > 0) { + --iterations; + yi = 0; + yw = yi; + var ms = mtx; + var ss = stx; + y = h; + do { + pr = px[yi]; + r = rxp1 * pr; + pg = px[yi + 1]; + g = rxp1 * pg; + pb = px[yi + 2]; + b = rxp1 * pb; + pa = px[yi + 3]; + a = rxp1 * pa; + sx = ssx; + i = rxp1; + do { + sx.r = pr; + sx.g = pg; + sx.b = pb; + sx.a = pa; + sx = sx.n; + } while(--i > -1); + var _g = 1; + var _g1 = rxp1; + while(_g < _g1) { + var i1 = _g++; + p = yi + ((w1 < i1 ? w1 : i1) << 2); + r += sx.r = px[p]; + g += sx.g = px[p + 1]; + b += sx.b = px[p + 2]; + a += sx.a = px[p + 3]; + sx = sx.n; + } + si = ssx; + var _g2 = 0; + var _g3 = w; + while(_g2 < _g3) { + var x = _g2++; + px[yi++] = r * ms >>> ss; + px[yi++] = g * ms >>> ss; + px[yi++] = b * ms >>> ss; + px[yi++] = a * ms >>> ss; + p = x + radiusX + 1; + p = yw + (p < w1 ? p : w1) << 2; + r -= si.r - (si.r = px[p]); + g -= si.g - (si.g = px[p + 1]); + b -= si.b - (si.b = px[p + 2]); + a -= si.a - (si.a = px[p + 3]); + si = si.n; + } + yw += w; + } while(--y > 0); + ms = mty; + ss = sty; + var _g4 = 0; + var _g5 = w; + while(_g4 < _g5) { + var x1 = _g4++; + yi = x1 << 2; + pr = px[yi]; + r = ryp1 * pr; + pg = px[yi + 1]; + g = ryp1 * pg; + pb = px[yi + 2]; + b = ryp1 * pb; + pa = px[yi + 3]; + a = ryp1 * pa; + sy = ssy; + var _g6 = 0; + var _g7 = ryp1; + while(_g6 < _g7) { + var i2 = _g6++; + sy.r = pr; + sy.g = pg; + sy.b = pb; + sy.a = pa; + sy = sy.n; + } + yp = w; + var _g8 = 1; + var _g9 = radiusY + 1; + while(_g8 < _g9) { + var i3 = _g8++; + yi = yp + x1 << 2; + r += sy.r = px[yi]; + g += sy.g = px[yi + 1]; + b += sy.b = px[yi + 2]; + a += sy.a = px[yi + 3]; + sy = sy.n; + if(i3 < h1) { + yp += w; + } + } + yi = x1; + si = ssy; + if(iterations > 0) { + var _g10 = 0; + var _g11 = h; + while(_g10 < _g11) { + var y1 = _g10++; + p = yi << 2; + pa = a * ms >>> ss; + px[p + 3] = pa; + if(pa > 0) { + px[p] = r * ms >>> ss; + px[p + 1] = g * ms >>> ss; + px[p + 2] = b * ms >>> ss; + } else { + px[p] = px[p + 1] = px[p + 2] = 0; + } + p = y1 + ryp1; + p = x1 + (p < h1 ? p : h1) * w << 2; + r -= si.r - (si.r = px[p]); + g -= si.g - (si.g = px[p + 1]); + b -= si.b - (si.b = px[p + 2]); + a -= si.a - (si.a = px[p + 3]); + si = si.n; + yi += w; + } + } else { + var _g12 = 0; + var _g13 = h; + while(_g12 < _g13) { + var y2 = _g12++; + p = yi << 2; + pa = a * ms >>> ss; + px[p + 3] = pa; + if(pa > 0) { + f = 255 / pa; + pr = (r * ms >>> ss) * f | 0; + pg = (g * ms >>> ss) * f | 0; + pb = (b * ms >>> ss) * f | 0; + px[p] = pr > 255 ? 255 : pr; + px[p + 1] = pg > 255 ? 255 : pg; + px[p + 2] = pb > 255 ? 255 : pb; + } else { + px[p] = px[p + 1] = px[p + 2] = 0; + } + p = y2 + ryp1; + p = x1 + (p < h1 ? p : h1) * w << 2; + r -= si.r - (si.r = px[p]); + g -= si.g - (si.g = px[p + 1]); + b -= si.b - (si.b = px[p + 2]); + a -= si.a - (si.a = px[p + 3]); + si = si.n; + yi += w; + } + } + } + } +}; +var lime__$internal_graphics_BlurStack = function() { + this.r = 0; + this.g = 0; + this.b = 0; + this.a = 0; + this.n = null; +}; +$hxClasses["lime._internal.graphics.BlurStack"] = lime__$internal_graphics_BlurStack; +lime__$internal_graphics_BlurStack.__name__ = "lime._internal.graphics.BlurStack"; +lime__$internal_graphics_BlurStack.prototype = { + __class__: lime__$internal_graphics_BlurStack +}; +var lime__$internal_macros_AssetsMacro = function() { }; +$hxClasses["lime._internal.macros.AssetsMacro"] = lime__$internal_macros_AssetsMacro; +lime__$internal_macros_AssetsMacro.__name__ = "lime._internal.macros.AssetsMacro"; +var lime_app_Event = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app.Event"] = lime_app_Event; +lime_app_Event.__name__ = "lime.app.Event"; +lime_app_Event.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,__class__: lime_app_Event +}; +var lime_app_Future = function(work,useThreads) { + if(useThreads == null) { + useThreads = false; + } + if(work != null) { + try { + this.value = work(); + this.isComplete = true; + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + this.error = e; + this.isError = true; + } + } +}; +$hxClasses["lime.app.Future"] = lime_app_Future; +lime_app_Future.__name__ = "lime.app.Future"; +lime_app_Future.ofEvents = function(onComplete,onError,onProgress) { + var promise = new lime_app_Promise(); + onComplete.add($bind(promise,promise.complete),true); + if(onError != null) { + onError.add($bind(promise,promise.error),true); + } + if(onProgress != null) { + onProgress.add($bind(promise,promise.progress),true); + } + return promise.future; +}; +lime_app_Future.withError = function(error) { + var future = new lime_app_Future(); + future.isError = true; + future.error = error; + return future; +}; +lime_app_Future.withValue = function(value) { + var future = new lime_app_Future(); + future.isComplete = true; + future.value = value; + return future; +}; +lime_app_Future.prototype = { + onComplete: function(listener) { + if(listener != null) { + if(this.isComplete) { + listener(this.value); + } else if(!this.isError) { + if(this.__completeListeners == null) { + this.__completeListeners = []; + } + this.__completeListeners.push(listener); + } + } + return this; + } + ,onError: function(listener) { + if(listener != null) { + if(this.isError) { + listener(this.error); + } else if(!this.isComplete) { + if(this.__errorListeners == null) { + this.__errorListeners = []; + } + this.__errorListeners.push(listener); + } + } + return this; + } + ,onProgress: function(listener) { + if(listener != null) { + if(this.__progressListeners == null) { + this.__progressListeners = []; + } + this.__progressListeners.push(listener); + } + return this; + } + ,ready: function(waitTime) { + if(waitTime == null) { + waitTime = -1; + } + return this; + } + ,result: function(waitTime) { + if(waitTime == null) { + waitTime = -1; + } + this.ready(waitTime); + if(this.isComplete) { + return this.value; + } else { + return null; + } + } + ,then: function(next) { + if(this.isComplete) { + return next(this.value); + } else if(this.isError) { + var future = new lime_app_Future(); + future.isError = true; + future.error = this.error; + return future; + } else { + var promise = new lime_app_Promise(); + this.onError($bind(promise,promise.error)); + this.onProgress($bind(promise,promise.progress)); + this.onComplete(function(val) { + var future = next(val); + future.onError($bind(promise,promise.error)); + future.onComplete($bind(promise,promise.complete)); + }); + return promise.future; + } + } + ,__class__: lime_app_Future +}; +var lime_app_Promise = function() { + this.future = new lime_app_Future(); +}; +$hxClasses["lime.app.Promise"] = lime_app_Promise; +lime_app_Promise.__name__ = "lime.app.Promise"; +lime_app_Promise.prototype = { + complete: function(data) { + if(!this.future.isError) { + this.future.isComplete = true; + this.future.value = data; + if(this.future.__completeListeners != null) { + var _g = 0; + var _g1 = this.future.__completeListeners; + while(_g < _g1.length) { + var listener = _g1[_g]; + ++_g; + listener(data); + } + this.future.__completeListeners = null; + } + } + return this; + } + ,completeWith: function(future) { + future.onComplete($bind(this,this.complete)); + future.onError($bind(this,this.error)); + future.onProgress($bind(this,this.progress)); + return this; + } + ,error: function(msg) { + if(!this.future.isComplete) { + this.future.isError = true; + this.future.error = msg; + if(this.future.__errorListeners != null) { + var _g = 0; + var _g1 = this.future.__errorListeners; + while(_g < _g1.length) { + var listener = _g1[_g]; + ++_g; + listener(msg); + } + this.future.__errorListeners = null; + } + } + return this; + } + ,progress: function(progress,total) { + if(!this.future.isError && !this.future.isComplete) { + if(this.future.__progressListeners != null) { + var _g = 0; + var _g1 = this.future.__progressListeners; + while(_g < _g1.length) { + var listener = _g1[_g]; + ++_g; + listener(progress,total); + } + } + } + return this; + } + ,get_isComplete: function() { + return this.future.isComplete; + } + ,get_isError: function() { + return this.future.isError; + } + ,__class__: lime_app_Promise + ,__properties__: {get_isError:"get_isError",get_isComplete:"get_isComplete"} +}; +var lime_app__$Event_$Float_$Float_$Float_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_Float_Float_Float_Void"] = lime_app__$Event_$Float_$Float_$Float_$Void; +lime_app__$Event_$Float_$Float_$Float_$Void.__name__ = "lime.app._Event_Float_Float_Float_Void"; +lime_app__$Event_$Float_$Float_$Float_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a,a1,a2) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a,a1,a2); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$Float_$Float_$Float_$Void +}; +var lime_app__$Event_$Float_$Float_$Int_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_Float_Float_Int_Void"] = lime_app__$Event_$Float_$Float_$Int_$Void; +lime_app__$Event_$Float_$Float_$Int_$Void.__name__ = "lime.app._Event_Float_Float_Int_Void"; +lime_app__$Event_$Float_$Float_$Int_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a,a1,a2) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a,a1,a2); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$Float_$Float_$Int_$Void +}; +var lime_app__$Event_$Float_$Float_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_Float_Float_Void"] = lime_app__$Event_$Float_$Float_$Void; +lime_app__$Event_$Float_$Float_$Void.__name__ = "lime.app._Event_Float_Float_Void"; +lime_app__$Event_$Float_$Float_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a,a1) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a,a1); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$Float_$Float_$Void +}; +var lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_Float_Float_lime_ui_MouseButton_Void"] = lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void; +lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void.__name__ = "lime.app._Event_Float_Float_lime_ui_MouseButton_Void"; +lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a,a1,a2) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a,a1,a2); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void +}; +var lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_Float_Float_lime_ui_MouseWheelMode_Void"] = lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void; +lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void.__name__ = "lime.app._Event_Float_Float_lime_ui_MouseWheelMode_Void"; +lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a,a1,a2) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a,a1,a2); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void +}; +var lime_app__$Event_$Int_$Float_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_Int_Float_Void"] = lime_app__$Event_$Int_$Float_$Void; +lime_app__$Event_$Int_$Float_$Void.__name__ = "lime.app._Event_Int_Float_Void"; +lime_app__$Event_$Int_$Float_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a,a1) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a,a1); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$Int_$Float_$Void +}; +var lime_app__$Event_$Int_$Int_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_Int_Int_Void"] = lime_app__$Event_$Int_$Int_$Void; +lime_app__$Event_$Int_$Int_$Void.__name__ = "lime.app._Event_Int_Int_Void"; +lime_app__$Event_$Int_$Int_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a,a1) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a,a1); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$Int_$Int_$Void +}; +var lime_app__$Event_$Int_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_Int_Void"] = lime_app__$Event_$Int_$Void; +lime_app__$Event_$Int_$Void.__name__ = "lime.app._Event_Int_Void"; +lime_app__$Event_$Int_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$Int_$Void +}; +var lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_Int_lime_ui_JoystickHatPosition_Void"] = lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void; +lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void.__name__ = "lime.app._Event_Int_lime_ui_JoystickHatPosition_Void"; +lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a,a1) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a,a1); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void +}; +var lime_app__$Event_$String_$Int_$Int_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_String_Int_Int_Void"] = lime_app__$Event_$String_$Int_$Int_$Void; +lime_app__$Event_$String_$Int_$Int_$Void.__name__ = "lime.app._Event_String_Int_Int_Void"; +lime_app__$Event_$String_$Int_$Int_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a,a1,a2) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a,a1,a2); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$String_$Int_$Int_$Void +}; +var lime_app__$Event_$String_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_String_Void"] = lime_app__$Event_$String_$Void; +lime_app__$Event_$String_$Void.__name__ = "lime.app._Event_String_Void"; +lime_app__$Event_$String_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$String_$Void +}; +var lime_app__$Event_$Void_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_Void_Void"] = lime_app__$Event_$Void_$Void; +lime_app__$Event_$Void_$Void.__name__ = "lime.app._Event_Void_Void"; +lime_app__$Event_$Void_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function() { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$Void_$Void +}; +var lime_app__$Event_$lime_$graphics_$RenderContext_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_lime_graphics_RenderContext_Void"] = lime_app__$Event_$lime_$graphics_$RenderContext_$Void; +lime_app__$Event_$lime_$graphics_$RenderContext_$Void.__name__ = "lime.app._Event_lime_graphics_RenderContext_Void"; +lime_app__$Event_$lime_$graphics_$RenderContext_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$lime_$graphics_$RenderContext_$Void +}; +var lime_app__$Event_$lime_$system_$State_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_lime_system_State_Void"] = lime_app__$Event_$lime_$system_$State_$Void; +lime_app__$Event_$lime_$system_$State_$Void.__name__ = "lime.app._Event_lime_system_State_Void"; +lime_app__$Event_$lime_$system_$State_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$lime_$system_$State_$Void +}; +var lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_lime_ui_GamepadAxis_Float_Void"] = lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void; +lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void.__name__ = "lime.app._Event_lime_ui_GamepadAxis_Float_Void"; +lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a,a1) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a,a1); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void +}; +var lime_app__$Event_$lime_$ui_$GamepadButton_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_lime_ui_GamepadButton_Void"] = lime_app__$Event_$lime_$ui_$GamepadButton_$Void; +lime_app__$Event_$lime_$ui_$GamepadButton_$Void.__name__ = "lime.app._Event_lime_ui_GamepadButton_Void"; +lime_app__$Event_$lime_$ui_$GamepadButton_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$lime_$ui_$GamepadButton_$Void +}; +var lime_app__$Event_$lime_$ui_$Gamepad_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_lime_ui_Gamepad_Void"] = lime_app__$Event_$lime_$ui_$Gamepad_$Void; +lime_app__$Event_$lime_$ui_$Gamepad_$Void.__name__ = "lime.app._Event_lime_ui_Gamepad_Void"; +lime_app__$Event_$lime_$ui_$Gamepad_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$lime_$ui_$Gamepad_$Void +}; +var lime_app__$Event_$lime_$ui_$Joystick_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_lime_ui_Joystick_Void"] = lime_app__$Event_$lime_$ui_$Joystick_$Void; +lime_app__$Event_$lime_$ui_$Joystick_$Void.__name__ = "lime.app._Event_lime_ui_Joystick_Void"; +lime_app__$Event_$lime_$ui_$Joystick_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$lime_$ui_$Joystick_$Void +}; +var lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_lime_ui_KeyCode_lime_ui_KeyModifier_Void"] = lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void; +lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void.__name__ = "lime.app._Event_lime_ui_KeyCode_lime_ui_KeyModifier_Void"; +lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a,a1) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a,a1); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void +}; +var lime_app__$Event_$lime_$ui_$Touch_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_lime_ui_Touch_Void"] = lime_app__$Event_$lime_$ui_$Touch_$Void; +lime_app__$Event_$lime_$ui_$Touch_$Void.__name__ = "lime.app._Event_lime_ui_Touch_Void"; +lime_app__$Event_$lime_$ui_$Touch_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$lime_$ui_$Touch_$Void +}; +var lime_app__$Event_$lime_$ui_$Window_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_lime_ui_Window_Void"] = lime_app__$Event_$lime_$ui_$Window_$Void; +lime_app__$Event_$lime_$ui_$Window_$Void.__name__ = "lime.app._Event_lime_ui_Window_Void"; +lime_app__$Event_$lime_$ui_$Window_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$lime_$ui_$Window_$Void +}; +var lime_app__$Event_$ofEvents_$T_$Void = function() { + this.canceled = false; + this.__listeners = []; + this.__priorities = []; + this.__repeat = []; +}; +$hxClasses["lime.app._Event_ofEvents_T_Void"] = lime_app__$Event_$ofEvents_$T_$Void; +lime_app__$Event_$ofEvents_$T_$Void.__name__ = "lime.app._Event_ofEvents_T_Void"; +lime_app__$Event_$ofEvents_$T_$Void.prototype = { + add: function(listener,once,priority) { + if(priority == null) { + priority = 0; + } + if(once == null) { + once = false; + } + var _g = 0; + var _g1 = this.__priorities.length; + while(_g < _g1) { + var i = _g++; + if(priority > this.__priorities[i]) { + this.__listeners.splice(i,0,listener); + this.__priorities.splice(i,0,priority); + this.__repeat.splice(i,0,!once); + return; + } + } + this.__listeners.push(listener); + this.__priorities.push(priority); + this.__repeat.push(!once); + } + ,cancel: function() { + this.canceled = true; + } + ,has: function(listener) { + var _g = 0; + var _g1 = this.__listeners; + while(_g < _g1.length) { + var l = _g1[_g]; + ++_g; + if(l == listener) { + return true; + } + } + return false; + } + ,remove: function(listener) { + var i = this.__listeners.length; + while(--i >= 0) if(this.__listeners[i] == listener) { + this.__listeners.splice(i,1); + this.__priorities.splice(i,1); + this.__repeat.splice(i,1); + } + } + ,removeAll: function() { + var len = this.__listeners.length; + this.__listeners.splice(0,len); + this.__priorities.splice(0,len); + this.__repeat.splice(0,len); + } + ,dispatch: function(a) { + this.canceled = false; + var listeners = this.__listeners; + var repeat = this.__repeat; + var i = 0; + while(i < listeners.length) { + listeners[i](a); + if(!repeat[i]) { + this.remove(listeners[i]); + } else { + ++i; + } + if(this.canceled) { + break; + } + } + } + ,__class__: lime_app__$Event_$ofEvents_$T_$Void +}; +var lime_graphics_CairoRenderContext = {}; +lime_graphics_CairoRenderContext.fromRenderContext = function(context) { + return context.cairo; +}; +var lime_graphics_Canvas2DRenderContext = {}; +lime_graphics_Canvas2DRenderContext.fromRenderContext = function(context) { + return context.canvas2D; +}; +var lime_graphics_DOMRenderContext = {}; +lime_graphics_DOMRenderContext.fromRenderContext = function(context) { + return context.dom; +}; +var lime_graphics_FlashRenderContext = {}; +lime_graphics_FlashRenderContext.fromRenderContext = function(context) { + return null; +}; +var lime_graphics_Image = function(buffer,offsetX,offsetY,width,height,color,type) { + if(height == null) { + height = -1; + } + if(width == null) { + width = -1; + } + if(offsetY == null) { + offsetY = 0; + } + if(offsetX == null) { + offsetX = 0; + } + this.offsetX = offsetX; + this.offsetY = offsetY; + this.width = width; + this.height = height; + this.version = 0; + if(type == null) { + type = lime_graphics_ImageType.CANVAS; + if(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) { + type = lime_graphics_ImageType.DATA; + } + } + this.type = type; + if(buffer == null) { + if(width > 0 && height > 0) { + switch(this.type._hx_index) { + case 0: + this.buffer = new lime_graphics_ImageBuffer(null,width,height); + lime__$internal_graphics_ImageCanvasUtil.createCanvas(this,width,height); + if(color != null && color != 0) { + this.fillRect(new lime_math_Rectangle(0,0,width,height),color); + } + break; + case 1: + var elements = width * height * 4; + var array = null; + var vector = null; + var view = null; + var buffer1 = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer1 != null) { + if(len == null) { + this1 = new Uint8Array(buffer1,0); + } else { + this1 = new Uint8Array(buffer1,0,len); + } + } else { + this1 = null; + } + this.buffer = new lime_graphics_ImageBuffer(this1,width,height); + if(color != null && color != 0) { + this.fillRect(new lime_math_Rectangle(0,0,width,height),color); + } + break; + case 2: + break; + default: + } + } + } else { + this.__fromImageBuffer(buffer); + } +}; +$hxClasses["lime.graphics.Image"] = lime_graphics_Image; +lime_graphics_Image.__name__ = "lime.graphics.Image"; +lime_graphics_Image.fromBase64 = function(base64,type) { + if(base64 == null) { + return null; + } + var image = new lime_graphics_Image(); + image.__fromBase64(base64,type); + return image; +}; +lime_graphics_Image.fromBitmapData = function(bitmapData) { + if(bitmapData == null) { + return null; + } + return bitmapData.image; +}; +lime_graphics_Image.fromBytes = function(bytes) { + if(bytes == null) { + return null; + } + var image = new lime_graphics_Image(); + if(image.__fromBytes(bytes)) { + return image; + } else { + return null; + } +}; +lime_graphics_Image.fromCanvas = function(canvas) { + if(canvas == null) { + return null; + } + var buffer = new lime_graphics_ImageBuffer(null,canvas.width,canvas.height); + buffer.set_src(canvas); + var image = new lime_graphics_Image(buffer); + image.type = lime_graphics_ImageType.CANVAS; + return image; +}; +lime_graphics_Image.fromFile = function(path) { + if(path == null) { + return null; + } + var image = new lime_graphics_Image(); + if(image.__fromFile(path)) { + return image; + } else { + return null; + } +}; +lime_graphics_Image.fromImageElement = function(image) { + if(image == null) { + return null; + } + var buffer = new lime_graphics_ImageBuffer(null,image.width,image.height); + buffer.set_src(image); + var _image = new lime_graphics_Image(buffer); + _image.type = lime_graphics_ImageType.CANVAS; + return _image; +}; +lime_graphics_Image.loadFromBase64 = function(base64,type) { + if(base64 == null || type == null) { + return lime_app_Future.withValue(null); + } + return lime__$internal_backend_html5_HTML5HTTPRequest.loadImage("data:" + type + ";base64," + base64); +}; +lime_graphics_Image.loadFromBytes = function(bytes) { + if(bytes == null) { + return lime_app_Future.withValue(null); + } + var type = ""; + if(lime_graphics_Image.__isPNG(bytes)) { + type = "image/png"; + } else if(lime_graphics_Image.__isJPG(bytes)) { + type = "image/jpeg"; + } else if(lime_graphics_Image.__isGIF(bytes)) { + type = "image/gif"; + } else if(lime_graphics_Image.__isWebP(bytes)) { + type = "image/webp"; + } else { + return lime_app_Future.withValue(null); + } + return lime__$internal_backend_html5_HTML5HTTPRequest.loadImageFromBytes(bytes,type); +}; +lime_graphics_Image.loadFromFile = function(path) { + if(path == null) { + return lime_app_Future.withValue(null); + } + return lime__$internal_backend_html5_HTML5HTTPRequest.loadImage(path); +}; +lime_graphics_Image.__isGIF = function(bytes) { + if(bytes == null || bytes.length < 6) { + return false; + } + var header = bytes.getString(0,6); + if(header != "GIF87a") { + return header == "GIF89a"; + } else { + return true; + } +}; +lime_graphics_Image.__isJPG = function(bytes) { + if(bytes == null || bytes.length < 4) { + return false; + } + if(bytes.b[0] == 255 && bytes.b[1] == 216 && bytes.b[bytes.length - 2] == 255) { + return bytes.b[bytes.length - 1] == 217; + } else { + return false; + } +}; +lime_graphics_Image.__isPNG = function(bytes) { + if(bytes == null || bytes.length < 8) { + return false; + } + if(bytes.b[0] == 137 && bytes.b[1] == 80 && bytes.b[2] == 78 && bytes.b[3] == 71 && bytes.b[4] == 13 && bytes.b[5] == 10 && bytes.b[6] == 26) { + return bytes.b[7] == 10; + } else { + return false; + } +}; +lime_graphics_Image.__isWebP = function(bytes) { + if(bytes == null || bytes.length < 16) { + return false; + } + if(bytes.getString(0,4) == "RIFF") { + return bytes.getString(8,4) == "WEBP"; + } else { + return false; + } +}; +lime_graphics_Image.prototype = { + clone: function() { + if(this.buffer != null) { + if(this.type == lime_graphics_ImageType.CANVAS) { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this); + } else { + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + } + var image = new lime_graphics_Image(this.buffer.clone(),this.offsetX,this.offsetY,this.width,this.height,null,this.type); + image.version = this.version; + return image; + } else { + return new lime_graphics_Image(null,this.offsetX,this.offsetY,this.width,this.height,null,this.type); + } + } + ,colorTransform: function(rect,colorMatrix) { + rect = this.__clipRect(rect); + if(this.buffer == null || rect == null) { + return; + } + switch(this.type._hx_index) { + case 0: + lime__$internal_graphics_ImageCanvasUtil.colorTransform(this,rect,colorMatrix); + break; + case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageDataUtil.colorTransform(this,rect,colorMatrix); + break; + case 2: + rect.offset(this.offsetX,this.offsetY); + this.buffer.__srcBitmapData.colorTransform(rect.__toFlashRectangle(),lime_math_ColorMatrix.__toFlashColorTransform(colorMatrix)); + break; + default: + } + } + ,copyChannel: function(sourceImage,sourceRect,destPoint,sourceChannel,destChannel) { + sourceRect = this.__clipRect(sourceRect); + if(this.buffer == null || sourceRect == null) { + return; + } + if(destChannel == lime_graphics_ImageChannel.ALPHA && !this.get_transparent()) { + return; + } + if(sourceRect.width <= 0 || sourceRect.height <= 0) { + return; + } + if(sourceRect.x + sourceRect.width > sourceImage.width) { + sourceRect.width = sourceImage.width - sourceRect.x; + } + if(sourceRect.y + sourceRect.height > sourceImage.height) { + sourceRect.height = sourceImage.height - sourceRect.y; + } + switch(this.type._hx_index) { + case 0: + lime__$internal_graphics_ImageCanvasUtil.copyChannel(this,sourceImage,sourceRect,destPoint,sourceChannel,destChannel); + break; + case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage); + lime__$internal_graphics_ImageDataUtil.copyChannel(this,sourceImage,sourceRect,destPoint,sourceChannel,destChannel); + break; + case 2: + var srcChannel; + switch(sourceChannel._hx_index) { + case 0: + srcChannel = 1; + break; + case 1: + srcChannel = 2; + break; + case 2: + srcChannel = 4; + break; + case 3: + srcChannel = 8; + break; + } + var dstChannel; + switch(destChannel._hx_index) { + case 0: + dstChannel = 1; + break; + case 1: + dstChannel = 2; + break; + case 2: + dstChannel = 4; + break; + case 3: + dstChannel = 8; + break; + } + sourceRect.offset(sourceImage.offsetX,sourceImage.offsetY); + destPoint.offset(this.offsetX,this.offsetY); + this.buffer.__srcBitmapData.copyChannel(sourceImage.buffer.get_src(),sourceRect.__toFlashRectangle(),destPoint.__toFlashPoint(),srcChannel,dstChannel); + break; + default: + } + } + ,copyPixels: function(sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha) { + if(mergeAlpha == null) { + mergeAlpha = false; + } + if(this.buffer == null || sourceImage == null) { + return; + } + if(sourceRect.width <= 0 || sourceRect.height <= 0) { + return; + } + if(this.width <= 0 || this.height <= 0) { + return; + } + if(sourceRect.x + sourceRect.width > sourceImage.width) { + sourceRect.width = sourceImage.width - sourceRect.x; + } + if(sourceRect.y + sourceRect.height > sourceImage.height) { + sourceRect.height = sourceImage.height - sourceRect.y; + } + if(sourceRect.x < 0) { + sourceRect.width += sourceRect.x; + sourceRect.x = 0; + } + if(sourceRect.y < 0) { + sourceRect.height += sourceRect.y; + sourceRect.y = 0; + } + if(destPoint.x + sourceRect.width > this.width) { + sourceRect.width = this.width - destPoint.x; + } + if(destPoint.y + sourceRect.height > this.height) { + sourceRect.height = this.height - destPoint.y; + } + if(destPoint.x < 0) { + sourceRect.width += destPoint.x; + sourceRect.x -= destPoint.x; + destPoint.x = 0; + } + if(destPoint.y < 0) { + sourceRect.height += destPoint.y; + sourceRect.y -= destPoint.y; + destPoint.y = 0; + } + if(sourceImage == this && destPoint.x < sourceRect.get_right() && destPoint.y < sourceRect.get_bottom()) { + sourceImage = this.clone(); + } + if(alphaImage == sourceImage && (alphaPoint == null || alphaPoint.x == 0 && alphaPoint.y == 0)) { + alphaImage = null; + alphaPoint = null; + } + switch(this.type._hx_index) { + case 0: + if(alphaImage != null) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage); + if(alphaImage != null) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(alphaImage); + } + lime__$internal_graphics_ImageDataUtil.copyPixels(this,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha); + } else { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this); + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(sourceImage); + lime__$internal_graphics_ImageCanvasUtil.copyPixels(this,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha); + } + break; + case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage); + if(alphaImage != null) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(alphaImage); + } + lime__$internal_graphics_ImageDataUtil.copyPixels(this,sourceImage,sourceRect,destPoint,alphaImage,alphaPoint,mergeAlpha); + break; + case 2: + sourceRect.offset(sourceImage.offsetX,sourceImage.offsetY); + destPoint.offset(this.offsetX,this.offsetY); + if(alphaImage != null && alphaPoint != null) { + alphaPoint.offset(alphaImage.offsetX,alphaImage.offsetY); + } + this.buffer.__srcBitmapData.copyPixels(sourceImage.buffer.__srcBitmapData,sourceRect.__toFlashRectangle(),destPoint.__toFlashPoint(),alphaImage != null ? alphaImage.buffer.get_src() : null,alphaPoint != null ? alphaPoint.__toFlashPoint() : null,mergeAlpha); + break; + default: + } + } + ,encode: function(format,quality) { + if(quality == null) { + quality = 90; + } + if(format == null) { + return lime__$internal_format_PNG.encode(this); + } else { + switch(format._hx_index) { + case 0: + return lime__$internal_format_BMP.encode(this); + case 1: + return lime__$internal_format_JPEG.encode(this,quality); + case 2: + return lime__$internal_format_PNG.encode(this); + } + } + } + ,fillRect: function(rect,color,format) { + rect = this.__clipRect(rect); + if(this.buffer == null || rect == null) { + return; + } + switch(this.type._hx_index) { + case 0: + lime__$internal_graphics_ImageCanvasUtil.fillRect(this,rect,color,format); + break; + case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + if(this.buffer.data.length == 0) { + return; + } + lime__$internal_graphics_ImageDataUtil.fillRect(this,rect,color,format); + break; + case 2: + rect.offset(this.offsetX,this.offsetY); + var argb; + if(format == null) { + var rgba = color; + var argb1 = 0; + argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + argb = argb1; + } else { + switch(format) { + case 1: + argb = color; + break; + case 2: + var bgra = color; + var argb1 = 0; + argb1 = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255; + argb = argb1; + break; + default: + var rgba = color; + var argb1 = 0; + argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + argb = argb1; + } + } + this.buffer.__srcBitmapData.fillRect(rect.__toFlashRectangle(),argb); + break; + default: + } + } + ,floodFill: function(x,y,color,format) { + if(this.buffer == null) { + return; + } + switch(this.type._hx_index) { + case 0: + lime__$internal_graphics_ImageCanvasUtil.floodFill(this,x,y,color,format); + break; + case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageDataUtil.floodFill(this,x,y,color,format); + break; + case 2: + var argb; + if(format == null) { + var rgba = color; + var argb1 = 0; + argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + argb = argb1; + } else { + switch(format) { + case 1: + argb = color; + break; + case 2: + var bgra = color; + var argb1 = 0; + argb1 = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255; + argb = argb1; + break; + default: + var rgba = color; + var argb1 = 0; + argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + argb = argb1; + } + } + this.buffer.__srcBitmapData.floodFill(x + this.offsetX,y + this.offsetY,argb); + break; + default: + } + } + ,getColorBoundsRect: function(mask,color,findColor,format) { + if(findColor == null) { + findColor = true; + } + if(this.buffer == null) { + return null; + } + switch(this.type._hx_index) { + case 0: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + return lime__$internal_graphics_ImageDataUtil.getColorBoundsRect(this,mask,color,findColor,format); + case 1: + return lime__$internal_graphics_ImageDataUtil.getColorBoundsRect(this,mask,color,findColor,format); + case 2: + var rect = this.buffer.__srcBitmapData.getColorBoundsRect(mask,color,findColor); + return new lime_math_Rectangle(rect.x,rect.y,rect.width,rect.height); + default: + return null; + } + } + ,getPixel: function(x,y,format) { + if(this.buffer == null || x < 0 || y < 0 || x >= this.width || y >= this.height) { + return 0; + } + switch(this.type._hx_index) { + case 0: + return lime__$internal_graphics_ImageCanvasUtil.getPixel(this,x,y,format); + case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + return lime__$internal_graphics_ImageDataUtil.getPixel(this,x,y,format); + case 2: + var color = this.buffer.__srcBitmapData.getPixel(x + this.offsetX,y + this.offsetY); + if(format == null) { + var rgba = 0; + rgba = (color >>> 16 & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color & 255 & 255) << 8 | color >>> 24 & 255 & 255; + var rgba1 = rgba; + return rgba1; + } else { + switch(format) { + case 1: + return color; + case 2: + var bgra = 0; + bgra = (color & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color >>> 16 & 255 & 255) << 8 | color >>> 24 & 255 & 255; + var bgra1 = bgra; + return bgra1; + default: + var rgba = 0; + rgba = (color >>> 16 & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color & 255 & 255) << 8 | color >>> 24 & 255 & 255; + var rgba1 = rgba; + return rgba1; + } + } + break; + default: + return 0; + } + } + ,getPixel32: function(x,y,format) { + if(this.buffer == null || x < 0 || y < 0 || x >= this.width || y >= this.height) { + return 0; + } + switch(this.type._hx_index) { + case 0: + return lime__$internal_graphics_ImageCanvasUtil.getPixel32(this,x,y,format); + case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + return lime__$internal_graphics_ImageDataUtil.getPixel32(this,x,y,format); + case 2: + var color = this.buffer.__srcBitmapData.getPixel32(x + this.offsetX,y + this.offsetY); + if(format == null) { + var rgba = 0; + rgba = (color >>> 16 & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color & 255 & 255) << 8 | color >>> 24 & 255 & 255; + var rgba1 = rgba; + return rgba1; + } else { + switch(format) { + case 1: + return color; + case 2: + var bgra = 0; + bgra = (color & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color >>> 16 & 255 & 255) << 8 | color >>> 24 & 255 & 255; + var bgra1 = bgra; + return bgra1; + default: + var rgba = 0; + rgba = (color >>> 16 & 255 & 255) << 24 | (color >>> 8 & 255 & 255) << 16 | (color & 255 & 255) << 8 | color >>> 24 & 255 & 255; + var rgba1 = rgba; + return rgba1; + } + } + break; + default: + return 0; + } + } + ,getPixels: function(rect,format) { + if(this.buffer == null) { + return null; + } + switch(this.type._hx_index) { + case 0: + return lime__$internal_graphics_ImageCanvasUtil.getPixels(this,rect,format); + case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + return lime__$internal_graphics_ImageDataUtil.getPixels(this,rect,format); + case 2: + return null; + default: + return null; + } + } + ,merge: function(sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) { + if(this.buffer == null || sourceImage == null) { + return; + } + switch(this.type._hx_index) { + case 0: + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this); + lime__$internal_graphics_ImageCanvasUtil.merge(this,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier); + break; + case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage); + lime__$internal_graphics_ImageDataUtil.merge(this,sourceImage,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier); + break; + case 2: + sourceRect.offset(this.offsetX,this.offsetY); + this.buffer.__srcBitmapData.merge(sourceImage.buffer.__srcBitmapData,sourceRect.__toFlashRectangle(),destPoint.__toFlashPoint(),redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier); + break; + default: + return; + } + } + ,resize: function(newWidth,newHeight) { + switch(this.type._hx_index) { + case 0: + lime__$internal_graphics_ImageCanvasUtil.resize(this,newWidth,newHeight); + break; + case 1: + lime__$internal_graphics_ImageDataUtil.resize(this,newWidth,newHeight); + break; + case 2: + break; + default: + } + this.buffer.width = newWidth; + this.buffer.height = newHeight; + this.offsetX = 0; + this.offsetY = 0; + this.width = newWidth; + this.height = newHeight; + } + ,scroll: function(x,y) { + if(this.buffer == null) { + return; + } + switch(this.type._hx_index) { + case 0: + lime__$internal_graphics_ImageCanvasUtil.scroll(this,x,y); + break; + case 1: + this.copyPixels(this,this.get_rect(),new lime_math_Vector2(x,y)); + break; + case 2: + this.buffer.__srcBitmapData.scroll(x + this.offsetX,y + this.offsetX); + break; + default: + } + } + ,setPixel: function(x,y,color,format) { + if(this.buffer == null || x < 0 || y < 0 || x >= this.width || y >= this.height) { + return; + } + switch(this.type._hx_index) { + case 0: + lime__$internal_graphics_ImageCanvasUtil.setPixel(this,x,y,color,format); + break; + case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageDataUtil.setPixel(this,x,y,color,format); + break; + case 2: + var argb; + if(format == null) { + var rgba = color; + var argb1 = 0; + argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + argb = argb1; + } else { + switch(format) { + case 1: + argb = color; + break; + case 2: + var bgra = color; + var argb1 = 0; + argb1 = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255; + argb = argb1; + break; + default: + var rgba = color; + var argb1 = 0; + argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + argb = argb1; + } + } + this.buffer.__srcBitmapData.setPixel(x + this.offsetX,y + this.offsetX,argb); + break; + default: + } + } + ,setPixel32: function(x,y,color,format) { + if(this.buffer == null || x < 0 || y < 0 || x >= this.width || y >= this.height) { + return; + } + switch(this.type._hx_index) { + case 0: + lime__$internal_graphics_ImageCanvasUtil.setPixel32(this,x,y,color,format); + break; + case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageDataUtil.setPixel32(this,x,y,color,format); + break; + case 2: + var argb; + if(format == null) { + var rgba = color; + var argb1 = 0; + argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + argb = argb1; + } else { + switch(format) { + case 1: + argb = color; + break; + case 2: + var bgra = color; + var argb1 = 0; + argb1 = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255; + argb = argb1; + break; + default: + var rgba = color; + var argb1 = 0; + argb1 = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + argb = argb1; + } + } + this.buffer.__srcBitmapData.setPixel32(x + this.offsetX,y + this.offsetY,argb); + break; + default: + } + } + ,setPixels: function(rect,bytePointer,format,endian) { + rect = this.__clipRect(rect); + if(this.buffer == null || rect == null) { + return; + } + if(endian == null) { + endian = lime_system_Endian.BIG_ENDIAN; + } + switch(this.type._hx_index) { + case 0: + lime__$internal_graphics_ImageCanvasUtil.setPixels(this,rect,bytePointer,format,endian); + break; + case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageDataUtil.setPixels(this,rect,bytePointer,format,endian); + break; + case 2: + break; + default: + } + } + ,threshold: function(sourceImage,sourceRect,destPoint,operation,threshold,color,mask,copySource,format) { + if(copySource == null) { + copySource = false; + } + if(mask == null) { + mask = -1; + } + if(color == null) { + color = 0; + } + if(this.buffer == null || sourceImage == null || sourceRect == null) { + return 0; + } + switch(this.type._hx_index) { + case 0:case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageCanvasUtil.convertToData(sourceImage); + return lime__$internal_graphics_ImageDataUtil.threshold(this,sourceImage,sourceRect,destPoint,operation,threshold,color,mask,copySource,format); + case 2: + var _color; + if(format == null) { + var rgba = color; + var argb = 0; + argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + _color = argb; + } else { + switch(format) { + case 1: + _color = color; + break; + case 2: + var bgra = color; + var argb = 0; + argb = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255; + _color = argb; + break; + default: + var rgba = color; + var argb = 0; + argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + _color = argb; + } + } + var _mask; + if(format == null) { + var rgba = mask; + var argb = 0; + argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + _mask = argb; + } else { + switch(format) { + case 1: + _mask = mask; + break; + case 2: + var bgra = mask; + var argb = 0; + argb = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255; + _mask = argb; + break; + default: + var rgba = mask; + var argb = 0; + argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + _mask = argb; + } + } + sourceRect.offset(sourceImage.offsetX,sourceImage.offsetY); + destPoint.offset(this.offsetX,this.offsetY); + return this.buffer.__srcBitmapData.threshold(sourceImage.buffer.get_src(),sourceRect.__toFlashRectangle(),destPoint.__toFlashPoint(),operation,threshold,_color,_mask,copySource); + default: + } + return 0; + } + ,__clipRect: function(r) { + if(r == null) { + return null; + } + if(r.x < 0) { + r.width -= -r.x; + r.x = 0; + if(r.x + r.width <= 0) { + return null; + } + } + if(r.y < 0) { + r.height -= -r.y; + r.y = 0; + if(r.y + r.height <= 0) { + return null; + } + } + if(r.x + r.width >= this.width) { + r.width -= r.x + r.width - this.width; + if(r.width <= 0) { + return null; + } + } + if(r.y + r.height >= this.height) { + r.height -= r.y + r.height - this.height; + if(r.height <= 0) { + return null; + } + } + return r; + } + ,__fromBase64: function(base64,type,onload) { + var _gthis = this; + var image = new window.Image (); + var image_onLoaded = function(event) { + _gthis.buffer = new lime_graphics_ImageBuffer(null,image.width,image.height); + _gthis.buffer.__srcImage = image; + _gthis.offsetX = 0; + _gthis.offsetY = 0; + _gthis.width = _gthis.buffer.width; + _gthis.height = _gthis.buffer.height; + if(onload != null) { + onload(_gthis); + } + }; + image.addEventListener("load",image_onLoaded,false); + image.src = "data:" + type + ";base64," + base64; + } + ,__fromBytes: function(bytes,onload) { + var type = ""; + if(lime_graphics_Image.__isPNG(bytes)) { + type = "image/png"; + } else if(lime_graphics_Image.__isJPG(bytes)) { + type = "image/jpeg"; + } else if(lime_graphics_Image.__isGIF(bytes)) { + type = "image/gif"; + } else { + return false; + } + this.__fromBase64(lime__$internal_format_Base64.encode(bytes),type,onload); + return true; + } + ,__fromFile: function(path,onload,onerror) { + var _gthis = this; + var image = new window.Image (); + if(!lime__$internal_backend_html5_HTML5HTTPRequest.__isSameOrigin(path)) { + image.crossOrigin = "Anonymous"; + } + image.onload = function(_) { + _gthis.buffer = new lime_graphics_ImageBuffer(null,image.width,image.height); + _gthis.buffer.__srcImage = image; + _gthis.width = image.width; + _gthis.height = image.height; + if(onload != null) { + onload(_gthis); + } + }; + image.onerror = function(_) { + if(onerror != null) { + onerror(); + } + }; + image.src = path; + var image1 = image.complete; + return true; + } + ,__fromImageBuffer: function(buffer) { + this.buffer = buffer; + if(buffer != null) { + if(this.width == -1) { + this.width = buffer.width; + } + if(this.height == -1) { + this.height = buffer.height; + } + } + } + ,get_data: function() { + if(this.buffer.data == null && this.buffer.width > 0 && this.buffer.height > 0) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + } + return this.buffer.data; + } + ,set_data: function(value) { + return this.buffer.data = value; + } + ,get_format: function() { + return this.buffer.format; + } + ,set_format: function(value) { + if(this.buffer.format != value) { + if(this.type._hx_index == 1) { + lime__$internal_graphics_ImageDataUtil.setFormat(this,value); + } + } + return this.buffer.format = value; + } + ,get_powerOfTwo: function() { + if(this.buffer.width != 0 && (this.buffer.width & ~this.buffer.width + 1) == this.buffer.width) { + if(this.buffer.height != 0) { + return (this.buffer.height & ~this.buffer.height + 1) == this.buffer.height; + } else { + return false; + } + } else { + return false; + } + } + ,set_powerOfTwo: function(value) { + if(value != this.get_powerOfTwo()) { + var newWidth = 1; + var newHeight = 1; + while(newWidth < this.buffer.width) newWidth <<= 1; + while(newHeight < this.buffer.height) newHeight <<= 1; + if(newWidth == this.buffer.width && newHeight == this.buffer.height) { + return value; + } + switch(this.type._hx_index) { + case 0: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageDataUtil.resizeBuffer(this,newWidth,newHeight); + break; + case 1: + lime__$internal_graphics_ImageDataUtil.resizeBuffer(this,newWidth,newHeight); + break; + case 2: + break; + default: + } + } + return value; + } + ,get_premultiplied: function() { + return this.buffer.premultiplied; + } + ,set_premultiplied: function(value) { + if(value && !this.buffer.premultiplied) { + switch(this.type._hx_index) { + case 0:case 1: + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageDataUtil.multiplyAlpha(this); + break; + default: + } + } else if(!value && this.buffer.premultiplied) { + if(this.type._hx_index == 1) { + lime__$internal_graphics_ImageCanvasUtil.convertToData(this); + lime__$internal_graphics_ImageDataUtil.unmultiplyAlpha(this); + } + } + return value; + } + ,get_rect: function() { + return new lime_math_Rectangle(0,0,this.width,this.height); + } + ,get_src: function() { + if(this.buffer.__srcCanvas == null && (this.buffer.data != null || this.type == lime_graphics_ImageType.DATA)) { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this); + } + return this.buffer.get_src(); + } + ,set_src: function(value) { + return this.buffer.set_src(value); + } + ,get_transparent: function() { + if(this.buffer == null) { + return false; + } + return this.buffer.transparent; + } + ,set_transparent: function(value) { + if(this.buffer == null) { + return false; + } + return this.buffer.transparent = value; + } + ,__class__: lime_graphics_Image + ,__properties__: {set_transparent:"set_transparent",get_transparent:"get_transparent",set_src:"set_src",get_src:"get_src",get_rect:"get_rect",set_premultiplied:"set_premultiplied",get_premultiplied:"get_premultiplied",set_powerOfTwo:"set_powerOfTwo",get_powerOfTwo:"get_powerOfTwo",set_format:"set_format",get_format:"get_format",set_data:"set_data",get_data:"get_data"} +}; +var lime_graphics_ImageBuffer = function(data,width,height,bitsPerPixel,format) { + if(bitsPerPixel == null) { + bitsPerPixel = 32; + } + if(height == null) { + height = 0; + } + if(width == null) { + width = 0; + } + this.data = data; + this.width = width; + this.height = height; + this.bitsPerPixel = bitsPerPixel; + this.format = format == null ? 0 : format; + this.premultiplied = false; + this.transparent = true; +}; +$hxClasses["lime.graphics.ImageBuffer"] = lime_graphics_ImageBuffer; +lime_graphics_ImageBuffer.__name__ = "lime.graphics.ImageBuffer"; +lime_graphics_ImageBuffer.prototype = { + clone: function() { + var buffer = new lime_graphics_ImageBuffer(this.data,this.width,this.height,this.bitsPerPixel); + if(this.data != null) { + var elements = this.data.byteLength; + var array = null; + var vector = null; + var view = null; + var buffer1 = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer1 != null) { + if(len == null) { + this1 = new Uint8Array(buffer1,0); + } else { + this1 = new Uint8Array(buffer1,0,len); + } + } else { + this1 = null; + } + buffer.data = this1; + var elements = null; + var array = null; + var vector = null; + var view = this.data; + var buffer1 = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer1 != null) { + if(len == null) { + this1 = new Uint8Array(buffer1,0); + } else { + this1 = new Uint8Array(buffer1,0,len); + } + } else { + this1 = null; + } + var copy = this1; + buffer.data.set(copy); + } else if(this.__srcImageData != null) { + buffer.__srcCanvas = window.document.createElement("canvas"); + buffer.__srcContext = buffer.__srcCanvas.getContext("2d"); + buffer.__srcCanvas.width = this.__srcImageData.width; + buffer.__srcCanvas.height = this.__srcImageData.height; + buffer.__srcImageData = buffer.__srcContext.createImageData(this.__srcImageData.width,this.__srcImageData.height); + var copy = new Uint8ClampedArray(this.__srcImageData.data); + buffer.__srcImageData.data.set(copy); + } else if(this.__srcCanvas != null) { + buffer.__srcCanvas = window.document.createElement("canvas"); + buffer.__srcContext = buffer.__srcCanvas.getContext("2d"); + buffer.__srcCanvas.width = this.__srcCanvas.width; + buffer.__srcCanvas.height = this.__srcCanvas.height; + buffer.__srcContext.drawImage(this.__srcCanvas,0,0); + } else { + buffer.__srcImage = this.__srcImage; + } + buffer.bitsPerPixel = this.bitsPerPixel; + buffer.format = this.format; + buffer.premultiplied = this.premultiplied; + buffer.transparent = this.transparent; + return buffer; + } + ,get_src: function() { + if(this.__srcImage != null) { + return this.__srcImage; + } + return this.__srcCanvas; + } + ,set_src: function(value) { + if(((value) instanceof Image)) { + this.__srcImage = value; + } else if(((value) instanceof HTMLCanvasElement)) { + this.__srcCanvas = value; + this.__srcContext = this.__srcCanvas.getContext("2d"); + } + return value; + } + ,get_stride: function() { + return this.width * (this.bitsPerPixel / 8 | 0); + } + ,__class__: lime_graphics_ImageBuffer + ,__properties__: {get_stride:"get_stride",set_src:"set_src",get_src:"get_src"} +}; +var lime_graphics_ImageChannel = $hxEnums["lime.graphics.ImageChannel"] = { __ename__:"lime.graphics.ImageChannel",__constructs__:null + ,RED: {_hx_name:"RED",_hx_index:0,__enum__:"lime.graphics.ImageChannel",toString:$estr} + ,GREEN: {_hx_name:"GREEN",_hx_index:1,__enum__:"lime.graphics.ImageChannel",toString:$estr} + ,BLUE: {_hx_name:"BLUE",_hx_index:2,__enum__:"lime.graphics.ImageChannel",toString:$estr} + ,ALPHA: {_hx_name:"ALPHA",_hx_index:3,__enum__:"lime.graphics.ImageChannel",toString:$estr} +}; +lime_graphics_ImageChannel.__constructs__ = [lime_graphics_ImageChannel.RED,lime_graphics_ImageChannel.GREEN,lime_graphics_ImageChannel.BLUE,lime_graphics_ImageChannel.ALPHA]; +var lime_graphics_ImageFileFormat = $hxEnums["lime.graphics.ImageFileFormat"] = { __ename__:"lime.graphics.ImageFileFormat",__constructs__:null + ,BMP: {_hx_name:"BMP",_hx_index:0,__enum__:"lime.graphics.ImageFileFormat",toString:$estr} + ,JPEG: {_hx_name:"JPEG",_hx_index:1,__enum__:"lime.graphics.ImageFileFormat",toString:$estr} + ,PNG: {_hx_name:"PNG",_hx_index:2,__enum__:"lime.graphics.ImageFileFormat",toString:$estr} +}; +lime_graphics_ImageFileFormat.__constructs__ = [lime_graphics_ImageFileFormat.BMP,lime_graphics_ImageFileFormat.JPEG,lime_graphics_ImageFileFormat.PNG]; +var lime_graphics_ImageType = $hxEnums["lime.graphics.ImageType"] = { __ename__:"lime.graphics.ImageType",__constructs__:null + ,CANVAS: {_hx_name:"CANVAS",_hx_index:0,__enum__:"lime.graphics.ImageType",toString:$estr} + ,DATA: {_hx_name:"DATA",_hx_index:1,__enum__:"lime.graphics.ImageType",toString:$estr} + ,FLASH: {_hx_name:"FLASH",_hx_index:2,__enum__:"lime.graphics.ImageType",toString:$estr} + ,CUSTOM: {_hx_name:"CUSTOM",_hx_index:3,__enum__:"lime.graphics.ImageType",toString:$estr} +}; +lime_graphics_ImageType.__constructs__ = [lime_graphics_ImageType.CANVAS,lime_graphics_ImageType.DATA,lime_graphics_ImageType.FLASH,lime_graphics_ImageType.CUSTOM]; +var lime_graphics_OpenGLES2RenderContext = {}; +lime_graphics_OpenGLES2RenderContext.fromGL = function(gl) { + return null; +}; +lime_graphics_OpenGLES2RenderContext.fromOpenGLES3RenderContext = function(gl) { + return null; +}; +lime_graphics_OpenGLES2RenderContext.fromRenderContext = function(context) { + return null; +}; +lime_graphics_OpenGLES2RenderContext.fromWebGLRenderContext = function(gl) { + return null; +}; +var lime_graphics_OpenGLES3RenderContext = {}; +lime_graphics_OpenGLES3RenderContext.fromRenderContext = function(context) { + return null; +}; +lime_graphics_OpenGLES3RenderContext.fromGL = function(gl) { + return null; +}; +lime_graphics_OpenGLES3RenderContext.fromOpenGLES2RenderContext = function(context) { + return null; +}; +lime_graphics_OpenGLES3RenderContext.fromWebGLRenderContext = function(context) { + return null; +}; +lime_graphics_OpenGLES3RenderContext.fromWebGL2RenderContext = function(context) { + return null; +}; +var lime_graphics_OpenGLRenderContext = {}; +lime_graphics_OpenGLRenderContext.fromRenderContext = function(context) { + return null; +}; +var lime_graphics_RenderContext = function() { +}; +$hxClasses["lime.graphics.RenderContext"] = lime_graphics_RenderContext; +lime_graphics_RenderContext.__name__ = "lime.graphics.RenderContext"; +lime_graphics_RenderContext.prototype = { + __class__: lime_graphics_RenderContext +}; +var lime_graphics_WebGL2RenderContext = {}; +lime_graphics_WebGL2RenderContext.bufferData = function(this1,target,srcData,usage,srcOffset,length) { + if(srcOffset != null) { + this1.bufferData(target,srcData,usage,srcOffset,length); + } else { + this1.bufferData(target,srcData,usage); + } +}; +lime_graphics_WebGL2RenderContext.bufferSubData = function(this1,target,dstByteOffset,srcData,srcOffset,length) { + if(srcOffset != null) { + this1.bufferSubData(target,dstByteOffset,srcData,srcOffset,length); + } else { + this1.bufferSubData(target,dstByteOffset,srcData); + } +}; +lime_graphics_WebGL2RenderContext.compressedTexImage2D = function(this1,target,level,internalformat,width,height,border,srcData,srcOffset,srcLengthOverride) { + if(srcOffset != null) { + this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData,srcOffset,srcLengthOverride); + } else { + this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData); + } +}; +lime_graphics_WebGL2RenderContext.compressedTexSubImage2D = function(this1,target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,srcLengthOverride) { + if(srcOffset != null) { + this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,srcLengthOverride); + } else { + this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData); + } +}; +lime_graphics_WebGL2RenderContext.getBufferSubData = function(this1,target,srcByteOffset,dstData,srcOffset,length) { + if(srcOffset != null) { + this1.getBufferSubData(target,srcByteOffset,dstData,srcOffset,length); + } else { + this1.getBufferSubData(target,srcByteOffset,dstData); + } +}; +lime_graphics_WebGL2RenderContext.readPixels = function(this1,x,y,width,height,format,type,pixels,dstOffset) { + if(dstOffset != null) { + this1.readPixels(x,y,width,height,format,type,pixels,dstOffset); + } else { + this1.readPixels(x,y,width,height,format,type,pixels); + } +}; +lime_graphics_WebGL2RenderContext.texImage2D = function(this1,target,level,internalformat,width,height,border,format,type,srcData,srcOffset) { + if(srcOffset != null) { + this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData,srcOffset); + } else if(format != null) { + this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData); + } else { + this1.texImage2D(target,level,internalformat,width,height,border); + } +}; +lime_graphics_WebGL2RenderContext.texSubImage2D = function(this1,target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset) { + if(srcOffset != null) { + this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset); + } else if(type != null) { + this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData); + } else { + this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format); + } +}; +lime_graphics_WebGL2RenderContext.uniform1fv = function(this1,location,data,srcOffset,srcLength) { + if(srcOffset != null) { + this1.uniform1fv(location,data,srcOffset,srcLength); + } else { + this1.uniform1fv(location,data); + } +}; +lime_graphics_WebGL2RenderContext.uniform1iv = function(this1,location,data,srcOffset,srcLength) { + if(srcOffset != null) { + this1.uniform1iv(location,data,srcOffset,srcLength); + } else { + this1.uniform1iv(location,data); + } +}; +lime_graphics_WebGL2RenderContext.uniform2fv = function(this1,location,data,srcOffset,srcLength) { + if(srcOffset != null) { + this1.uniform2fv(location,data,srcOffset,srcLength); + } else { + this1.uniform2fv(location,data); + } +}; +lime_graphics_WebGL2RenderContext.uniform2iv = function(this1,location,data,srcOffset,srcLength) { + if(srcOffset != null) { + this1.uniform2iv(location,data,srcOffset,srcLength); + } else { + this1.uniform2iv(location,data); + } +}; +lime_graphics_WebGL2RenderContext.uniform3fv = function(this1,location,data,srcOffset,srcLength) { + if(srcOffset != null) { + this1.uniform3fv(location,data,srcOffset,srcLength); + } else { + this1.uniform3fv(location,data); + } +}; +lime_graphics_WebGL2RenderContext.uniform3iv = function(this1,location,data,srcOffset,srcLength) { + if(srcOffset != null) { + this1.uniform3iv(location,data,srcOffset,srcLength); + } else { + this1.uniform3iv(location,data); + } +}; +lime_graphics_WebGL2RenderContext.uniform4fv = function(this1,location,data,srcOffset,srcLength) { + if(srcOffset != null) { + this1.uniform4fv(location,data,srcOffset,srcLength); + } else { + this1.uniform4fv(location,data); + } +}; +lime_graphics_WebGL2RenderContext.uniform4iv = function(this1,location,data,srcOffset,srcLength) { + if(srcOffset != null) { + this1.uniform4iv(location,data,srcOffset,srcLength); + } else { + this1.uniform4iv(location,data); + } +}; +lime_graphics_WebGL2RenderContext.uniformMatrix2fv = function(this1,location,transpose,data,srcOffset,srcLength) { + if(srcOffset != null) { + this1.uniformMatrix2fv(location,transpose,data,srcOffset,srcLength); + } else { + this1.uniformMatrix2fv(location,transpose,data); + } +}; +lime_graphics_WebGL2RenderContext.uniformMatrix3fv = function(this1,location,transpose,data,srcOffset,srcLength) { + if(srcOffset != null) { + this1.uniformMatrix3fv(location,transpose,data,srcOffset,srcLength); + } else { + this1.uniformMatrix3fv(location,transpose,data); + } +}; +lime_graphics_WebGL2RenderContext.uniformMatrix4fv = function(this1,location,transpose,data,srcOffset,srcLength) { + if(srcOffset != null) { + this1.uniformMatrix4fv(location,transpose,data,srcOffset,srcLength); + } else { + this1.uniformMatrix4fv(location,transpose,data); + } +}; +lime_graphics_WebGL2RenderContext.fromGL = function(gl) { + return null; +}; +lime_graphics_WebGL2RenderContext.fromRenderContext = function(context) { + return context.webgl2; +}; +lime_graphics_WebGL2RenderContext.toWebGLRenderContext = function(gl) { + return gl; +}; +var lime_graphics_WebGLRenderContext = {}; +lime_graphics_WebGLRenderContext.bufferData = function(this1,target,srcData,usage) { + var srcOffset = null; + if(srcOffset != null) { + this1.bufferData(target,srcData,usage,srcOffset,null); + } else { + this1.bufferData(target,srcData,usage); + } +}; +lime_graphics_WebGLRenderContext.bufferSubData = function(this1,target,offset,srcData) { + var srcOffset = null; + if(srcOffset != null) { + this1.bufferSubData(target,offset,srcData,srcOffset,null); + } else { + this1.bufferSubData(target,offset,srcData); + } +}; +lime_graphics_WebGLRenderContext.compressedTexImage2D = function(this1,target,level,internalformat,width,height,border,srcData) { + var srcOffset = null; + if(srcOffset != null) { + this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData,srcOffset,null); + } else { + this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData); + } +}; +lime_graphics_WebGLRenderContext.compressedTexSubImage2D = function(this1,target,level,xoffset,yoffset,width,height,format,srcData) { + var srcOffset = null; + if(srcOffset != null) { + this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,null); + } else { + this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData); + } +}; +lime_graphics_WebGLRenderContext.readPixels = function(this1,x,y,width,height,format,type,pixels) { + var dstOffset = null; + if(dstOffset != null) { + this1.readPixels(x,y,width,height,format,type,pixels,dstOffset); + } else { + this1.readPixels(x,y,width,height,format,type,pixels); + } +}; +lime_graphics_WebGLRenderContext.texImage2D = function(this1,target,level,internalformat,width,height,border,format,type,srcData) { + var srcOffset = null; + if(srcOffset != null) { + this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData,srcOffset); + } else if(format != null) { + this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData); + } else { + this1.texImage2D(target,level,internalformat,width,height,border); + } +}; +lime_graphics_WebGLRenderContext.texSubImage2D = function(this1,target,level,xoffset,yoffset,width,height,format,type,srcData) { + var srcOffset = null; + if(srcOffset != null) { + this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset); + } else if(type != null) { + this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData); + } else { + this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format); + } +}; +lime_graphics_WebGLRenderContext.uniformMatrix2fv = function(this1,location,transpose,v) { + var data = v; + var srcOffset = null; + if(srcOffset != null) { + this1.uniformMatrix2fv(location,transpose,data,srcOffset,null); + } else { + this1.uniformMatrix2fv(location,transpose,data); + } +}; +lime_graphics_WebGLRenderContext.uniformMatrix3fv = function(this1,location,transpose,v) { + var data = v; + var srcOffset = null; + if(srcOffset != null) { + this1.uniformMatrix3fv(location,transpose,data,srcOffset,null); + } else { + this1.uniformMatrix3fv(location,transpose,data); + } +}; +lime_graphics_WebGLRenderContext.uniformMatrix4fv = function(this1,location,transpose,v) { + var data = v; + var srcOffset = null; + if(srcOffset != null) { + this1.uniformMatrix4fv(location,transpose,data,srcOffset,null); + } else { + this1.uniformMatrix4fv(location,transpose,data); + } +}; +lime_graphics_WebGLRenderContext.fromWebGL2RenderContext = function(gl) { + return gl; +}; +lime_graphics_WebGLRenderContext.fromRenderContext = function(context) { + return context.webgl; +}; +lime_graphics_WebGLRenderContext.fromGL = function(gl) { + return lime_graphics_opengl_GL.context; +}; +var lime_graphics_cairo_Cairo = function(surface) { + var tmp = surface != null; +}; +$hxClasses["lime.graphics.cairo.Cairo"] = lime_graphics_cairo_Cairo; +lime_graphics_cairo_Cairo.__name__ = "lime.graphics.cairo.Cairo"; +lime_graphics_cairo_Cairo.__properties__ = {get_versionString:"get_versionString",get_version:"get_version"}; +lime_graphics_cairo_Cairo.get_version = function() { + return 0; +}; +lime_graphics_cairo_Cairo.get_versionString = function() { + return ""; +}; +lime_graphics_cairo_Cairo.prototype = { + arc: function(xc,yc,radius,angle1,angle2) { + } + ,arcNegative: function(xc,yc,radius,angle1,angle2) { + } + ,clip: function() { + } + ,clipExtents: function(x1,y1,x2,y2) { + } + ,clipPreserve: function() { + } + ,closePath: function() { + } + ,copyPage: function() { + } + ,curveTo: function(x1,y1,x2,y2,x3,y3) { + } + ,fill: function() { + } + ,fillExtents: function(x1,y1,x2,y2) { + } + ,fillPreserve: function() { + } + ,getOperator: function() { + return 0; + } + ,identityMatrix: function() { + } + ,inClip: function(x,y) { + return false; + } + ,inFill: function(x,y) { + return false; + } + ,inStroke: function(x,y) { + return false; + } + ,lineTo: function(x,y) { + } + ,mask: function(pattern) { + } + ,maskSurface: function(surface,x,y) { + } + ,moveTo: function(x,y) { + } + ,newPath: function() { + } + ,paint: function() { + } + ,paintWithAlpha: function(alpha) { + } + ,popGroup: function() { + return null; + } + ,popGroupToSource: function() { + } + ,pushGroup: function() { + } + ,pushGroupWithContent: function(content) { + } + ,recreate: function(surface) { + } + ,rectangle: function(x,y,width,height) { + } + ,relCurveTo: function(dx1,dy1,dx2,dy2,dx3,dy3) { + } + ,relLineTo: function(dx,dy) { + } + ,relMoveTo: function(dx,dy) { + } + ,resetClip: function() { + } + ,restore: function() { + } + ,rotate: function(amount) { + } + ,save: function() { + } + ,scale: function(x,y) { + } + ,setFontSize: function(size) { + } + ,setOperator: function(value) { + return value; + } + ,setSourceRGB: function(r,g,b) { + } + ,setSourceRGBA: function(r,g,b,a) { + } + ,setSourceSurface: function(surface,x,y) { + } + ,showGlyphs: function(glyphs) { + } + ,showPage: function() { + } + ,showText: function(utf8) { + } + ,status: function() { + return 0; + } + ,stroke: function() { + } + ,strokeExtents: function(x1,y1,x2,y2) { + } + ,strokePreserve: function() { + } + ,textPath: function(utf8) { + } + ,transform: function(matrix) { + } + ,translate: function(x,y) { + } + ,get_antialias: function() { + return 0; + } + ,set_antialias: function(value) { + return value; + } + ,get_currentPoint: function() { + return null; + } + ,get_dash: function() { + return []; + } + ,set_dash: function(value) { + return value; + } + ,get_dashCount: function() { + return 0; + } + ,get_fillRule: function() { + return 0; + } + ,set_fillRule: function(value) { + return value; + } + ,get_fontFace: function() { + return 0; + } + ,set_fontFace: function(value) { + return value; + } + ,get_fontOptions: function() { + return null; + } + ,set_fontOptions: function(value) { + return value; + } + ,get_groupTarget: function() { + return 0; + } + ,get_hasCurrentPoint: function() { + return false; + } + ,get_lineCap: function() { + return 0; + } + ,set_lineCap: function(value) { + return value; + } + ,get_lineJoin: function() { + return 0; + } + ,set_lineJoin: function(value) { + return value; + } + ,get_lineWidth: function() { + return 0; + } + ,set_lineWidth: function(value) { + return value; + } + ,get_matrix: function() { + return null; + } + ,set_matrix: function(value) { + return value; + } + ,get_miterLimit: function() { + return 0; + } + ,set_miterLimit: function(value) { + return value; + } + ,get_source: function() { + return 0; + } + ,set_source: function(value) { + return value; + } + ,get_target: function() { + return 0; + } + ,get_tolerance: function() { + return 0; + } + ,set_tolerance: function(value) { + return value; + } + ,__class__: lime_graphics_cairo_Cairo + ,__properties__: {set_tolerance:"set_tolerance",get_tolerance:"get_tolerance",get_target:"get_target",set_source:"set_source",get_source:"get_source",set_miterLimit:"set_miterLimit",get_miterLimit:"get_miterLimit",set_matrix:"set_matrix",get_matrix:"get_matrix",set_lineWidth:"set_lineWidth",get_lineWidth:"get_lineWidth",set_lineJoin:"set_lineJoin",get_lineJoin:"get_lineJoin",set_lineCap:"set_lineCap",get_lineCap:"get_lineCap",get_hasCurrentPoint:"get_hasCurrentPoint",get_groupTarget:"get_groupTarget",set_fontOptions:"set_fontOptions",get_fontOptions:"get_fontOptions",set_fontFace:"set_fontFace",get_fontFace:"get_fontFace",set_fillRule:"set_fillRule",get_fillRule:"get_fillRule",get_dashCount:"get_dashCount",set_dash:"set_dash",get_dash:"get_dash",get_currentPoint:"get_currentPoint",set_antialias:"set_antialias",get_antialias:"get_antialias"} +}; +var lime_graphics_cairo_CairoFTFontFace = {}; +lime_graphics_cairo_CairoFTFontFace._new = function() { + return 0; +}; +lime_graphics_cairo_CairoFTFontFace.create = function(face,loadFlags) { + return 0; +}; +var lime_graphics_cairo_CairoFontFace = {}; +lime_graphics_cairo_CairoFontFace._new = function() { + return null; +}; +lime_graphics_cairo_CairoFontFace.status = function(this1) { + return 0; +}; +var lime_graphics_cairo_CairoFontOptions = {}; +lime_graphics_cairo_CairoFontOptions.__properties__ = {set_subpixelOrder:"set_subpixelOrder",get_subpixelOrder:"get_subpixelOrder",set_hintStyle:"set_hintStyle",get_hintStyle:"get_hintStyle",set_hintMetrics:"set_hintMetrics",get_hintMetrics:"get_hintMetrics",set_antialias:"set_antialias",get_antialias:"get_antialias"}; +lime_graphics_cairo_CairoFontOptions._new = function() { + return null; +}; +lime_graphics_cairo_CairoFontOptions.get_antialias = function(this1) { + return 0; +}; +lime_graphics_cairo_CairoFontOptions.set_antialias = function(this1,value) { + return value; +}; +lime_graphics_cairo_CairoFontOptions.get_hintMetrics = function(this1) { + return 0; +}; +lime_graphics_cairo_CairoFontOptions.set_hintMetrics = function(this1,value) { + return value; +}; +lime_graphics_cairo_CairoFontOptions.get_hintStyle = function(this1) { + return 0; +}; +lime_graphics_cairo_CairoFontOptions.set_hintStyle = function(this1,value) { + return value; +}; +lime_graphics_cairo_CairoFontOptions.get_subpixelOrder = function(this1) { + return 0; +}; +lime_graphics_cairo_CairoFontOptions.set_subpixelOrder = function(this1,value) { + return value; +}; +var lime_graphics_cairo_CairoGlyph = function(index,x,y) { + if(y == null) { + y = 0; + } + if(x == null) { + x = 0; + } + this.index = index; + this.x = x; + this.y = y; +}; +$hxClasses["lime.graphics.cairo.CairoGlyph"] = lime_graphics_cairo_CairoGlyph; +lime_graphics_cairo_CairoGlyph.__name__ = "lime.graphics.cairo.CairoGlyph"; +lime_graphics_cairo_CairoGlyph.prototype = { + __class__: lime_graphics_cairo_CairoGlyph +}; +var lime_graphics_cairo_CairoImageSurface = {}; +lime_graphics_cairo_CairoImageSurface.__properties__ = {get_width:"get_width",get_stride:"get_stride",get_height:"get_height",get_format:"get_format",get_data:"get_data"}; +lime_graphics_cairo_CairoImageSurface._new = function(format,width,height) { + return 0; +}; +lime_graphics_cairo_CairoImageSurface.create = function(data,format,width,height,stride) { + return 0; +}; +lime_graphics_cairo_CairoImageSurface.fromImage = function(image) { + return null; +}; +lime_graphics_cairo_CairoImageSurface.get_data = function(this1) { + return lime_utils_DataPointer.fromFloat(0); +}; +lime_graphics_cairo_CairoImageSurface.get_format = function(this1) { + return 0; +}; +lime_graphics_cairo_CairoImageSurface.get_height = function(this1) { + return 0; +}; +lime_graphics_cairo_CairoImageSurface.get_stride = function(this1) { + return 0; +}; +lime_graphics_cairo_CairoImageSurface.get_width = function(this1) { + return 0; +}; +var lime_graphics_cairo_CairoPattern = {}; +lime_graphics_cairo_CairoPattern.__properties__ = {set_matrix:"set_matrix",get_matrix:"get_matrix",set_filter:"set_filter",get_filter:"get_filter",set_extend:"set_extend",get_extend:"get_extend",get_colorStopCount:"get_colorStopCount"}; +lime_graphics_cairo_CairoPattern._new = function(handle) { + return handle; +}; +lime_graphics_cairo_CairoPattern.addColorStopRGB = function(this1,offset,r,g,b) { +}; +lime_graphics_cairo_CairoPattern.addColorStopRGBA = function(this1,offset,r,g,b,a) { +}; +lime_graphics_cairo_CairoPattern.createForSurface = function(surface) { + return 0; +}; +lime_graphics_cairo_CairoPattern.createLinear = function(x0,y0,x1,y1) { + return 0; +}; +lime_graphics_cairo_CairoPattern.createRadial = function(cx0,cy0,radius0,cx1,cy1,radius1) { + return 0; +}; +lime_graphics_cairo_CairoPattern.createRGB = function(r,g,b) { + return 0; +}; +lime_graphics_cairo_CairoPattern.createRGBA = function(r,g,b,a) { + return 0; +}; +lime_graphics_cairo_CairoPattern.get_colorStopCount = function(this1) { + return 0; +}; +lime_graphics_cairo_CairoPattern.get_extend = function(this1) { + return 0; +}; +lime_graphics_cairo_CairoPattern.set_extend = function(this1,value) { + return value; +}; +lime_graphics_cairo_CairoPattern.get_filter = function(this1) { + return 0; +}; +lime_graphics_cairo_CairoPattern.set_filter = function(this1,value) { + return value; +}; +lime_graphics_cairo_CairoPattern.get_matrix = function(this1) { + return null; +}; +lime_graphics_cairo_CairoPattern.set_matrix = function(this1,value) { + return value; +}; +var lime_graphics_cairo_CairoSurface = {}; +lime_graphics_cairo_CairoSurface.flush = function(this1) { +}; +var lime_graphics_opengl_GL = function() { }; +$hxClasses["lime.graphics.opengl.GL"] = lime_graphics_opengl_GL; +lime_graphics_opengl_GL.__name__ = "lime.graphics.opengl.GL"; +lime_graphics_opengl_GL.activeTexture = function(texture) { + lime_graphics_opengl_GL.context.activeTexture(texture); +}; +lime_graphics_opengl_GL.attachShader = function(program,shader) { + lime_graphics_opengl_GL.context.attachShader(program,shader); +}; +lime_graphics_opengl_GL.beginQuery = function(target,query) { + lime_graphics_opengl_GL.context.beginQuery(target,query); +}; +lime_graphics_opengl_GL.beginTransformFeedback = function(primitiveNode) { + lime_graphics_opengl_GL.context.beginTransformFeedback(primitiveNode); +}; +lime_graphics_opengl_GL.bindAttribLocation = function(program,index,name) { + lime_graphics_opengl_GL.context.bindAttribLocation(program,index,name); +}; +lime_graphics_opengl_GL.bindBuffer = function(target,buffer) { + lime_graphics_opengl_GL.context.bindBuffer(target,buffer); +}; +lime_graphics_opengl_GL.bindBufferBase = function(target,index,buffer) { + lime_graphics_opengl_GL.context.bindBufferBase(target,index,buffer); +}; +lime_graphics_opengl_GL.bindBufferRange = function(target,index,buffer,offset,size) { + lime_graphics_opengl_GL.context.bindBufferRange(target,index,buffer,offset,lime_utils_DataPointer.fromFloat(size)); +}; +lime_graphics_opengl_GL.bindFramebuffer = function(target,framebuffer) { + lime_graphics_opengl_GL.context.bindFramebuffer(target,framebuffer); +}; +lime_graphics_opengl_GL.bindRenderbuffer = function(target,renderbuffer) { + lime_graphics_opengl_GL.context.bindRenderbuffer(target,renderbuffer); +}; +lime_graphics_opengl_GL.bindSampler = function(unit,sampler) { + lime_graphics_opengl_GL.context.bindSampler(unit,sampler); +}; +lime_graphics_opengl_GL.bindTexture = function(target,texture) { + lime_graphics_opengl_GL.context.bindTexture(target,texture); +}; +lime_graphics_opengl_GL.bindTransformFeedback = function(target,transformFeedback) { + lime_graphics_opengl_GL.context.bindTransformFeedback(target,transformFeedback); +}; +lime_graphics_opengl_GL.bindVertexArray = function(vertexArray) { + lime_graphics_opengl_GL.context.bindVertexArray(vertexArray); +}; +lime_graphics_opengl_GL.blitFramebuffer = function(srcX0,srcY0,srcX1,srcY1,dstX0,dstY0,dstX1,dstY1,mask,filter) { + lime_graphics_opengl_GL.context.blitFramebuffer(srcX0,srcY0,srcX1,srcY1,dstX0,dstY0,dstX1,dstY1,mask,filter); +}; +lime_graphics_opengl_GL.blendColor = function(red,green,blue,alpha) { + lime_graphics_opengl_GL.context.blendColor(red,green,blue,alpha); +}; +lime_graphics_opengl_GL.blendEquation = function(mode) { + lime_graphics_opengl_GL.context.blendEquation(mode); +}; +lime_graphics_opengl_GL.blendEquationSeparate = function(modeRGB,modeAlpha) { + lime_graphics_opengl_GL.context.blendEquationSeparate(modeRGB,modeAlpha); +}; +lime_graphics_opengl_GL.blendFunc = function(sfactor,dfactor) { + lime_graphics_opengl_GL.context.blendFunc(sfactor,dfactor); +}; +lime_graphics_opengl_GL.blendFuncSeparate = function(srcRGB,dstRGB,srcAlpha,dstAlpha) { + lime_graphics_opengl_GL.context.blendFuncSeparate(srcRGB,dstRGB,srcAlpha,dstAlpha); +}; +lime_graphics_opengl_GL.bufferDataWEBGL = function(target,srcData,usage,srcOffset,length) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.bufferData(target,srcData,usage,srcOffset,length); + } else { + this1.bufferData(target,srcData,usage); + } +}; +lime_graphics_opengl_GL.bufferSubDataWEBGL = function(target,dstByteOffset,srcData,srcOffset,length) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.bufferSubData(target,dstByteOffset,srcData,srcOffset,length); + } else { + this1.bufferSubData(target,dstByteOffset,srcData); + } +}; +lime_graphics_opengl_GL.checkFramebufferStatus = function(target) { + return lime_graphics_opengl_GL.context.checkFramebufferStatus(target); +}; +lime_graphics_opengl_GL.clear = function(mask) { + lime_graphics_opengl_GL.context.clear(mask); +}; +lime_graphics_opengl_GL.clearBufferfi = function(buffer,drawbuffer,depth,stencil) { + lime_graphics_opengl_GL.context.clearBufferfi(buffer,drawbuffer,depth,stencil); +}; +lime_graphics_opengl_GL.clearBufferfvWEBGL = function(buffer,drawbuffer,values,srcOffset) { + lime_graphics_opengl_GL.context.clearBufferfv(buffer,drawbuffer,values,srcOffset); +}; +lime_graphics_opengl_GL.clearBufferivWEBGL = function(buffer,drawbuffer,values,srcOffset) { + lime_graphics_opengl_GL.context.clearBufferiv(buffer,drawbuffer,values,srcOffset); +}; +lime_graphics_opengl_GL.clearBufferuivWEBGL = function(buffer,drawbuffer,values,srcOffset) { + lime_graphics_opengl_GL.context.clearBufferuiv(buffer,drawbuffer,values,srcOffset); +}; +lime_graphics_opengl_GL.clearColor = function(red,green,blue,alpha) { + lime_graphics_opengl_GL.context.clearColor(red,green,blue,alpha); +}; +lime_graphics_opengl_GL.clearDepth = function(depth) { + lime_graphics_opengl_GL.context.clearDepth(depth); +}; +lime_graphics_opengl_GL.clearStencil = function(s) { + lime_graphics_opengl_GL.context.clearStencil(s); +}; +lime_graphics_opengl_GL.clientWaitSync = function(sync,flags,timeout) { + return lime_graphics_opengl_GL.context.clientWaitSync(sync,flags,timeout); +}; +lime_graphics_opengl_GL.colorMask = function(red,green,blue,alpha) { + lime_graphics_opengl_GL.context.colorMask(red,green,blue,alpha); +}; +lime_graphics_opengl_GL.compileShader = function(shader) { + lime_graphics_opengl_GL.context.compileShader(shader); +}; +lime_graphics_opengl_GL.compressedTexImage2DWEBGL = function(target,level,internalformat,width,height,border,srcData,srcOffset,srcLengthOverride) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData,srcOffset,srcLengthOverride); + } else { + this1.compressedTexImage2D(target,level,internalformat,width,height,border,srcData); + } +}; +lime_graphics_opengl_GL.compressedTexImage3DWEBGL = function(target,level,internalformat,width,height,depth,border,srcData,srcOffset,srcLengthOverride) { + lime_graphics_opengl_GL.context.compressedTexImage3D(target,level,internalformat,width,height,depth,border,srcData,srcOffset,srcLengthOverride); +}; +lime_graphics_opengl_GL.compressedTexSubImage2DWEBGL = function(target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,srcLengthOverride) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData,srcOffset,srcLengthOverride); + } else { + this1.compressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,srcData); + } +}; +lime_graphics_opengl_GL.compressedTexSubImage3DWEBGL = function(target,level,xoffset,yoffset,zoffset,width,height,depth,format,srcData,srcOffset,srcLengthOverride) { + lime_graphics_opengl_GL.context.compressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,srcData,srcOffset,srcLengthOverride); +}; +lime_graphics_opengl_GL.copyTexImage2D = function(target,level,internalformat,x,y,width,height,border) { + lime_graphics_opengl_GL.context.copyTexImage2D(target,level,internalformat,x,y,width,height,border); +}; +lime_graphics_opengl_GL.copyTexSubImage2D = function(target,level,xoffset,yoffset,x,y,width,height) { + lime_graphics_opengl_GL.context.copyTexSubImage2D(target,level,xoffset,yoffset,x,y,width,height); +}; +lime_graphics_opengl_GL.copyTexSubImage3D = function(target,level,xoffset,yoffset,zoffset,x,y,width,height) { + lime_graphics_opengl_GL.context.copyTexSubImage3D(target,level,xoffset,yoffset,zoffset,x,y,width,height); +}; +lime_graphics_opengl_GL.createBuffer = function() { + return lime_graphics_opengl_GL.context.createBuffer(); +}; +lime_graphics_opengl_GL.createFramebuffer = function() { + return lime_graphics_opengl_GL.context.createFramebuffer(); +}; +lime_graphics_opengl_GL.createProgram = function() { + return lime_graphics_opengl_GL.context.createProgram(); +}; +lime_graphics_opengl_GL.createQuery = function() { + return lime_graphics_opengl_GL.context.createQuery(); +}; +lime_graphics_opengl_GL.createRenderbuffer = function() { + return lime_graphics_opengl_GL.context.createRenderbuffer(); +}; +lime_graphics_opengl_GL.createSampler = function() { + return lime_graphics_opengl_GL.context.createSampler(); +}; +lime_graphics_opengl_GL.createShader = function(type) { + return lime_graphics_opengl_GL.context.createShader(type); +}; +lime_graphics_opengl_GL.createTexture = function() { + return lime_graphics_opengl_GL.context.createTexture(); +}; +lime_graphics_opengl_GL.createTransformFeedback = function() { + return lime_graphics_opengl_GL.context.createTransformFeedback(); +}; +lime_graphics_opengl_GL.createVertexArray = function() { + return lime_graphics_opengl_GL.context.createVertexArray(); +}; +lime_graphics_opengl_GL.cullFace = function(mode) { + lime_graphics_opengl_GL.context.cullFace(mode); +}; +lime_graphics_opengl_GL.deleteBuffer = function(buffer) { + lime_graphics_opengl_GL.context.deleteBuffer(buffer); +}; +lime_graphics_opengl_GL.deleteFramebuffer = function(framebuffer) { + lime_graphics_opengl_GL.context.deleteFramebuffer(framebuffer); +}; +lime_graphics_opengl_GL.deleteProgram = function(program) { + lime_graphics_opengl_GL.context.deleteProgram(program); +}; +lime_graphics_opengl_GL.deleteQuery = function(query) { + lime_graphics_opengl_GL.context.deleteQuery(query); +}; +lime_graphics_opengl_GL.deleteRenderbuffer = function(renderbuffer) { + lime_graphics_opengl_GL.context.deleteRenderbuffer(renderbuffer); +}; +lime_graphics_opengl_GL.deleteSampler = function(sampler) { + lime_graphics_opengl_GL.context.deleteSampler(sampler); +}; +lime_graphics_opengl_GL.deleteShader = function(shader) { + lime_graphics_opengl_GL.context.deleteShader(shader); +}; +lime_graphics_opengl_GL.deleteSync = function(sync) { + lime_graphics_opengl_GL.context.deleteSync(sync); +}; +lime_graphics_opengl_GL.deleteTexture = function(texture) { + lime_graphics_opengl_GL.context.deleteTexture(texture); +}; +lime_graphics_opengl_GL.deleteTransformFeedback = function(transformFeedback) { + lime_graphics_opengl_GL.context.deleteTransformFeedback(transformFeedback); +}; +lime_graphics_opengl_GL.deleteVertexArray = function(vertexArray) { + lime_graphics_opengl_GL.context.deleteVertexArray(vertexArray); +}; +lime_graphics_opengl_GL.depthFunc = function(func) { + lime_graphics_opengl_GL.context.depthFunc(func); +}; +lime_graphics_opengl_GL.depthMask = function(flag) { + lime_graphics_opengl_GL.context.depthMask(flag); +}; +lime_graphics_opengl_GL.depthRange = function(zNear,zFar) { + lime_graphics_opengl_GL.context.depthRange(zNear,zFar); +}; +lime_graphics_opengl_GL.detachShader = function(program,shader) { + lime_graphics_opengl_GL.context.detachShader(program,shader); +}; +lime_graphics_opengl_GL.disable = function(cap) { + lime_graphics_opengl_GL.context.disable(cap); +}; +lime_graphics_opengl_GL.disableVertexAttribArray = function(index) { + lime_graphics_opengl_GL.context.disableVertexAttribArray(index); +}; +lime_graphics_opengl_GL.drawArrays = function(mode,first,count) { + lime_graphics_opengl_GL.context.drawArrays(mode,first,count); +}; +lime_graphics_opengl_GL.drawArraysInstanced = function(mode,first,count,instanceCount) { + lime_graphics_opengl_GL.context.drawArraysInstanced(mode,first,count,instanceCount); +}; +lime_graphics_opengl_GL.drawBuffers = function(buffers) { + lime_graphics_opengl_GL.context.drawBuffers(buffers); +}; +lime_graphics_opengl_GL.drawElements = function(mode,count,type,offset) { + lime_graphics_opengl_GL.context.drawElements(mode,count,type,offset); +}; +lime_graphics_opengl_GL.drawElementsInstanced = function(mode,count,type,offset,instanceCount) { + lime_graphics_opengl_GL.context.drawElementsInstanced(mode,count,type,offset,instanceCount); +}; +lime_graphics_opengl_GL.drawRangeElements = function(mode,start,end,count,type,offset) { + lime_graphics_opengl_GL.context.drawRangeElements(mode,start,end,count,type,offset); +}; +lime_graphics_opengl_GL.enable = function(cap) { + lime_graphics_opengl_GL.context.enable(cap); +}; +lime_graphics_opengl_GL.enableVertexAttribArray = function(index) { + lime_graphics_opengl_GL.context.enableVertexAttribArray(index); +}; +lime_graphics_opengl_GL.endQuery = function(target) { + lime_graphics_opengl_GL.context.endQuery(target); +}; +lime_graphics_opengl_GL.endTransformFeedback = function() { + lime_graphics_opengl_GL.context.endTransformFeedback(); +}; +lime_graphics_opengl_GL.fenceSync = function(condition,flags) { + return lime_graphics_opengl_GL.context.fenceSync(condition,flags); +}; +lime_graphics_opengl_GL.finish = function() { + lime_graphics_opengl_GL.context.finish(); +}; +lime_graphics_opengl_GL.flush = function() { + lime_graphics_opengl_GL.context.flush(); +}; +lime_graphics_opengl_GL.framebufferRenderbuffer = function(target,attachment,renderbuffertarget,renderbuffer) { + lime_graphics_opengl_GL.context.framebufferRenderbuffer(target,attachment,renderbuffertarget,renderbuffer); +}; +lime_graphics_opengl_GL.framebufferTexture2D = function(target,attachment,textarget,texture,level) { + lime_graphics_opengl_GL.context.framebufferTexture2D(target,attachment,textarget,texture,level); +}; +lime_graphics_opengl_GL.framebufferTextureLayer = function(target,attachment,texture,level,layer) { + lime_graphics_opengl_GL.context.framebufferTextureLayer(target,attachment,texture,level,layer); +}; +lime_graphics_opengl_GL.frontFace = function(mode) { + lime_graphics_opengl_GL.context.frontFace(mode); +}; +lime_graphics_opengl_GL.generateMipmap = function(target) { + lime_graphics_opengl_GL.context.generateMipmap(target); +}; +lime_graphics_opengl_GL.getActiveAttrib = function(program,index) { + return lime_graphics_opengl_GL.context.getActiveAttrib(program,index); +}; +lime_graphics_opengl_GL.getActiveUniform = function(program,index) { + return lime_graphics_opengl_GL.context.getActiveUniform(program,index); +}; +lime_graphics_opengl_GL.getActiveUniformBlockName = function(program,uniformBlockIndex) { + return lime_graphics_opengl_GL.context.getActiveUniformBlockName(program,uniformBlockIndex); +}; +lime_graphics_opengl_GL.getActiveUniformBlockParameter = function(program,uniformBlockIndex,pname) { + return lime_graphics_opengl_GL.context.getActiveUniformBlockParameter(program,uniformBlockIndex,pname); +}; +lime_graphics_opengl_GL.getActiveUniforms = function(program,uniformIndices,pname) { + return lime_graphics_opengl_GL.context.getActiveUniforms(program,uniformIndices,pname); +}; +lime_graphics_opengl_GL.getAttachedShaders = function(program) { + return lime_graphics_opengl_GL.context.getAttachedShaders(program); +}; +lime_graphics_opengl_GL.getAttribLocation = function(program,name) { + return lime_graphics_opengl_GL.context.getAttribLocation(program,name); +}; +lime_graphics_opengl_GL.getBufferParameter = function(target,pname) { + return lime_graphics_opengl_GL.context.getBufferParameter(target,pname); +}; +lime_graphics_opengl_GL.getBufferSubDataWEBGL = function(target,srcByteOffset,dstData,srcOffset,length) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.getBufferSubData(target,srcByteOffset,dstData,srcOffset,length); + } else { + this1.getBufferSubData(target,srcByteOffset,dstData); + } +}; +lime_graphics_opengl_GL.getContextAttributes = function() { + return lime_graphics_opengl_GL.context.getContextAttributes(); +}; +lime_graphics_opengl_GL.getError = function() { + return lime_graphics_opengl_GL.context.getError(); +}; +lime_graphics_opengl_GL.getExtension = function(name) { + return lime_graphics_opengl_GL.context.getExtension(name); +}; +lime_graphics_opengl_GL.getFragDataLocation = function(program,name) { + return lime_graphics_opengl_GL.context.getFragDataLocation(program,name); +}; +lime_graphics_opengl_GL.getFramebufferAttachmentParameter = function(target,attachment,pname) { + return lime_graphics_opengl_GL.context.getFramebufferAttachmentParameter(target,attachment,pname); +}; +lime_graphics_opengl_GL.getIndexedParameter = function(target,index) { + return lime_graphics_opengl_GL.context.getIndexedParameter(target,index); +}; +lime_graphics_opengl_GL.getInternalformatParameter = function(target,internalformat,pname) { + return lime_graphics_opengl_GL.context.getInternalformatParameter(target,internalformat,pname); +}; +lime_graphics_opengl_GL.getParameter = function(pname) { + return lime_graphics_opengl_GL.context.getParameter(pname); +}; +lime_graphics_opengl_GL.getProgramInfoLog = function(program) { + return lime_graphics_opengl_GL.context.getProgramInfoLog(program); +}; +lime_graphics_opengl_GL.getProgramParameter = function(program,pname) { + return lime_graphics_opengl_GL.context.getProgramParameter(program,pname); +}; +lime_graphics_opengl_GL.getQuery = function(target,pname) { + return lime_graphics_opengl_GL.context.getQuery(target,pname); +}; +lime_graphics_opengl_GL.getQueryParameter = function(query,pname) { + return lime_graphics_opengl_GL.context.getQueryParameter(query,pname); +}; +lime_graphics_opengl_GL.getRenderbufferParameter = function(target,pname) { + return lime_graphics_opengl_GL.context.getRenderbufferParameter(target,pname); +}; +lime_graphics_opengl_GL.getSamplerParameter = function(sampler,pname) { + return lime_graphics_opengl_GL.context.getSamplerParameter(sampler,pname); +}; +lime_graphics_opengl_GL.getShaderInfoLog = function(shader) { + return lime_graphics_opengl_GL.context.getShaderInfoLog(shader); +}; +lime_graphics_opengl_GL.getShaderParameter = function(shader,pname) { + return lime_graphics_opengl_GL.context.getShaderParameter(shader,pname); +}; +lime_graphics_opengl_GL.getShaderPrecisionFormat = function(shadertype,precisiontype) { + return lime_graphics_opengl_GL.context.getShaderPrecisionFormat(shadertype,precisiontype); +}; +lime_graphics_opengl_GL.getShaderSource = function(shader) { + return lime_graphics_opengl_GL.context.getShaderSource(shader); +}; +lime_graphics_opengl_GL.getSupportedExtensions = function() { + return lime_graphics_opengl_GL.context.getSupportedExtensions(); +}; +lime_graphics_opengl_GL.getSyncParameter = function(sync,pname) { + return lime_graphics_opengl_GL.context.getSyncParameter(sync,pname); +}; +lime_graphics_opengl_GL.getTexParameter = function(target,pname) { + return lime_graphics_opengl_GL.context.getTexParameter(target,pname); +}; +lime_graphics_opengl_GL.getTransformFeedbackVarying = function(program,index) { + return lime_graphics_opengl_GL.context.getTransformFeedbackVarying(program,index); +}; +lime_graphics_opengl_GL.getUniform = function(program,location) { + return lime_graphics_opengl_GL.context.getUniform(program,location); +}; +lime_graphics_opengl_GL.getUniformBlockIndex = function(program,uniformBlockName) { + return lime_graphics_opengl_GL.context.getUniformBlockIndex(program,uniformBlockName); +}; +lime_graphics_opengl_GL.getUniformIndices = function(program,uniformNames) { + return lime_graphics_opengl_GL.context.getUniformIndices(program,uniformNames); +}; +lime_graphics_opengl_GL.getUniformLocation = function(program,name) { + return lime_graphics_opengl_GL.context.getUniformLocation(program,name); +}; +lime_graphics_opengl_GL.getVertexAttrib = function(index,pname) { + return lime_graphics_opengl_GL.context.getVertexAttrib(index,pname); +}; +lime_graphics_opengl_GL.getVertexAttribOffset = function(index,pname) { + return lime_utils_DataPointer.fromFloat(lime_graphics_opengl_GL.context.getVertexAttribOffset(index,pname)); +}; +lime_graphics_opengl_GL.hint = function(target,mode) { + lime_graphics_opengl_GL.context.hint(target,mode); +}; +lime_graphics_opengl_GL.invalidateFramebuffer = function(target,attachments) { + lime_graphics_opengl_GL.context.invalidateFramebuffer(target,attachments); +}; +lime_graphics_opengl_GL.invalidateSubFramebuffer = function(target,attachments,x,y,width,height) { + lime_graphics_opengl_GL.context.invalidateSubFramebuffer(target,attachments,x,y,width,height); +}; +lime_graphics_opengl_GL.isBuffer = function(buffer) { + return lime_graphics_opengl_GL.context.isBuffer(buffer); +}; +lime_graphics_opengl_GL.isContextLost = function() { + return lime_graphics_opengl_GL.context.isContextLost(); +}; +lime_graphics_opengl_GL.isEnabled = function(cap) { + return lime_graphics_opengl_GL.context.isEnabled(cap); +}; +lime_graphics_opengl_GL.isFramebuffer = function(framebuffer) { + return lime_graphics_opengl_GL.context.isFramebuffer(framebuffer); +}; +lime_graphics_opengl_GL.isProgram = function(program) { + return lime_graphics_opengl_GL.context.isProgram(program); +}; +lime_graphics_opengl_GL.isQuery = function(query) { + return lime_graphics_opengl_GL.context.isQuery(query); +}; +lime_graphics_opengl_GL.isRenderbuffer = function(renderbuffer) { + return lime_graphics_opengl_GL.context.isRenderbuffer(renderbuffer); +}; +lime_graphics_opengl_GL.isSampler = function(sampler) { + return lime_graphics_opengl_GL.context.isSampler(sampler); +}; +lime_graphics_opengl_GL.isShader = function(shader) { + return lime_graphics_opengl_GL.context.isShader(shader); +}; +lime_graphics_opengl_GL.isSync = function(sync) { + return lime_graphics_opengl_GL.context.isSync(sync); +}; +lime_graphics_opengl_GL.isTexture = function(texture) { + return lime_graphics_opengl_GL.context.isTexture(texture); +}; +lime_graphics_opengl_GL.isTransformFeedback = function(transformFeedback) { + return lime_graphics_opengl_GL.context.isTransformFeedback(transformFeedback); +}; +lime_graphics_opengl_GL.isVertexArray = function(vertexArray) { + return lime_graphics_opengl_GL.context.isVertexArray(vertexArray); +}; +lime_graphics_opengl_GL.lineWidth = function(width) { + lime_graphics_opengl_GL.context.lineWidth(width); +}; +lime_graphics_opengl_GL.linkProgram = function(program) { + lime_graphics_opengl_GL.context.linkProgram(program); +}; +lime_graphics_opengl_GL.pauseTransformFeedback = function() { + lime_graphics_opengl_GL.context.pauseTransformFeedback(); +}; +lime_graphics_opengl_GL.pixelStorei = function(pname,param) { + lime_graphics_opengl_GL.context.pixelStorei(pname,param); +}; +lime_graphics_opengl_GL.polygonOffset = function(factor,units) { + lime_graphics_opengl_GL.context.polygonOffset(factor,units); +}; +lime_graphics_opengl_GL.readBuffer = function(src) { + lime_graphics_opengl_GL.context.readBuffer(src); +}; +lime_graphics_opengl_GL.readPixelsWEBGL = function(x,y,width,height,format,type,pixels,dstOffset) { + var this1 = lime_graphics_opengl_GL.context; + if(dstOffset != null) { + this1.readPixels(x,y,width,height,format,type,pixels,dstOffset); + } else { + this1.readPixels(x,y,width,height,format,type,pixels); + } +}; +lime_graphics_opengl_GL.renderbufferStorage = function(target,internalformat,width,height) { + lime_graphics_opengl_GL.context.renderbufferStorage(target,internalformat,width,height); +}; +lime_graphics_opengl_GL.renderbufferStorageMultisample = function(target,samples,internalformat,width,height) { + lime_graphics_opengl_GL.context.renderbufferStorageMultisample(target,samples,internalformat,width,height); +}; +lime_graphics_opengl_GL.resumeTransformFeedback = function() { + lime_graphics_opengl_GL.context.resumeTransformFeedback(); +}; +lime_graphics_opengl_GL.sampleCoverage = function(value,invert) { + lime_graphics_opengl_GL.context.sampleCoverage(value,invert); +}; +lime_graphics_opengl_GL.samplerParameterf = function(sampler,pname,param) { + lime_graphics_opengl_GL.context.samplerParameterf(sampler,pname,param); +}; +lime_graphics_opengl_GL.samplerParameteri = function(sampler,pname,param) { + lime_graphics_opengl_GL.context.samplerParameteri(sampler,pname,param); +}; +lime_graphics_opengl_GL.scissor = function(x,y,width,height) { + lime_graphics_opengl_GL.context.scissor(x,y,width,height); +}; +lime_graphics_opengl_GL.shaderSource = function(shader,source) { + lime_graphics_opengl_GL.context.shaderSource(shader,source); +}; +lime_graphics_opengl_GL.stencilFunc = function(func,ref,mask) { + lime_graphics_opengl_GL.context.stencilFunc(func,ref,mask); +}; +lime_graphics_opengl_GL.stencilFuncSeparate = function(face,func,ref,mask) { + lime_graphics_opengl_GL.context.stencilFuncSeparate(face,func,ref,mask); +}; +lime_graphics_opengl_GL.stencilMask = function(mask) { + lime_graphics_opengl_GL.context.stencilMask(mask); +}; +lime_graphics_opengl_GL.stencilMaskSeparate = function(face,mask) { + lime_graphics_opengl_GL.context.stencilMaskSeparate(face,mask); +}; +lime_graphics_opengl_GL.stencilOp = function(fail,zfail,zpass) { + lime_graphics_opengl_GL.context.stencilOp(fail,zfail,zpass); +}; +lime_graphics_opengl_GL.stencilOpSeparate = function(face,fail,zfail,zpass) { + lime_graphics_opengl_GL.context.stencilOpSeparate(face,fail,zfail,zpass); +}; +lime_graphics_opengl_GL.texImage2DWEBGL = function(target,level,internalformat,width,height,border,format,type,srcData,srcOffset) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData,srcOffset); + } else if(format != null) { + this1.texImage2D(target,level,internalformat,width,height,border,format,type,srcData); + } else { + this1.texImage2D(target,level,internalformat,width,height,border); + } +}; +lime_graphics_opengl_GL.texImage3DWEBGL = function(target,level,internalformat,width,height,depth,border,format,type,srcData,srcOffset) { + lime_graphics_opengl_GL.context.texImage3D(target,level,internalformat,width,height,depth,border,format,type,srcData,srcOffset); +}; +lime_graphics_opengl_GL.texStorage2D = function(target,level,internalformat,width,height) { + lime_graphics_opengl_GL.context.texStorage2D(target,level,internalformat,width,height); +}; +lime_graphics_opengl_GL.texStorage3D = function(target,level,internalformat,width,height,depth) { + lime_graphics_opengl_GL.context.texStorage3D(target,level,internalformat,width,height,depth); +}; +lime_graphics_opengl_GL.texParameterf = function(target,pname,param) { + lime_graphics_opengl_GL.context.texParameterf(target,pname,param); +}; +lime_graphics_opengl_GL.texParameteri = function(target,pname,param) { + lime_graphics_opengl_GL.context.texParameteri(target,pname,param); +}; +lime_graphics_opengl_GL.texSubImage2DWEBGL = function(target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData,srcOffset); + } else if(type != null) { + this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format,type,srcData); + } else { + this1.texSubImage2D(target,level,xoffset,yoffset,width,height,format); + } +}; +lime_graphics_opengl_GL.texSubImage3DWEBGL = function(target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,source,srcOffset) { + lime_graphics_opengl_GL.context.texSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,source,srcOffset); +}; +lime_graphics_opengl_GL.transformFeedbackVaryings = function(program,varyings,bufferMode) { + lime_graphics_opengl_GL.context.transformFeedbackVaryings(program,varyings,bufferMode); +}; +lime_graphics_opengl_GL.uniform1f = function(location,v0) { + lime_graphics_opengl_GL.context.uniform1f(location,v0); +}; +lime_graphics_opengl_GL.uniform1fvWEBGL = function(location,data,srcOffset,srcLength) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.uniform1fv(location,data,srcOffset,srcLength); + } else { + this1.uniform1fv(location,data); + } +}; +lime_graphics_opengl_GL.uniform1i = function(location,v0) { + lime_graphics_opengl_GL.context.uniform1i(location,v0); +}; +lime_graphics_opengl_GL.uniform1ivWEBGL = function(location,data,srcOffset,srcLength) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.uniform1iv(location,data,srcOffset,srcLength); + } else { + this1.uniform1iv(location,data); + } +}; +lime_graphics_opengl_GL.uniform1ui = function(location,v0) { + lime_graphics_opengl_GL.context.uniform1ui(location,v0); +}; +lime_graphics_opengl_GL.uniform1uivWEBGL = function(location,data,srcOffset,srcLength) { + lime_graphics_opengl_GL.context.uniform1uiv(location,data,srcOffset,srcLength); +}; +lime_graphics_opengl_GL.uniform2f = function(location,v0,v1) { + lime_graphics_opengl_GL.context.uniform2f(location,v0,v1); +}; +lime_graphics_opengl_GL.uniform2fvWEBGL = function(location,data,srcOffset,srcLength) { + lime_graphics_WebGL2RenderContext.uniform2fv(lime_graphics_opengl_GL.context,location,data,srcOffset,srcLength); +}; +lime_graphics_opengl_GL.uniform2i = function(location,x,y) { + lime_graphics_opengl_GL.context.uniform2i(location,x,y); +}; +lime_graphics_opengl_GL.uniform2ivWEBGL = function(location,data,srcOffset,srcLength) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.uniform2iv(location,data,srcOffset,srcLength); + } else { + this1.uniform2iv(location,data); + } +}; +lime_graphics_opengl_GL.uniform2ui = function(location,x,y) { + lime_graphics_opengl_GL.context.uniform2ui(location,x,y); +}; +lime_graphics_opengl_GL.uniform2uivWEBGL = function(location,data,srcOffset,srcLength) { + lime_graphics_opengl_GL.context.uniform2uiv(location,data,srcOffset,srcLength); +}; +lime_graphics_opengl_GL.uniform3f = function(location,v0,v1,v2) { + lime_graphics_opengl_GL.context.uniform3f(location,v0,v1,v2); +}; +lime_graphics_opengl_GL.uniform3fvWEBGL = function(location,data,srcOffset,srcLength) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.uniform3fv(location,data,srcOffset,srcLength); + } else { + this1.uniform3fv(location,data); + } +}; +lime_graphics_opengl_GL.uniform3i = function(location,v0,v1,v2) { + lime_graphics_opengl_GL.context.uniform3i(location,v0,v1,v2); +}; +lime_graphics_opengl_GL.uniform3ivWEBGL = function(location,data,srcOffset,srcLength) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.uniform3iv(location,data,srcOffset,srcLength); + } else { + this1.uniform3iv(location,data); + } +}; +lime_graphics_opengl_GL.uniform3ui = function(location,v0,v1,v2) { + lime_graphics_opengl_GL.context.uniform3ui(location,v0,v1,v2); +}; +lime_graphics_opengl_GL.uniform3uivWEBGL = function(location,data,srcOffset,srcLength) { + lime_graphics_opengl_GL.context.uniform3uiv(location,data,srcOffset,srcLength); +}; +lime_graphics_opengl_GL.uniform4f = function(location,v0,v1,v2,v3) { + lime_graphics_opengl_GL.context.uniform4f(location,v0,v1,v2,v3); +}; +lime_graphics_opengl_GL.uniform4fvWEBGL = function(location,data,srcOffset,srcLength) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.uniform4fv(location,data,srcOffset,srcLength); + } else { + this1.uniform4fv(location,data); + } +}; +lime_graphics_opengl_GL.uniform4i = function(location,v0,v1,v2,v3) { + lime_graphics_opengl_GL.context.uniform4i(location,v0,v1,v2,v3); +}; +lime_graphics_opengl_GL.uniform4ivWEBGL = function(location,data,srcOffset,srcLength) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.uniform4iv(location,data,srcOffset,srcLength); + } else { + this1.uniform4iv(location,data); + } +}; +lime_graphics_opengl_GL.uniform4ui = function(location,v0,v1,v2,v3) { + lime_graphics_opengl_GL.context.uniform4ui(location,v0,v1,v2,v3); +}; +lime_graphics_opengl_GL.uniform4uivWEBGL = function(location,data,srcOffset,srcLength) { + lime_graphics_opengl_GL.context.uniform4uiv(location,data,srcOffset,srcLength); +}; +lime_graphics_opengl_GL.uniformBlockBinding = function(program,uniformBlockIndex,uniformBlockBinding) { + lime_graphics_opengl_GL.context.uniformBlockBinding(program,uniformBlockIndex,uniformBlockBinding); +}; +lime_graphics_opengl_GL.uniformMatrix2fvWEBGL = function(location,transpose,v,srcOffset,srcLength) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.uniformMatrix2fv(location,transpose,v,srcOffset,srcLength); + } else { + this1.uniformMatrix2fv(location,transpose,v); + } +}; +lime_graphics_opengl_GL.uniformMatrix2x3fvWEBGL = function(location,transpose,v,srcOffset,srcLength) { + lime_graphics_opengl_GL.context.uniformMatrix2x3fv(location,transpose,v,srcOffset,srcLength); +}; +lime_graphics_opengl_GL.uniformMatrix2x4fvWEBGL = function(location,transpose,v,srcOffset,srcLength) { + lime_graphics_opengl_GL.context.uniformMatrix2x4fv(location,transpose,v,srcOffset,srcLength); +}; +lime_graphics_opengl_GL.uniformMatrix3fvWEBGL = function(location,transpose,v,srcOffset,srcLength) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.uniformMatrix3fv(location,transpose,v,srcOffset,srcLength); + } else { + this1.uniformMatrix3fv(location,transpose,v); + } +}; +lime_graphics_opengl_GL.uniformMatrix3x2fvWEBGL = function(location,transpose,v,srcOffset,srcLength) { + lime_graphics_opengl_GL.context.uniformMatrix3x2fv(location,transpose,v,srcOffset,srcLength); +}; +lime_graphics_opengl_GL.uniformMatrix3x4fvWEBGL = function(location,transpose,v,srcOffset,srcLength) { + lime_graphics_opengl_GL.context.uniformMatrix3x4fv(location,transpose,v,srcOffset,srcLength); +}; +lime_graphics_opengl_GL.uniformMatrix4fvWEBGL = function(location,transpose,v,srcOffset,srcLength) { + var this1 = lime_graphics_opengl_GL.context; + if(srcOffset != null) { + this1.uniformMatrix4fv(location,transpose,v,srcOffset,srcLength); + } else { + this1.uniformMatrix4fv(location,transpose,v); + } +}; +lime_graphics_opengl_GL.uniformMatrix4x2fvWEBGL = function(location,transpose,v,srcOffset,srcLength) { + lime_graphics_opengl_GL.context.uniformMatrix4x2fv(location,transpose,v,srcOffset,srcLength); +}; +lime_graphics_opengl_GL.uniformMatrix4x3fvWEBGL = function(location,transpose,v,srcOffset,srcLength) { + lime_graphics_opengl_GL.context.uniformMatrix4x3fv(location,transpose,v,srcOffset,srcLength); +}; +lime_graphics_opengl_GL.useProgram = function(program) { + lime_graphics_opengl_GL.context.useProgram(program); +}; +lime_graphics_opengl_GL.validateProgram = function(program) { + lime_graphics_opengl_GL.context.validateProgram(program); +}; +lime_graphics_opengl_GL.vertexAttrib1f = function(index,v0) { + lime_graphics_opengl_GL.context.vertexAttrib1f(index,v0); +}; +lime_graphics_opengl_GL.vertexAttrib1fv = function(index,v) { + lime_graphics_opengl_GL.context.vertexAttrib1fv(index,v); +}; +lime_graphics_opengl_GL.vertexAttrib1fvWEBGL = function(index,v) { + lime_graphics_opengl_GL.context.vertexAttrib1fv(index,v); +}; +lime_graphics_opengl_GL.vertexAttrib2f = function(index,v0,v1) { + lime_graphics_opengl_GL.context.vertexAttrib2f(index,v0,v1); +}; +lime_graphics_opengl_GL.vertexAttrib2fv = function(index,v) { + lime_graphics_opengl_GL.context.vertexAttrib2fv(index,v); +}; +lime_graphics_opengl_GL.vertexAttrib2fvWEBGL = function(index,v) { + lime_graphics_opengl_GL.context.vertexAttrib2fv(index,v); +}; +lime_graphics_opengl_GL.vertexAttrib3f = function(index,v0,v1,v2) { + lime_graphics_opengl_GL.context.vertexAttrib3f(index,v0,v1,v2); +}; +lime_graphics_opengl_GL.vertexAttrib3fv = function(index,v) { + lime_graphics_opengl_GL.context.vertexAttrib3fv(index,v); +}; +lime_graphics_opengl_GL.vertexAttrib3fvWEBGL = function(index,v) { + lime_graphics_opengl_GL.context.vertexAttrib3fv(index,v); +}; +lime_graphics_opengl_GL.vertexAttrib4f = function(index,v0,v1,v2,v3) { + lime_graphics_opengl_GL.context.vertexAttrib4f(index,v0,v1,v2,v3); +}; +lime_graphics_opengl_GL.vertexAttrib4fv = function(index,v) { + lime_graphics_opengl_GL.context.vertexAttrib4fv(index,v); +}; +lime_graphics_opengl_GL.vertexAttrib4fvWEBGL = function(index,v) { + lime_graphics_opengl_GL.context.vertexAttrib4fv(index,v); +}; +lime_graphics_opengl_GL.vertexAttribDivisor = function(index,divisor) { + lime_graphics_opengl_GL.context.vertexAttribDivisor(index,divisor); +}; +lime_graphics_opengl_GL.vertexAttribI4i = function(index,v0,v1,v2,v3) { + lime_graphics_opengl_GL.context.vertexAttribI4i(index,v0,v1,v2,v3); +}; +lime_graphics_opengl_GL.vertexAttribI4iv = function(index,v) { + lime_graphics_opengl_GL.context.vertexAttribI4iv(index,v); +}; +lime_graphics_opengl_GL.vertexAttribI4ivWEBGL = function(index,v) { + lime_graphics_opengl_GL.context.vertexAttribI4iv(index,v); +}; +lime_graphics_opengl_GL.vertexAttribI4ui = function(index,v0,v1,v2,v3) { + lime_graphics_opengl_GL.context.vertexAttribI4ui(index,v0,v1,v2,v3); +}; +lime_graphics_opengl_GL.vertexAttribI4uiv = function(index,v) { + lime_graphics_opengl_GL.context.vertexAttribI4uiv(index,v); +}; +lime_graphics_opengl_GL.vertexAttribI4uivWEBGL = function(index,v) { + lime_graphics_opengl_GL.context.vertexAttribI4uiv(index,v); +}; +lime_graphics_opengl_GL.vertexAttribIPointer = function(index,size,type,stride,offset) { + lime_graphics_opengl_GL.context.vertexAttribIPointer(index,size,type,stride,offset); +}; +lime_graphics_opengl_GL.vertexAttribPointer = function(index,size,type,normalized,stride,offset) { + lime_graphics_opengl_GL.context.vertexAttribPointer(index,size,type,normalized,stride,offset); +}; +lime_graphics_opengl_GL.viewport = function(x,y,width,height) { + lime_graphics_opengl_GL.context.viewport(x,y,width,height); +}; +lime_graphics_opengl_GL.waitSync = function(sync,flags,timeout) { + lime_graphics_opengl_GL.context.waitSync(sync,flags,timeout); +}; +lime_graphics_opengl_GL.__getObjectID = function(object) { + if(object == null) { + return 0; + } else { + return object.id; + } +}; +var lime_graphics_opengl_GLProgram = {}; +lime_graphics_opengl_GLProgram.fromSources = function(gl,vertexSource,fragmentSource) { + var vertexShader = lime_graphics_opengl_GLShader.fromSource(gl,vertexSource,gl.VERTEX_SHADER); + var fragmentShader = lime_graphics_opengl_GLShader.fromSource(gl,fragmentSource,gl.FRAGMENT_SHADER); + var program = gl.createProgram(); + gl.attachShader(program,vertexShader); + gl.attachShader(program,fragmentShader); + gl.linkProgram(program); + if(gl.getProgramParameter(program,35714) == 0) { + var message = "Unable to initialize the shader program"; + message += "\n" + lime_graphics_opengl_GL.context.getProgramInfoLog(program); + lime_utils_Log.error(message,{ fileName : "lime/graphics/opengl/GLProgram.hx", lineNumber : 39, className : "lime.graphics.opengl._GLProgram.GLProgram_Impl_", methodName : "fromSources"}); + } + return program; +}; +var lime_graphics_opengl_GLShader = {}; +lime_graphics_opengl_GLShader.fromSource = function(gl,source,type) { + var shader = gl.createShader(type); + gl.shaderSource(shader,source); + gl.compileShader(shader); + var shaderInfoLog = gl.getShaderInfoLog(shader); + var compileStatus = gl.getShaderParameter(shader,gl.COMPILE_STATUS); + if(shaderInfoLog != null || compileStatus == 0) { + var message; + if(compileStatus == 0) { + message = "Error "; + } else { + message = "Info "; + } + if(type == gl.VERTEX_SHADER) { + message = "compiling vertex shader"; + } else if(type == gl.FRAGMENT_SHADER) { + message = "compiling fragment shader"; + } else { + message = "compiling unknown shader type"; + } + message += "\n" + shaderInfoLog; + if(compileStatus == 0) { + lime_utils_Log.error(message,{ fileName : "lime/graphics/opengl/GLShader.hx", lineNumber : 47, className : "lime.graphics.opengl._GLShader.GLShader_Impl_", methodName : "fromSource"}); + } else if(shaderInfoLog != null) { + lime_utils_Log.debug(message,{ fileName : "lime/graphics/opengl/GLShader.hx", lineNumber : 48, className : "lime.graphics.opengl._GLShader.GLShader_Impl_", methodName : "fromSource"}); + } + } + return shader; +}; +var lime_graphics_opengl_ext_KHR_$debug = function() { + this.STACK_UNDERFLOW = 1284; + this.STACK_OVERFLOW = 1283; + this.CONTEXT_FLAG_DEBUG_BIT = 2; + this.DEBUG_OUTPUT = 37600; + this.DEBUG_SEVERITY_LOW = 37192; + this.DEBUG_SEVERITY_MEDIUM = 37191; + this.DEBUG_SEVERITY_HIGH = 37190; + this.DEBUG_LOGGED_MESSAGES = 37189; + this.MAX_DEBUG_LOGGED_MESSAGES = 37188; + this.MAX_DEBUG_MESSAGE_LENGTH = 37187; + this.MAX_LABEL_LENGTH = 33512; + this.SAMPLER = 33510; + this.QUERY = 33507; + this.PROGRAM = 33506; + this.SHADER = 33505; + this.BUFFER = 33504; + this.DEBUG_GROUP_STACK_DEPTH = 33389; + this.MAX_DEBUG_GROUP_STACK_DEPTH = 33388; + this.DEBUG_SEVERITY_NOTIFICATION = 33387; + this.DEBUG_TYPE_POP_GROUP = 33386; + this.DEBUG_TYPE_PUSH_GROUP = 33385; + this.DEBUG_TYPE_MARKER = 33384; + this.DEBUG_TYPE_OTHER = 33361; + this.DEBUG_TYPE_PERFORMANCE = 33360; + this.DEBUG_TYPE_PORTABILITY = 33359; + this.DEBUG_TYPE_UNDEFINED_BEHAVIOR = 33358; + this.DEBUG_TYPE_DEPRECATED_BEHAVIOR = 33357; + this.DEBUG_TYPE_ERROR = 33356; + this.DEBUG_SOURCE_OTHER = 33355; + this.DEBUG_SOURCE_APPLICATION = 33354; + this.DEBUG_SOURCE_THIRD_PARTY = 33353; + this.DEBUG_SOURCE_SHADER_COMPILER = 33352; + this.DEBUG_SOURCE_WINDOW_SYSTEM = 33351; + this.DEBUG_SOURCE_API = 33350; + this.DEBUG_CALLBACK_USER_PARAM = 33349; + this.DEBUG_CALLBACK_FUNCTION = 33348; + this.DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 33347; + this.DEBUG_OUTPUT_SYNCHRONOUS = 33346; +}; +$hxClasses["lime.graphics.opengl.ext.KHR_debug"] = lime_graphics_opengl_ext_KHR_$debug; +lime_graphics_opengl_ext_KHR_$debug.__name__ = "lime.graphics.opengl.ext.KHR_debug"; +lime_graphics_opengl_ext_KHR_$debug.prototype = { + __class__: lime_graphics_opengl_ext_KHR_$debug +}; +var lime_math_ARGB = {}; +lime_math_ARGB.__properties__ = {set_r:"set_r",get_r:"get_r",set_g:"set_g",get_g:"get_g",set_b:"set_b",get_b:"get_b",set_a:"set_a",get_a:"get_a"}; +lime_math_ARGB._new = function(argb) { + if(argb == null) { + argb = 0; + } + return argb; +}; +lime_math_ARGB.create = function(a,r,g,b) { + var argb = 0; + argb = (a & 255) << 24 | (r & 255) << 16 | (g & 255) << 8 | b & 255; + return argb; +}; +lime_math_ARGB.multiplyAlpha = function(this1) { + if((this1 >>> 24 & 255) == 0) { + this1 = 0; + } else if((this1 >>> 24 & 255) != 255) { + lime_math_ARGB.a16 = lime_math_RGBA.__alpha16[this1 >>> 24 & 255]; + this1 = (this1 >>> 24 & 255 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_ARGB.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_ARGB.a16 >> 16 & 255) << 8 | (this1 & 255) * lime_math_ARGB.a16 >> 16 & 255; + } +}; +lime_math_ARGB.readUInt8 = function(this1,data,offset,format,premultiplied) { + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + switch(format) { + case 0: + this1 = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255; + break; + case 1: + this1 = (data[offset + 2] & 255) << 24 | (data[offset + 3] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 1] & 255; + break; + case 2: + this1 = (data[offset + 1] & 255) << 24 | (data[offset] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset + 2] & 255; + break; + } + if(premultiplied) { + if((this1 >>> 24 & 255) != 0 && (this1 >>> 24 & 255) != 255) { + lime_math_ARGB.unmult = 255.0 / (this1 >>> 24 & 255); + this1 = (this1 >>> 24 & 255 & 255) << 24 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 16 & 255) * lime_math_ARGB.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 8 & 255) * lime_math_ARGB.unmult)] & 255) << 8 | lime_math_RGBA.__clamp[Math.floor((this1 & 255) * lime_math_ARGB.unmult)] & 255; + } + } +}; +lime_math_ARGB.set = function(this1,a,r,g,b) { + this1 = (a & 255) << 24 | (r & 255) << 16 | (g & 255) << 8 | b & 255; +}; +lime_math_ARGB.unmultiplyAlpha = function(this1) { + if((this1 >>> 24 & 255) != 0 && (this1 >>> 24 & 255) != 255) { + lime_math_ARGB.unmult = 255.0 / (this1 >>> 24 & 255); + this1 = (this1 >>> 24 & 255 & 255) << 24 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 16 & 255) * lime_math_ARGB.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 8 & 255) * lime_math_ARGB.unmult)] & 255) << 8 | lime_math_RGBA.__clamp[Math.floor((this1 & 255) * lime_math_ARGB.unmult)] & 255; + } +}; +lime_math_ARGB.writeUInt8 = function(this1,data,offset,format,premultiplied) { + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + if(premultiplied) { + if((this1 >>> 24 & 255) == 0) { + this1 = 0; + } else if((this1 >>> 24 & 255) != 255) { + lime_math_ARGB.a16 = lime_math_RGBA.__alpha16[this1 >>> 24 & 255]; + this1 = (this1 >>> 24 & 255 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_ARGB.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_ARGB.a16 >> 16 & 255) << 8 | (this1 & 255) * lime_math_ARGB.a16 >> 16 & 255; + } + } + switch(format) { + case 0: + data[offset] = this1 >>> 16 & 255; + data[offset + 1] = this1 >>> 8 & 255; + data[offset + 2] = this1 & 255; + data[offset + 3] = this1 >>> 24 & 255; + break; + case 1: + data[offset] = this1 >>> 24 & 255; + data[offset + 1] = this1 >>> 16 & 255; + data[offset + 2] = this1 >>> 8 & 255; + data[offset + 3] = this1 & 255; + break; + case 2: + data[offset] = this1 & 255; + data[offset + 1] = this1 >>> 8 & 255; + data[offset + 2] = this1 >>> 16 & 255; + data[offset + 3] = this1 >>> 24 & 255; + break; + } +}; +lime_math_ARGB.__fromBGRA = function(bgra) { + var argb = 0; + argb = (bgra & 255 & 255) << 24 | (bgra >>> 8 & 255 & 255) << 16 | (bgra >>> 16 & 255 & 255) << 8 | bgra >>> 24 & 255 & 255; + return argb; +}; +lime_math_ARGB.__fromRGBA = function(rgba) { + var argb = 0; + argb = (rgba & 255 & 255) << 24 | (rgba >>> 24 & 255 & 255) << 16 | (rgba >>> 16 & 255 & 255) << 8 | rgba >>> 8 & 255 & 255; + return argb; +}; +lime_math_ARGB.get_a = function(this1) { + return this1 >>> 24 & 255; +}; +lime_math_ARGB.set_a = function(this1,value) { + this1 = (value & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255; + return value; +}; +lime_math_ARGB.get_b = function(this1) { + return this1 & 255; +}; +lime_math_ARGB.set_b = function(this1,value) { + this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | value & 255; + return value; +}; +lime_math_ARGB.get_g = function(this1) { + return this1 >>> 8 & 255; +}; +lime_math_ARGB.set_g = function(this1,value) { + this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | this1 & 255 & 255; + return value; +}; +lime_math_ARGB.get_r = function(this1) { + return this1 >>> 16 & 255; +}; +lime_math_ARGB.set_r = function(this1,value) { + this1 = (this1 >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255; + return value; +}; +var lime_math_BGRA = {}; +lime_math_BGRA.__properties__ = {set_r:"set_r",get_r:"get_r",set_g:"set_g",get_g:"get_g",set_b:"set_b",get_b:"get_b",set_a:"set_a",get_a:"get_a"}; +lime_math_BGRA._new = function(bgra) { + if(bgra == null) { + bgra = 0; + } + return bgra; +}; +lime_math_BGRA.create = function(b,g,r,a) { + var bgra = 0; + bgra = (b & 255) << 24 | (g & 255) << 16 | (r & 255) << 8 | a & 255; + return bgra; +}; +lime_math_BGRA.multiplyAlpha = function(this1) { + if((this1 & 255) == 0) { + this1 = 0; + } else if((this1 & 255) != 255) { + lime_math_BGRA.a16 = lime_math_RGBA.__alpha16[this1 & 255]; + this1 = ((this1 >>> 24 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 8 | this1 & 255 & 255; + } +}; +lime_math_BGRA.readUInt8 = function(this1,data,offset,format,premultiplied) { + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + switch(format) { + case 0: + this1 = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255; + break; + case 1: + this1 = (data[offset + 3] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 1] & 255) << 8 | data[offset] & 255; + break; + case 2: + this1 = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255; + break; + } + if(premultiplied) { + if((this1 & 255) != 0 && (this1 & 255) != 255) { + lime_math_BGRA.unmult = 255.0 / (this1 & 255); + this1 = (lime_math_RGBA.__clamp[Math.floor((this1 >>> 24 & 255) * lime_math_BGRA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 16 & 255) * lime_math_BGRA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 8 & 255) * lime_math_BGRA.unmult)] & 255) << 8 | this1 & 255 & 255; + } + } +}; +lime_math_BGRA.set = function(this1,b,g,r,a) { + this1 = (b & 255) << 24 | (g & 255) << 16 | (r & 255) << 8 | a & 255; +}; +lime_math_BGRA.unmultiplyAlpha = function(this1) { + if((this1 & 255) != 0 && (this1 & 255) != 255) { + lime_math_BGRA.unmult = 255.0 / (this1 & 255); + this1 = (lime_math_RGBA.__clamp[Math.floor((this1 >>> 24 & 255) * lime_math_BGRA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 16 & 255) * lime_math_BGRA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.floor((this1 >>> 8 & 255) * lime_math_BGRA.unmult)] & 255) << 8 | this1 & 255 & 255; + } +}; +lime_math_BGRA.writeUInt8 = function(this1,data,offset,format,premultiplied) { + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + if(premultiplied) { + if((this1 & 255) == 0) { + this1 = 0; + } else if((this1 & 255) != 255) { + lime_math_BGRA.a16 = lime_math_RGBA.__alpha16[this1 & 255]; + this1 = ((this1 >>> 24 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_BGRA.a16 >> 16 & 255) << 8 | this1 & 255 & 255; + } + } + switch(format) { + case 0: + data[offset] = this1 >>> 8 & 255; + data[offset + 1] = this1 >>> 16 & 255; + data[offset + 2] = this1 >>> 24 & 255; + data[offset + 3] = this1 & 255; + break; + case 1: + data[offset] = this1 & 255; + data[offset + 1] = this1 >>> 8 & 255; + data[offset + 2] = this1 >>> 16 & 255; + data[offset + 3] = this1 >>> 24 & 255; + break; + case 2: + data[offset] = this1 >>> 24 & 255; + data[offset + 1] = this1 >>> 16 & 255; + data[offset + 2] = this1 >>> 8 & 255; + data[offset + 3] = this1 & 255; + break; + } +}; +lime_math_BGRA.__fromARGB = function(argb) { + var bgra = 0; + bgra = (argb & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb >>> 16 & 255 & 255) << 8 | argb >>> 24 & 255 & 255; + return bgra; +}; +lime_math_BGRA.__fromRGBA = function(rgba) { + var bgra = 0; + bgra = (rgba >>> 8 & 255 & 255) << 24 | (rgba >>> 16 & 255 & 255) << 16 | (rgba >>> 24 & 255 & 255) << 8 | rgba & 255 & 255; + return bgra; +}; +lime_math_BGRA.get_a = function(this1) { + return this1 & 255; +}; +lime_math_BGRA.set_a = function(this1,value) { + this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | value & 255; + return value; +}; +lime_math_BGRA.get_b = function(this1) { + return this1 >>> 24 & 255; +}; +lime_math_BGRA.set_b = function(this1,value) { + this1 = (value & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255; + return value; +}; +lime_math_BGRA.get_g = function(this1) { + return this1 >>> 16 & 255; +}; +lime_math_BGRA.set_g = function(this1,value) { + this1 = (this1 >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255; + return value; +}; +lime_math_BGRA.get_r = function(this1) { + return this1 >>> 8 & 255; +}; +lime_math_BGRA.set_r = function(this1,value) { + this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | this1 & 255 & 255; + return value; +}; +var lime_math_ColorMatrix = {}; +lime_math_ColorMatrix.__properties__ = {set_redOffset:"set_redOffset",get_redOffset:"get_redOffset",set_redMultiplier:"set_redMultiplier",get_redMultiplier:"get_redMultiplier",set_greenOffset:"set_greenOffset",get_greenOffset:"get_greenOffset",set_greenMultiplier:"set_greenMultiplier",get_greenMultiplier:"get_greenMultiplier",set_color:"set_color",get_color:"get_color",set_blueOffset:"set_blueOffset",get_blueOffset:"get_blueOffset",set_blueMultiplier:"set_blueMultiplier",get_blueMultiplier:"get_blueMultiplier",set_alphaOffset:"set_alphaOffset",get_alphaOffset:"get_alphaOffset",set_alphaMultiplier:"set_alphaMultiplier",get_alphaMultiplier:"get_alphaMultiplier"}; +lime_math_ColorMatrix._new = function(data) { + var this1; + if(data != null && data.length == 20) { + this1 = data; + } else { + var elements = null; + var array = lime_math_ColorMatrix.__identity; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this2; + if(elements != null) { + this2 = new Float32Array(elements); + } else if(array != null) { + this2 = new Float32Array(array); + } else if(vector != null) { + this2 = new Float32Array(vector.__array); + } else if(view != null) { + this2 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this2 = new Float32Array(buffer,0); + } else { + this2 = new Float32Array(buffer,0,len); + } + } else { + this2 = null; + } + this1 = this2; + } + return this1; +}; +lime_math_ColorMatrix.clone = function(this1) { + var elements = null; + var array = null; + var vector = null; + var view = lime_utils_Float32Array.toArrayBufferView(this1); + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Float32Array(elements); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Float32Array(buffer,0); + } else { + this1 = new Float32Array(buffer,0,len); + } + } else { + this1 = null; + } + return lime_math_ColorMatrix._new(this1); +}; +lime_math_ColorMatrix.concat = function(this1,second) { + this1[0] += second[0]; + this1[6] += second[6]; + this1[12] += second[12]; + this1[18] += second[18]; +}; +lime_math_ColorMatrix.copyFrom = function(this1,other) { + this1.set(other); +}; +lime_math_ColorMatrix.identity = function(this1) { + this1[0] = 1; + this1[1] = 0; + this1[2] = 0; + this1[3] = 0; + this1[4] = 0; + this1[5] = 0; + this1[6] = 1; + this1[7] = 0; + this1[8] = 0; + this1[9] = 0; + this1[10] = 0; + this1[11] = 0; + this1[12] = 1; + this1[13] = 0; + this1[14] = 0; + this1[15] = 0; + this1[16] = 0; + this1[17] = 0; + this1[18] = 1; + this1[19] = 0; +}; +lime_math_ColorMatrix.getAlphaTable = function(this1) { + if(lime_math_ColorMatrix.__alphaTable == null) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + lime_math_ColorMatrix.__alphaTable = new Uint8Array(256); + } + var value; + lime_math_ColorMatrix.__alphaTable[0] = 0; + var _g = 1; + while(_g < 256) { + var i = _g++; + value = Math.floor(i * this1[18] + this1[19] * 255); + if(value > 255) { + value = 255; + } + if(value < 0) { + value = 0; + } + lime_math_ColorMatrix.__alphaTable[i] = value; + } + return lime_math_ColorMatrix.__alphaTable; +}; +lime_math_ColorMatrix.getBlueTable = function(this1) { + if(lime_math_ColorMatrix.__blueTable == null) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + lime_math_ColorMatrix.__blueTable = new Uint8Array(256); + } + var value; + var _g = 0; + while(_g < 256) { + var i = _g++; + value = Math.floor(i * this1[12] + this1[14] * 255); + if(value > 255) { + value = 255; + } + if(value < 0) { + value = 0; + } + lime_math_ColorMatrix.__blueTable[i] = value; + } + return lime_math_ColorMatrix.__blueTable; +}; +lime_math_ColorMatrix.getGreenTable = function(this1) { + if(lime_math_ColorMatrix.__greenTable == null) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + lime_math_ColorMatrix.__greenTable = new Uint8Array(256); + } + var value; + var _g = 0; + while(_g < 256) { + var i = _g++; + value = Math.floor(i * this1[6] + this1[9] * 255); + if(value > 255) { + value = 255; + } + if(value < 0) { + value = 0; + } + lime_math_ColorMatrix.__greenTable[i] = value; + } + return lime_math_ColorMatrix.__greenTable; +}; +lime_math_ColorMatrix.getRedTable = function(this1) { + if(lime_math_ColorMatrix.__redTable == null) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + lime_math_ColorMatrix.__redTable = new Uint8Array(256); + } + var value; + var _g = 0; + while(_g < 256) { + var i = _g++; + value = Math.floor(i * this1[0] + this1[4] * 255); + if(value > 255) { + value = 255; + } + if(value < 0) { + value = 0; + } + lime_math_ColorMatrix.__redTable[i] = value; + } + return lime_math_ColorMatrix.__redTable; +}; +lime_math_ColorMatrix.__toFlashColorTransform = function(this1) { + return null; +}; +lime_math_ColorMatrix.get_alphaMultiplier = function(this1) { + return this1[18]; +}; +lime_math_ColorMatrix.set_alphaMultiplier = function(this1,value) { + return this1[18] = value; +}; +lime_math_ColorMatrix.get_alphaOffset = function(this1) { + return this1[19] * 255; +}; +lime_math_ColorMatrix.set_alphaOffset = function(this1,value) { + return this1[19] = value / 255; +}; +lime_math_ColorMatrix.get_blueMultiplier = function(this1) { + return this1[12]; +}; +lime_math_ColorMatrix.set_blueMultiplier = function(this1,value) { + return this1[12] = value; +}; +lime_math_ColorMatrix.get_blueOffset = function(this1) { + return this1[14] * 255; +}; +lime_math_ColorMatrix.set_blueOffset = function(this1,value) { + return this1[14] = value / 255; +}; +lime_math_ColorMatrix.get_color = function(this1) { + return (this1[4] * 255 | 0) << 16 | (this1[9] * 255 | 0) << 8 | (this1[14] * 255 | 0); +}; +lime_math_ColorMatrix.set_color = function(this1,value) { + this1[4] = (value >> 16 & 255) / 255; + this1[9] = (value >> 8 & 255) / 255; + this1[14] = (value & 255) / 255; + this1[0] = 0; + this1[6] = 0; + this1[12] = 0; + return lime_math_ColorMatrix.get_color(this1); +}; +lime_math_ColorMatrix.get_greenMultiplier = function(this1) { + return this1[6]; +}; +lime_math_ColorMatrix.set_greenMultiplier = function(this1,value) { + return this1[6] = value; +}; +lime_math_ColorMatrix.get_greenOffset = function(this1) { + return this1[9] * 255; +}; +lime_math_ColorMatrix.set_greenOffset = function(this1,value) { + return this1[9] = value / 255; +}; +lime_math_ColorMatrix.get_redMultiplier = function(this1) { + return this1[0]; +}; +lime_math_ColorMatrix.set_redMultiplier = function(this1,value) { + return this1[0] = value; +}; +lime_math_ColorMatrix.get_redOffset = function(this1) { + return this1[4] * 255; +}; +lime_math_ColorMatrix.set_redOffset = function(this1,value) { + return this1[4] = value / 255; +}; +lime_math_ColorMatrix.get = function(this1,index) { + return this1[index]; +}; +lime_math_ColorMatrix.set = function(this1,index,value) { + return this1[index] = value; +}; +var lime_math_Matrix3 = {}; +lime_math_Matrix3.__properties__ = {set_ty:"set_ty",get_ty:"get_ty",set_tx:"set_tx",get_tx:"get_tx",set_d:"set_d",get_d:"get_d",set_c:"set_c",get_c:"get_c",set_b:"set_b",get_b:"get_b",set_a:"set_a",get_a:"get_a"}; +lime_math_Matrix3._new = function(a,b,c,d,tx,ty) { + if(ty == null) { + ty = 0; + } + if(tx == null) { + tx = 0; + } + if(d == null) { + d = 1; + } + if(c == null) { + c = 0; + } + if(b == null) { + b = 0; + } + if(a == null) { + a = 1; + } + var elements = null; + var array = [a,b,0,c,d,0,tx,ty,1]; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Float32Array(elements); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Float32Array(buffer,0); + } else { + this1 = new Float32Array(buffer,0,len); + } + } else { + this1 = null; + } + return this1; +}; +lime_math_Matrix3.clone = function(this1) { + return lime_math_Matrix3._new(this1[0],this1[1],this1[3],this1[4],this1[6],this1[7]); +}; +lime_math_Matrix3.concat = function(this1,m) { + var a1 = this1[0] * m[0] + this1[1] * m[3]; + this1[1] = this1[0] * m[1] + this1[1] * m[4]; + this1[0] = a1; + var c1 = this1[3] * m[0] + this1[4] * m[3]; + this1[4] = this1[3] * m[1] + this1[4] * m[4]; + this1[3] = c1; + var tx1 = this1[6] * m[0] + this1[7] * m[3] + m[6]; + this1[7] = this1[6] * m[1] + this1[7] * m[4] + m[7]; + this1[6] = tx1; +}; +lime_math_Matrix3.copyColumnFrom = function(this1,column,vector4) { + if(column > 2) { + throw haxe_Exception.thrown("Column " + column + " out of bounds (2)"); + } else if(column == 0) { + this1[0] = vector4.x; + this1[1] = vector4.y; + } else if(column == 1) { + this1[3] = vector4.x; + this1[4] = vector4.y; + } else { + this1[6] = vector4.x; + this1[7] = vector4.y; + } +}; +lime_math_Matrix3.copyColumnTo = function(this1,column,vector4) { + if(column > 2) { + throw haxe_Exception.thrown("Column " + column + " out of bounds (2)"); + } else if(column == 0) { + vector4.x = this1[0]; + vector4.y = this1[1]; + vector4.z = 0; + } else if(column == 1) { + vector4.x = this1[3]; + vector4.y = this1[4]; + vector4.z = 0; + } else { + vector4.x = this1[6]; + vector4.y = this1[7]; + vector4.z = 1; + } +}; +lime_math_Matrix3.copyFrom = function(this1,sourceMatrix3) { + this1[0] = sourceMatrix3[0]; + this1[1] = sourceMatrix3[1]; + this1[3] = sourceMatrix3[3]; + this1[4] = sourceMatrix3[4]; + this1[6] = sourceMatrix3[6]; + this1[7] = sourceMatrix3[7]; +}; +lime_math_Matrix3.copyRowFrom = function(this1,row,vector4) { + if(row > 2) { + throw haxe_Exception.thrown("Row " + row + " out of bounds (2)"); + } else if(row == 0) { + this1[0] = vector4.x; + this1[3] = vector4.y; + this1[6] = vector4.z; + } else if(row == 1) { + this1[1] = vector4.x; + this1[4] = vector4.y; + this1[7] = vector4.z; + } +}; +lime_math_Matrix3.copyRowTo = function(this1,row,vector4) { + if(row > 2) { + throw haxe_Exception.thrown("Row " + row + " out of bounds (2)"); + } else if(row == 0) { + vector4.x = this1[0]; + vector4.y = this1[3]; + vector4.z = this1[6]; + } else if(row == 1) { + vector4.x = this1[1]; + vector4.y = this1[4]; + vector4.z = this1[7]; + } else { + vector4.x = 0; + vector4.y = 0; + vector4.z = 1; + } +}; +lime_math_Matrix3.createBox = function(this1,scaleX,scaleY,rotation,xTranslate,yTranslate) { + if(yTranslate == null) { + yTranslate = 0; + } + if(xTranslate == null) { + xTranslate = 0; + } + if(rotation == null) { + rotation = 0; + } + if(rotation != 0) { + var cos = Math.cos(rotation); + var sin = Math.sin(rotation); + this1[0] = cos * scaleX; + this1[1] = sin * scaleY; + this1[3] = -sin * scaleX; + this1[4] = cos * scaleY; + } else { + this1[0] = scaleX; + this1[1] = 0; + this1[3] = 0; + this1[4] = scaleY; + } + this1[6] = xTranslate; + this1[7] = yTranslate; +}; +lime_math_Matrix3.createGradientBox = function(this1,width,height,rotation,xTranslate,yTranslate) { + if(yTranslate == null) { + yTranslate = 0; + } + if(xTranslate == null) { + xTranslate = 0; + } + if(rotation == null) { + rotation = 0; + } + this1[0] = width / 1638.4; + this1[4] = height / 1638.4; + if(rotation != 0) { + var cos = Math.cos(rotation); + var sin = Math.sin(rotation); + this1[1] = sin * this1[4]; + this1[3] = -sin * this1[0]; + this1[0] *= cos; + this1[4] *= cos; + } else { + this1[1] = 0; + this1[3] = 0; + } + this1[6] = xTranslate + width / 2; + this1[7] = yTranslate + height / 2; +}; +lime_math_Matrix3.equals = function(this1,matrix3) { + if(matrix3 != null && this1[6] == matrix3[6] && this1[7] == matrix3[7] && this1[0] == matrix3[0] && this1[1] == matrix3[1] && this1[3] == matrix3[3]) { + return this1[4] == matrix3[4]; + } else { + return false; + } +}; +lime_math_Matrix3.deltaTransformVector = function(this1,Vector2,result) { + if(result == null) { + result = new lime_math_Vector2(); + } + result.x = Vector2.x * this1[0] + Vector2.y * this1[3]; + result.y = Vector2.x * this1[1] + Vector2.y * this1[4]; + return result; +}; +lime_math_Matrix3.fromCairoMatrix3 = function(matrix) { + return lime_math_Matrix3._new(matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty); +}; +lime_math_Matrix3.fromFloat32Array = function(array) { + if(array.length != 9) { + throw haxe_Exception.thrown("Expected array of length 9, got " + array.length); + } + return array; +}; +lime_math_Matrix3.identity = function(this1) { + this1[0] = 1; + this1[1] = 0; + this1[3] = 0; + this1[4] = 1; + this1[6] = 0; + this1[7] = 0; +}; +lime_math_Matrix3.invert = function(this1) { + var norm = this1[0] * this1[4] - this1[1] * this1[3]; + if(norm == 0) { + this1[0] = this1[1] = this1[3] = this1[4] = 0; + this1[6] = -this1[6]; + this1[7] = -this1[7]; + } else { + norm = 1.0 / norm; + var a1 = this1[4] * norm; + this1[4] = this1[0] * norm; + this1[0] = a1; + this1[1] *= -norm; + this1[3] *= -norm; + var tx1 = -this1[0] * this1[6] - this1[3] * this1[7]; + this1[7] = -this1[1] * this1[6] - this1[4] * this1[7]; + this1[6] = tx1; + } + if(this1.length != 9) { + throw haxe_Exception.thrown("Expected array of length 9, got " + this1.length); + } + return this1; +}; +lime_math_Matrix3.rotate = function(this1,theta) { + var cos = Math.cos(theta); + var sin = Math.sin(theta); + var a1 = this1[0] * cos - this1[1] * sin; + this1[1] = this1[0] * sin + this1[1] * cos; + this1[0] = a1; + var c1 = this1[3] * cos - this1[4] * sin; + this1[4] = this1[3] * sin + this1[4] * cos; + this1[3] = c1; + var tx1 = this1[6] * cos - this1[7] * sin; + this1[7] = this1[6] * sin + this1[7] * cos; + this1[6] = tx1; +}; +lime_math_Matrix3.scale = function(this1,sx,sy) { + this1[0] *= sx; + this1[1] *= sy; + this1[3] *= sx; + this1[4] *= sy; + this1[6] *= sx; + this1[7] *= sy; +}; +lime_math_Matrix3.setRotation = function(this1,theta,scale) { + if(scale == null) { + scale = 1; + } + this1[0] = Math.cos(theta) * scale; + this1[3] = Math.sin(theta) * scale; + this1[1] = -this1[3]; + this1[4] = this1[0]; +}; +lime_math_Matrix3.setTo = function(this1,a,b,c,d,tx,ty) { + this1[0] = a; + this1[1] = b; + this1[3] = c; + this1[4] = d; + this1[6] = tx; + this1[7] = ty; +}; +lime_math_Matrix3.toCairoMatrix3 = function(this1) { + return new lime_math_CairoMatrix3(this1[0],this1[1],this1[3],this1[4],this1[6],this1[7]); +}; +lime_math_Matrix3.toString = function(this1) { + return "matrix(" + this1[0] + ", " + this1[1] + ", " + this1[3] + ", " + this1[4] + ", " + this1[6] + ", " + this1[7] + ")"; +}; +lime_math_Matrix3.transformRect = function(this1,rect,result) { + if(result == null) { + result = new lime_math_Rectangle(); + } + var tx0 = this1[0] * rect.x + this1[3] * rect.y; + var tx1 = tx0; + var ty0 = this1[1] * rect.x + this1[4] * rect.y; + var ty1 = ty0; + var tx = this1[0] * (rect.x + rect.width) + this1[3] * rect.y; + var ty = this1[1] * (rect.x + rect.width) + this1[4] * rect.y; + if(tx < tx0) { + tx0 = tx; + } + if(ty < ty0) { + ty0 = ty; + } + if(tx > tx1) { + tx1 = tx; + } + if(ty > ty1) { + ty1 = ty; + } + tx = this1[0] * (rect.x + rect.width) + this1[3] * (rect.y + rect.height); + ty = this1[1] * (rect.x + rect.width) + this1[4] * (rect.y + rect.height); + if(tx < tx0) { + tx0 = tx; + } + if(ty < ty0) { + ty0 = ty; + } + if(tx > tx1) { + tx1 = tx; + } + if(ty > ty1) { + ty1 = ty; + } + tx = this1[0] * rect.x + this1[3] * (rect.y + rect.height); + ty = this1[1] * rect.x + this1[4] * (rect.y + rect.height); + if(tx < tx0) { + tx0 = tx; + } + if(ty < ty0) { + ty0 = ty; + } + if(tx > tx1) { + tx1 = tx; + } + if(ty > ty1) { + ty1 = ty; + } + result.setTo(tx0 + tx,ty0 + ty,tx1 - tx0,ty1 - ty0); + return result; +}; +lime_math_Matrix3.transformVector = function(this1,pos,result) { + if(result == null) { + result = new lime_math_Vector2(); + } + result.x = pos.x * this1[0] + pos.y * this1[3] + this1[6]; + result.y = pos.x * this1[1] + pos.y * this1[4] + this1[7]; + return result; +}; +lime_math_Matrix3.translate = function(this1,dx,dy) { + this1[6] += dx; + this1[7] += dy; +}; +lime_math_Matrix3.get_a = function(this1) { + return this1[0]; +}; +lime_math_Matrix3.set_a = function(this1,value) { + return this1[0] = value; +}; +lime_math_Matrix3.get_b = function(this1) { + return this1[1]; +}; +lime_math_Matrix3.set_b = function(this1,value) { + return this1[1] = value; +}; +lime_math_Matrix3.get_c = function(this1) { + return this1[3]; +}; +lime_math_Matrix3.set_c = function(this1,value) { + return this1[3] = value; +}; +lime_math_Matrix3.get_d = function(this1) { + return this1[4]; +}; +lime_math_Matrix3.set_d = function(this1,value) { + return this1[4] = value; +}; +lime_math_Matrix3.get_tx = function(this1) { + return this1[6]; +}; +lime_math_Matrix3.set_tx = function(this1,value) { + return this1[6] = value; +}; +lime_math_Matrix3.get_ty = function(this1) { + return this1[7]; +}; +lime_math_Matrix3.set_ty = function(this1,value) { + return this1[7] = value; +}; +lime_math_Matrix3.get = function(this1,index) { + return this1[index]; +}; +lime_math_Matrix3.set = function(this1,index,value) { + this1[index] = value; + return value; +}; +var lime_math_CairoMatrix3 = function(a,b,c,d,tx,ty) { + if(ty == null) { + ty = 0; + } + if(tx == null) { + tx = 0; + } + if(d == null) { + d = 1; + } + if(c == null) { + c = 0; + } + if(b == null) { + b = 0; + } + if(a == null) { + a = 1; + } + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.tx = tx; + this.ty = ty; +}; +$hxClasses["lime.math.CairoMatrix3"] = lime_math_CairoMatrix3; +lime_math_CairoMatrix3.__name__ = "lime.math.CairoMatrix3"; +lime_math_CairoMatrix3.prototype = { + __class__: lime_math_CairoMatrix3 +}; +var lime_math_Matrix4 = {}; +lime_math_Matrix4.__properties__ = {set_position:"set_position",get_position:"get_position",get_determinant:"get_determinant"}; +lime_math_Matrix4._new = function(data) { + var this1; + if(data != null && data.length == 16) { + this1 = data; + } else { + var elements = null; + var array = lime_math_Matrix4.__identity; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this2; + if(elements != null) { + this2 = new Float32Array(elements); + } else if(array != null) { + this2 = new Float32Array(array); + } else if(vector != null) { + this2 = new Float32Array(vector.__array); + } else if(view != null) { + this2 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this2 = new Float32Array(buffer,0); + } else { + this2 = new Float32Array(buffer,0,len); + } + } else { + this2 = null; + } + this1 = this2; + } + return this1; +}; +lime_math_Matrix4.append = function(this1,lhs) { + var m111 = this1[0]; + var m121 = this1[4]; + var m131 = this1[8]; + var m141 = this1[12]; + var m112 = this1[1]; + var m122 = this1[5]; + var m132 = this1[9]; + var m142 = this1[13]; + var m113 = this1[2]; + var m123 = this1[6]; + var m133 = this1[10]; + var m143 = this1[14]; + var m114 = this1[3]; + var m124 = this1[7]; + var m134 = this1[11]; + var m144 = this1[15]; + var m211 = lime_math_Matrix4.get(lhs,0); + var m221 = lime_math_Matrix4.get(lhs,4); + var m231 = lime_math_Matrix4.get(lhs,8); + var m241 = lime_math_Matrix4.get(lhs,12); + var m212 = lime_math_Matrix4.get(lhs,1); + var m222 = lime_math_Matrix4.get(lhs,5); + var m232 = lime_math_Matrix4.get(lhs,9); + var m242 = lime_math_Matrix4.get(lhs,13); + var m213 = lime_math_Matrix4.get(lhs,2); + var m223 = lime_math_Matrix4.get(lhs,6); + var m233 = lime_math_Matrix4.get(lhs,10); + var m243 = lime_math_Matrix4.get(lhs,14); + var m214 = lime_math_Matrix4.get(lhs,3); + var m224 = lime_math_Matrix4.get(lhs,7); + var m234 = lime_math_Matrix4.get(lhs,11); + var m244 = lime_math_Matrix4.get(lhs,15); + this1[0] = m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241; + this1[1] = m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242; + this1[2] = m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243; + this1[3] = m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244; + this1[4] = m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241; + this1[5] = m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242; + this1[6] = m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243; + this1[7] = m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244; + this1[8] = m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241; + this1[9] = m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242; + this1[10] = m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243; + this1[11] = m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244; + this1[12] = m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241; + this1[13] = m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242; + this1[14] = m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243; + this1[15] = m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244; +}; +lime_math_Matrix4.appendRotation = function(this1,degrees,axis,pivotPoint) { + var m = lime_math_Matrix4.__getAxisRotation(this1,axis.x,axis.y,axis.z,degrees); + if(pivotPoint != null) { + var p = pivotPoint; + lime_math_Matrix4.appendTranslation(m,p.x,p.y,p.z); + } + lime_math_Matrix4.append(this1,m); +}; +lime_math_Matrix4.appendScale = function(this1,xScale,yScale,zScale) { + var elements = null; + var array = [xScale,0.0,0.0,0.0,0.0,yScale,0.0,0.0,0.0,0.0,zScale,0.0,0.0,0.0,0.0,1.0]; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this2; + if(elements != null) { + this2 = new Float32Array(elements); + } else if(array != null) { + this2 = new Float32Array(array); + } else if(vector != null) { + this2 = new Float32Array(vector.__array); + } else if(view != null) { + this2 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this2 = new Float32Array(buffer,0); + } else { + this2 = new Float32Array(buffer,0,len); + } + } else { + this2 = null; + } + lime_math_Matrix4.append(this1,lime_math_Matrix4._new(this2)); +}; +lime_math_Matrix4.appendTranslation = function(this1,x,y,z) { + this1[12] += x; + this1[13] += y; + this1[14] += z; +}; +lime_math_Matrix4.clone = function(this1) { + var elements = null; + var array = null; + var vector = null; + var view = lime_utils_Float32Array.toArrayBufferView(this1); + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Float32Array(elements); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Float32Array(buffer,0); + } else { + this1 = new Float32Array(buffer,0,len); + } + } else { + this1 = null; + } + return lime_math_Matrix4._new(this1); +}; +lime_math_Matrix4.copyColumnFrom = function(this1,column,vector) { + switch(column) { + case 0: + this1[0] = vector.x; + this1[1] = vector.y; + this1[2] = vector.z; + this1[3] = vector.w; + break; + case 1: + this1[4] = vector.x; + this1[5] = vector.y; + this1[6] = vector.z; + this1[7] = vector.w; + break; + case 2: + this1[8] = vector.x; + this1[9] = vector.y; + this1[10] = vector.z; + this1[11] = vector.w; + break; + case 3: + this1[12] = vector.x; + this1[13] = vector.y; + this1[14] = vector.z; + this1[15] = vector.w; + break; + default: + lime_utils_Log.error("Column " + column + " out of bounds [0, ..., 3]",{ fileName : "lime/math/Matrix4.hx", lineNumber : 187, className : "lime.math._Matrix4.Matrix4_Impl_", methodName : "copyColumnFrom"}); + } +}; +lime_math_Matrix4.copyColumnTo = function(this1,column,vector) { + switch(column) { + case 0: + vector.x = this1[0]; + vector.y = this1[1]; + vector.z = this1[2]; + vector.w = this1[3]; + break; + case 1: + vector.x = this1[4]; + vector.y = this1[5]; + vector.z = this1[6]; + vector.w = this1[7]; + break; + case 2: + vector.x = this1[8]; + vector.y = this1[9]; + vector.z = this1[10]; + vector.w = this1[11]; + break; + case 3: + vector.x = this1[12]; + vector.y = this1[13]; + vector.z = this1[14]; + vector.w = this1[15]; + break; + default: + lime_utils_Log.error("Column " + column + " out of bounds [0, ..., 3]",{ fileName : "lime/math/Matrix4.hx", lineNumber : 225, className : "lime.math._Matrix4.Matrix4_Impl_", methodName : "copyColumnTo"}); + } +}; +lime_math_Matrix4.copyFrom = function(this1,other) { + this1.set(other); +}; +lime_math_Matrix4.copyRowFrom = function(this1,row,vector) { + switch(row) { + case 0: + this1[0] = vector.x; + this1[4] = vector.y; + this1[8] = vector.z; + this1[12] = vector.w; + break; + case 1: + this1[1] = vector.x; + this1[5] = vector.y; + this1[9] = vector.z; + this1[13] = vector.w; + break; + case 2: + this1[2] = vector.x; + this1[6] = vector.y; + this1[10] = vector.z; + this1[14] = vector.w; + break; + case 3: + this1[3] = vector.x; + this1[7] = vector.y; + this1[11] = vector.z; + this1[15] = vector.w; + break; + default: + lime_utils_Log.error("Row " + row + " out of bounds [0, ..., 3]",{ fileName : "lime/math/Matrix4.hx", lineNumber : 272, className : "lime.math._Matrix4.Matrix4_Impl_", methodName : "copyRowFrom"}); + } +}; +lime_math_Matrix4.copyRowTo = function(this1,row,vector) { + switch(row) { + case 0: + vector.x = this1[0]; + vector.y = this1[4]; + vector.z = this1[8]; + vector.w = this1[12]; + break; + case 1: + vector.x = this1[1]; + vector.y = this1[5]; + vector.z = this1[9]; + vector.w = this1[13]; + break; + case 2: + vector.x = this1[2]; + vector.y = this1[6]; + vector.z = this1[10]; + vector.w = this1[14]; + break; + case 3: + vector.x = this1[3]; + vector.y = this1[7]; + vector.z = this1[11]; + vector.w = this1[15]; + break; + default: + lime_utils_Log.error("Row " + row + " out of bounds [0, ..., 3]",{ fileName : "lime/math/Matrix4.hx", lineNumber : 310, className : "lime.math._Matrix4.Matrix4_Impl_", methodName : "copyRowTo"}); + } +}; +lime_math_Matrix4.create2D = function(this1,a,b,c,d,tx,ty) { + if(ty == null) { + ty = 0; + } + if(tx == null) { + tx = 0; + } + this1[0] = a; + this1[1] = b; + this1[2] = 0; + this1[3] = 0; + this1[4] = c; + this1[5] = d; + this1[6] = 0; + this1[7] = 0; + this1[8] = 0; + this1[9] = 0; + this1[10] = 1; + this1[11] = 0; + this1[12] = tx; + this1[13] = ty; + this1[14] = 0; + this1[15] = 1; +}; +lime_math_Matrix4.createOrtho = function(this1,left,right,bottom,top,zNear,zFar) { + var sx = 1.0 / (right - left); + var sy = 1.0 / (top - bottom); + var sz = 1.0 / (zFar - zNear); + this1[0] = 2 * sx; + this1[1] = 0; + this1[2] = 0; + this1[3] = 0; + this1[4] = 0; + this1[5] = 2 * sy; + this1[6] = 0; + this1[7] = 0; + this1[8] = 0; + this1[9] = 0; + this1[10] = -2 * sz; + this1[11] = 0; + this1[12] = -(left + right) * sx; + this1[13] = -(bottom + top) * sy; + this1[14] = -(zNear + zFar) * sz; + this1[15] = 1; +}; +lime_math_Matrix4.createPerspective = function(this1,fov,aspect,zNear,zFar) { + if(aspect > -0.0000001 && aspect < 0.0000001) { + throw haxe_Exception.thrown("Aspect ratio may not be 0"); + } + var top = fov * zNear; + var bottom = -top; + var right = top * aspect; + var left = -right; + this1[0] = 2.0 * zNear / (right - left); + this1[1] = 0; + this1[2] = 0; + this1[3] = 0; + this1[4] = 0; + this1[5] = 2.0 * zNear / (top - bottom); + this1[6] = 0; + this1[7] = 0; + this1[8] = (right + left) / (right - left); + this1[9] = (top + bottom) / (top - bottom); + this1[10] = -(zFar + zNear) / (zFar - zNear); + this1[11] = -1.0; + this1[12] = 0; + this1[13] = 0; + this1[14] = -2 * zFar * zNear / (zFar - zNear); + this1[15] = 1; +}; +lime_math_Matrix4.deltaTransformVector = function(this1,v,result) { + if(result == null) { + result = new lime_math_Vector4(); + } + var x = v.x; + var y = v.y; + var z = v.z; + result.x = x * this1[0] + y * this1[4] + z * this1[8] + this1[3]; + result.y = x * this1[1] + y * this1[5] + z * this1[9] + this1[7]; + result.z = x * this1[2] + y * this1[6] + z * this1[10] + this1[11]; + return result; +}; +lime_math_Matrix4.fromMatrix3 = function(matrix3) { + var mat = lime_math_Matrix4._new(); + lime_math_Matrix4.create2D(mat,matrix3[0],matrix3[1],matrix3[3],matrix3[4],matrix3[6],matrix3[7]); + return mat; +}; +lime_math_Matrix4.identity = function(this1) { + this1[0] = 1; + this1[1] = 0; + this1[2] = 0; + this1[3] = 0; + this1[4] = 0; + this1[5] = 1; + this1[6] = 0; + this1[7] = 0; + this1[8] = 0; + this1[9] = 0; + this1[10] = 1; + this1[11] = 0; + this1[12] = 0; + this1[13] = 0; + this1[14] = 0; + this1[15] = 1; +}; +lime_math_Matrix4.interpolate = function(thisMat,toMat,percent,result) { + if(result == null) { + result = lime_math_Matrix4._new(); + } + var _g = 0; + while(_g < 16) { + var i = _g++; + lime_math_Matrix4.set(result,i,lime_math_Matrix4.get(thisMat,i) + (lime_math_Matrix4.get(toMat,i) - lime_math_Matrix4.get(thisMat,i)) * percent); + } + return result; +}; +lime_math_Matrix4.interpolateTo = function(this1,toMat,percent) { + var _g = 0; + while(_g < 16) { + var i = _g++; + this1[i] += (lime_math_Matrix4.get(toMat,i) - this1[i]) * percent; + } +}; +lime_math_Matrix4.invert = function(this1) { + var d = lime_math_Matrix4.get_determinant(this1); + var invertable = Math.abs(d) > 0.00000000001; + if(invertable) { + d = 1 / d; + var m11 = this1[0]; + var m21 = this1[4]; + var m31 = this1[8]; + var m41 = this1[12]; + var m12 = this1[1]; + var m22 = this1[5]; + var m32 = this1[9]; + var m42 = this1[13]; + var m13 = this1[2]; + var m23 = this1[6]; + var m33 = this1[10]; + var m43 = this1[14]; + var m14 = this1[3]; + var m24 = this1[7]; + var m34 = this1[11]; + var m44 = this1[15]; + this1[0] = d * (m22 * (m33 * m44 - m43 * m34) - m32 * (m23 * m44 - m43 * m24) + m42 * (m23 * m34 - m33 * m24)); + this1[1] = -d * (m12 * (m33 * m44 - m43 * m34) - m32 * (m13 * m44 - m43 * m14) + m42 * (m13 * m34 - m33 * m14)); + this1[2] = d * (m12 * (m23 * m44 - m43 * m24) - m22 * (m13 * m44 - m43 * m14) + m42 * (m13 * m24 - m23 * m14)); + this1[3] = -d * (m12 * (m23 * m34 - m33 * m24) - m22 * (m13 * m34 - m33 * m14) + m32 * (m13 * m24 - m23 * m14)); + this1[4] = -d * (m21 * (m33 * m44 - m43 * m34) - m31 * (m23 * m44 - m43 * m24) + m41 * (m23 * m34 - m33 * m24)); + this1[5] = d * (m11 * (m33 * m44 - m43 * m34) - m31 * (m13 * m44 - m43 * m14) + m41 * (m13 * m34 - m33 * m14)); + this1[6] = -d * (m11 * (m23 * m44 - m43 * m24) - m21 * (m13 * m44 - m43 * m14) + m41 * (m13 * m24 - m23 * m14)); + this1[7] = d * (m11 * (m23 * m34 - m33 * m24) - m21 * (m13 * m34 - m33 * m14) + m31 * (m13 * m24 - m23 * m14)); + this1[8] = d * (m21 * (m32 * m44 - m42 * m34) - m31 * (m22 * m44 - m42 * m24) + m41 * (m22 * m34 - m32 * m24)); + this1[9] = -d * (m11 * (m32 * m44 - m42 * m34) - m31 * (m12 * m44 - m42 * m14) + m41 * (m12 * m34 - m32 * m14)); + this1[10] = d * (m11 * (m22 * m44 - m42 * m24) - m21 * (m12 * m44 - m42 * m14) + m41 * (m12 * m24 - m22 * m14)); + this1[11] = -d * (m11 * (m22 * m34 - m32 * m24) - m21 * (m12 * m34 - m32 * m14) + m31 * (m12 * m24 - m22 * m14)); + this1[12] = -d * (m21 * (m32 * m43 - m42 * m33) - m31 * (m22 * m43 - m42 * m23) + m41 * (m22 * m33 - m32 * m23)); + this1[13] = d * (m11 * (m32 * m43 - m42 * m33) - m31 * (m12 * m43 - m42 * m13) + m41 * (m12 * m33 - m32 * m13)); + this1[14] = -d * (m11 * (m22 * m43 - m42 * m23) - m21 * (m12 * m43 - m42 * m13) + m41 * (m12 * m23 - m22 * m13)); + this1[15] = d * (m11 * (m22 * m33 - m32 * m23) - m21 * (m12 * m33 - m32 * m13) + m31 * (m12 * m23 - m22 * m13)); + } + return invertable; +}; +lime_math_Matrix4.pointAt = function(this1,pos,at,up) { + if(at == null) { + at = new lime_math_Vector4(0,0,1); + } + if(up == null) { + up = new lime_math_Vector4(0,1,0); + } + var result = null; + if(result == null) { + result = new lime_math_Vector4(); + } + result.x = pos.x - at.x; + result.y = pos.y - at.y; + result.z = pos.z - at.z; + var dir = result; + var vup = new lime_math_Vector4(up.x,up.y,up.z,up.w); + var l = Math.sqrt(dir.x * dir.x + dir.y * dir.y + dir.z * dir.z); + if(l != 0) { + dir.x /= l; + dir.y /= l; + dir.z /= l; + } + var l = Math.sqrt(vup.x * vup.x + vup.y * vup.y + vup.z * vup.z); + if(l != 0) { + vup.x /= l; + vup.y /= l; + vup.z /= l; + } + var dir2 = new lime_math_Vector4(dir.x,dir.y,dir.z,dir.w); + var s = vup.x * dir.x + vup.y * dir.y + vup.z * dir.z; + dir2.x *= s; + dir2.y *= s; + dir2.z *= s; + var result = null; + if(result == null) { + result = new lime_math_Vector4(); + } + result.x = vup.x - dir2.x; + result.y = vup.y - dir2.y; + result.z = vup.z - dir2.z; + vup = result; + if(Math.sqrt(vup.x * vup.x + vup.y * vup.y + vup.z * vup.z) > 0) { + var l = Math.sqrt(vup.x * vup.x + vup.y * vup.y + vup.z * vup.z); + if(l != 0) { + vup.x /= l; + vup.y /= l; + vup.z /= l; + } + } else if(dir.x != 0) { + vup = new lime_math_Vector4(-dir.y,dir.x,0); + } else { + vup = new lime_math_Vector4(1,0,0); + } + var result = null; + if(result == null) { + result = new lime_math_Vector4(); + } + var ya = vup.z * dir.x - vup.x * dir.z; + var za = vup.x * dir.y - vup.y * dir.x; + result.x = vup.y * dir.z - vup.z * dir.y; + result.y = ya; + result.z = za; + result.w = 1; + var right = result; + var l = Math.sqrt(right.x * right.x + right.y * right.y + right.z * right.z); + if(l != 0) { + right.x /= l; + right.y /= l; + right.z /= l; + } + this1[0] = right.x; + this1[4] = right.y; + this1[8] = right.z; + this1[12] = 0.0; + this1[1] = vup.x; + this1[5] = vup.y; + this1[9] = vup.z; + this1[13] = 0.0; + this1[2] = dir.x; + this1[6] = dir.y; + this1[10] = dir.z; + this1[14] = 0.0; + this1[3] = pos.x; + this1[7] = pos.y; + this1[11] = pos.z; + this1[15] = 1.0; +}; +lime_math_Matrix4.prepend = function(this1,rhs) { + var m111 = lime_math_Matrix4.get(rhs,0); + var m121 = lime_math_Matrix4.get(rhs,4); + var m131 = lime_math_Matrix4.get(rhs,8); + var m141 = lime_math_Matrix4.get(rhs,12); + var m112 = lime_math_Matrix4.get(rhs,1); + var m122 = lime_math_Matrix4.get(rhs,5); + var m132 = lime_math_Matrix4.get(rhs,9); + var m142 = lime_math_Matrix4.get(rhs,13); + var m113 = lime_math_Matrix4.get(rhs,2); + var m123 = lime_math_Matrix4.get(rhs,6); + var m133 = lime_math_Matrix4.get(rhs,10); + var m143 = lime_math_Matrix4.get(rhs,14); + var m114 = lime_math_Matrix4.get(rhs,3); + var m124 = lime_math_Matrix4.get(rhs,7); + var m134 = lime_math_Matrix4.get(rhs,11); + var m144 = lime_math_Matrix4.get(rhs,15); + var m211 = this1[0]; + var m221 = this1[4]; + var m231 = this1[8]; + var m241 = this1[12]; + var m212 = this1[1]; + var m222 = this1[5]; + var m232 = this1[9]; + var m242 = this1[13]; + var m213 = this1[2]; + var m223 = this1[6]; + var m233 = this1[10]; + var m243 = this1[14]; + var m214 = this1[3]; + var m224 = this1[7]; + var m234 = this1[11]; + var m244 = this1[15]; + this1[0] = m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241; + this1[1] = m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242; + this1[2] = m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243; + this1[3] = m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244; + this1[4] = m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241; + this1[5] = m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242; + this1[6] = m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243; + this1[7] = m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244; + this1[8] = m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241; + this1[9] = m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242; + this1[10] = m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243; + this1[11] = m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244; + this1[12] = m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241; + this1[13] = m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242; + this1[14] = m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243; + this1[15] = m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244; +}; +lime_math_Matrix4.prependRotation = function(this1,degrees,axis,pivotPoint) { + var m = lime_math_Matrix4.__getAxisRotation(this1,axis.x,axis.y,axis.z,degrees); + if(pivotPoint != null) { + var p = pivotPoint; + lime_math_Matrix4.appendTranslation(m,p.x,p.y,p.z); + } + lime_math_Matrix4.prepend(this1,m); +}; +lime_math_Matrix4.prependScale = function(this1,xScale,yScale,zScale) { + var elements = null; + var array = [xScale,0.0,0.0,0.0,0.0,yScale,0.0,0.0,0.0,0.0,zScale,0.0,0.0,0.0,0.0,1.0]; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this2; + if(elements != null) { + this2 = new Float32Array(elements); + } else if(array != null) { + this2 = new Float32Array(array); + } else if(vector != null) { + this2 = new Float32Array(vector.__array); + } else if(view != null) { + this2 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this2 = new Float32Array(buffer,0); + } else { + this2 = new Float32Array(buffer,0,len); + } + } else { + this2 = null; + } + lime_math_Matrix4.prepend(this1,lime_math_Matrix4._new(this2)); +}; +lime_math_Matrix4.prependTranslation = function(this1,x,y,z) { + var m = lime_math_Matrix4._new(); + lime_math_Matrix4.set_position(m,new lime_math_Vector4(x,y,z)); + lime_math_Matrix4.prepend(this1,m); +}; +lime_math_Matrix4.transformVector = function(this1,v,result) { + if(result == null) { + result = new lime_math_Vector4(); + } + var x = v.x; + var y = v.y; + var z = v.z; + result.x = x * this1[0] + y * this1[4] + z * this1[8] + this1[12]; + result.y = x * this1[1] + y * this1[5] + z * this1[9] + this1[13]; + result.z = x * this1[2] + y * this1[6] + z * this1[10] + this1[14]; + result.w = x * this1[3] + y * this1[7] + z * this1[11] + this1[15]; + return result; +}; +lime_math_Matrix4.transformVectors = function(this1,ain,aout) { + var i = 0; + var x; + var y; + var z; + while(i + 3 <= ain.length) { + x = ain[i]; + y = ain[i + 1]; + z = ain[i + 2]; + aout[i] = x * this1[0] + y * this1[4] + z * this1[8] + this1[12]; + aout[i + 1] = x * this1[1] + y * this1[5] + z * this1[9] + this1[13]; + aout[i + 2] = x * this1[2] + y * this1[6] + z * this1[10] + this1[14]; + i += 3; + } +}; +lime_math_Matrix4.transpose = function(this1) { + var temp = this1[1]; + this1[1] = this1[4]; + this1[4] = temp; + var temp = this1[2]; + this1[2] = this1[8]; + this1[8] = temp; + var temp = this1[3]; + this1[3] = this1[12]; + this1[12] = temp; + var temp = this1[6]; + this1[6] = this1[9]; + this1[9] = temp; + var temp = this1[7]; + this1[7] = this1[13]; + this1[13] = temp; + var temp = this1[11]; + this1[11] = this1[14]; + this1[14] = temp; +}; +lime_math_Matrix4.__getAxisRotation = function(this1,x,y,z,degrees) { + var m = lime_math_Matrix4._new(); + var a1 = new lime_math_Vector4(x,y,z); + var rad = -degrees * (Math.PI / 180); + var c = Math.cos(rad); + var s = Math.sin(rad); + var t = 1.0 - c; + lime_math_Matrix4.set(m,0,c + a1.x * a1.x * t); + lime_math_Matrix4.set(m,5,c + a1.y * a1.y * t); + lime_math_Matrix4.set(m,10,c + a1.z * a1.z * t); + var tmp1 = a1.x * a1.y * t; + var tmp2 = a1.z * s; + lime_math_Matrix4.set(m,4,tmp1 + tmp2); + lime_math_Matrix4.set(m,1,tmp1 - tmp2); + tmp1 = a1.x * a1.z * t; + tmp2 = a1.y * s; + lime_math_Matrix4.set(m,8,tmp1 - tmp2); + lime_math_Matrix4.set(m,2,tmp1 + tmp2); + tmp1 = a1.y * a1.z * t; + tmp2 = a1.x * s; + lime_math_Matrix4.set(m,9,tmp1 + tmp2); + lime_math_Matrix4.set(m,6,tmp1 - tmp2); + return m; +}; +lime_math_Matrix4.__swap = function(this1,a,b) { + var temp = this1[a]; + this1[a] = this1[b]; + this1[b] = temp; +}; +lime_math_Matrix4.get_determinant = function(this1) { + return (this1[0] * this1[5] - this1[4] * this1[1]) * (this1[10] * this1[15] - this1[14] * this1[11]) - (this1[0] * this1[9] - this1[8] * this1[1]) * (this1[6] * this1[15] - this1[14] * this1[7]) + (this1[0] * this1[13] - this1[12] * this1[1]) * (this1[6] * this1[11] - this1[10] * this1[7]) + (this1[4] * this1[9] - this1[8] * this1[5]) * (this1[2] * this1[15] - this1[14] * this1[3]) - (this1[4] * this1[13] - this1[12] * this1[5]) * (this1[2] * this1[11] - this1[10] * this1[3]) + (this1[8] * this1[13] - this1[12] * this1[9]) * (this1[2] * this1[7] - this1[6] * this1[3]); +}; +lime_math_Matrix4.get_position = function(this1) { + return new lime_math_Vector4(this1[12],this1[13],this1[14]); +}; +lime_math_Matrix4.set_position = function(this1,val) { + this1[12] = val.x; + this1[13] = val.y; + this1[14] = val.z; + return val; +}; +lime_math_Matrix4.get = function(this1,index) { + return this1[index]; +}; +lime_math_Matrix4.set = function(this1,index,value) { + this1[index] = value; + return value; +}; +var lime_math_RGBA = {}; +lime_math_RGBA.__properties__ = {set_r:"set_r",get_r:"get_r",set_g:"set_g",get_g:"get_g",set_b:"set_b",get_b:"get_b",set_a:"set_a",get_a:"get_a"}; +lime_math_RGBA._new = function(rgba) { + if(rgba == null) { + rgba = 0; + } + return rgba; +}; +lime_math_RGBA.create = function(r,g,b,a) { + var rgba = 0; + rgba = (r & 255) << 24 | (g & 255) << 16 | (b & 255) << 8 | a & 255; + return rgba; +}; +lime_math_RGBA.multiplyAlpha = function(this1) { + if((this1 & 255) == 0) { + if(this1 != 0) { + this1 = 0; + } + } else if((this1 & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[this1 & 255]; + this1 = ((this1 >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | this1 & 255 & 255; + } +}; +lime_math_RGBA.readUInt8 = function(this1,data,offset,format,premultiplied) { + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + switch(format) { + case 0: + this1 = (data[offset] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset + 2] & 255) << 8 | data[offset + 3] & 255; + break; + case 1: + this1 = (data[offset + 1] & 255) << 24 | (data[offset + 2] & 255) << 16 | (data[offset + 3] & 255) << 8 | data[offset] & 255; + break; + case 2: + this1 = (data[offset + 2] & 255) << 24 | (data[offset + 1] & 255) << 16 | (data[offset] & 255) << 8 | data[offset + 3] & 255; + break; + } + if(premultiplied) { + if((this1 & 255) != 0 && (this1 & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (this1 & 255); + this1 = (lime_math_RGBA.__clamp[Math.round((this1 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((this1 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((this1 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | this1 & 255 & 255; + } + } +}; +lime_math_RGBA.set = function(this1,r,g,b,a) { + this1 = (r & 255) << 24 | (g & 255) << 16 | (b & 255) << 8 | a & 255; +}; +lime_math_RGBA.unmultiplyAlpha = function(this1) { + if((this1 & 255) != 0 && (this1 & 255) != 255) { + lime_math_RGBA.unmult = 255.0 / (this1 & 255); + this1 = (lime_math_RGBA.__clamp[Math.round((this1 >>> 24 & 255) * lime_math_RGBA.unmult)] & 255) << 24 | (lime_math_RGBA.__clamp[Math.round((this1 >>> 16 & 255) * lime_math_RGBA.unmult)] & 255) << 16 | (lime_math_RGBA.__clamp[Math.round((this1 >>> 8 & 255) * lime_math_RGBA.unmult)] & 255) << 8 | this1 & 255 & 255; + } +}; +lime_math_RGBA.writeUInt8 = function(this1,data,offset,format,premultiplied) { + if(premultiplied == null) { + premultiplied = false; + } + if(format == null) { + format = 0; + } + if(premultiplied) { + if((this1 & 255) == 0) { + if(this1 != 0) { + this1 = 0; + } + } else if((this1 & 255) != 255) { + lime_math_RGBA.a16 = lime_math_RGBA.__alpha16[this1 & 255]; + this1 = ((this1 >>> 24 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 24 | ((this1 >>> 16 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 16 | ((this1 >>> 8 & 255) * lime_math_RGBA.a16 >> 16 & 255) << 8 | this1 & 255 & 255; + } + } + switch(format) { + case 0: + data[offset] = this1 >>> 24 & 255; + data[offset + 1] = this1 >>> 16 & 255; + data[offset + 2] = this1 >>> 8 & 255; + data[offset + 3] = this1 & 255; + break; + case 1: + data[offset] = this1 & 255; + data[offset + 1] = this1 >>> 24 & 255; + data[offset + 2] = this1 >>> 16 & 255; + data[offset + 3] = this1 >>> 8 & 255; + break; + case 2: + data[offset] = this1 >>> 8 & 255; + data[offset + 1] = this1 >>> 16 & 255; + data[offset + 2] = this1 >>> 24 & 255; + data[offset + 3] = this1 & 255; + break; + } +}; +lime_math_RGBA.__fromARGB = function(argb) { + var rgba = 0; + rgba = (argb >>> 16 & 255 & 255) << 24 | (argb >>> 8 & 255 & 255) << 16 | (argb & 255 & 255) << 8 | argb >>> 24 & 255 & 255; + return rgba; +}; +lime_math_RGBA.__fromBGRA = function(bgra) { + var rgba = 0; + rgba = (bgra >>> 8 & 255 & 255) << 24 | (bgra >>> 16 & 255 & 255) << 16 | (bgra >>> 24 & 255 & 255) << 8 | bgra & 255 & 255; + return rgba; +}; +lime_math_RGBA.get_a = function(this1) { + return this1 & 255; +}; +lime_math_RGBA.set_a = function(this1,value) { + this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | value & 255; + return value; +}; +lime_math_RGBA.get_b = function(this1) { + return this1 >>> 8 & 255; +}; +lime_math_RGBA.set_b = function(this1,value) { + this1 = (this1 >>> 24 & 255 & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (value & 255) << 8 | this1 & 255 & 255; + return value; +}; +lime_math_RGBA.get_g = function(this1) { + return this1 >>> 16 & 255; +}; +lime_math_RGBA.set_g = function(this1,value) { + this1 = (this1 >>> 24 & 255 & 255) << 24 | (value & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255; + return value; +}; +lime_math_RGBA.get_r = function(this1) { + return this1 >>> 24 & 255; +}; +lime_math_RGBA.set_r = function(this1,value) { + this1 = (value & 255) << 24 | (this1 >>> 16 & 255 & 255) << 16 | (this1 >>> 8 & 255 & 255) << 8 | this1 & 255 & 255; + return value; +}; +var lime_math_Rectangle = function(x,y,width,height) { + if(height == null) { + height = 0; + } + if(width == null) { + width = 0; + } + if(y == null) { + y = 0; + } + if(x == null) { + x = 0; + } + this.x = x; + this.y = y; + this.width = width; + this.height = height; +}; +$hxClasses["lime.math.Rectangle"] = lime_math_Rectangle; +lime_math_Rectangle.__name__ = "lime.math.Rectangle"; +lime_math_Rectangle.prototype = { + clone: function() { + return new lime_math_Rectangle(this.x,this.y,this.width,this.height); + } + ,contains: function(x,y) { + if(x >= this.x && y >= this.y && x < this.get_right()) { + return y < this.get_bottom(); + } else { + return false; + } + } + ,containsPoint: function(point) { + return this.containsVector(point); + } + ,containsRect: function(rect) { + if(rect.width <= 0 || rect.height <= 0) { + if(rect.x > this.x && rect.y > this.y && rect.get_right() < this.get_right()) { + return rect.get_bottom() < this.get_bottom(); + } else { + return false; + } + } else if(rect.x >= this.x && rect.y >= this.y && rect.get_right() <= this.get_right()) { + return rect.get_bottom() <= this.get_bottom(); + } else { + return false; + } + } + ,containsVector: function(vector) { + return this.contains(vector.x,vector.y); + } + ,copyFrom: function(sourceRect) { + this.x = sourceRect.x; + this.y = sourceRect.y; + this.width = sourceRect.width; + this.height = sourceRect.height; + } + ,equals: function(toCompare) { + if(toCompare != null && this.x == toCompare.x && this.y == toCompare.y && this.width == toCompare.width) { + return this.height == toCompare.height; + } else { + return false; + } + } + ,inflate: function(dx,dy) { + this.x -= dx; + this.width += dx * 2; + this.y -= dy; + this.height += dy * 2; + } + ,inflateVector: function(vector) { + this.inflate(vector.x,vector.y); + } + ,intersection: function(toIntersect,result) { + if(result == null) { + result = new lime_math_Rectangle(); + } + var x0 = this.x < toIntersect.x ? toIntersect.x : this.x; + var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right(); + if(x1 <= x0) { + result.setEmpty(); + return result; + } + var y0 = this.y < toIntersect.y ? toIntersect.y : this.y; + var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom(); + if(y1 <= y0) { + result.setEmpty(); + return result; + } + result.x = x0; + result.y = y0; + result.width = x1 - x0; + result.height = y1 - y0; + return result; + } + ,intersects: function(toIntersect) { + var x0 = this.x < toIntersect.x ? toIntersect.x : this.x; + var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right(); + if(x1 <= x0) { + return false; + } + var y0 = this.y < toIntersect.y ? toIntersect.y : this.y; + var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom(); + return y1 > y0; + } + ,isEmpty: function() { + if(!(this.width <= 0)) { + return this.height <= 0; + } else { + return true; + } + } + ,offset: function(dx,dy) { + this.x += dx; + this.y += dy; + } + ,offsetVector: function(vector) { + this.x += vector.x; + this.y += vector.y; + } + ,setEmpty: function() { + this.x = this.y = this.width = this.height = 0; + } + ,setTo: function(xa,ya,widtha,heighta) { + this.x = xa; + this.y = ya; + this.width = widtha; + this.height = heighta; + } + ,union: function(toUnion,result) { + if(result == null) { + result = new lime_math_Rectangle(); + } + if(this.width == 0 || this.height == 0) { + result.copyFrom(toUnion); + } else if(toUnion.width == 0 || toUnion.height == 0) { + result.copyFrom(this); + } else { + var x0 = this.x > toUnion.x ? toUnion.x : this.x; + var x1 = this.get_right() < toUnion.get_right() ? toUnion.get_right() : this.get_right(); + var y0 = this.y > toUnion.y ? toUnion.y : this.y; + var y1 = this.get_bottom() < toUnion.get_bottom() ? toUnion.get_bottom() : this.get_bottom(); + result.setTo(x0,y0,x1 - x0,y1 - y0); + } + return result; + } + ,__toFlashRectangle: function() { + return null; + } + ,get_bottom: function() { + return this.y + this.height; + } + ,set_bottom: function(b) { + this.height = b - this.y; + return b; + } + ,get_bottomRight: function() { + return new lime_math_Vector2(this.x + this.width,this.y + this.height); + } + ,set_bottomRight: function(p) { + this.width = p.x - this.x; + this.height = p.y - this.y; + return p.clone(); + } + ,get_left: function() { + return this.x; + } + ,set_left: function(l) { + this.width -= l - this.x; + this.x = l; + return l; + } + ,get_right: function() { + return this.x + this.width; + } + ,set_right: function(r) { + this.width = r - this.x; + return r; + } + ,get_size: function() { + return new lime_math_Vector2(this.width,this.height); + } + ,set_size: function(p) { + this.width = p.x; + this.height = p.y; + return p.clone(); + } + ,get_top: function() { + return this.y; + } + ,set_top: function(t) { + this.height -= t - this.y; + this.y = t; + return t; + } + ,get_topLeft: function() { + return new lime_math_Vector2(this.x,this.y); + } + ,set_topLeft: function(p) { + this.x = p.x; + this.y = p.y; + return p.clone(); + } + ,__class__: lime_math_Rectangle + ,__properties__: {set_topLeft:"set_topLeft",get_topLeft:"get_topLeft",set_top:"set_top",get_top:"get_top",set_size:"set_size",get_size:"get_size",set_right:"set_right",get_right:"get_right",set_left:"set_left",get_left:"get_left",set_bottomRight:"set_bottomRight",get_bottomRight:"get_bottomRight",set_bottom:"set_bottom",get_bottom:"get_bottom"} +}; +var lime_math_Vector2 = function(x,y) { + if(y == null) { + y = 0; + } + if(x == null) { + x = 0; + } + this.x = x; + this.y = y; +}; +$hxClasses["lime.math.Vector2"] = lime_math_Vector2; +lime_math_Vector2.__name__ = "lime.math.Vector2"; +lime_math_Vector2.distance = function(pt1,pt2) { + var dx = pt1.x - pt2.x; + var dy = pt1.y - pt2.y; + return Math.sqrt(dx * dx + dy * dy); +}; +lime_math_Vector2.interpolate = function(pt1,pt2,f,result) { + if(result == null) { + result = new lime_math_Vector2(); + } + result.x = pt2.x + f * (pt1.x - pt2.x); + result.y = pt2.y + f * (pt1.y - pt2.y); + return result; +}; +lime_math_Vector2.polar = function(len,angle,result) { + if(result == null) { + result = new lime_math_Vector2(); + } + var ya = len * Math.sin(angle); + result.x = len * Math.cos(angle); + result.y = ya; + return result; +}; +lime_math_Vector2.prototype = { + add: function(v,result) { + if(result == null) { + result = new lime_math_Vector2(); + } + result.x = v.x + this.x; + result.y = v.y + this.y; + return result; + } + ,clone: function() { + return new lime_math_Vector2(this.x,this.y); + } + ,equals: function(toCompare) { + if(toCompare != null && toCompare.x == this.x) { + return toCompare.y == this.y; + } else { + return false; + } + } + ,normalize: function(thickness) { + if(this.x == 0 && this.y == 0) { + return; + } else { + var norm = thickness / Math.sqrt(this.x * this.x + this.y * this.y); + this.x *= norm; + this.y *= norm; + } + } + ,offset: function(dx,dy) { + this.x += dx; + this.y += dy; + } + ,setTo: function(xa,ya) { + this.x = xa; + this.y = ya; + } + ,subtract: function(v,result) { + if(result == null) { + result = new lime_math_Vector2(); + } + result.x = this.x - v.x; + result.y = this.y - v.y; + return result; + } + ,__toFlashPoint: function() { + return null; + } + ,get_length: function() { + return Math.sqrt(this.x * this.x + this.y * this.y); + } + ,get_lengthSquared: function() { + return this.x * this.x + this.y * this.y; + } + ,__class__: lime_math_Vector2 + ,__properties__: {get_lengthSquared:"get_lengthSquared",get_length:"get_length"} +}; +var lime_math_Vector4 = function(x,y,z,w) { + if(w == null) { + w = 0.; + } + if(z == null) { + z = 0.; + } + if(y == null) { + y = 0.; + } + if(x == null) { + x = 0.; + } + this.w = w; + this.x = x; + this.y = y; + this.z = z; +}; +$hxClasses["lime.math.Vector4"] = lime_math_Vector4; +lime_math_Vector4.__name__ = "lime.math.Vector4"; +lime_math_Vector4.__properties__ = {get_Z_AXIS:"get_Z_AXIS",get_Y_AXIS:"get_Y_AXIS",get_X_AXIS:"get_X_AXIS"}; +lime_math_Vector4.angleBetween = function(a,b) { + var a0 = new lime_math_Vector4(a.x,a.y,a.z,a.w); + var l = Math.sqrt(a0.x * a0.x + a0.y * a0.y + a0.z * a0.z); + if(l != 0) { + a0.x /= l; + a0.y /= l; + a0.z /= l; + } + var b0 = new lime_math_Vector4(b.x,b.y,b.z,b.w); + var l = Math.sqrt(b0.x * b0.x + b0.y * b0.y + b0.z * b0.z); + if(l != 0) { + b0.x /= l; + b0.y /= l; + b0.z /= l; + } + return Math.acos(a0.x * b0.x + a0.y * b0.y + a0.z * b0.z); +}; +lime_math_Vector4.distance = function(pt1,pt2) { + var x = pt2.x - pt1.x; + var y = pt2.y - pt1.y; + var z = pt2.z - pt1.z; + return Math.sqrt(x * x + y * y + z * z); +}; +lime_math_Vector4.distanceSquared = function(pt1,pt2) { + var x = pt2.x - pt1.x; + var y = pt2.y - pt1.y; + var z = pt2.z - pt1.z; + return x * x + y * y + z * z; +}; +lime_math_Vector4.get_X_AXIS = function() { + return new lime_math_Vector4(1,0,0); +}; +lime_math_Vector4.get_Y_AXIS = function() { + return new lime_math_Vector4(0,1,0); +}; +lime_math_Vector4.get_Z_AXIS = function() { + return new lime_math_Vector4(0,0,1); +}; +lime_math_Vector4.prototype = { + add: function(a,result) { + if(result == null) { + result = new lime_math_Vector4(); + } + result.x = this.x + a.x; + result.y = this.y + a.y; + result.z = this.z + a.z; + return result; + } + ,clone: function() { + return new lime_math_Vector4(this.x,this.y,this.z,this.w); + } + ,copyFrom: function(sourceVector4) { + this.x = sourceVector4.x; + this.y = sourceVector4.y; + this.z = sourceVector4.z; + } + ,crossProduct: function(a,result) { + if(result == null) { + result = new lime_math_Vector4(); + } + var ya = this.z * a.x - this.x * a.z; + var za = this.x * a.y - this.y * a.x; + result.x = this.y * a.z - this.z * a.y; + result.y = ya; + result.z = za; + result.w = 1; + return result; + } + ,decrementBy: function(a) { + this.x -= a.x; + this.y -= a.y; + this.z -= a.z; + } + ,dotProduct: function(a) { + return this.x * a.x + this.y * a.y + this.z * a.z; + } + ,equals: function(toCompare,allFour) { + if(allFour == null) { + allFour = false; + } + if(this.x == toCompare.x && this.y == toCompare.y && this.z == toCompare.z) { + if(!(!allFour)) { + return this.w == toCompare.w; + } else { + return true; + } + } else { + return false; + } + } + ,incrementBy: function(a) { + this.x += a.x; + this.y += a.y; + this.z += a.z; + } + ,nearEquals: function(toCompare,tolerance,allFour) { + if(allFour == null) { + allFour = false; + } + if(Math.abs(this.x - toCompare.x) < tolerance && Math.abs(this.y - toCompare.y) < tolerance && Math.abs(this.z - toCompare.z) < tolerance) { + if(!(!allFour)) { + return Math.abs(this.w - toCompare.w) < tolerance; + } else { + return true; + } + } else { + return false; + } + } + ,negate: function() { + this.x *= -1; + this.y *= -1; + this.z *= -1; + } + ,normalize: function() { + var l = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + if(l != 0) { + this.x /= l; + this.y /= l; + this.z /= l; + } + return l; + } + ,project: function() { + this.x /= this.w; + this.y /= this.w; + this.z /= this.w; + } + ,scaleBy: function(s) { + this.x *= s; + this.y *= s; + this.z *= s; + } + ,setTo: function(xa,ya,za) { + this.x = xa; + this.y = ya; + this.z = za; + } + ,subtract: function(a,result) { + if(result == null) { + result = new lime_math_Vector4(); + } + result.x = this.x - a.x; + result.y = this.y - a.y; + result.z = this.z - a.z; + return result; + } + ,toString: function() { + return "Vector4(" + this.x + ", " + this.y + ", " + this.z + ")"; + } + ,get_length: function() { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + } + ,get_lengthSquared: function() { + return this.x * this.x + this.y * this.y + this.z * this.z; + } + ,__class__: lime_math_Vector4 + ,__properties__: {get_lengthSquared:"get_lengthSquared",get_length:"get_length"} +}; +var lime_media_AudioBuffer = function() { +}; +$hxClasses["lime.media.AudioBuffer"] = lime_media_AudioBuffer; +lime_media_AudioBuffer.__name__ = "lime.media.AudioBuffer"; +lime_media_AudioBuffer.fromBase64 = function(base64String) { + if(base64String == null) { + return null; + } + if(base64String.indexOf(",") == -1) { + base64String = "data:" + lime_media_AudioBuffer.__getCodec(lime__$internal_format_Base64.decode(base64String)) + ";base64," + base64String; + } + var audioBuffer = new lime_media_AudioBuffer(); + audioBuffer.set_src(new Howl({ src : [base64String], html5 : true, preload : false})); + return audioBuffer; +}; +lime_media_AudioBuffer.fromBytes = function(bytes) { + if(bytes == null) { + return null; + } + var audioBuffer = new lime_media_AudioBuffer(); + audioBuffer.set_src(new Howl({ src : ["data:" + lime_media_AudioBuffer.__getCodec(bytes) + ";base64," + lime__$internal_format_Base64.encode(bytes)], html5 : true, preload : false})); + return audioBuffer; +}; +lime_media_AudioBuffer.fromFile = function(path) { + if(path == null) { + return null; + } + var audioBuffer = new lime_media_AudioBuffer(); + audioBuffer.__srcHowl = new Howl({ src : [path], preload : false}); + return audioBuffer; +}; +lime_media_AudioBuffer.fromFiles = function(paths) { + var audioBuffer = new lime_media_AudioBuffer(); + audioBuffer.__srcHowl = new Howl({ src : paths, preload : false}); + return audioBuffer; +}; +lime_media_AudioBuffer.fromVorbisFile = function(vorbisFile) { + return null; +}; +lime_media_AudioBuffer.loadFromFile = function(path) { + var promise = new lime_app_Promise(); + var audioBuffer = lime_media_AudioBuffer.fromFile(path); + if(audioBuffer != null) { + if(audioBuffer != null) { + audioBuffer.__srcHowl.on("load",function() { + promise.complete(audioBuffer); + }); + audioBuffer.__srcHowl.on("loaderror",function(id,msg) { + promise.error(msg); + }); + audioBuffer.__srcHowl.load(); + } + } else { + promise.error(null); + } + return promise.future; +}; +lime_media_AudioBuffer.loadFromFiles = function(paths) { + var promise = new lime_app_Promise(); + var audioBuffer = lime_media_AudioBuffer.fromFiles(paths); + if(audioBuffer != null) { + audioBuffer.__srcHowl.on("load",function() { + promise.complete(audioBuffer); + }); + audioBuffer.__srcHowl.on("loaderror",function() { + promise.error(null); + }); + audioBuffer.__srcHowl.load(); + } else { + promise.error(null); + } + return promise.future; +}; +lime_media_AudioBuffer.__getCodec = function(bytes) { + var signature = bytes.getString(0,4); + switch(signature) { + case "OggS": + return "audio/ogg"; + case "RIFF": + if(bytes.getString(8,4) == "WAVE") { + return "audio/wav"; + } else { + var _g = bytes.b[1]; + var _g1 = bytes.b[2]; + switch(bytes.b[0]) { + case 73: + if(_g == 68) { + if(_g1 == 51) { + return "audio/mp3"; + } + } + break; + case 255: + switch(_g) { + case 243:case 250:case 251: + return "audio/mp3"; + default: + } + break; + default: + } + } + break; + case "fLaC": + return "audio/flac"; + default: + var _g = bytes.b[1]; + var _g1 = bytes.b[2]; + switch(bytes.b[0]) { + case 73: + if(_g == 68) { + if(_g1 == 51) { + return "audio/mp3"; + } + } + break; + case 255: + switch(_g) { + case 243:case 250:case 251: + return "audio/mp3"; + default: + } + break; + default: + } + } + lime_utils_Log.error("Unsupported sound format",{ fileName : "lime/media/AudioBuffer.hx", lineNumber : 440, className : "lime.media.AudioBuffer", methodName : "__getCodec"}); + return null; +}; +lime_media_AudioBuffer.prototype = { + dispose: function() { + this.__srcHowl.unload(); + } + ,get_src: function() { + return this.__srcHowl; + } + ,set_src: function(value) { + return this.__srcHowl = value; + } + ,__class__: lime_media_AudioBuffer + ,__properties__: {set_src:"set_src",get_src:"get_src"} +}; +var lime_media_AudioContext = function(type) { + if(type != "custom") { + if(type == null || type == "web") { + try { + window.AudioContext = window.AudioContext || window.webkitAudioContext; + this.web = new window.AudioContext (); + this.type = "web"; + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + } + } + if(this.web == null && type != "web") { + this.html5 = new lime_media_HTML5AudioContext(); + this.type = "html5"; + } + } else { + this.type = "custom"; + } +}; +$hxClasses["lime.media.AudioContext"] = lime_media_AudioContext; +lime_media_AudioContext.__name__ = "lime.media.AudioContext"; +lime_media_AudioContext.prototype = { + __class__: lime_media_AudioContext +}; +var lime_media_AudioManager = function() { }; +$hxClasses["lime.media.AudioManager"] = lime_media_AudioManager; +lime_media_AudioManager.__name__ = "lime.media.AudioManager"; +lime_media_AudioManager.init = function(context) { + if(lime_media_AudioManager.context == null) { + if(context == null) { + lime_media_AudioManager.context = new lime_media_AudioContext(); + context = lime_media_AudioManager.context; + if(context.type == "openal") { + var alc = context.openal; + var device = alc.openDevice(); + if(device != null) { + var ctx = alc.createContext(device); + alc.makeContextCurrent(ctx); + alc.processContext(ctx); + } + } + } + lime_media_AudioManager.context = context; + } +}; +lime_media_AudioManager.resume = function() { + if(lime_media_AudioManager.context != null && lime_media_AudioManager.context.type == "openal") { + var alc = lime_media_AudioManager.context.openal; + var currentContext = alc.getCurrentContext(); + if(currentContext != null) { + var device = alc.getContextsDevice(currentContext); + alc.resumeDevice(device); + alc.processContext(currentContext); + } + } +}; +lime_media_AudioManager.shutdown = function() { + if(lime_media_AudioManager.context != null && lime_media_AudioManager.context.type == "openal") { + var alc = lime_media_AudioManager.context.openal; + var currentContext = alc.getCurrentContext(); + if(currentContext != null) { + var device = alc.getContextsDevice(currentContext); + alc.makeContextCurrent(null); + alc.destroyContext(currentContext); + if(device != null) { + alc.closeDevice(device); + } + } + } + lime_media_AudioManager.context = null; +}; +lime_media_AudioManager.suspend = function() { + if(lime_media_AudioManager.context != null && lime_media_AudioManager.context.type == "openal") { + var alc = lime_media_AudioManager.context.openal; + var currentContext = alc.getCurrentContext(); + if(currentContext != null) { + alc.suspendContext(currentContext); + var device = alc.getContextsDevice(currentContext); + if(device != null) { + alc.pauseDevice(device); + } + } + } +}; +var lime_media_AudioSource = function(buffer,offset,length,loops) { + if(loops == null) { + loops = 0; + } + if(offset == null) { + offset = 0; + } + this.onComplete = new lime_app__$Event_$Void_$Void(); + this.buffer = buffer; + this.offset = offset; + this.__backend = new lime__$internal_backend_html5_HTML5AudioSource(this); + if(length != null && length != 0) { + this.set_length(length); + } + this.set_loops(loops); + if(buffer != null) { + this.init(); + } +}; +$hxClasses["lime.media.AudioSource"] = lime_media_AudioSource; +lime_media_AudioSource.__name__ = "lime.media.AudioSource"; +lime_media_AudioSource.prototype = { + dispose: function() { + this.__backend.dispose(); + } + ,init: function() { + this.__backend.init(); + } + ,play: function() { + this.__backend.play(); + } + ,pause: function() { + this.__backend.pause(); + } + ,stop: function() { + this.__backend.stop(); + } + ,get_currentTime: function() { + return this.__backend.getCurrentTime(); + } + ,set_currentTime: function(value) { + return this.__backend.setCurrentTime(value); + } + ,get_gain: function() { + return this.__backend.getGain(); + } + ,set_gain: function(value) { + return this.__backend.setGain(value); + } + ,get_length: function() { + return this.__backend.getLength(); + } + ,set_length: function(value) { + return this.__backend.setLength(value); + } + ,get_loops: function() { + return this.__backend.getLoops(); + } + ,set_loops: function(value) { + return this.__backend.setLoops(value); + } + ,get_pitch: function() { + return this.__backend.getPitch(); + } + ,set_pitch: function(value) { + return this.__backend.setPitch(value); + } + ,get_position: function() { + return this.__backend.getPosition(); + } + ,set_position: function(value) { + return this.__backend.setPosition(value); + } + ,__class__: lime_media_AudioSource + ,__properties__: {set_position:"set_position",get_position:"get_position",set_pitch:"set_pitch",get_pitch:"get_pitch",set_loops:"set_loops",get_loops:"get_loops",set_length:"set_length",get_length:"get_length",set_gain:"set_gain",get_gain:"get_gain",set_currentTime:"set_currentTime",get_currentTime:"get_currentTime"} +}; +var lime_media_FlashAudioContext = function() { +}; +$hxClasses["lime.media.FlashAudioContext"] = lime_media_FlashAudioContext; +lime_media_FlashAudioContext.__name__ = "lime.media.FlashAudioContext"; +lime_media_FlashAudioContext.prototype = { + createBuffer: function(stream,context) { + return null; + } + ,getBytesLoaded: function(buffer) { + return 0; + } + ,getBytesTotal: function(buffer) { + return 0; + } + ,getID3: function(buffer) { + return null; + } + ,getIsBuffering: function(buffer) { + return false; + } + ,getIsURLInaccessible: function(buffer) { + return false; + } + ,getLength: function(buffer) { + return 0; + } + ,getURL: function(buffer) { + return null; + } + ,close: function(buffer) { + } + ,extract: function(buffer,target,length,startPosition) { + if(startPosition == null) { + startPosition = -1; + } + return 0; + } + ,load: function(buffer,stream,context) { + } + ,loadCompressedDataFromByteArray: function(buffer,bytes,bytesLength) { + } + ,loadPCMFromByteArray: function(buffer,bytes,samples,format,stereo,sampleRate) { + if(sampleRate == null) { + sampleRate = 44100; + } + if(stereo == null) { + stereo = true; + } + } + ,play: function(buffer,startTime,loops,sndTransform) { + if(loops == null) { + loops = 0; + } + if(startTime == null) { + startTime = 0; + } + return null; + } + ,__class__: lime_media_FlashAudioContext +}; +var lime_media_HTML5AudioContext = function() { + this.NETWORK_NO_SOURCE = 3; + this.NETWORK_LOADING = 2; + this.NETWORK_IDLE = 1; + this.NETWORK_EMPTY = 0; + this.HAVE_NOTHING = 0; + this.HAVE_METADATA = 1; + this.HAVE_FUTURE_DATA = 3; + this.HAVE_ENOUGH_DATA = 4; + this.HAVE_CURRENT_DATA = 2; +}; +$hxClasses["lime.media.HTML5AudioContext"] = lime_media_HTML5AudioContext; +lime_media_HTML5AudioContext.__name__ = "lime.media.HTML5AudioContext"; +lime_media_HTML5AudioContext.prototype = { + canPlayType: function(buffer,type) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.canPlayType(type); + } + return null; + } + ,createBuffer: function(urlString) { + var buffer = new lime_media_AudioBuffer(); + buffer.__srcAudio = new Audio(); + buffer.__srcAudio.src = urlString; + return buffer; + } + ,getAutoplay: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.autoplay; + } + return false; + } + ,getBuffered: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.buffered; + } + return null; + } + ,getCurrentSrc: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.currentSrc; + } + return null; + } + ,getCurrentTime: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.currentTime; + } + return 0; + } + ,getDefaultPlaybackRate: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.defaultPlaybackRate; + } + return 1; + } + ,getDuration: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.duration; + } + return 0; + } + ,getEnded: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.ended; + } + return false; + } + ,getError: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.error; + } + return null; + } + ,getLoop: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.loop; + } + return false; + } + ,getMuted: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.muted; + } + return false; + } + ,getNetworkState: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.networkState; + } + return 0; + } + ,getPaused: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.paused; + } + return false; + } + ,getPlaybackRate: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.playbackRate; + } + return 1; + } + ,getPlayed: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.played; + } + return null; + } + ,getPreload: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.preload; + } + return null; + } + ,getReadyState: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.readyState; + } + return 0; + } + ,getSeekable: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.seekable; + } + return null; + } + ,getSeeking: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.seeking; + } + return false; + } + ,getSrc: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.src; + } + return null; + } + ,getStartTime: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.playbackRate; + } + return 0; + } + ,getVolume: function(buffer) { + if(buffer.__srcAudio != null) { + return buffer.__srcAudio.volume; + } + return 1; + } + ,load: function(buffer) { + if(buffer.__srcAudio != null) { + buffer.__srcAudio.load(); + } + } + ,pause: function(buffer) { + if(buffer.__srcAudio != null) { + buffer.__srcAudio.pause(); + } + } + ,play: function(buffer) { + if(buffer.__srcAudio != null) { + buffer.__srcAudio.play(); + } + } + ,setAutoplay: function(buffer,value) { + if(buffer.__srcAudio != null) { + buffer.__srcAudio.autoplay = value; + } + } + ,setCurrentTime: function(buffer,value) { + if(buffer.__srcAudio != null) { + buffer.__srcAudio.currentTime = value; + } + } + ,setDefaultPlaybackRate: function(buffer,value) { + if(buffer.__srcAudio != null) { + buffer.__srcAudio.defaultPlaybackRate = value; + } + } + ,setLoop: function(buffer,value) { + if(buffer.__srcAudio != null) { + buffer.__srcAudio.loop = value; + } + } + ,setMuted: function(buffer,value) { + if(buffer.__srcAudio != null) { + buffer.__srcAudio.muted = value; + } + } + ,setPlaybackRate: function(buffer,value) { + if(buffer.__srcAudio != null) { + buffer.__srcAudio.playbackRate = value; + } + } + ,setPreload: function(buffer,value) { + if(buffer.__srcAudio != null) { + buffer.__srcAudio.preload = value; + } + } + ,setSrc: function(buffer,value) { + if(buffer.__srcAudio != null) { + buffer.__srcAudio.src = value; + } + } + ,setVolume: function(buffer,value) { + if(buffer.__srcAudio != null) { + buffer.__srcAudio.volume = value; + } + } + ,__class__: lime_media_HTML5AudioContext +}; +var lime_media_OpenALAudioContext = function() { + this.ALL_DEVICES_SPECIFIER = 4115; + this.DEFAULT_ALL_DEVICES_SPECIFIER = 4114; + this.ENUMERATE_ALL_EXT = 1; + this.DEVICE_SPECIFIER = 4101; + this.DEFAULT_DEVICE_SPECIFIER = 4100; + this.ALL_ATTRIBUTES = 4099; + this.ATTRIBUTES_SIZE = 4098; + this.INVALID_CONTEXT = 40962; + this.INVALID_DEVICE = 40961; + this.STEREO_SOURCES = 4113; + this.MONO_SOURCES = 4112; + this.SYNC = 4105; + this.REFRESH = 4104; + this.EXPONENT_DISTANCE_CLAMPED = 53254; + this.EXPONENT_DISTANCE = 53253; + this.LINEAR_DISTANCE_CLAMPED = 53252; + this.LINEAR_DISTANCE = 53251; + this.INVERSE_DISTANCE_CLAMPED = 53250; + this.INVERSE_DISTANCE = 53249; + this.DISTANCE_MODEL = 53248; + this.DOPPLER_VELOCITY = 49153; + this.SPEED_OF_SOUND = 49155; + this.DOPPLER_FACTOR = 49152; + this.EXTENSIONS = 45060; + this.RENDERER = 45059; + this.VERSION = 45058; + this.VENDOR = 45057; + this.OUT_OF_MEMORY = 40965; + this.INVALID_OPERATION = 40964; + this.INVALID_VALUE = 40963; + this.INVALID_ENUM = 40962; + this.INVALID_NAME = 40961; + this.NO_ERROR = 0; + this.SIZE = 8196; + this.CHANNELS = 8195; + this.BITS = 8194; + this.FREQUENCY = 8193; + this.FORMAT_STEREO16 = 4355; + this.FORMAT_STEREO8 = 4354; + this.FORMAT_MONO16 = 4353; + this.FORMAT_MONO8 = 4352; + this.UNDETERMINED = 4144; + this.STREAMING = 4137; + this.STATIC = 4136; + this.SOURCE_TYPE = 4135; + this.BYTE_OFFSET = 4134; + this.SAMPLE_OFFSET = 4133; + this.SEC_OFFSET = 4132; + this.MAX_DISTANCE = 4131; + this.CONE_OUTER_GAIN = 4130; + this.ROLLOFF_FACTOR = 4129; + this.REFERENCE_DISTANCE = 4128; + this.BUFFERS_PROCESSED = 4118; + this.BUFFERS_QUEUED = 4117; + this.STOPPED = 4116; + this.PAUSED = 4115; + this.PLAYING = 4114; + this.INITIAL = 4113; + this.SOURCE_STATE = 4112; + this.ORIENTATION = 4111; + this.MAX_GAIN = 4110; + this.MIN_GAIN = 4109; + this.GAIN = 4106; + this.BUFFER = 4105; + this.LOOPING = 4103; + this.VELOCITY = 4102; + this.DIRECTION = 4101; + this.POSITION = 4100; + this.PITCH = 4099; + this.CONE_OUTER_ANGLE = 4098; + this.CONE_INNER_ANGLE = 4097; + this.SOURCE_RELATIVE = 514; + this.TRUE = 1; + this.FALSE = 0; + this.NONE = 0; +}; +$hxClasses["lime.media.OpenALAudioContext"] = lime_media_OpenALAudioContext; +lime_media_OpenALAudioContext.__name__ = "lime.media.OpenALAudioContext"; +lime_media_OpenALAudioContext.prototype = { + bufferData: function(buffer,format,data,size,freq) { + lime_media_openal_AL.bufferData(buffer,format,data,size,freq); + } + ,buffer3f: function(buffer,param,value1,value2,value3) { + lime_media_openal_AL.buffer3f(buffer,param,value1,value2,value3); + } + ,buffer3i: function(buffer,param,value1,value2,value3) { + lime_media_openal_AL.buffer3i(buffer,param,value1,value2,value3); + } + ,bufferf: function(buffer,param,value) { + lime_media_openal_AL.bufferf(buffer,param,value); + } + ,bufferfv: function(buffer,param,values) { + lime_media_openal_AL.bufferfv(buffer,param,values); + } + ,bufferi: function(buffer,param,value) { + lime_media_openal_AL.bufferi(buffer,param,value); + } + ,bufferiv: function(buffer,param,values) { + lime_media_openal_AL.bufferiv(buffer,param,values); + } + ,closeDevice: function(device) { + return lime_media_openal_ALC.closeDevice(device); + } + ,createContext: function(device,attrlist) { + return lime_media_openal_ALC.createContext(device,attrlist); + } + ,createBuffer: function() { + return lime_media_openal_AL.createBuffer(); + } + ,createSource: function() { + return lime_media_openal_AL.createSource(); + } + ,deleteBuffer: function(buffer) { + lime_media_openal_AL.deleteBuffer(buffer); + } + ,deleteBuffers: function(buffers) { + lime_media_openal_AL.deleteBuffers(buffers); + } + ,deleteSource: function(source) { + lime_media_openal_AL.deleteSource(source); + } + ,deleteSources: function(sources) { + lime_media_openal_AL.deleteSources(sources); + } + ,destroyContext: function(context) { + if(context == null) { + return; + } + lime_media_openal_ALC.destroyContext(context); + } + ,disable: function(capability) { + lime_media_openal_AL.disable(capability); + } + ,distanceModel: function(distanceModel) { + lime_media_openal_AL.distanceModel(distanceModel); + } + ,dopplerFactor: function(value) { + lime_media_openal_AL.dopplerFactor(value); + } + ,dopplerVelocity: function(value) { + lime_media_openal_AL.dopplerVelocity(value); + } + ,enable: function(capability) { + lime_media_openal_AL.enable(capability); + } + ,genSource: function() { + return this.createSource(); + } + ,genSources: function(n) { + return lime_media_openal_AL.genSources(n); + } + ,genBuffer: function() { + return this.createBuffer(); + } + ,genBuffers: function(n) { + return lime_media_openal_AL.genBuffers(n); + } + ,getBoolean: function(param) { + return lime_media_openal_AL.getBoolean(param); + } + ,getBooleanv: function(param,count) { + if(count == null) { + count = 1; + } + return lime_media_openal_AL.getBooleanv(param,count); + } + ,getBuffer3f: function(buffer,param) { + return lime_media_openal_AL.getBuffer3f(buffer,param); + } + ,getBuffer3i: function(buffer,param) { + return lime_media_openal_AL.getBuffer3i(buffer,param); + } + ,getBufferf: function(buffer,param) { + return lime_media_openal_AL.getBufferf(buffer,param); + } + ,getBufferfv: function(buffer,param,count) { + if(count == null) { + count = 1; + } + return lime_media_openal_AL.getBufferfv(buffer,param,count); + } + ,getBufferi: function(buffer,param) { + return lime_media_openal_AL.getBufferi(buffer,param); + } + ,getBufferiv: function(buffer,param,count) { + if(count == null) { + count = 1; + } + return lime_media_openal_AL.getBufferiv(buffer,param,count); + } + ,getContextsDevice: function(context) { + if(context == null) { + return null; + } + return lime_media_openal_ALC.getContextsDevice(context); + } + ,getCurrentContext: function() { + return lime_media_openal_ALC.getCurrentContext(); + } + ,getDouble: function(param) { + return lime_media_openal_AL.getDouble(param); + } + ,getDoublev: function(param,count) { + if(count == null) { + count = 1; + } + return lime_media_openal_AL.getDoublev(param,count); + } + ,getEnumValue: function(ename) { + return lime_media_openal_AL.getEnumValue(ename); + } + ,getError: function(device) { + if(device == null) { + return lime_media_openal_AL.getError(); + } else { + return lime_media_openal_ALC.getError(device); + } + } + ,getErrorString: function(device) { + if(device == null) { + return lime_media_openal_AL.getErrorString(); + } else { + return lime_media_openal_ALC.getErrorString(device); + } + } + ,getFloat: function(param) { + return lime_media_openal_AL.getFloat(param); + } + ,getFloatv: function(param,count) { + if(count == null) { + count = 1; + } + return lime_media_openal_AL.getFloatv(param,count); + } + ,getInteger: function(param) { + return lime_media_openal_AL.getInteger(param); + } + ,getIntegerv: function(param,count,device) { + if(count == null) { + count = 1; + } + if(device == null) { + return lime_media_openal_AL.getIntegerv(param,count); + } else { + return lime_media_openal_ALC.getIntegerv(device,param,count); + } + } + ,getListener3f: function(param) { + return lime_media_openal_AL.getListener3f(param); + } + ,getListener3i: function(param) { + return lime_media_openal_AL.getListener3i(param); + } + ,getListenerf: function(param) { + return lime_media_openal_AL.getListenerf(param); + } + ,getListenerfv: function(param,count) { + if(count == null) { + count = 1; + } + return lime_media_openal_AL.getListenerfv(param,count); + } + ,getListeneri: function(param) { + return lime_media_openal_AL.getListeneri(param); + } + ,getListeneriv: function(param,count) { + if(count == null) { + count = 1; + } + return lime_media_openal_AL.getListeneriv(param,count); + } + ,getProcAddress: function(fname) { + return lime_media_openal_AL.getProcAddress(fname); + } + ,getSource3f: function(source,param) { + return lime_media_openal_AL.getSource3f(source,param); + } + ,getSourcef: function(source,param) { + return lime_media_openal_AL.getSourcef(source,param); + } + ,getSource3i: function(source,param) { + return lime_media_openal_AL.getSource3i(source,param); + } + ,getSourcefv: function(source,param,count) { + if(count == null) { + count = 1; + } + return lime_media_openal_AL.getSourcefv(source,param); + } + ,getSourcei: function(source,param) { + return lime_media_openal_AL.getSourcei(source,param); + } + ,getSourceiv: function(source,param,count) { + if(count == null) { + count = 1; + } + return lime_media_openal_AL.getSourceiv(source,param,count); + } + ,getString: function(param,device) { + if(device == null) { + return lime_media_openal_AL.getString(param); + } else { + return lime_media_openal_ALC.getString(device,param); + } + } + ,isBuffer: function(buffer) { + return lime_media_openal_AL.isBuffer(buffer); + } + ,isEnabled: function(capability) { + return lime_media_openal_AL.isEnabled(capability); + } + ,isExtensionPresent: function(extname) { + return lime_media_openal_AL.isExtensionPresent(extname); + } + ,isSource: function(source) { + return lime_media_openal_AL.isSource(source); + } + ,listener3f: function(param,value1,value2,value3) { + lime_media_openal_AL.listener3f(param,value1,value2,value3); + } + ,listener3i: function(param,value1,value2,value3) { + lime_media_openal_AL.listener3i(param,value1,value2,value3); + } + ,listenerf: function(param,value) { + lime_media_openal_AL.listenerf(param,value); + } + ,listenerfv: function(param,values) { + lime_media_openal_AL.listenerfv(param,values); + } + ,listeneri: function(param,value) { + lime_media_openal_AL.listeneri(param,value); + } + ,listeneriv: function(param,values) { + lime_media_openal_AL.listeneriv(param,values); + } + ,makeContextCurrent: function(context) { + return lime_media_openal_ALC.makeContextCurrent(context); + } + ,openDevice: function(deviceName) { + return lime_media_openal_ALC.openDevice(deviceName); + } + ,pauseDevice: function(device) { + lime_media_openal_ALC.pauseDevice(device); + } + ,processContext: function(context) { + lime_media_openal_ALC.processContext(context); + } + ,resumeDevice: function(device) { + lime_media_openal_ALC.resumeDevice(device); + } + ,source3f: function(source,param,value1,value2,value3) { + lime_media_openal_AL.source3f(source,param,value1,value2,value3); + } + ,source3i: function(source,param,value1,value2,value3) { + lime_media_openal_AL.source3i(source,param,value1,value2,value3); + } + ,sourcef: function(source,param,value) { + lime_media_openal_AL.sourcef(source,param,value); + } + ,sourcefv: function(source,param,values) { + lime_media_openal_AL.sourcefv(source,param,values); + } + ,sourcei: function(source,param,value) { + lime_media_openal_AL.sourcei(source,param,value); + } + ,sourceiv: function(source,param,values) { + lime_media_openal_AL.sourceiv(source,param,values); + } + ,sourcePlay: function(source) { + lime_media_openal_AL.sourcePlay(source); + } + ,sourcePlayv: function(sources) { + lime_media_openal_AL.sourcePlayv(sources); + } + ,sourceStop: function(source) { + lime_media_openal_AL.sourceStop(source); + } + ,sourceStopv: function(sources) { + lime_media_openal_AL.sourceStopv(sources); + } + ,sourceRewind: function(source) { + lime_media_openal_AL.sourceRewind(source); + } + ,sourceRewindv: function(sources) { + lime_media_openal_AL.sourceRewindv(sources); + } + ,sourcePause: function(source) { + lime_media_openal_AL.sourcePause(source); + } + ,sourcePausev: function(sources) { + lime_media_openal_AL.sourcePausev(sources); + } + ,sourceQueueBuffer: function(source,buffer) { + lime_media_openal_AL.sourceQueueBuffer(source,buffer); + } + ,sourceQueueBuffers: function(source,nb,buffers) { + lime_media_openal_AL.sourceQueueBuffers(source,nb,buffers); + } + ,sourceUnqueueBuffer: function(source) { + return lime_media_openal_AL.sourceUnqueueBuffer(source); + } + ,sourceUnqueueBuffers: function(source,nb) { + return lime_media_openal_AL.sourceUnqueueBuffers(source,nb); + } + ,speedOfSound: function(value) { + lime_media_openal_AL.speedOfSound(value); + } + ,suspendContext: function(context) { + lime_media_openal_ALC.suspendContext(context); + } + ,__class__: lime_media_OpenALAudioContext +}; +var lime_media_openal_AL = function() { }; +$hxClasses["lime.media.openal.AL"] = lime_media_openal_AL; +lime_media_openal_AL.__name__ = "lime.media.openal.AL"; +lime_media_openal_AL.removeDirectFilter = function(source) { +}; +lime_media_openal_AL.removeSend = function(source,index) { +}; +lime_media_openal_AL.auxf = function(aux,param,value) { +}; +lime_media_openal_AL.auxfv = function(aux,param,values) { +}; +lime_media_openal_AL.auxi = function(aux,param,value) { +}; +lime_media_openal_AL.auxiv = function(aux,param,values) { +}; +lime_media_openal_AL.bufferData = function(buffer,format,data,size,freq) { +}; +lime_media_openal_AL.buffer3f = function(buffer,param,value1,value2,value3) { +}; +lime_media_openal_AL.buffer3i = function(buffer,param,value1,value2,value3) { +}; +lime_media_openal_AL.bufferf = function(buffer,param,value) { +}; +lime_media_openal_AL.bufferfv = function(buffer,param,values) { +}; +lime_media_openal_AL.bufferi = function(buffer,param,value) { +}; +lime_media_openal_AL.bufferiv = function(buffer,param,values) { +}; +lime_media_openal_AL.createAux = function() { + return null; +}; +lime_media_openal_AL.createBuffer = function() { + return null; +}; +lime_media_openal_AL.createEffect = function() { + return null; +}; +lime_media_openal_AL.createFilter = function() { + return null; +}; +lime_media_openal_AL.createSource = function() { + return null; +}; +lime_media_openal_AL.deleteBuffer = function(buffer) { +}; +lime_media_openal_AL.deleteBuffers = function(buffers) { +}; +lime_media_openal_AL.deleteSource = function(source) { +}; +lime_media_openal_AL.deleteSources = function(sources) { +}; +lime_media_openal_AL.disable = function(capability) { +}; +lime_media_openal_AL.distanceModel = function(distanceModel) { +}; +lime_media_openal_AL.dopplerFactor = function(value) { +}; +lime_media_openal_AL.dopplerVelocity = function(value) { +}; +lime_media_openal_AL.effectf = function(effect,param,value) { +}; +lime_media_openal_AL.effectfv = function(effect,param,values) { +}; +lime_media_openal_AL.effecti = function(effect,param,value) { +}; +lime_media_openal_AL.effectiv = function(effect,param,values) { +}; +lime_media_openal_AL.enable = function(capability) { +}; +lime_media_openal_AL.genSource = function() { + return null; +}; +lime_media_openal_AL.genSources = function(n) { + return null; +}; +lime_media_openal_AL.genBuffer = function() { + return null; +}; +lime_media_openal_AL.genBuffers = function(n) { + return null; +}; +lime_media_openal_AL.getBoolean = function(param) { + return false; +}; +lime_media_openal_AL.getBooleanv = function(param,count) { + if(count == null) { + count = 1; + } + return null; +}; +lime_media_openal_AL.getBuffer3f = function(buffer,param) { + return null; +}; +lime_media_openal_AL.getBuffer3i = function(buffer,param) { + return null; +}; +lime_media_openal_AL.getBufferf = function(buffer,param) { + return 0; +}; +lime_media_openal_AL.getBufferfv = function(buffer,param,count) { + if(count == null) { + count = 1; + } + return null; +}; +lime_media_openal_AL.getBufferi = function(buffer,param) { + return 0; +}; +lime_media_openal_AL.getBufferiv = function(buffer,param,count) { + if(count == null) { + count = 1; + } + return null; +}; +lime_media_openal_AL.getDouble = function(param) { + return 0; +}; +lime_media_openal_AL.getDoublev = function(param,count) { + if(count == null) { + count = 1; + } + return null; +}; +lime_media_openal_AL.getEnumValue = function(ename) { + return 0; +}; +lime_media_openal_AL.getError = function() { + return 0; +}; +lime_media_openal_AL.getErrorString = function() { + switch(lime_media_openal_AL.getError()) { + case 40961: + return "INVALID_NAME: Invalid parameter name"; + case 40962: + return "INVALID_ENUM: Invalid enum value"; + case 40963: + return "INVALID_VALUE: Invalid parameter value"; + case 40964: + return "INVALID_OPERATION: Illegal operation or call"; + case 40965: + return "OUT_OF_MEMORY: OpenAL has run out of memory"; + default: + return ""; + } +}; +lime_media_openal_AL.getFilteri = function(filter,param) { + return 0; +}; +lime_media_openal_AL.getFloat = function(param) { + return 0; +}; +lime_media_openal_AL.getFloatv = function(param,count) { + if(count == null) { + count = 1; + } + return null; +}; +lime_media_openal_AL.getInteger = function(param) { + return 0; +}; +lime_media_openal_AL.getIntegerv = function(param,count) { + if(count == null) { + count = 1; + } + return null; +}; +lime_media_openal_AL.getListener3f = function(param) { + return null; +}; +lime_media_openal_AL.getListener3i = function(param) { + return null; +}; +lime_media_openal_AL.getListenerf = function(param) { + return 0; +}; +lime_media_openal_AL.getListenerfv = function(param,count) { + if(count == null) { + count = 1; + } + return null; +}; +lime_media_openal_AL.getListeneri = function(param) { + return 0; +}; +lime_media_openal_AL.getListeneriv = function(param,count) { + if(count == null) { + count = 1; + } + return null; +}; +lime_media_openal_AL.getParameter = function(param) { + return null; +}; +lime_media_openal_AL.getProcAddress = function(fname) { + return null; +}; +lime_media_openal_AL.getSource3f = function(source,param) { + return null; +}; +lime_media_openal_AL.getSourcef = function(source,param) { + return 0; +}; +lime_media_openal_AL.getSource3i = function(source,param) { + return null; +}; +lime_media_openal_AL.getSourcefv = function(source,param,count) { + if(count == null) { + count = 1; + } + return null; +}; +lime_media_openal_AL.getSourcei = function(source,param) { + return 0; +}; +lime_media_openal_AL.getSourceiv = function(source,param,count) { + if(count == null) { + count = 1; + } + return null; +}; +lime_media_openal_AL.getString = function(param) { + return null; +}; +lime_media_openal_AL.isBuffer = function(buffer) { + return false; +}; +lime_media_openal_AL.isEnabled = function(capability) { + return false; +}; +lime_media_openal_AL.isExtensionPresent = function(extname) { + return false; +}; +lime_media_openal_AL.isAux = function(aux) { + return false; +}; +lime_media_openal_AL.isEffect = function(effect) { + return false; +}; +lime_media_openal_AL.isFilter = function(filter) { + return false; +}; +lime_media_openal_AL.isSource = function(source) { + return false; +}; +lime_media_openal_AL.listener3f = function(param,value1,value2,value3) { +}; +lime_media_openal_AL.listener3i = function(param,value1,value2,value3) { +}; +lime_media_openal_AL.listenerf = function(param,value) { +}; +lime_media_openal_AL.listenerfv = function(param,values) { +}; +lime_media_openal_AL.listeneri = function(param,value) { +}; +lime_media_openal_AL.listeneriv = function(param,values) { +}; +lime_media_openal_AL.source3f = function(source,param,value1,value2,value3) { +}; +lime_media_openal_AL.source3i = function(source,param,value1,value2,value3) { +}; +lime_media_openal_AL.sourcef = function(source,param,value) { +}; +lime_media_openal_AL.sourcefv = function(source,param,values) { +}; +lime_media_openal_AL.sourcei = function(source,param,value) { +}; +lime_media_openal_AL.filteri = function(filter,param,value) { +}; +lime_media_openal_AL.filterf = function(filter,param,value) { +}; +lime_media_openal_AL.sourceiv = function(source,param,values) { +}; +lime_media_openal_AL.sourcePlay = function(source) { +}; +lime_media_openal_AL.sourcePlayv = function(sources) { +}; +lime_media_openal_AL.sourceStop = function(source) { +}; +lime_media_openal_AL.sourceStopv = function(sources) { +}; +lime_media_openal_AL.sourceRewind = function(source) { +}; +lime_media_openal_AL.sourceRewindv = function(sources) { +}; +lime_media_openal_AL.sourcePause = function(source) { +}; +lime_media_openal_AL.sourcePausev = function(sources) { +}; +lime_media_openal_AL.sourceQueueBuffer = function(source,buffer) { +}; +lime_media_openal_AL.sourceQueueBuffers = function(source,nb,buffers) { +}; +lime_media_openal_AL.sourceUnqueueBuffer = function(source) { + return 0; +}; +lime_media_openal_AL.sourceUnqueueBuffers = function(source,nb) { + return null; +}; +lime_media_openal_AL.speedOfSound = function(value) { +}; +var lime_media_openal_ALAuxiliaryEffectSlot = {}; +lime_media_openal_ALAuxiliaryEffectSlot._new = function(handle) { + return handle; +}; +var lime_media_openal_ALBuffer = {}; +lime_media_openal_ALBuffer._new = function(handle) { + return handle; +}; +var lime_media_openal_ALC = function() { }; +$hxClasses["lime.media.openal.ALC"] = lime_media_openal_ALC; +lime_media_openal_ALC.__name__ = "lime.media.openal.ALC"; +lime_media_openal_ALC.closeDevice = function(device) { + return false; +}; +lime_media_openal_ALC.createContext = function(device,attrlist) { + return null; +}; +lime_media_openal_ALC.destroyContext = function(context) { +}; +lime_media_openal_ALC.getContextsDevice = function(context) { + return null; +}; +lime_media_openal_ALC.getCurrentContext = function() { + return null; +}; +lime_media_openal_ALC.getError = function(device) { + return 0; +}; +lime_media_openal_ALC.getErrorString = function(device) { + switch(lime_media_openal_ALC.getError(device)) { + case 40961: + return "INVALID_DEVICE: Invalid device (or no device?)"; + case 40962: + return "INVALID_CONTEXT: Invalid context (or no context?)"; + case 40963: + return "INVALID_ENUM: Invalid enum value"; + case 40964: + return "INVALID_VALUE: Invalid param value"; + case 40965: + return "OUT_OF_MEMORY: OpenAL has run out of memory"; + default: + return ""; + } +}; +lime_media_openal_ALC.getIntegerv = function(device,param,size) { + return null; +}; +lime_media_openal_ALC.getString = function(device,param) { + return null; +}; +lime_media_openal_ALC.makeContextCurrent = function(context) { + return false; +}; +lime_media_openal_ALC.openDevice = function(deviceName) { + return null; +}; +lime_media_openal_ALC.pauseDevice = function(device) { +}; +lime_media_openal_ALC.processContext = function(context) { +}; +lime_media_openal_ALC.resumeDevice = function(device) { +}; +lime_media_openal_ALC.suspendContext = function(context) { +}; +var lime_media_openal_ALContext = {}; +lime_media_openal_ALContext._new = function(handle) { + return handle; +}; +var lime_media_openal_ALDevice = {}; +lime_media_openal_ALDevice._new = function(handle) { + return handle; +}; +var lime_media_openal_ALEffect = {}; +lime_media_openal_ALEffect._new = function(handle) { + return handle; +}; +var lime_media_openal_ALFilter = {}; +lime_media_openal_ALFilter._new = function(handle) { + return handle; +}; +var lime_media_openal_ALSource = {}; +lime_media_openal_ALSource._new = function(handle) { + return handle; +}; +var lime_media_vorbis_VorbisComment = function() { +}; +$hxClasses["lime.media.vorbis.VorbisComment"] = lime_media_vorbis_VorbisComment; +lime_media_vorbis_VorbisComment.__name__ = "lime.media.vorbis.VorbisComment"; +lime_media_vorbis_VorbisComment.prototype = { + __class__: lime_media_vorbis_VorbisComment +}; +var lime_media_vorbis_VorbisFile = function(handle) { + this.handle = handle; +}; +$hxClasses["lime.media.vorbis.VorbisFile"] = lime_media_vorbis_VorbisFile; +lime_media_vorbis_VorbisFile.__name__ = "lime.media.vorbis.VorbisFile"; +lime_media_vorbis_VorbisFile.fromBytes = function(bytes) { + return null; +}; +lime_media_vorbis_VorbisFile.fromFile = function(path) { + return null; +}; +lime_media_vorbis_VorbisFile.prototype = { + bitrate: function(bitstream) { + if(bitstream == null) { + bitstream = -1; + } + return 0; + } + ,bitrateInstant: function() { + return 0; + } + ,clear: function() { + } + ,comment: function(bitstream) { + if(bitstream == null) { + bitstream = -1; + } + return null; + } + ,crosslap: function(other) { + return 0; + } + ,info: function(bitstream) { + if(bitstream == null) { + bitstream = -1; + } + return null; + } + ,pcmSeek: function(pos) { + return 0; + } + ,pcmSeekLap: function(pos) { + return 0; + } + ,pcmSeekPage: function(pos) { + return 0; + } + ,pcmSeekPageLap: function(pos) { + return 0; + } + ,pcmTell: function() { + return new haxe__$Int64__$_$_$Int64(0,0); + } + ,pcmTotal: function(bitstream) { + if(bitstream == null) { + bitstream = -1; + } + return new haxe__$Int64__$_$_$Int64(0,0); + } + ,rawSeek: function(pos) { + return 0; + } + ,rawSeekLap: function(pos) { + return 0; + } + ,rawTell: function() { + return new haxe__$Int64__$_$_$Int64(0,0); + } + ,rawTotal: function(bitstream) { + if(bitstream == null) { + bitstream = -1; + } + return new haxe__$Int64__$_$_$Int64(0,0); + } + ,read: function(buffer,position,length,bigEndianPacking,wordSize,signed) { + if(signed == null) { + signed = true; + } + if(wordSize == null) { + wordSize = 2; + } + if(bigEndianPacking == null) { + bigEndianPacking = false; + } + if(length == null) { + length = 4096; + } + return 0; + } + ,readFloat: function(pcmChannels,samples) { + return 0; + } + ,seekable: function() { + return false; + } + ,serialNumber: function(bitstream) { + if(bitstream == null) { + bitstream = -1; + } + return 0; + } + ,streams: function() { + return 0; + } + ,timeSeek: function(s) { + return 0; + } + ,timeSeekLap: function(s) { + return 0; + } + ,timeSeekPage: function(s) { + return 0; + } + ,timeSeekPageLap: function(s) { + return 0; + } + ,timeTell: function() { + return 0; + } + ,timeTotal: function(bitstream) { + if(bitstream == null) { + bitstream = -1; + } + return 0; + } + ,__class__: lime_media_vorbis_VorbisFile +}; +var lime_media_vorbis_VorbisInfo = function() { +}; +$hxClasses["lime.media.vorbis.VorbisInfo"] = lime_media_vorbis_VorbisInfo; +lime_media_vorbis_VorbisInfo.__name__ = "lime.media.vorbis.VorbisInfo"; +lime_media_vorbis_VorbisInfo.prototype = { + __class__: lime_media_vorbis_VorbisInfo +}; +var lime_net__$IHTTPRequest = function() { }; +$hxClasses["lime.net._IHTTPRequest"] = lime_net__$IHTTPRequest; +lime_net__$IHTTPRequest.__name__ = "lime.net._IHTTPRequest"; +lime_net__$IHTTPRequest.__isInterface__ = true; +lime_net__$IHTTPRequest.prototype = { + __class__: lime_net__$IHTTPRequest +}; +var lime_net__$HTTPRequest_AbstractHTTPRequest = function(uri) { + this.uri = uri; + this.contentType = "application/x-www-form-urlencoded"; + this.followRedirects = true; + this.enableResponseHeaders = false; + this.formData = new haxe_ds_StringMap(); + this.headers = []; + this.method = "GET"; + this.timeout = 30000; + this.withCredentials = false; + this.manageCookies = true; + this.__backend = new lime__$internal_backend_html5_HTML5HTTPRequest(); + this.__backend.init(this); +}; +$hxClasses["lime.net._HTTPRequest.AbstractHTTPRequest"] = lime_net__$HTTPRequest_AbstractHTTPRequest; +lime_net__$HTTPRequest_AbstractHTTPRequest.__name__ = "lime.net._HTTPRequest.AbstractHTTPRequest"; +lime_net__$HTTPRequest_AbstractHTTPRequest.__interfaces__ = [lime_net__$IHTTPRequest]; +lime_net__$HTTPRequest_AbstractHTTPRequest.prototype = { + cancel: function() { + this.__backend.cancel(); + } + ,load: function(uri) { + return null; + } + ,__class__: lime_net__$HTTPRequest_AbstractHTTPRequest +}; +var lime_net_HTTPRequest = function(uri) { + lime_net__$HTTPRequest_AbstractHTTPRequest.call(this,uri); +}; +$hxClasses["lime.net.HTTPRequest"] = lime_net_HTTPRequest; +lime_net_HTTPRequest.__name__ = "lime.net.HTTPRequest"; +lime_net_HTTPRequest.__super__ = lime_net__$HTTPRequest_AbstractHTTPRequest; +lime_net_HTTPRequest.prototype = $extend(lime_net__$HTTPRequest_AbstractHTTPRequest.prototype,{ + __class__: lime_net_HTTPRequest +}); +var lime_net__$HTTPRequest_$Bytes = function(uri) { + lime_net__$HTTPRequest_AbstractHTTPRequest.call(this,uri); +}; +$hxClasses["lime.net._HTTPRequest_Bytes"] = lime_net__$HTTPRequest_$Bytes; +lime_net__$HTTPRequest_$Bytes.__name__ = "lime.net._HTTPRequest_Bytes"; +lime_net__$HTTPRequest_$Bytes.__super__ = lime_net__$HTTPRequest_AbstractHTTPRequest; +lime_net__$HTTPRequest_$Bytes.prototype = $extend(lime_net__$HTTPRequest_AbstractHTTPRequest.prototype,{ + fromBytes: function(bytes) { + return bytes; + } + ,load: function(uri) { + var _gthis = this; + if(uri != null) { + this.uri = uri; + } + var promise = new lime_app_Promise(); + var future = this.__backend.loadData(this.uri); + future.onProgress($bind(promise,promise.progress)); + future.onError(function(errorResponse) { + _gthis.responseData = errorResponse.responseData; + promise.error(errorResponse.error); + }); + future.onComplete(function(bytes) { + _gthis.responseData = _gthis.fromBytes(bytes); + promise.complete(_gthis.responseData); + }); + return promise.future; + } + ,__class__: lime_net__$HTTPRequest_$Bytes +}); +var lime_net__$HTTPRequest_$String = function(uri) { + lime_net__$HTTPRequest_AbstractHTTPRequest.call(this,uri); +}; +$hxClasses["lime.net._HTTPRequest_String"] = lime_net__$HTTPRequest_$String; +lime_net__$HTTPRequest_$String.__name__ = "lime.net._HTTPRequest_String"; +lime_net__$HTTPRequest_$String.__super__ = lime_net__$HTTPRequest_AbstractHTTPRequest; +lime_net__$HTTPRequest_$String.prototype = $extend(lime_net__$HTTPRequest_AbstractHTTPRequest.prototype,{ + load: function(uri) { + var _gthis = this; + if(uri != null) { + this.uri = uri; + } + var promise = new lime_app_Promise(); + var future = this.__backend.loadText(this.uri); + future.onProgress($bind(promise,promise.progress)); + future.onError(function(errorResponse) { + _gthis.responseData = errorResponse.responseData; + promise.error(errorResponse.error); + }); + future.onComplete(function(text) { + _gthis.responseData = text; + promise.complete(_gthis.responseData); + }); + return promise.future; + } + ,__class__: lime_net__$HTTPRequest_$String +}); +var lime_net__$HTTPRequestErrorResponse = function(error,responseData) { + this.error = error; + this.responseData = responseData; +}; +$hxClasses["lime.net._HTTPRequestErrorResponse"] = lime_net__$HTTPRequestErrorResponse; +lime_net__$HTTPRequestErrorResponse.__name__ = "lime.net._HTTPRequestErrorResponse"; +lime_net__$HTTPRequestErrorResponse.prototype = { + __class__: lime_net__$HTTPRequestErrorResponse +}; +var lime_net_HTTPRequestHeader = function(name,value) { + if(value == null) { + value = ""; + } + this.name = name; + this.value = value; +}; +$hxClasses["lime.net.HTTPRequestHeader"] = lime_net_HTTPRequestHeader; +lime_net_HTTPRequestHeader.__name__ = "lime.net.HTTPRequestHeader"; +lime_net_HTTPRequestHeader.prototype = { + __class__: lime_net_HTTPRequestHeader +}; +var lime_net__$HTTPRequest_$lime_$text_$Font = function(uri) { + lime_net__$HTTPRequest_$Bytes.call(this,uri); +}; +$hxClasses["lime.net._HTTPRequest_lime_text_Font"] = lime_net__$HTTPRequest_$lime_$text_$Font; +lime_net__$HTTPRequest_$lime_$text_$Font.__name__ = "lime.net._HTTPRequest_lime_text_Font"; +lime_net__$HTTPRequest_$lime_$text_$Font.__super__ = lime_net__$HTTPRequest_$Bytes; +lime_net__$HTTPRequest_$lime_$text_$Font.prototype = $extend(lime_net__$HTTPRequest_$Bytes.prototype,{ + fromBytes: function(bytes) { + return lime_text_Font.fromBytes(bytes); + } + ,__class__: lime_net__$HTTPRequest_$lime_$text_$Font +}); +var lime_net__$HTTPRequest_$lime_$utils_$Bytes = function(uri) { + lime_net__$HTTPRequest_$Bytes.call(this,uri); +}; +$hxClasses["lime.net._HTTPRequest_lime_utils_Bytes"] = lime_net__$HTTPRequest_$lime_$utils_$Bytes; +lime_net__$HTTPRequest_$lime_$utils_$Bytes.__name__ = "lime.net._HTTPRequest_lime_utils_Bytes"; +lime_net__$HTTPRequest_$lime_$utils_$Bytes.__super__ = lime_net__$HTTPRequest_$Bytes; +lime_net__$HTTPRequest_$lime_$utils_$Bytes.prototype = $extend(lime_net__$HTTPRequest_$Bytes.prototype,{ + fromBytes: function(bytes) { + return lime_utils_Bytes.fromBytes(bytes); + } + ,__class__: lime_net__$HTTPRequest_$lime_$utils_$Bytes +}); +var lime_net__$HTTPRequest_$openfl_$utils_$ByteArray = function(uri) { + lime_net__$HTTPRequest_$Bytes.call(this,uri); +}; +$hxClasses["lime.net._HTTPRequest_openfl_utils_ByteArray"] = lime_net__$HTTPRequest_$openfl_$utils_$ByteArray; +lime_net__$HTTPRequest_$openfl_$utils_$ByteArray.__name__ = "lime.net._HTTPRequest_openfl_utils_ByteArray"; +lime_net__$HTTPRequest_$openfl_$utils_$ByteArray.__super__ = lime_net__$HTTPRequest_$Bytes; +lime_net__$HTTPRequest_$openfl_$utils_$ByteArray.prototype = $extend(lime_net__$HTTPRequest_$Bytes.prototype,{ + fromBytes: function(bytes) { + return openfl_utils_ByteArray.fromBytes(bytes); + } + ,__class__: lime_net__$HTTPRequest_$openfl_$utils_$ByteArray +}); +var lime_system_CFFI = function() { }; +$hxClasses["lime.system.CFFI"] = lime_system_CFFI; +lime_system_CFFI.__name__ = "lime.system.CFFI"; +lime_system_CFFI.load = function(library,method,args,lazy) { + if(lazy == null) { + lazy = false; + } + if(args == null) { + args = 0; + } + if(!lime_system_CFFI.enabled) { + return Reflect.makeVarArgs(function(__) { + return { }; + }); + } + var result = null; + return result; +}; +lime_system_CFFI.stringValue = function(value) { + return value; +}; +lime_system_CFFI.__findNDLLFolder = function() { + return ""; +}; +lime_system_CFFI.__loaderTrace = function(message) { +}; +lime_system_CFFI.__sysName = function() { + return null; +}; +lime_system_CFFI.__tryLoad = function(name,library,func,args) { + return null; +}; +var lime_system_CFFIPointer = {}; +lime_system_CFFIPointer._new = function(handle) { + return handle; +}; +lime_system_CFFIPointer.get = function(this1) { + var tmp = this1 != null; + return 0; +}; +lime_system_CFFIPointer.equals = function(a,b) { + return lime_system_CFFIPointer.get(a) == b; +}; +lime_system_CFFIPointer.equalsPointer = function(a,b) { + return lime_system_CFFIPointer.get(a) == lime_system_CFFIPointer.get(b); +}; +lime_system_CFFIPointer.greaterThan = function(a,b) { + return lime_system_CFFIPointer.get(a) > b; +}; +lime_system_CFFIPointer.greaterThanPointer = function(a,b) { + return lime_system_CFFIPointer.get(a) > lime_system_CFFIPointer.get(b); +}; +lime_system_CFFIPointer.greaterThanOrEqual = function(a,b) { + return lime_system_CFFIPointer.get(a) >= b; +}; +lime_system_CFFIPointer.greaterThanOrEqualPointer = function(a,b) { + return lime_system_CFFIPointer.get(a) >= lime_system_CFFIPointer.get(b); +}; +lime_system_CFFIPointer.lessThan = function(a,b) { + return lime_system_CFFIPointer.get(a) < b; +}; +lime_system_CFFIPointer.lessThanPointer = function(a,b) { + return lime_system_CFFIPointer.get(a) < lime_system_CFFIPointer.get(b); +}; +lime_system_CFFIPointer.lessThanOrEqual = function(a,b) { + return lime_system_CFFIPointer.get(a) <= b; +}; +lime_system_CFFIPointer.lessThanOrEqualPointer = function(a,b) { + return lime_system_CFFIPointer.get(a) <= lime_system_CFFIPointer.get(b); +}; +lime_system_CFFIPointer.notEquals = function(a,b) { + return lime_system_CFFIPointer.get(a) != b; +}; +lime_system_CFFIPointer.notEqualsPointer = function(a,b) { + return lime_system_CFFIPointer.get(a) != lime_system_CFFIPointer.get(b); +}; +var lime_system_Clipboard = function() { }; +$hxClasses["lime.system.Clipboard"] = lime_system_Clipboard; +lime_system_Clipboard.__name__ = "lime.system.Clipboard"; +lime_system_Clipboard.__properties__ = {set_text:"set_text",get_text:"get_text"}; +lime_system_Clipboard.__update = function() { + var cacheText = lime_system_Clipboard._text; + lime_system_Clipboard._text = null; + lime_system_Clipboard._text = cacheText; + lime_system_Clipboard.__updated = true; + if(lime_system_Clipboard._text != cacheText) { + lime_system_Clipboard.onUpdate.dispatch(); + } +}; +lime_system_Clipboard.get_text = function() { + lime_system_Clipboard.__update(); + return lime_system_Clipboard._text; +}; +lime_system_Clipboard.set_text = function(value) { + var cacheText = lime_system_Clipboard._text; + lime_system_Clipboard._text = value; + var $window = lime_app_Application.current.__window; + if($window != null) { + $window.__backend.setClipboard(value); + } + if(lime_system_Clipboard._text != cacheText) { + lime_system_Clipboard.onUpdate.dispatch(); + } + return value; +}; +var lime_system_Display = function() { +}; +$hxClasses["lime.system.Display"] = lime_system_Display; +lime_system_Display.__name__ = "lime.system.Display"; +lime_system_Display.prototype = { + __class__: lime_system_Display +}; +var lime_system_DisplayMode = function(width,height,refreshRate,pixelFormat) { + this.width = width; + this.height = height; + this.refreshRate = refreshRate; + this.pixelFormat = pixelFormat; +}; +$hxClasses["lime.system.DisplayMode"] = lime_system_DisplayMode; +lime_system_DisplayMode.__name__ = "lime.system.DisplayMode"; +lime_system_DisplayMode.prototype = { + __class__: lime_system_DisplayMode +}; +var lime_system_Endian = $hxEnums["lime.system.Endian"] = { __ename__:"lime.system.Endian",__constructs__:null + ,LITTLE_ENDIAN: {_hx_name:"LITTLE_ENDIAN",_hx_index:0,__enum__:"lime.system.Endian",toString:$estr} + ,BIG_ENDIAN: {_hx_name:"BIG_ENDIAN",_hx_index:1,__enum__:"lime.system.Endian",toString:$estr} +}; +lime_system_Endian.__constructs__ = [lime_system_Endian.LITTLE_ENDIAN,lime_system_Endian.BIG_ENDIAN]; +var lime_system_JNI = function() { }; +$hxClasses["lime.system.JNI"] = lime_system_JNI; +lime_system_JNI.__name__ = "lime.system.JNI"; +lime_system_JNI.transformClassName = function(className) { + var parts = className.split("."); + if(parts.length <= 1) { + return className; + } + var nestedClassName = ""; + if(new EReg("^[A-Z]","").match(parts[parts.length - 2])) { + nestedClassName = "$" + parts.pop(); + } + return parts.join("/") + nestedClassName; +}; +lime_system_JNI.callMember = function(method,jobject,a) { + return method.apply(null,[jobject].concat(a)); +}; +lime_system_JNI.callStatic = function(method,a) { + return method.apply(null,a); +}; +lime_system_JNI.createMemberField = function(className,memberName,signature) { + lime_system_JNI.init(); + return new lime_system_JNIMemberField(null); +}; +lime_system_JNI.createMemberMethod = function(className,memberName,signature,useArray,quietFail) { + if(quietFail == null) { + quietFail = false; + } + if(useArray == null) { + useArray = false; + } + lime_system_JNI.init(); + return null; +}; +lime_system_JNI.createStaticField = function(className,memberName,signature) { + lime_system_JNI.init(); + return new lime_system_JNIStaticField(null); +}; +lime_system_JNI.createStaticMethod = function(className,memberName,signature,useArray,quietFail) { + if(quietFail == null) { + quietFail = false; + } + if(useArray == null) { + useArray = false; + } + lime_system_JNI.init(); + return null; +}; +lime_system_JNI.getEnv = function() { + lime_system_JNI.init(); + return null; +}; +lime_system_JNI.init = function() { + if(!lime_system_JNI.initialized) { + lime_system_JNI.initialized = true; + } +}; +lime_system_JNI.onCallback = function(object,method,args) { + var field = Reflect.field(object,method); + if(field != null) { + if(args == null) { + args = []; + } + return field.apply(object,args); + } + haxe_Log.trace("onCallback - unknown field " + method,{ fileName : "lime/system/JNI.hx", lineNumber : 223, className : "lime.system.JNI", methodName : "onCallback"}); + return null; +}; +lime_system_JNI.postUICallback = function(callback) { + callback(); +}; +var lime_system_JNIMemberField = function(field) { + this.field = field; +}; +$hxClasses["lime.system.JNIMemberField"] = lime_system_JNIMemberField; +lime_system_JNIMemberField.__name__ = "lime.system.JNIMemberField"; +lime_system_JNIMemberField.prototype = { + get: function(jobject) { + return null; + } + ,set: function(jobject,value) { + return value; + } + ,__class__: lime_system_JNIMemberField +}; +var lime_system_JNIStaticField = function(field) { + this.field = field; +}; +$hxClasses["lime.system.JNIStaticField"] = lime_system_JNIStaticField; +lime_system_JNIStaticField.__name__ = "lime.system.JNIStaticField"; +lime_system_JNIStaticField.prototype = { + get: function() { + return null; + } + ,set: function(value) { + return value; + } + ,__class__: lime_system_JNIStaticField +}; +var lime_system_JNIMethod = function(method) { + this.method = method; +}; +$hxClasses["lime.system.JNIMethod"] = lime_system_JNIMethod; +lime_system_JNIMethod.__name__ = "lime.system.JNIMethod"; +lime_system_JNIMethod.prototype = { + callMember: function(args) { + return null; + } + ,callStatic: function(args) { + return null; + } + ,getMemberMethod: function(useArray) { + if(useArray) { + return $bind(this,this.callMember); + } else { + return Reflect.makeVarArgs($bind(this,this.callMember)); + } + } + ,getStaticMethod: function(useArray) { + if(useArray) { + return $bind(this,this.callStatic); + } else { + return Reflect.makeVarArgs($bind(this,this.callStatic)); + } + } + ,__class__: lime_system_JNIMethod +}; +var lime_system_JNISafety = function() { }; +$hxClasses["lime.system.JNISafety"] = lime_system_JNISafety; +lime_system_JNISafety.__name__ = "lime.system.JNISafety"; +lime_system_JNISafety.__isInterface__ = true; +var lime_system_JNISafetyTools = function() { }; +$hxClasses["lime.system.JNISafetyTools"] = lime_system_JNISafetyTools; +lime_system_JNISafetyTools.__name__ = "lime.system.JNISafetyTools"; +lime_system_JNISafetyTools.onMainThread = function() { + return true; +}; +var lime_system_Locale = {}; +lime_system_Locale.__properties__ = {get_region:"get_region",get_language:"get_language",get_systemLocale:"get_systemLocale",set_currentLocale:"set_currentLocale",get_currentLocale:"get_currentLocale"}; +lime_system_Locale._new = function(value) { + return value; +}; +lime_system_Locale.equals = function(a,b) { + var language = lime_system_Locale.get_language(a); + var region = lime_system_Locale.get_region(a); + var language2 = lime_system_Locale.get_language(b); + var region2 = lime_system_Locale.get_region(b); + var languageMatch = language == language2; + var regionMatch = region == region2; + if(!languageMatch && language != null && language2 != null) { + languageMatch = language.toLowerCase() == language2.toLowerCase(); + } + if(!regionMatch && region != null && region2 != null) { + regionMatch = region.toLowerCase() == region2.toLowerCase(); + } + if(languageMatch) { + return regionMatch; + } else { + return false; + } +}; +lime_system_Locale.__init = function() { + if(lime_system_Locale.__systemLocale == null) { + var locale = null; + locale = navigator.language; + if(locale != null) { + lime_system_Locale.__systemLocale = locale; + } else { + lime_system_Locale.__systemLocale = "en-US"; + } + lime_system_Locale.set_currentLocale(lime_system_Locale.__systemLocale); + } +}; +lime_system_Locale.get_language = function(this1) { + if(this1 != null) { + var index = this1.indexOf("_"); + if(index > -1) { + var dashIndex = this1.indexOf("-"); + if(dashIndex > -1 && dashIndex < index) { + index = dashIndex; + } + return this1.substring(0,index); + } + index = this1.indexOf("-"); + if(index > -1) { + return this1.substring(0,index); + } + } + return this1; +}; +lime_system_Locale.get_region = function(this1) { + if(this1 != null) { + var underscoreIndex = this1.indexOf("_"); + var dotIndex = this1.indexOf("."); + var dashIndex = this1.indexOf("-"); + if(underscoreIndex > -1) { + if(dotIndex > -1) { + return this1.substring(underscoreIndex + 1,dotIndex); + } else { + return this1.substring(underscoreIndex + 1); + } + } else if(dashIndex > -1) { + if(dotIndex > -1) { + return this1.substring(dashIndex + 1,dotIndex); + } else { + return this1.substring(dashIndex + 1); + } + } + } + return null; +}; +lime_system_Locale.get_currentLocale = function() { + lime_system_Locale.__init(); + return lime_system_Locale.currentLocale; +}; +lime_system_Locale.set_currentLocale = function(value) { + lime_system_Locale.__init(); + return lime_system_Locale.currentLocale = value; +}; +lime_system_Locale.get_systemLocale = function() { + lime_system_Locale.__init(); + return lime_system_Locale.__systemLocale; +}; +var lime_system_Sensor = function(type,id) { + this.onUpdate = new lime_app__$Event_$Float_$Float_$Float_$Void(); + this.type = type; + this.id = id; +}; +$hxClasses["lime.system.Sensor"] = lime_system_Sensor; +lime_system_Sensor.__name__ = "lime.system.Sensor"; +lime_system_Sensor.getSensors = function(type) { + if(type == null) { + return lime_system_Sensor.sensors.slice(); + } else { + var result = []; + var _g = 0; + var _g1 = lime_system_Sensor.sensors; + while(_g < _g1.length) { + var sensor = _g1[_g]; + ++_g; + if(sensor.type == type) { + result.push(sensor); + } + } + return result; + } +}; +lime_system_Sensor.registerSensor = function(type,id) { + var sensor = new lime_system_Sensor(type,id); + lime_system_Sensor.sensors.push(sensor); + lime_system_Sensor.sensorByID.h[id] = sensor; + return sensor; +}; +lime_system_Sensor.prototype = { + __class__: lime_system_Sensor +}; +var lime_system_SensorType = $hxEnums["lime.system.SensorType"] = { __ename__:"lime.system.SensorType",__constructs__:null + ,ACCELEROMETER: {_hx_name:"ACCELEROMETER",_hx_index:0,__enum__:"lime.system.SensorType",toString:$estr} +}; +lime_system_SensorType.__constructs__ = [lime_system_SensorType.ACCELEROMETER]; +var lime_system_System = function() { }; +$hxClasses["lime.system.System"] = lime_system_System; +lime_system_System.__name__ = "lime.system.System"; +lime_system_System.__properties__ = {get_userDirectory:"get_userDirectory",get_platformVersion:"get_platformVersion",get_platformName:"get_platformName",get_platformLabel:"get_platformLabel",get_numDisplays:"get_numDisplays",get_fontsDirectory:"get_fontsDirectory",get_endianness:"get_endianness",get_documentsDirectory:"get_documentsDirectory",get_deviceVendor:"get_deviceVendor",get_deviceModel:"get_deviceModel",get_desktopDirectory:"get_desktopDirectory",get_applicationStorageDirectory:"get_applicationStorageDirectory",get_applicationDirectory:"get_applicationDirectory",set_allowScreenTimeout:"set_allowScreenTimeout",get_allowScreenTimeout:"get_allowScreenTimeout"}; +lime_system_System.embed = $hx_exports["lime"]["embed"] = function(projectName,element,width,height,config) { + if(lime_system_System.__applicationEntryPoint == null) { + return; + } + if(Object.prototype.hasOwnProperty.call(lime_system_System.__applicationEntryPoint.h,projectName)) { + var htmlElement = null; + if(typeof(element) == "string") { + htmlElement = window.document.getElementById(element); + } else if(element == null) { + htmlElement = window.document.createElement("div"); + } else { + htmlElement = element; + } + if(htmlElement == null) { + window.console.log("[lime.embed] ERROR: Cannot find target element: " + Std.string(element)); + return; + } + if(width == null) { + width = 0; + } + if(height == null) { + height = 0; + } + if(config == null) { + config = { }; + } + if(Object.prototype.hasOwnProperty.call(config,"background") && typeof(config.background) == "string") { + var background = StringTools.replace(Std.string(config.background),"#",""); + if(background.indexOf("0x") > -1) { + config.background = Std.parseInt(background); + } else { + config.background = Std.parseInt("0x" + background); + } + } + config.element = htmlElement; + config.width = width; + config.height = height; + lime_system_System.__applicationEntryPoint.h[projectName](config); + } +}; +lime_system_System.exit = function(code) { + var currentApp = lime_app_Application.current; + if(currentApp != null) { + currentApp.onExit.dispatch(code); + if(currentApp.onExit.canceled) { + return; + } + } + if(currentApp != null && currentApp.__window != null) { + currentApp.__window.close(); + } +}; +lime_system_System.getDisplay = function(id) { + if(id == 0) { + var display = new lime_system_Display(); + display.id = 0; + display.name = "Generic Display"; + display.dpi = 96 * window.devicePixelRatio; + display.currentMode = new lime_system_DisplayMode(window.screen.width,window.screen.height,60,1); + display.supportedModes = [display.currentMode]; + display.bounds = new lime_math_Rectangle(0,0,display.currentMode.width,display.currentMode.height); + return display; + } + return null; +}; +lime_system_System.getTimer = function() { + return window.performance.now() | 0; +}; +lime_system_System.load = function(library,method,args,lazy) { + if(lazy == null) { + lazy = false; + } + if(args == null) { + args = 0; + } + return lime_system_CFFI.load(library,method,args,lazy); +}; +lime_system_System.openFile = function(path) { + if(path != null) { + window.open(path,"_blank"); + } +}; +lime_system_System.openURL = function(url,target) { + if(target == null) { + target = "_blank"; + } + if(url != null) { + window.open(url,target); + } +}; +lime_system_System.__copyMissingFields = function(target,source) { + if(source == null || target == null) { + return; + } + var _g = 0; + var _g1 = Reflect.fields(source); + while(_g < _g1.length) { + var field = _g1[_g]; + ++_g; + if(!Object.prototype.hasOwnProperty.call(target,field)) { + target[field] = Reflect.field(source,field); + } + } +}; +lime_system_System.__getDirectory = function(type) { + return null; +}; +lime_system_System.__parseBool = function(value) { + return value == "true"; +}; +lime_system_System.__registerEntryPoint = function(projectName,entryPoint) { + if(lime_system_System.__applicationEntryPoint == null) { + lime_system_System.__applicationEntryPoint = new haxe_ds_StringMap(); + } + lime_system_System.__applicationEntryPoint.h[projectName] = entryPoint; +}; +lime_system_System.__runProcess = function(command,args) { + return null; +}; +lime_system_System.get_allowScreenTimeout = function() { + return true; +}; +lime_system_System.set_allowScreenTimeout = function(value) { + return true; +}; +lime_system_System.get_applicationDirectory = function() { + if(lime_system_System.__applicationDirectory == null) { + lime_system_System.__applicationDirectory = lime_system_System.__getDirectory(0); + } + return lime_system_System.__applicationDirectory; +}; +lime_system_System.get_applicationStorageDirectory = function() { + if(lime_system_System.__applicationStorageDirectory == null) { + lime_system_System.__applicationStorageDirectory = lime_system_System.__getDirectory(1); + } + return lime_system_System.__applicationStorageDirectory; +}; +lime_system_System.get_deviceModel = function() { + var tmp = lime_system_System.__deviceModel == null; + return lime_system_System.__deviceModel; +}; +lime_system_System.get_deviceVendor = function() { + var tmp = lime_system_System.__deviceVendor == null; + return lime_system_System.__deviceVendor; +}; +lime_system_System.get_desktopDirectory = function() { + if(lime_system_System.__desktopDirectory == null) { + lime_system_System.__desktopDirectory = lime_system_System.__getDirectory(2); + } + return lime_system_System.__desktopDirectory; +}; +lime_system_System.get_documentsDirectory = function() { + if(lime_system_System.__documentsDirectory == null) { + lime_system_System.__documentsDirectory = lime_system_System.__getDirectory(3); + } + return lime_system_System.__documentsDirectory; +}; +lime_system_System.get_endianness = function() { + if(lime_system_System.__endianness == null) { + var arrayBuffer = new ArrayBuffer(2); + var elements = null; + var array = null; + var vector = null; + var view = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(arrayBuffer != null) { + if(len == null) { + this1 = new Uint8Array(arrayBuffer,0); + } else { + this1 = new Uint8Array(arrayBuffer,0,len); + } + } else { + this1 = null; + } + var uint8Array = this1; + var elements = null; + var array = null; + var vector = null; + var view = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint16Array(elements); + } else if(array != null) { + this1 = new Uint16Array(array); + } else if(vector != null) { + this1 = new Uint16Array(vector.__array); + } else if(view != null) { + this1 = new Uint16Array(view); + } else if(arrayBuffer != null) { + if(len == null) { + this1 = new Uint16Array(arrayBuffer,0); + } else { + this1 = new Uint16Array(arrayBuffer,0,len); + } + } else { + this1 = null; + } + var uint16array = this1; + uint8Array[0] = 170; + uint8Array[1] = 187; + if(uint16array[0] == 43707) { + lime_system_System.__endianness = lime_system_Endian.BIG_ENDIAN; + } else { + lime_system_System.__endianness = lime_system_Endian.LITTLE_ENDIAN; + } + } + return lime_system_System.__endianness; +}; +lime_system_System.get_fontsDirectory = function() { + if(lime_system_System.__fontsDirectory == null) { + lime_system_System.__fontsDirectory = lime_system_System.__getDirectory(4); + } + return lime_system_System.__fontsDirectory; +}; +lime_system_System.get_numDisplays = function() { + return 1; +}; +lime_system_System.get_platformLabel = function() { + if(lime_system_System.__platformLabel == null) { + var name = lime_system_System.get_platformName(); + var version = lime_system_System.get_platformVersion(); + if(name != null && version != null) { + lime_system_System.__platformLabel = name + " " + version; + } else if(name != null) { + lime_system_System.__platformLabel = name; + } + } + return lime_system_System.__platformLabel; +}; +lime_system_System.get_platformName = function() { + if(lime_system_System.__platformName == null) { + lime_system_System.__platformName = "HTML5"; + } + return lime_system_System.__platformName; +}; +lime_system_System.get_platformVersion = function() { + var tmp = lime_system_System.__platformVersion == null; + return lime_system_System.__platformVersion; +}; +lime_system_System.get_userDirectory = function() { + if(lime_system_System.__userDirectory == null) { + lime_system_System.__userDirectory = lime_system_System.__getDirectory(5); + } + return lime_system_System.__userDirectory; +}; +var lime_system_WorkOutput = function(mode) { + this.__activeJob = new lime_system_Tls(); + this.__jobComplete = new lime_system_Tls(); + this.__jobOutput = new haxe_ds_List(); + this.workIterations = new lime_system_Tls(); + this.workIterations.value = 0; + this.__jobComplete.value = false; + this.__mode = mode != null && mode; +}; +$hxClasses["lime.system.WorkOutput"] = lime_system_WorkOutput; +lime_system_WorkOutput.__name__ = "lime.system.WorkOutput"; +lime_system_WorkOutput.prototype = { + sendComplete: function(message,transferList) { + if(!this.__jobComplete.value) { + this.__jobComplete.value = true; + if(this.__mode == true) { + lime__$internal_backend_html5_HTML5Thread.returnMessage({ event : "COMPLETE", message : message, jobID : this.__activeJob.value.id},transferList); + } else { + this.__jobOutput.add({ event : "COMPLETE", message : message, jobID : this.__activeJob.value.id}); + } + } + } + ,sendError: function(message,transferList) { + if(!this.__jobComplete.value) { + this.__jobComplete.value = true; + if(this.__mode == true) { + lime__$internal_backend_html5_HTML5Thread.returnMessage({ event : "ERROR", message : message, jobID : this.__activeJob.value.id},transferList); + } else { + this.__jobOutput.add({ event : "ERROR", message : message, jobID : this.__activeJob.value.id}); + } + } + } + ,sendProgress: function(message,transferList) { + if(!this.__jobComplete.value) { + if(this.__mode == true) { + lime__$internal_backend_html5_HTML5Thread.returnMessage({ event : "PROGRESS", message : message, jobID : this.__activeJob.value.id},transferList); + } else { + this.__jobOutput.add({ event : "PROGRESS", message : message, jobID : this.__activeJob.value.id}); + } + } + } + ,resetJobProgress: function() { + this.__jobComplete.value = false; + this.workIterations.value = 0; + } + ,createThread: function(executeThread) { + var _gthis = this; + var thread = lime__$internal_backend_html5_HTML5Thread.create(executeThread); + thread.onMessage.add(function(event) { + _gthis.__jobOutput.add(event); + }); + return thread; + } + ,get_mode: function() { + return this.__mode; + } + ,get_activeJob: function() { + return this.__activeJob.value; + } + ,set_activeJob: function(value) { + return this.__activeJob.value = value; + } + ,__class__: lime_system_WorkOutput + ,__properties__: {set_activeJob:"set_activeJob",get_activeJob:"get_activeJob",get_mode:"get_mode"} +}; +var lime_system_ThreadPool = function(minThreads,maxThreads,mode) { + if(maxThreads == null) { + maxThreads = 1; + } + if(minThreads == null) { + minThreads = 0; + } + this.__jobQueue = new lime_system_JobList(); + this.workPriority = 1; + this.onRun = new lime_app__$Event_$lime_$system_$State_$Void(); + this.onProgress = new lime_app__$Event_$Dynamic_$Void(); + this.onError = new lime_app__$Event_$Dynamic_$Void(); + this.onComplete = new lime_app__$Event_$Dynamic_$Void(); + lime_system_WorkOutput.call(this,mode); + this.__activeJobs = new lime_system_JobList(this); + this.minThreads = minThreads; + this.maxThreads = maxThreads; + if(this.__mode == true) { + this.__activeThreads = new haxe_ds_IntMap(); + this.__idleThreads = []; + } +}; +$hxClasses["lime.system.ThreadPool"] = lime_system_ThreadPool; +lime_system_ThreadPool.__name__ = "lime.system.ThreadPool"; +lime_system_ThreadPool.isMainThread = function() { + return lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread; +}; +lime_system_ThreadPool.__executeThread = function() { + (async function() { + var output = new lime_system_WorkOutput(true); + var event = null; + while(true) { + if(event == null) { + do event = lime__$internal_backend_html5_HTML5Thread.__messages.isEmpty() ? await new Promise(function(resolve,_) { + lime__$internal_backend_html5_HTML5Thread.__resolveMethods.add(resolve); + }) : await new Promise(function(resolve,_) { + $global.setTimeout(resolve); + }).then(function(_) { + return lime__$internal_backend_html5_HTML5Thread.__messages.pop(); + }); while(event == null || !Object.prototype.hasOwnProperty.call(event,"event")); + output.__jobComplete.value = false; + output.workIterations.value = 0; + } + if(event.event == "EXIT") { + lime__$internal_backend_html5_HTML5Thread.__current.destroy(); + return; + } + if(event.event != "WORK" || event.job == null) { + event = null; + continue; + } + output.__activeJob.value = event.job; + var interruption = null; + try { + while(true) { + var tmp; + if(!output.__jobComplete.value) { + interruption = await new Promise(function(resolve,_) { + $global.setTimeout(resolve); + }).then(function(_) { + return lime__$internal_backend_html5_HTML5Thread.__messages.pop(); + }); + tmp = interruption == null; + } else { + tmp = false; + } + if(!tmp) { + break; + } + output.workIterations.value += 1; + (lime__$internal_backend_html5_WorkFunction.toFunction(event.job.doWork))(event.job.state,output); + } + } catch( _g ) { + var e = haxe_Exception.caught(_g); + output.sendError(e); + } + output.__activeJob.value = null; + if(interruption == null || output.__jobComplete.value) { + event = interruption; + } else if(Object.prototype.hasOwnProperty.call(interruption,"event")) { + event = interruption; + output.__jobComplete.value = false; + output.workIterations.value = 0; + } + } + })(); +}; +lime_system_ThreadPool.timestamp = function() { + return new Date().getTime() / 1000; +}; +lime_system_ThreadPool.__super__ = lime_system_WorkOutput; +lime_system_ThreadPool.prototype = $extend(lime_system_WorkOutput.prototype,{ + cancel: function(error) { + if(lime__$internal_backend_html5_HTML5Thread.__current != lime_system_ThreadPool.__mainThread) { + throw haxe_Exception.thrown("Call cancel() only from the main thread."); + } + lime_app_Application.current.onUpdate.remove($bind(this,this.__update)); + var _g = this.__activeJobs; + while(_g.__jobs.length > 0) { + _g.__index++; + if(_g.__index >= _g.__jobs.length) { + _g.__index = 0; + } + var job = _g.__jobs[_g.__index]; + if(this.__mode == true) { + var thread = this.__activeThreads.h[job.id]; + if(this.__idleThreads.length < this.minThreads) { + thread.sendMessage({ event : "CANCEL"}); + this.__idleThreads.push(thread); + } else { + thread.sendMessage({ event : "EXIT"}); + } + } + if(error != null) { + if(job.duration == 0) { + job.duration = new Date().getTime() / 1000 - job.startTime; + } + this.__activeJob.value = job; + this.onError.dispatch(error); + this.__activeJob.value = null; + } + } + var _this = this.__activeJobs; + _this.__jobs.length = 0; + if(_this.pool != null && _this.__addingWorkPriority != false && lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread) { + lime_system_ThreadPool.__totalWorkPriority -= _this.pool.workPriority; + _this.__addingWorkPriority = false; + } + while(this.__idleThreads.length > this.minThreads) this.__idleThreads.pop().sendMessage({ event : "EXIT"}); + if(error != null) { + var _g = this.__jobQueue; + while(_g.__jobs.length > 0) { + _g.__index++; + if(_g.__index >= _g.__jobs.length) { + _g.__index = 0; + } + var job = _g.__jobs[_g.__index]; + this.__activeJob.value = job; + this.onError.dispatch(error); + } + } + var _this = this.__jobQueue; + _this.__jobs.length = 0; + if(_this.pool != null && _this.__addingWorkPriority != false && lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread) { + lime_system_ThreadPool.__totalWorkPriority -= _this.pool.workPriority; + _this.__addingWorkPriority = false; + } + this.__jobComplete.value = false; + this.__activeJob.value = null; + } + ,cancelJob: function(jobID) { + var thread = this.__activeThreads.h[jobID]; + if(thread != null) { + thread.sendMessage({ event : "CANCEL"}); + this.__activeThreads.remove(jobID); + this.__idleThreads.push(thread); + } + if(!this.__activeJobs.remove(this.__activeJobs.get(jobID))) { + return this.__jobQueue.remove(this.__jobQueue.get(jobID)); + } else { + return true; + } + } + ,queue: function(doWork,state) { + return this.run(doWork,state); + } + ,run: function(doWork,state) { + if(lime__$internal_backend_html5_HTML5Thread.__current != lime_system_ThreadPool.__mainThread) { + throw haxe_Exception.thrown("Call run() only from the main thread."); + } + if(doWork == null) { + if(this.__doWork == null) { + throw haxe_Exception.thrown("run() requires doWork argument."); + } else { + doWork = this.__doWork; + } + } + if(state == null) { + state = { }; + } + var job = new lime_system_JobData(doWork,state); + var _this = this.__jobQueue; + _this.__jobs.push(job); + if(_this.pool != null && _this.__addingWorkPriority != true && lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread) { + lime_system_ThreadPool.__totalWorkPriority += _this.pool.workPriority; + _this.__addingWorkPriority = true; + } + if(!lime_app_Application.current.onUpdate.has($bind(this,this.__update))) { + lime_app_Application.current.onUpdate.add($bind(this,this.__update)); + } + return job.id; + } + ,__update: function(deltaTime) { + if(lime__$internal_backend_html5_HTML5Thread.__current != lime_system_ThreadPool.__mainThread) { + return; + } + while(this.__jobQueue.__jobs.length > 0 && this.__activeJobs.__jobs.length < this.maxThreads) { + var _this = this.__jobQueue; + var job = _this.__jobs.pop(); + var value = _this.__jobs.length > 0; + if(_this.pool != null && _this.__addingWorkPriority != value && lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread) { + if(value) { + lime_system_ThreadPool.__totalWorkPriority += _this.pool.workPriority; + } else { + lime_system_ThreadPool.__totalWorkPriority -= _this.pool.workPriority; + } + _this.__addingWorkPriority = value; + } + var job1 = job; + job1.startTime = new Date().getTime() / 1000; + var _this1 = this.__activeJobs; + _this1.__jobs.push(job1); + if(_this1.pool != null && _this1.__addingWorkPriority != true && lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread) { + lime_system_ThreadPool.__totalWorkPriority += _this1.pool.workPriority; + _this1.__addingWorkPriority = true; + } + if(this.__mode == true) { + lime__$internal_backend_html5_WorkFunction.makePortable(job1.doWork); + var thread = this.__idleThreads.length == 0 ? this.createThread({ func : lime_system_ThreadPool.__executeThread, classPath : "lime.system.ThreadPool", functionName : "__executeThread"}) : this.__idleThreads.pop(); + this.__activeThreads.h[job1.id] = thread; + thread.sendMessage({ event : "WORK", job : job1}); + } + } + if(this.__mode == false && this.__activeJobs.__jobs.length > 0) { + var _this = this.__activeJobs; + _this.__index++; + if(_this.__index >= _this.__jobs.length) { + _this.__index = 0; + } + this.__activeJob.value = _this.__jobs[_this.__index]; + var state = this.__activeJob.value.state; + this.__jobComplete.value = false; + this.workIterations.value = 0; + var maxTimeElapsed = this.workPriority * lime_system_ThreadPool.workLoad / (lime_system_ThreadPool.__totalWorkPriority * lime_app_Application.current.__window.__backend.getFrameRate()); + var startTime = new Date().getTime() / 1000; + var timeElapsed = 0; + try { + do { + this.workIterations.value += 1; + (lime__$internal_backend_html5_WorkFunction.toFunction(this.__activeJob.value.doWork))(state,this); + timeElapsed = new Date().getTime() / 1000 - startTime; + } while(!this.__jobComplete.value && timeElapsed < maxTimeElapsed); + } catch( _g ) { + var e = haxe_Exception.caught(_g); + this.sendError(e); + } + this.__activeJob.value.duration += timeElapsed; + this.__activeJob.value = null; + } + var threadEvent; + while(true) { + threadEvent = this.__jobOutput.pop(); + if(!(threadEvent != null)) { + break; + } + if(threadEvent.jobID != null) { + var value = this.__activeJobs.get(threadEvent.jobID); + this.__activeJob.value = value; + } else { + this.__activeJob.value = threadEvent.job; + } + if(this.__activeJob.value == null || this.__activeJobs.get(this.__activeJob.value.id) == null) { + continue; + } + if(this.__mode == true) { + var tmp = new Date().getTime() / 1000; + this.__activeJob.value.duration = tmp - this.__activeJob.value.startTime; + } + switch(threadEvent.event) { + case "COMPLETE":case "ERROR": + if(threadEvent.event == "COMPLETE") { + this.onComplete.dispatch(threadEvent.message); + } else { + this.onError.dispatch(threadEvent.message); + } + this.__activeJobs.remove(this.__activeJob.value); + if(this.__mode == true) { + var thread = this.__activeThreads.h[this.__activeJob.value.id]; + this.__activeThreads.remove(this.__activeJob.value.id); + if(this.__activeJobs.__jobs.length + this.__idleThreads.length > this.maxThreads || this.__jobQueue.__jobs.length == 0 && this.__activeJobs.__jobs.length + this.__idleThreads.length > this.minThreads) { + thread.sendMessage({ event : "EXIT"}); + } else { + this.__idleThreads.push(thread); + } + } + break; + case "PROGRESS": + this.onProgress.dispatch(threadEvent.message); + break; + case "WORK": + this.onRun.dispatch(threadEvent.message); + break; + default: + } + this.__activeJob.value = null; + } + if(this.__activeJobs.__jobs.length == 0 && this.__jobQueue.__jobs.length == 0) { + lime_app_Application.current.onUpdate.remove($bind(this,this.__update)); + } + } + ,createThread: function(executeThread) { + var thread = lime_system_WorkOutput.prototype.createThread.call(this,executeThread); + return thread; + } + ,get_activeJobs: function() { + return this.__activeJobs.__jobs.length; + } + ,get_idleThreads: function() { + return this.__idleThreads.length; + } + ,get_currentThreads: function() { + return this.__activeJobs.__jobs.length + this.__idleThreads.length; + } + ,get_doWork: function() { + return this; + } + ,set_workPriority: function(value) { + if(this.__mode == false && this.__activeJobs.__jobs.length > 0) { + lime_system_ThreadPool.__totalWorkPriority += value - this.workPriority; + } + return this.workPriority = value; + } + ,__class__: lime_system_ThreadPool + ,__properties__: $extend(lime_system_WorkOutput.prototype.__properties__,{get_doWork:"get_doWork",set_workPriority:"set_workPriority",get_idleThreads:"get_idleThreads",get_activeJobs:"get_activeJobs",get_currentThreads:"get_currentThreads"}) +}); +var lime_system__$ThreadPool_PseudoEvent = {}; +lime_system__$ThreadPool_PseudoEvent.__properties__ = {get___repeat:"get___repeat",get___listeners:"get___listeners"}; +lime_system__$ThreadPool_PseudoEvent.get___listeners = function(this1) { + return []; +}; +lime_system__$ThreadPool_PseudoEvent.get___repeat = function(this1) { + return []; +}; +lime_system__$ThreadPool_PseudoEvent.add = function(this1,callback) { + var callCallback = function(state,output) { + callback(state); + }; + if(this1.__mode == true) { + throw haxe_Exception.thrown("Unsupported operation; instead pass the callback to ThreadPool's constructor."); + } else { + this1.__doWork = { func : callCallback}; + } +}; +lime_system__$ThreadPool_PseudoEvent.cancel = function(this1) { +}; +lime_system__$ThreadPool_PseudoEvent.dispatch = function(this1) { +}; +lime_system__$ThreadPool_PseudoEvent.has = function(this1,callback) { + return this1.__doWork != null; +}; +lime_system__$ThreadPool_PseudoEvent.remove = function(this1,callback) { + this1.__doWork = null; +}; +lime_system__$ThreadPool_PseudoEvent.removeAll = function(this1) { + this1.__doWork = null; +}; +var lime_system_JobList = function(pool) { + this.__jobs = []; + this.__index = 0; + this.pool = pool; + this.__addingWorkPriority = false; +}; +$hxClasses["lime.system.JobList"] = lime_system_JobList; +lime_system_JobList.__name__ = "lime.system.JobList"; +lime_system_JobList.prototype = { + clear: function() { + this.__jobs.length = 0; + if(this.pool != null && this.__addingWorkPriority != false && lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread) { + lime_system_ThreadPool.__totalWorkPriority -= this.pool.workPriority; + this.__addingWorkPriority = false; + } + } + ,exists: function(job) { + return this.get(job.id) != null; + } + ,hasNext: function() { + return this.__jobs.length > 0; + } + ,next: function() { + this.__index++; + if(this.__index >= this.__jobs.length) { + this.__index = 0; + } + return this.__jobs[this.__index]; + } + ,pop: function() { + var job = this.__jobs.pop(); + var value = this.__jobs.length > 0; + if(this.pool != null && this.__addingWorkPriority != value && lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread) { + if(value) { + lime_system_ThreadPool.__totalWorkPriority += this.pool.workPriority; + } else { + lime_system_ThreadPool.__totalWorkPriority -= this.pool.workPriority; + } + this.__addingWorkPriority = value; + } + return job; + } + ,remove: function(job) { + if(HxOverrides.remove(this.__jobs,job)) { + var value = this.__jobs.length > 0; + if(this.pool != null && this.__addingWorkPriority != value && lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread) { + if(value) { + lime_system_ThreadPool.__totalWorkPriority += this.pool.workPriority; + } else { + lime_system_ThreadPool.__totalWorkPriority -= this.pool.workPriority; + } + this.__addingWorkPriority = value; + } + return true; + } else { + var tmp; + if(HxOverrides.remove(this.__jobs,this.get(job.id))) { + var value = this.__jobs.length > 0; + if(this.pool != null && this.__addingWorkPriority != value && lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread) { + if(value) { + lime_system_ThreadPool.__totalWorkPriority += this.pool.workPriority; + } else { + lime_system_ThreadPool.__totalWorkPriority -= this.pool.workPriority; + } + this.__addingWorkPriority = value; + } + tmp = true; + } else { + tmp = false; + } + if(tmp) { + return true; + } else { + return false; + } + } + } + ,removeByID: function(id) { + if(HxOverrides.remove(this.__jobs,this.get(id))) { + var value = this.__jobs.length > 0; + if(this.pool != null && this.__addingWorkPriority != value && lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread) { + if(value) { + lime_system_ThreadPool.__totalWorkPriority += this.pool.workPriority; + } else { + lime_system_ThreadPool.__totalWorkPriority -= this.pool.workPriority; + } + this.__addingWorkPriority = value; + } + return true; + } else { + return false; + } + } + ,get: function(id) { + var _g = 0; + var _g1 = this.__jobs; + while(_g < _g1.length) { + var job = _g1[_g]; + ++_g; + if(job.id == id) { + return job; + } + } + return null; + } + ,push: function(job) { + this.__jobs.push(job); + if(this.pool != null && this.__addingWorkPriority != true && lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread) { + lime_system_ThreadPool.__totalWorkPriority += this.pool.workPriority; + this.__addingWorkPriority = true; + } + } + ,set___addingWorkPriority: function(value) { + if(this.pool != null && this.__addingWorkPriority != value && lime__$internal_backend_html5_HTML5Thread.__current == lime_system_ThreadPool.__mainThread) { + if(value) { + lime_system_ThreadPool.__totalWorkPriority += this.pool.workPriority; + } else { + lime_system_ThreadPool.__totalWorkPriority -= this.pool.workPriority; + } + return this.__addingWorkPriority = value; + } else { + return this.__addingWorkPriority; + } + } + ,get_length: function() { + return this.__jobs.length; + } + ,__class__: lime_system_JobList + ,__properties__: {get_length:"get_length",set___addingWorkPriority:"set___addingWorkPriority"} +}; +var lime_system_JobData = function(doWork,state) { + this.startTime = 0; + this.duration = 0; + this.id = lime_system_JobData.nextID++; + this.doWork = doWork; + this.state = state; +}; +$hxClasses["lime.system.JobData"] = lime_system_JobData; +lime_system_JobData.__name__ = "lime.system.JobData"; +lime_system_JobData.prototype = { + __class__: lime_system_JobData +}; +var lime_system_JSAsync = function() { }; +$hxClasses["lime.system.JSAsync"] = lime_system_JSAsync; +lime_system_JSAsync.__name__ = "lime.system.JSAsync"; +var lime_system_Deque = {}; +lime_system_Deque._new = function() { + return new haxe_ds_List(); +}; +lime_system_Deque.pop = function(this1,block) { + return this1.pop(); +}; +var lime_system_Tls = function() { +}; +$hxClasses["lime.system.Tls"] = lime_system_Tls; +lime_system_Tls.__name__ = "lime.system.Tls"; +lime_system_Tls.prototype = { + __class__: lime_system_Tls +}; +var lime_text_Glyph = {}; +lime_text_Glyph._new = function(i) { + return i; +}; +var lime_text_GlyphMetrics = function() { +}; +$hxClasses["lime.text.GlyphMetrics"] = lime_text_GlyphMetrics; +lime_text_GlyphMetrics.__name__ = "lime.text.GlyphMetrics"; +lime_text_GlyphMetrics.prototype = { + __class__: lime_text_GlyphMetrics +}; +var lime_text_harfbuzz_HB = function() { }; +$hxClasses["lime.text.harfbuzz.HB"] = lime_text_harfbuzz_HB; +lime_text_harfbuzz_HB.__name__ = "lime.text.harfbuzz.HB"; +lime_text_harfbuzz_HB.shape = function(font,buffer,features) { +}; +var lime_text_harfbuzz_HBBlob = {}; +lime_text_harfbuzz_HBBlob.__properties__ = {get_length:"get_length",get_immutable:"get_immutable",get_dataWritable:"get_dataWritable",get_data:"get_data",get_empty:"get_empty"}; +lime_text_harfbuzz_HBBlob._new = function(data,length,memoryMode) { + return null; +}; +lime_text_harfbuzz_HBBlob.createSubBlob = function(this1,offset,length) { + return null; +}; +lime_text_harfbuzz_HBBlob.makeImmutable = function(this1) { +}; +lime_text_harfbuzz_HBBlob.get_data = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBBlob.get_dataWritable = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBBlob.get_empty = function() { + return null; +}; +lime_text_harfbuzz_HBBlob.get_immutable = function(this1) { + return false; +}; +lime_text_harfbuzz_HBBlob.get_length = function(this1) { + return 0; +}; +var lime_text_harfbuzz_HBBuffer = {}; +lime_text_harfbuzz_HBBuffer.__properties__ = {set_segmentProperties:"set_segmentProperties",get_segmentProperties:"get_segmentProperties",set_script:"set_script",get_script:"get_script",set_replacementCodepoint:"set_replacementCodepoint",get_replacementCodepoint:"get_replacementCodepoint",set_length:"set_length",get_length:"get_length",set_language:"set_language",get_language:"get_language",set_flags:"set_flags",get_flags:"get_flags",set_direction:"set_direction",get_direction:"get_direction",set_contentType:"set_contentType",get_contentType:"get_contentType",set_clusterLevel:"set_clusterLevel",get_clusterLevel:"get_clusterLevel",get_allocationSuccessful:"get_allocationSuccessful"}; +lime_text_harfbuzz_HBBuffer._new = function() { + return null; +}; +lime_text_harfbuzz_HBBuffer.add = function(this1,codepoint,cluster) { +}; +lime_text_harfbuzz_HBBuffer.addCodepoints = function(this1,text,textLength,itemOffset,itemLength) { +}; +lime_text_harfbuzz_HBBuffer.addUTF8 = function(this1,text,itemOffset,itemLength) { +}; +lime_text_harfbuzz_HBBuffer.addUTF16 = function(this1,text,textLength,itemOffset,itemLength) { +}; +lime_text_harfbuzz_HBBuffer.addUTF32 = function(this1,text,textLength,itemOffset,itemLength) { +}; +lime_text_harfbuzz_HBBuffer.clearContents = function(this1) { +}; +lime_text_harfbuzz_HBBuffer.getGlyphInfo = function(this1) { + return null; +}; +lime_text_harfbuzz_HBBuffer.getGlyphPositions = function(this1) { + return null; +}; +lime_text_harfbuzz_HBBuffer.guessSegmentProperties = function(this1) { +}; +lime_text_harfbuzz_HBBuffer.normalizeGlyphs = function(this1) { +}; +lime_text_harfbuzz_HBBuffer.preallocate = function(this1,size) { + return false; +}; +lime_text_harfbuzz_HBBuffer.reset = function(this1) { +}; +lime_text_harfbuzz_HBBuffer.reverse = function(this1) { +}; +lime_text_harfbuzz_HBBuffer.reverseClusters = function(this1) { +}; +lime_text_harfbuzz_HBBuffer.get_allocationSuccessful = function(this1) { + return false; +}; +lime_text_harfbuzz_HBBuffer.get_clusterLevel = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBBuffer.set_clusterLevel = function(this1,value) { + return value; +}; +lime_text_harfbuzz_HBBuffer.get_contentType = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBBuffer.set_contentType = function(this1,value) { + return value; +}; +lime_text_harfbuzz_HBBuffer.get_direction = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBBuffer.set_direction = function(this1,value) { + return value; +}; +lime_text_harfbuzz_HBBuffer.get_empty = function() { + return null; +}; +lime_text_harfbuzz_HBBuffer.get_flags = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBBuffer.set_flags = function(this1,value) { + return value; +}; +lime_text_harfbuzz_HBBuffer.get_language = function(this1) { + return null; +}; +lime_text_harfbuzz_HBBuffer.set_language = function(this1,value) { + return value; +}; +lime_text_harfbuzz_HBBuffer.get_length = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBBuffer.set_length = function(this1,value) { + return value; +}; +lime_text_harfbuzz_HBBuffer.get_replacementCodepoint = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBBuffer.set_replacementCodepoint = function(this1,value) { + return value; +}; +lime_text_harfbuzz_HBBuffer.get_script = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBBuffer.set_script = function(this1,value) { + return value; +}; +lime_text_harfbuzz_HBBuffer.get_segmentProperties = function(this1) { + return null; +}; +lime_text_harfbuzz_HBBuffer.set_segmentProperties = function(this1,value) { + return value; +}; +var lime_text_harfbuzz_HBFTFont = {}; +lime_text_harfbuzz_HBFTFont.__properties__ = {set_loadFlags:"set_loadFlags",get_loadFlags:"get_loadFlags"}; +lime_text_harfbuzz_HBFTFont._new = function(font) { + var this1; + if(font.src != null) { + this1 = null; + } else { + this1 = null; + } + return this1; +}; +lime_text_harfbuzz_HBFTFont.get_loadFlags = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBFTFont.set_loadFlags = function(this1,value) { + return value; +}; +var lime_text_harfbuzz_HBFace = {}; +lime_text_harfbuzz_HBFace.__properties__ = {set_upem:"set_upem",get_upem:"get_upem",set_index:"set_index",get_index:"get_index",get_immutable:"get_immutable",set_glyphCount:"set_glyphCount",get_glyphCount:"get_glyphCount",get_empty:"get_empty"}; +lime_text_harfbuzz_HBFace._new = function(blob,index) { + return null; +}; +lime_text_harfbuzz_HBFace.get_empty = function() { + return null; +}; +lime_text_harfbuzz_HBFace.get_glyphCount = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBFace.set_glyphCount = function(this1,value) { + return value; +}; +lime_text_harfbuzz_HBFace.get_immutable = function(this1) { + return false; +}; +lime_text_harfbuzz_HBFace.get_index = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBFace.set_index = function(this1,value) { + return value; +}; +lime_text_harfbuzz_HBFace.get_upem = function(this1) { + return 0; +}; +lime_text_harfbuzz_HBFace.set_upem = function(this1,value) { + return value; +}; +var lime_text_harfbuzz_HBFeature = function() { +}; +$hxClasses["lime.text.harfbuzz.HBFeature"] = lime_text_harfbuzz_HBFeature; +lime_text_harfbuzz_HBFeature.__name__ = "lime.text.harfbuzz.HBFeature"; +lime_text_harfbuzz_HBFeature.prototype = { + __class__: lime_text_harfbuzz_HBFeature +}; +var lime_text_harfbuzz_HBFont = {}; +lime_text_harfbuzz_HBFont.__properties__ = {set_scale:"set_scale",get_scale:"get_scale",set_ppem:"set_ppem",get_ppem:"get_ppem",get_parent:"get_parent",get_immutable:"get_immutable",get_face:"get_face",get_empty:"get_empty"}; +lime_text_harfbuzz_HBFont._new = function(face) { + return null; +}; +lime_text_harfbuzz_HBFont.addGlyphOriginForDirection = function(this1,glyph,direction,x,y) { +}; +lime_text_harfbuzz_HBFont.createSubFont = function(this1) { + return null; +}; +lime_text_harfbuzz_HBFont.getGlyphAdvanceForDirection = function(this1,glyph,direction) { + return null; +}; +lime_text_harfbuzz_HBFont.getGlyphKerningForDirection = function(this1,glyph,firstGlyph,secondGlyph,direction) { + return null; +}; +lime_text_harfbuzz_HBFont.getGlyphOriginForDirection = function(this1,glyph,direction) { + return null; +}; +lime_text_harfbuzz_HBFont.glyphFromString = function(this1,s) { + return 0; +}; +lime_text_harfbuzz_HBFont.glyphToString = function(this1,codepoint) { + return null; +}; +lime_text_harfbuzz_HBFont.makeImmutable = function(this1) { +}; +lime_text_harfbuzz_HBFont.subtractGlyphOriginForDirection = function(this1,glyph,direction,x,y) { +}; +lime_text_harfbuzz_HBFont.get_empty = function() { + return null; +}; +lime_text_harfbuzz_HBFont.get_face = function(this1) { + return null; +}; +lime_text_harfbuzz_HBFont.get_immutable = function(this1) { + return false; +}; +lime_text_harfbuzz_HBFont.get_parent = function(this1) { + return null; +}; +lime_text_harfbuzz_HBFont.get_ppem = function(this1) { + return null; +}; +lime_text_harfbuzz_HBFont.set_ppem = function(this1,value) { + return value; +}; +lime_text_harfbuzz_HBFont.get_scale = function(this1) { + return null; +}; +lime_text_harfbuzz_HBFont.set_scale = function(this1,value) { + return value; +}; +var lime_text_harfbuzz_HBGlyphInfo = function() { +}; +$hxClasses["lime.text.harfbuzz.HBGlyphInfo"] = lime_text_harfbuzz_HBGlyphInfo; +lime_text_harfbuzz_HBGlyphInfo.__name__ = "lime.text.harfbuzz.HBGlyphInfo"; +lime_text_harfbuzz_HBGlyphInfo.prototype = { + __class__: lime_text_harfbuzz_HBGlyphInfo +}; +var lime_text_harfbuzz_HBGlyphPosition = function() { +}; +$hxClasses["lime.text.harfbuzz.HBGlyphPosition"] = lime_text_harfbuzz_HBGlyphPosition; +lime_text_harfbuzz_HBGlyphPosition.__name__ = "lime.text.harfbuzz.HBGlyphPosition"; +lime_text_harfbuzz_HBGlyphPosition.prototype = { + __class__: lime_text_harfbuzz_HBGlyphPosition +}; +var lime_text_harfbuzz_HBLanguage = {}; +lime_text_harfbuzz_HBLanguage._new = function(language) { + return null; +}; +lime_text_harfbuzz_HBLanguage.toString = function(this1) { + return null; +}; +lime_text_harfbuzz_HBLanguage.fromString = function(value) { + return lime_text_harfbuzz_HBLanguage._new(value); +}; +var lime_text_harfbuzz_HBSegmentProperties = function() { +}; +$hxClasses["lime.text.harfbuzz.HBSegmentProperties"] = lime_text_harfbuzz_HBSegmentProperties; +lime_text_harfbuzz_HBSegmentProperties.__name__ = "lime.text.harfbuzz.HBSegmentProperties"; +lime_text_harfbuzz_HBSegmentProperties.prototype = { + __class__: lime_text_harfbuzz_HBSegmentProperties +}; +var lime_ui_Gamepad = function(id) { + this.onDisconnect = new lime_app__$Event_$Void_$Void(); + this.onButtonUp = new lime_app__$Event_$lime_$ui_$GamepadButton_$Void(); + this.onButtonDown = new lime_app__$Event_$lime_$ui_$GamepadButton_$Void(); + this.onAxisMove = new lime_app__$Event_$lime_$ui_$GamepadAxis_$Float_$Void(); + this.id = id; + this.connected = true; +}; +$hxClasses["lime.ui.Gamepad"] = lime_ui_Gamepad; +lime_ui_Gamepad.__name__ = "lime.ui.Gamepad"; +lime_ui_Gamepad.addMappings = function(mappings) { +}; +lime_ui_Gamepad.__connect = function(id) { + if(!lime_ui_Gamepad.devices.h.hasOwnProperty(id)) { + var gamepad = new lime_ui_Gamepad(id); + lime_ui_Gamepad.devices.h[id] = gamepad; + lime_ui_Gamepad.onConnect.dispatch(gamepad); + } +}; +lime_ui_Gamepad.__disconnect = function(id) { + var gamepad = lime_ui_Gamepad.devices.h[id]; + if(gamepad != null) { + gamepad.connected = false; + } + lime_ui_Gamepad.devices.remove(id); + if(gamepad != null) { + gamepad.onDisconnect.dispatch(); + } +}; +lime_ui_Gamepad.prototype = { + get_guid: function() { + var devices = lime_ui_Joystick.__getDeviceData(); + return devices[this.id].id; + } + ,get_name: function() { + var devices = lime_ui_Joystick.__getDeviceData(); + return devices[this.id].id; + } + ,__class__: lime_ui_Gamepad + ,__properties__: {get_name:"get_name",get_guid:"get_guid"} +}; +var lime_ui_GamepadAxis = {}; +lime_ui_GamepadAxis.toString = function(this1) { + switch(this1) { + case 0: + return "LEFT_X"; + case 1: + return "LEFT_Y"; + case 2: + return "RIGHT_X"; + case 3: + return "RIGHT_Y"; + case 4: + return "TRIGGER_LEFT"; + case 5: + return "TRIGGER_RIGHT"; + default: + return "UNKNOWN (" + this1 + ")"; + } +}; +var lime_ui_GamepadButton = {}; +lime_ui_GamepadButton.toString = function(this1) { + switch(this1) { + case 0: + return "A"; + case 1: + return "B"; + case 2: + return "X"; + case 3: + return "Y"; + case 4: + return "BACK"; + case 5: + return "GUIDE"; + case 6: + return "START"; + case 7: + return "LEFT_STICK"; + case 8: + return "RIGHT_STICK"; + case 9: + return "LEFT_SHOULDER"; + case 10: + return "RIGHT_SHOULDER"; + case 11: + return "DPAD_UP"; + case 12: + return "DPAD_DOWN"; + case 13: + return "DPAD_LEFT"; + case 14: + return "DPAD_RIGHT"; + default: + return "UNKNOWN (" + this1 + ")"; + } +}; +var lime_ui_Joystick = function(id) { + this.onHatMove = new lime_app__$Event_$Int_$lime_$ui_$JoystickHatPosition_$Void(); + this.onDisconnect = new lime_app__$Event_$Void_$Void(); + this.onButtonUp = new lime_app__$Event_$Int_$Void(); + this.onButtonDown = new lime_app__$Event_$Int_$Void(); + this.onAxisMove = new lime_app__$Event_$Int_$Float_$Void(); + this.id = id; + this.connected = true; +}; +$hxClasses["lime.ui.Joystick"] = lime_ui_Joystick; +lime_ui_Joystick.__name__ = "lime.ui.Joystick"; +lime_ui_Joystick.__connect = function(id) { + if(!lime_ui_Joystick.devices.h.hasOwnProperty(id)) { + var joystick = new lime_ui_Joystick(id); + lime_ui_Joystick.devices.h[id] = joystick; + lime_ui_Joystick.onConnect.dispatch(joystick); + } +}; +lime_ui_Joystick.__disconnect = function(id) { + var joystick = lime_ui_Joystick.devices.h[id]; + if(joystick != null) { + joystick.connected = false; + } + lime_ui_Joystick.devices.remove(id); + if(joystick != null) { + joystick.onDisconnect.dispatch(); + } +}; +lime_ui_Joystick.__getDeviceData = function() { + var res = null; + try { + res = navigator.getGamepads ? navigator.getGamepads() : navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : null; + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + } + return res; +}; +lime_ui_Joystick.prototype = { + get_guid: function() { + var devices = lime_ui_Joystick.__getDeviceData(); + return devices[this.id].id; + } + ,get_name: function() { + var devices = lime_ui_Joystick.__getDeviceData(); + return devices[this.id].id; + } + ,get_numAxes: function() { + var devices = lime_ui_Joystick.__getDeviceData(); + return devices[this.id].axes.length; + } + ,get_numButtons: function() { + var devices = lime_ui_Joystick.__getDeviceData(); + return devices[this.id].buttons.length; + } + ,get_numHats: function() { + return 0; + } + ,__class__: lime_ui_Joystick + ,__properties__: {get_numHats:"get_numHats",get_numButtons:"get_numButtons",get_numAxes:"get_numAxes",get_name:"get_name",get_guid:"get_guid"} +}; +var lime_ui_JoystickHatPosition = {}; +lime_ui_JoystickHatPosition.__properties__ = {set_up:"set_up",get_up:"get_up",set_right:"set_right",get_right:"get_right",set_left:"set_left",get_left:"get_left",set_down:"set_down",get_down:"get_down",set_center:"set_center",get_center:"get_center"}; +lime_ui_JoystickHatPosition._new = function(value) { + return value; +}; +lime_ui_JoystickHatPosition.get_center = function(this1) { + return this1 == 0; +}; +lime_ui_JoystickHatPosition.set_center = function(this1,value) { + if(value) { + this1 = 0; + } + return value; +}; +lime_ui_JoystickHatPosition.get_down = function(this1) { + return (this1 & 4) > 0; +}; +lime_ui_JoystickHatPosition.set_down = function(this1,value) { + if(value) { + this1 |= 4; + } else { + this1 &= 268435455 - 4; + } + return value; +}; +lime_ui_JoystickHatPosition.get_left = function(this1) { + return (this1 & 8) > 0; +}; +lime_ui_JoystickHatPosition.set_left = function(this1,value) { + if(value) { + this1 |= 8; + } else { + this1 &= 268435455 - 8; + } + return value; +}; +lime_ui_JoystickHatPosition.get_right = function(this1) { + return (this1 & 2) > 0; +}; +lime_ui_JoystickHatPosition.set_right = function(this1,value) { + if(value) { + this1 |= 2; + } else { + this1 &= 268435455 - 2; + } + return value; +}; +lime_ui_JoystickHatPosition.get_up = function(this1) { + return (this1 & 1) > 0; +}; +lime_ui_JoystickHatPosition.set_up = function(this1,value) { + if(value) { + this1 |= 1; + } else { + this1 &= 268435455 - 1; + } + return value; +}; +var lime_ui_KeyCode = {}; +lime_ui_KeyCode.fromScanCode = function(scanCode) { + return 0; +}; +lime_ui_KeyCode.toScanCode = function(keyCode) { + return 0; +}; +lime_ui_KeyCode.gt = function(a,b) { + return a > b; +}; +lime_ui_KeyCode.gte = function(a,b) { + return a >= b; +}; +lime_ui_KeyCode.lt = function(a,b) { + return a < b; +}; +lime_ui_KeyCode.lte = function(a,b) { + return a <= b; +}; +lime_ui_KeyCode.plus = function(a,b) { + return a + b; +}; +var lime_ui_KeyModifier = {}; +lime_ui_KeyModifier.__properties__ = {set_shiftKey:"set_shiftKey",get_shiftKey:"get_shiftKey",set_numLock:"set_numLock",get_numLock:"get_numLock",set_metaKey:"set_metaKey",get_metaKey:"get_metaKey",set_ctrlKey:"set_ctrlKey",get_ctrlKey:"get_ctrlKey",set_capsLock:"set_capsLock",get_capsLock:"get_capsLock",set_altKey:"set_altKey",get_altKey:"get_altKey"}; +lime_ui_KeyModifier.get_altKey = function(this1) { + if((this1 & 256) <= 0) { + return (this1 & 512) > 0; + } else { + return true; + } +}; +lime_ui_KeyModifier.set_altKey = function(this1,value) { + if(value) { + this1 |= 768; + } else { + this1 &= 268435455 - 768; + } + return value; +}; +lime_ui_KeyModifier.get_capsLock = function(this1) { + if((this1 & 8192) <= 0) { + return (this1 & 8192) > 0; + } else { + return true; + } +}; +lime_ui_KeyModifier.set_capsLock = function(this1,value) { + if(value) { + this1 |= 8192; + } else { + this1 &= 268435455 - 8192; + } + return value; +}; +lime_ui_KeyModifier.get_ctrlKey = function(this1) { + if((this1 & 64) <= 0) { + return (this1 & 128) > 0; + } else { + return true; + } +}; +lime_ui_KeyModifier.set_ctrlKey = function(this1,value) { + if(value) { + this1 |= 192; + } else { + this1 &= 268435455 - 192; + } + return value; +}; +lime_ui_KeyModifier.get_metaKey = function(this1) { + if((this1 & 1024) <= 0) { + return (this1 & 2048) > 0; + } else { + return true; + } +}; +lime_ui_KeyModifier.set_metaKey = function(this1,value) { + if(value) { + this1 |= 3072; + } else { + this1 &= 268435455 - 3072; + } + return value; +}; +lime_ui_KeyModifier.get_numLock = function(this1) { + if((this1 & 4096) <= 0) { + return (this1 & 4096) > 0; + } else { + return true; + } +}; +lime_ui_KeyModifier.set_numLock = function(this1,value) { + if(value) { + this1 |= 4096; + } else { + this1 &= 268435455 - 4096; + } + return value; +}; +lime_ui_KeyModifier.get_shiftKey = function(this1) { + if((this1 & 1) <= 0) { + return (this1 & 2) > 0; + } else { + return true; + } +}; +lime_ui_KeyModifier.set_shiftKey = function(this1,value) { + if(value) { + this1 |= 3; + } else { + this1 &= 268435455 - 3; + } + return value; +}; +var lime_ui_MouseCursor = $hxEnums["lime.ui.MouseCursor"] = { __ename__:"lime.ui.MouseCursor",__constructs__:null + ,ARROW: {_hx_name:"ARROW",_hx_index:0,__enum__:"lime.ui.MouseCursor",toString:$estr} + ,CROSSHAIR: {_hx_name:"CROSSHAIR",_hx_index:1,__enum__:"lime.ui.MouseCursor",toString:$estr} + ,DEFAULT: {_hx_name:"DEFAULT",_hx_index:2,__enum__:"lime.ui.MouseCursor",toString:$estr} + ,MOVE: {_hx_name:"MOVE",_hx_index:3,__enum__:"lime.ui.MouseCursor",toString:$estr} + ,POINTER: {_hx_name:"POINTER",_hx_index:4,__enum__:"lime.ui.MouseCursor",toString:$estr} + ,RESIZE_NESW: {_hx_name:"RESIZE_NESW",_hx_index:5,__enum__:"lime.ui.MouseCursor",toString:$estr} + ,RESIZE_NS: {_hx_name:"RESIZE_NS",_hx_index:6,__enum__:"lime.ui.MouseCursor",toString:$estr} + ,RESIZE_NWSE: {_hx_name:"RESIZE_NWSE",_hx_index:7,__enum__:"lime.ui.MouseCursor",toString:$estr} + ,RESIZE_WE: {_hx_name:"RESIZE_WE",_hx_index:8,__enum__:"lime.ui.MouseCursor",toString:$estr} + ,TEXT: {_hx_name:"TEXT",_hx_index:9,__enum__:"lime.ui.MouseCursor",toString:$estr} + ,WAIT: {_hx_name:"WAIT",_hx_index:10,__enum__:"lime.ui.MouseCursor",toString:$estr} + ,WAIT_ARROW: {_hx_name:"WAIT_ARROW",_hx_index:11,__enum__:"lime.ui.MouseCursor",toString:$estr} + ,CUSTOM: {_hx_name:"CUSTOM",_hx_index:12,__enum__:"lime.ui.MouseCursor",toString:$estr} +}; +lime_ui_MouseCursor.__constructs__ = [lime_ui_MouseCursor.ARROW,lime_ui_MouseCursor.CROSSHAIR,lime_ui_MouseCursor.DEFAULT,lime_ui_MouseCursor.MOVE,lime_ui_MouseCursor.POINTER,lime_ui_MouseCursor.RESIZE_NESW,lime_ui_MouseCursor.RESIZE_NS,lime_ui_MouseCursor.RESIZE_NWSE,lime_ui_MouseCursor.RESIZE_WE,lime_ui_MouseCursor.TEXT,lime_ui_MouseCursor.WAIT,lime_ui_MouseCursor.WAIT_ARROW,lime_ui_MouseCursor.CUSTOM]; +var lime_ui_MouseWheelMode = $hxEnums["lime.ui.MouseWheelMode"] = { __ename__:"lime.ui.MouseWheelMode",__constructs__:null + ,PIXELS: {_hx_name:"PIXELS",_hx_index:0,__enum__:"lime.ui.MouseWheelMode",toString:$estr} + ,LINES: {_hx_name:"LINES",_hx_index:1,__enum__:"lime.ui.MouseWheelMode",toString:$estr} + ,PAGES: {_hx_name:"PAGES",_hx_index:2,__enum__:"lime.ui.MouseWheelMode",toString:$estr} + ,UNKNOWN: {_hx_name:"UNKNOWN",_hx_index:3,__enum__:"lime.ui.MouseWheelMode",toString:$estr} +}; +lime_ui_MouseWheelMode.__constructs__ = [lime_ui_MouseWheelMode.PIXELS,lime_ui_MouseWheelMode.LINES,lime_ui_MouseWheelMode.PAGES,lime_ui_MouseWheelMode.UNKNOWN]; +var lime_ui_ScanCode = {}; +lime_ui_ScanCode.fromKeyCode = function(keyCode) { + return lime_ui_KeyCode.toScanCode(keyCode); +}; +lime_ui_ScanCode.toKeyCode = function(scanCode) { + return lime_ui_KeyCode.fromScanCode(scanCode); +}; +lime_ui_ScanCode.gt = function(a,b) { + return a > b; +}; +lime_ui_ScanCode.gte = function(a,b) { + return a >= b; +}; +lime_ui_ScanCode.lt = function(a,b) { + return a < b; +}; +lime_ui_ScanCode.lte = function(a,b) { + return a <= b; +}; +lime_ui_ScanCode.plus = function(a,b) { + return a + b; +}; +var lime_ui_Touch = function(x,y,id,dx,dy,pressure,device) { + this.x = x; + this.y = y; + this.id = id; + this.dx = dx; + this.dy = dy; + this.pressure = pressure; + this.device = device; +}; +$hxClasses["lime.ui.Touch"] = lime_ui_Touch; +lime_ui_Touch.__name__ = "lime.ui.Touch"; +lime_ui_Touch.prototype = { + __class__: lime_ui_Touch +}; +var lime_ui_Window = function(application,attributes) { + this.__maxHeight = 2147483647; + this.__maxWidth = 2147483647; + this.__minHeight = 0; + this.__minWidth = 0; + this.clickCount = 0; + this.onTextInput = new lime_app__$Event_$String_$Void(); + this.onTextEdit = new lime_app__$Event_$String_$Int_$Int_$Void(); + this.onShow = new lime_app__$Event_$Void_$Void(); + this.onRestore = new lime_app__$Event_$Void_$Void(); + this.onResize = new lime_app__$Event_$Int_$Int_$Void(); + this.onRenderContextRestored = new lime_app__$Event_$lime_$graphics_$RenderContext_$Void(); + this.onRenderContextLost = new lime_app__$Event_$Void_$Void(); + this.onRender = new lime_app__$Event_$lime_$graphics_$RenderContext_$Void(); + this.onMove = new lime_app__$Event_$Float_$Float_$Void(); + this.onMouseWheel = new lime_app__$Event_$Float_$Float_$lime_$ui_$MouseWheelMode_$Void(); + this.onMouseUp = new lime_app__$Event_$Float_$Float_$Int_$Void(); + this.onMouseMoveRelative = new lime_app__$Event_$Float_$Float_$Void(); + this.onMouseMove = new lime_app__$Event_$Float_$Float_$Void(); + this.onMouseDown = new lime_app__$Event_$Float_$Float_$lime_$ui_$MouseButton_$Void(); + this.onMinimize = new lime_app__$Event_$Void_$Void(); + this.onMaximize = new lime_app__$Event_$Void_$Void(); + this.onLeave = new lime_app__$Event_$Void_$Void(); + this.onKeyUp = new lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void(); + this.onKeyDown = new lime_app__$Event_$lime_$ui_$KeyCode_$lime_$ui_$KeyModifier_$Void(); + this.onHide = new lime_app__$Event_$Void_$Void(); + this.onFullscreen = new lime_app__$Event_$Void_$Void(); + this.onFocusOut = new lime_app__$Event_$Void_$Void(); + this.onFocusIn = new lime_app__$Event_$Void_$Void(); + this.onExpose = new lime_app__$Event_$Void_$Void(); + this.onEnter = new lime_app__$Event_$Void_$Void(); + this.onDropFile = new lime_app__$Event_$String_$Void(); + this.onDeactivate = new lime_app__$Event_$Void_$Void(); + this.onClose = new lime_app__$Event_$Void_$Void(); + this.onActivate = new lime_app__$Event_$Void_$Void(); + this.application = application; + this.__attributes = attributes != null ? attributes : { }; + if(Object.prototype.hasOwnProperty.call(this.__attributes,"parameters")) { + this.parameters = this.__attributes.parameters; + } + this.__width = 0; + this.__height = 0; + this.__fullscreen = false; + this.__scale = 1; + this.__x = 0; + this.__y = 0; + this.__title = Object.prototype.hasOwnProperty.call(this.__attributes,"title") ? this.__attributes.title : ""; + this.id = -1; + this.__backend = new lime__$internal_backend_html5_HTML5Window(this); +}; +$hxClasses["lime.ui.Window"] = lime_ui_Window; +lime_ui_Window.__name__ = "lime.ui.Window"; +lime_ui_Window.prototype = { + alert: function(message,title) { + this.__backend.alert(message,title); + } + ,close: function() { + this.__backend.close(); + } + ,focus: function() { + this.__backend.focus(); + } + ,move: function(x,y) { + this.__backend.move(x,y); + this.__x = x; + this.__y = y; + } + ,readPixels: function(rect) { + return this.__backend.readPixels(rect); + } + ,resize: function(width,height) { + if(width < this.__minWidth) { + width = this.__minWidth; + } else if(width > this.__maxWidth) { + width = this.__maxWidth; + } + if(height < this.__minHeight) { + height = this.__minHeight; + } else if(height > this.__maxHeight) { + height = this.__maxHeight; + } + this.__backend.resize(width,height); + this.__width = width; + this.__height = height; + } + ,setMinSize: function(width,height) { + this.__backend.setMinSize(width,height); + this.__minWidth = width; + this.__minHeight = height; + if(this.__width < this.__minWidth || this.__height < this.__minHeight) { + this.resize(this.__width,this.__height); + } + } + ,setMaxSize: function(width,height) { + this.__backend.setMaxSize(width,height); + this.__maxWidth = width; + this.__maxHeight = height; + if(this.__width > this.__maxWidth || this.__height > this.__maxHeight) { + this.resize(this.__width,this.__height); + } + } + ,setIcon: function(image) { + if(image == null) { + return; + } + this.__backend.setIcon(image); + } + ,toString: function() { + return "[object Window]"; + } + ,warpMouse: function(x,y) { + this.__backend.warpMouse(x,y); + } + ,get_cursor: function() { + return this.__backend.getCursor(); + } + ,set_cursor: function(value) { + return this.__backend.setCursor(value); + } + ,get_display: function() { + return this.__backend.getDisplay(); + } + ,get_displayMode: function() { + return this.__backend.getDisplayMode(); + } + ,set_displayMode: function(value) { + return this.__backend.setDisplayMode(value); + } + ,get_borderless: function() { + return this.__borderless; + } + ,set_borderless: function(value) { + return this.__borderless = this.__backend.setBorderless(value); + } + ,get_frameRate: function() { + return this.__backend.getFrameRate(); + } + ,set_frameRate: function(value) { + return this.__backend.setFrameRate(value); + } + ,get_fullscreen: function() { + return this.__fullscreen; + } + ,set_fullscreen: function(value) { + return this.__fullscreen = this.__backend.setFullscreen(value); + } + ,get_height: function() { + return this.__height; + } + ,set_height: function(value) { + this.resize(this.__width,value); + return this.__height; + } + ,get_hidden: function() { + return this.__hidden; + } + ,get_maxHeight: function() { + return this.__maxHeight; + } + ,set_maxHeight: function(value) { + this.setMaxSize(this.__maxWidth,value); + return this.__maxHeight; + } + ,get_maximized: function() { + return this.__maximized; + } + ,set_maximized: function(value) { + this.__minimized = false; + return this.__maximized = this.__backend.setMaximized(value); + } + ,get_maxWidth: function() { + return this.__maxWidth; + } + ,set_maxWidth: function(value) { + this.setMinSize(value,this.__maxHeight); + return this.__maxWidth; + } + ,get_minHeight: function() { + return this.__minHeight; + } + ,set_minHeight: function(value) { + this.setMinSize(this.__minWidth,value); + return this.__minHeight; + } + ,get_minimized: function() { + return this.__minimized; + } + ,set_minimized: function(value) { + this.__maximized = false; + return this.__minimized = this.__backend.setMinimized(value); + } + ,get_minWidth: function() { + return this.__minWidth; + } + ,set_minWidth: function(value) { + this.setMinSize(value,this.__minHeight); + return this.__minWidth; + } + ,get_mouseLock: function() { + return this.__backend.getMouseLock(); + } + ,set_mouseLock: function(value) { + this.__backend.setMouseLock(value); + return value; + } + ,get_opacity: function() { + return this.__backend.getOpacity(); + } + ,set_opacity: function(value) { + this.__backend.setOpacity(value); + return value; + } + ,get_resizable: function() { + return this.__resizable; + } + ,set_resizable: function(value) { + this.__resizable = this.__backend.setResizable(value); + return this.__resizable; + } + ,get_scale: function() { + return this.__scale; + } + ,get_textInputEnabled: function() { + return this.__backend.getTextInputEnabled(); + } + ,set_textInputEnabled: function(value) { + return this.__backend.setTextInputEnabled(value); + } + ,setTextInputRect: function(value) { + return this.__backend.setTextInputRect(value); + } + ,get_title: function() { + return this.__title; + } + ,set_title: function(value) { + return this.__title = this.__backend.setTitle(value); + } + ,get_visible: function() { + return this.__visible; + } + ,set_visible: function(value) { + this.__visible = this.__backend.setVisible(value); + return this.__visible; + } + ,get_width: function() { + return this.__width; + } + ,set_width: function(value) { + this.resize(value,this.__height); + return this.__width; + } + ,get_x: function() { + return this.__x; + } + ,set_x: function(value) { + this.move(value,this.__y); + return this.__x; + } + ,get_y: function() { + return this.__y; + } + ,set_y: function(value) { + this.move(this.__x,value); + return this.__y; + } + ,__class__: lime_ui_Window + ,__properties__: {set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x",set_width:"set_width",get_width:"get_width",set_visible:"set_visible",get_visible:"get_visible",set_title:"set_title",get_title:"get_title",set_textInputEnabled:"set_textInputEnabled",get_textInputEnabled:"get_textInputEnabled",get_scale:"get_scale",set_resizable:"set_resizable",get_resizable:"get_resizable",set_opacity:"set_opacity",get_opacity:"get_opacity",set_mouseLock:"set_mouseLock",get_mouseLock:"get_mouseLock",set_minWidth:"set_minWidth",get_minWidth:"get_minWidth",set_minimized:"set_minimized",get_minimized:"get_minimized",set_minHeight:"set_minHeight",get_minHeight:"get_minHeight",set_maxWidth:"set_maxWidth",get_maxWidth:"get_maxWidth",set_maximized:"set_maximized",get_maximized:"get_maximized",set_maxHeight:"set_maxHeight",get_maxHeight:"get_maxHeight",get_hidden:"get_hidden",set_height:"set_height",get_height:"get_height",set_fullscreen:"set_fullscreen",get_fullscreen:"get_fullscreen",set_frameRate:"set_frameRate",get_frameRate:"get_frameRate",set_displayMode:"set_displayMode",get_displayMode:"get_displayMode",get_display:"get_display",set_cursor:"set_cursor",get_cursor:"get_cursor",set_borderless:"set_borderless",get_borderless:"get_borderless"} +}; +var lime_utils_TAError = $hxEnums["lime.utils.TAError"] = { __ename__:"lime.utils.TAError",__constructs__:null + ,RangeError: {_hx_name:"RangeError",_hx_index:0,__enum__:"lime.utils.TAError",toString:$estr} +}; +lime_utils_TAError.__constructs__ = [lime_utils_TAError.RangeError]; +var lime_utils_AssetBundle = function() { + this.data = new haxe_ds_StringMap(); + this.paths = []; +}; +$hxClasses["lime.utils.AssetBundle"] = lime_utils_AssetBundle; +lime_utils_AssetBundle.__name__ = "lime.utils.AssetBundle"; +lime_utils_AssetBundle.fromBytes = function(bytes) { + var input = new haxe_io_BytesInput(bytes); + return lime_utils_AssetBundle.__extractBundle(input); +}; +lime_utils_AssetBundle.fromFile = function(path) { + return null; +}; +lime_utils_AssetBundle.loadFromBytes = function(bytes) { + return lime_app_Future.withValue(lime_utils_AssetBundle.fromBytes(bytes)); +}; +lime_utils_AssetBundle.loadFromFile = function(path) { + return lime_utils_Bytes.loadFromFile(path).then(lime_utils_AssetBundle.loadFromBytes); +}; +lime_utils_AssetBundle.__extractBundle = function(input) { + var entries = haxe_zip_Reader.readZip(input); + var bundle = new lime_utils_AssetBundle(); + var _g_head = entries.h; + while(_g_head != null) { + var val = _g_head.item; + _g_head = _g_head.next; + var entry = val; + if(entry.compressed) { + var bytes = entry.data; + var this1 = bundle.data; + var key = entry.fileName; + var value = lime_utils_Bytes.decompress(bytes,lime_utils_CompressionAlgorithm.DEFLATE); + this1.h[key] = value; + } else { + bundle.data.h[entry.fileName] = entry.data; + } + bundle.paths.push(entry.fileName); + } + return bundle; +}; +lime_utils_AssetBundle.prototype = { + __class__: lime_utils_AssetBundle +}; +var lime_utils_AssetCache = function() { + this.enabled = true; + this.audio = new haxe_ds_StringMap(); + this.font = new haxe_ds_StringMap(); + this.image = new haxe_ds_StringMap(); + this.version = 812316; +}; +$hxClasses["lime.utils.AssetCache"] = lime_utils_AssetCache; +lime_utils_AssetCache.__name__ = "lime.utils.AssetCache"; +lime_utils_AssetCache.prototype = { + exists: function(id,type) { + if(type == "IMAGE" || type == null) { + if(Object.prototype.hasOwnProperty.call(this.image.h,id)) { + return true; + } + } + if(type == "FONT" || type == null) { + if(Object.prototype.hasOwnProperty.call(this.font.h,id)) { + return true; + } + } + if(type == "SOUND" || type == "MUSIC" || type == null) { + if(Object.prototype.hasOwnProperty.call(this.audio.h,id)) { + return true; + } + } + return false; + } + ,set: function(id,type,asset) { + switch(type) { + case "FONT": + this.font.h[id] = asset; + break; + case "IMAGE": + if(!((asset) instanceof lime_graphics_Image)) { + throw haxe_Exception.thrown("Cannot cache non-Image asset: " + Std.string(asset) + " as Image"); + } + this.image.h[id] = asset; + break; + case "MUSIC":case "SOUND": + if(!((asset) instanceof lime_media_AudioBuffer)) { + throw haxe_Exception.thrown("Cannot cache non-AudioBuffer asset: " + Std.string(asset) + " as AudioBuffer"); + } + this.audio.h[id] = asset; + break; + default: + throw haxe_Exception.thrown(type + " assets are not cachable"); + } + } + ,clear: function(prefix) { + if(prefix == null) { + this.audio = new haxe_ds_StringMap(); + this.font = new haxe_ds_StringMap(); + this.image = new haxe_ds_StringMap(); + } else { + var h = this.audio.h; + var key_h = h; + var key_keys = Object.keys(h); + var key_length = key_keys.length; + var key_current = 0; + while(key_current < key_length) { + var key = key_keys[key_current++]; + if(StringTools.startsWith(key,prefix)) { + var _this = this.audio; + if(Object.prototype.hasOwnProperty.call(_this.h,key)) { + delete(_this.h[key]); + } + } + } + var h = this.font.h; + var key_h = h; + var key_keys = Object.keys(h); + var key_length = key_keys.length; + var key_current = 0; + while(key_current < key_length) { + var key = key_keys[key_current++]; + if(StringTools.startsWith(key,prefix)) { + var _this = this.font; + if(Object.prototype.hasOwnProperty.call(_this.h,key)) { + delete(_this.h[key]); + } + } + } + var h = this.image.h; + var key_h = h; + var key_keys = Object.keys(h); + var key_length = key_keys.length; + var key_current = 0; + while(key_current < key_length) { + var key = key_keys[key_current++]; + if(StringTools.startsWith(key,prefix)) { + var _this = this.image; + if(Object.prototype.hasOwnProperty.call(_this.h,key)) { + delete(_this.h[key]); + } + } + } + } + } + ,__class__: lime_utils_AssetCache +}; +var lime_utils_AssetLibrary = function() { + this.types = new haxe_ds_StringMap(); + this.sizes = new haxe_ds_StringMap(); + this.preload = new haxe_ds_StringMap(); + this.paths = new haxe_ds_StringMap(); + this.pathGroups = new haxe_ds_StringMap(); + this.classTypes = new haxe_ds_StringMap(); + this.cachedText = new haxe_ds_StringMap(); + this.cachedImages = new haxe_ds_StringMap(); + this.cachedFonts = new haxe_ds_StringMap(); + this.cachedBytes = new haxe_ds_StringMap(); + this.cachedAudioBuffers = new haxe_ds_StringMap(); + this.onChange = new lime_app__$Event_$Void_$Void(); + this.bytesLoaded = 0; + this.bytesTotal = 0; +}; +$hxClasses["lime.utils.AssetLibrary"] = lime_utils_AssetLibrary; +lime_utils_AssetLibrary.__name__ = "lime.utils.AssetLibrary"; +lime_utils_AssetLibrary.fromBytes = function(bytes,rootPath) { + return lime_utils_AssetLibrary.fromManifest(lime_utils_AssetManifest.fromBytes(bytes,rootPath)); +}; +lime_utils_AssetLibrary.fromFile = function(path,rootPath) { + return lime_utils_AssetLibrary.fromManifest(lime_utils_AssetManifest.fromFile(path,rootPath)); +}; +lime_utils_AssetLibrary.fromBundle = function(bundle) { + if(Object.prototype.hasOwnProperty.call(bundle.data.h,"library.json")) { + var manifest = lime_utils_AssetManifest.fromBytes(bundle.data.h["library.json"]); + if(manifest != null) { + var library = null; + if(manifest.libraryType == null) { + library = new lime_utils_AssetLibrary(); + } else { + var name = manifest.libraryType; + var libraryClass = $hxClasses[name]; + if(libraryClass != null) { + library = Type.createInstance(libraryClass,manifest.libraryArgs); + } else { + lime_utils_Log.warn("Could not find library type: " + manifest.libraryType,{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 122, className : "lime.utils.AssetLibrary", methodName : "fromBundle"}); + return null; + } + } + library.__fromBundle(bundle,manifest); + return library; + } + } else { + var library = new lime_utils_AssetLibrary(); + library.__fromBundle(bundle); + return library; + } + return null; +}; +lime_utils_AssetLibrary.fromManifest = function(manifest) { + if(manifest == null) { + return null; + } + var library = null; + if(manifest.libraryType == null) { + library = new lime_utils_AssetLibrary(); + } else { + var name = manifest.libraryType; + var libraryClass = $hxClasses[name]; + if(libraryClass != null) { + library = Type.createInstance(libraryClass,manifest.libraryArgs); + } else { + lime_utils_Log.warn("Could not find library type: " + manifest.libraryType,{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 160, className : "lime.utils.AssetLibrary", methodName : "fromManifest"}); + return null; + } + } + library.__fromManifest(manifest); + return library; +}; +lime_utils_AssetLibrary.loadFromBytes = function(bytes,rootPath) { + return lime_utils_AssetManifest.loadFromBytes(bytes,rootPath).then(function(manifest) { + return lime_utils_AssetLibrary.loadFromManifest(manifest); + }); +}; +lime_utils_AssetLibrary.loadFromFile = function(path,rootPath) { + return lime_utils_AssetManifest.loadFromFile(path,rootPath).then(function(manifest) { + return lime_utils_AssetLibrary.loadFromManifest(manifest); + }); +}; +lime_utils_AssetLibrary.loadFromManifest = function(manifest) { + var library = lime_utils_AssetLibrary.fromManifest(manifest); + if(library != null) { + return library.load(); + } else { + return lime_app_Future.withError("Could not load asset manifest"); + } +}; +lime_utils_AssetLibrary.prototype = { + exists: function(id,type) { + var requestedType = type != null ? js_Boot.__cast(type , String) : null; + var assetType = this.types.h[id]; + if(assetType != null) { + if(assetType == requestedType || (requestedType == "SOUND" || requestedType == "MUSIC") && (assetType == "MUSIC" || assetType == "SOUND")) { + return true; + } + if(requestedType == "BINARY" || requestedType == null || assetType == "BINARY" && requestedType == "TEXT") { + return true; + } + } + return false; + } + ,getAsset: function(id,type) { + switch(type) { + case "BINARY": + return this.getBytes(id); + case "FONT": + return this.getFont(id); + case "IMAGE": + return this.getImage(id); + case "MUSIC":case "SOUND": + return this.getAudioBuffer(id); + case "TEMPLATE": + throw haxe_Exception.thrown("Not sure how to get template: " + id); + case "TEXT": + return this.getText(id); + default: + throw haxe_Exception.thrown("Unknown asset type: " + type); + } + } + ,getAudioBuffer: function(id) { + if(Object.prototype.hasOwnProperty.call(this.cachedAudioBuffers.h,id)) { + return this.cachedAudioBuffers.h[id]; + } else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) { + return lime_media_AudioBuffer.fromBytes(js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , haxe_io_Bytes)); + } else { + return lime_media_AudioBuffer.fromFile(this.getPath(id)); + } + } + ,getBytes: function(id) { + if(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) { + return this.cachedBytes.h[id]; + } else if(Object.prototype.hasOwnProperty.call(this.cachedText.h,id)) { + var bytes = lime_utils_Bytes.ofString(this.cachedText.h[id]); + this.cachedBytes.h[id] = bytes; + return bytes; + } else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) { + return js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , haxe_io_Bytes); + } else { + return lime_utils_Bytes.fromFile(this.getPath(id)); + } + } + ,getFont: function(id) { + if(Object.prototype.hasOwnProperty.call(this.cachedFonts.h,id)) { + return this.cachedFonts.h[id]; + } else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) { + return js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , lime_text_Font); + } else { + return lime_text_Font.fromFile(this.getPath(id)); + } + } + ,getImage: function(id) { + if(Object.prototype.hasOwnProperty.call(this.cachedImages.h,id)) { + return this.cachedImages.h[id]; + } else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) { + return js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , lime_graphics_Image); + } else { + return lime_graphics_Image.fromFile(this.getPath(id)); + } + } + ,getPath: function(id) { + if(Object.prototype.hasOwnProperty.call(this.paths.h,id)) { + return this.paths.h[id]; + } else if(Object.prototype.hasOwnProperty.call(this.pathGroups.h,id)) { + return this.pathGroups.h[id][0]; + } else { + return null; + } + } + ,getText: function(id) { + if(Object.prototype.hasOwnProperty.call(this.cachedText.h,id)) { + return this.cachedText.h[id]; + } else { + var bytes = this.getBytes(id); + if(bytes == null) { + return null; + } else { + return bytes.getString(0,bytes.length); + } + } + } + ,isLocal: function(id,type) { + if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) { + return true; + } + var _g = js_Boot.__cast(type , String); + if(_g == null) { + if(!(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id) || Object.prototype.hasOwnProperty.call(this.cachedText.h,id) || Object.prototype.hasOwnProperty.call(this.cachedImages.h,id) || Object.prototype.hasOwnProperty.call(this.cachedAudioBuffers.h,id))) { + return Object.prototype.hasOwnProperty.call(this.cachedFonts.h,id); + } else { + return true; + } + } else { + switch(_g) { + case "FONT": + return Object.prototype.hasOwnProperty.call(this.cachedFonts.h,id); + case "IMAGE": + return Object.prototype.hasOwnProperty.call(this.cachedImages.h,id); + case "MUSIC":case "SOUND": + return Object.prototype.hasOwnProperty.call(this.cachedAudioBuffers.h,id); + default: + if(!Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) { + return Object.prototype.hasOwnProperty.call(this.cachedText.h,id); + } else { + return true; + } + } + } + } + ,list: function(type) { + var requestedType = type != null ? js_Boot.__cast(type , String) : null; + var items = []; + var h = this.types.h; + var id_h = h; + var id_keys = Object.keys(h); + var id_length = id_keys.length; + var id_current = 0; + while(id_current < id_length) { + var id = id_keys[id_current++]; + if(requestedType == null || this.exists(id,type)) { + items.push(id); + } + } + return items; + } + ,loadAsset: function(id,type) { + switch(type) { + case "BINARY": + return this.loadBytes(id); + case "FONT": + return this.loadFont(id); + case "IMAGE": + return this.loadImage(id); + case "MUSIC":case "SOUND": + return this.loadAudioBuffer(id); + case "TEMPLATE": + throw haxe_Exception.thrown("Not sure how to load template: " + id); + case "TEXT": + return this.loadText(id); + default: + throw haxe_Exception.thrown("Unknown asset type: " + type); + } + } + ,load: function() { + if(this.loaded) { + return lime_app_Future.withValue(this); + } + if(this.promise == null) { + this.promise = new lime_app_Promise(); + this.bytesLoadedCache = new haxe_ds_StringMap(); + this.assetsLoaded = 0; + this.assetsTotal = 1; + var h = this.preload.h; + var id_h = h; + var id_keys = Object.keys(h); + var id_length = id_keys.length; + var id_current = 0; + while(id_current < id_length) { + var id = id_keys[id_current++]; + if(!this.preload.h[id]) { + continue; + } + lime_utils_Log.verbose("Preloading asset: " + id + " [" + this.types.h[id] + "]",{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 408, className : "lime.utils.AssetLibrary", methodName : "load"}); + var _g = this.types.h[id]; + if(_g != null) { + switch(_g) { + case "BINARY": + this.assetsTotal++; + var future = this.loadBytes(id); + future.onProgress((function(id,_g) { + return function(bytesLoaded,bytesTotal) { + _g[0].load_onProgress(id[0],bytesLoaded,bytesTotal); + }; + })([id],[this])); + future.onError((function(id,_g) { + return function(message) { + _g[0].load_onError(id[0],message); + }; + })([id],[this])); + future.onComplete((function(id,_g) { + return function(bytes) { + _g[0].loadBytes_onComplete(id[0],bytes); + }; + })([id],[this])); + break; + case "FONT": + this.assetsTotal++; + var future1 = this.loadFont(id); + future1.onProgress((function(id,_g) { + return function(bytesLoaded,bytesTotal) { + _g[0].load_onProgress(id[0],bytesLoaded,bytesTotal); + }; + })([id],[this])); + future1.onError((function(id,_g) { + return function(message) { + _g[0].load_onError(id[0],message); + }; + })([id],[this])); + future1.onComplete((function(id,_g) { + return function(font) { + _g[0].loadFont_onComplete(id[0],font); + }; + })([id],[this])); + break; + case "IMAGE": + this.assetsTotal++; + var future2 = this.loadImage(id); + future2.onProgress((function(id,_g) { + return function(bytesLoaded,bytesTotal) { + _g[0].load_onProgress(id[0],bytesLoaded,bytesTotal); + }; + })([id],[this])); + future2.onError((function(id,_g) { + return function(message) { + _g[0].load_onError(id[0],message); + }; + })([id],[this])); + future2.onComplete((function(id,_g) { + return function(image) { + _g[0].loadImage_onComplete(id[0],image); + }; + })([id],[this])); + break; + case "MUSIC":case "SOUND": + this.assetsTotal++; + var future3 = this.loadAudioBuffer(id); + future3.onProgress((function(id,_g) { + return function(bytesLoaded,bytesTotal) { + _g[0].load_onProgress(id[0],bytesLoaded,bytesTotal); + }; + })([id],[this])); + future3.onError((function(id,_g) { + return function(message) { + _g[0].loadAudioBuffer_onError(id[0],message); + }; + })([id],[this])); + future3.onComplete((function(id,_g) { + return function(audioBuffer) { + _g[0].loadAudioBuffer_onComplete(id[0],audioBuffer); + }; + })([id],[this])); + break; + case "TEXT": + this.assetsTotal++; + var future4 = this.loadText(id); + future4.onProgress((function(id,_g) { + return function(bytesLoaded,bytesTotal) { + _g[0].load_onProgress(id[0],bytesLoaded,bytesTotal); + }; + })([id],[this])); + future4.onError((function(id,_g) { + return function(message) { + _g[0].load_onError(id[0],message); + }; + })([id],[this])); + future4.onComplete((function(id,_g) { + return function(text) { + _g[0].loadText_onComplete(id[0],text); + }; + })([id],[this])); + break; + default: + } + } + } + this.__assetLoaded(null); + } + return this.promise.future; + } + ,loadAudioBuffer: function(id) { + if(Object.prototype.hasOwnProperty.call(this.cachedAudioBuffers.h,id)) { + return lime_app_Future.withValue(this.cachedAudioBuffers.h[id]); + } else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) { + return lime_app_Future.withValue(lime_media_AudioBuffer.fromBytes(js_Boot.__cast(Type.createInstance(this.classTypes.h[id],[]) , haxe_io_Bytes))); + } else if(Object.prototype.hasOwnProperty.call(this.pathGroups.h,id)) { + return lime_media_AudioBuffer.loadFromFiles(this.pathGroups.h[id]); + } else { + return lime_media_AudioBuffer.loadFromFile(this.paths.h[id]); + } + } + ,loadBytes: function(id) { + if(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) { + return lime_app_Future.withValue(this.cachedBytes.h[id]); + } else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) { + return lime_app_Future.withValue(Type.createInstance(this.classTypes.h[id],[])); + } else { + return lime_utils_Bytes.loadFromFile(this.getPath(id)); + } + } + ,loadFont: function(id) { + if(Object.prototype.hasOwnProperty.call(this.cachedFonts.h,id)) { + return lime_app_Future.withValue(this.cachedFonts.h[id]); + } else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) { + var font = Type.createInstance(this.classTypes.h[id],[]); + return font.__loadFromName(font.name); + } else { + return lime_text_Font.loadFromName(this.getPath(id)); + } + } + ,loadImage: function(id) { + var _gthis = this; + if(Object.prototype.hasOwnProperty.call(this.cachedImages.h,id)) { + return lime_app_Future.withValue(this.cachedImages.h[id]); + } else if(Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) { + return lime_app_Future.withValue(Type.createInstance(this.classTypes.h[id],[])); + } else if(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id)) { + return lime_graphics_Image.loadFromBytes(this.cachedBytes.h[id]).then(function(image) { + var _this = _gthis.cachedBytes; + if(Object.prototype.hasOwnProperty.call(_this.h,id)) { + delete(_this.h[id]); + } + _gthis.cachedImages.h[id] = image; + return lime_app_Future.withValue(image); + }); + } else { + return lime_graphics_Image.loadFromFile(this.getPath(id)); + } + } + ,loadText: function(id) { + if(Object.prototype.hasOwnProperty.call(this.cachedText.h,id)) { + return lime_app_Future.withValue(this.cachedText.h[id]); + } else if(Object.prototype.hasOwnProperty.call(this.cachedBytes.h,id) || Object.prototype.hasOwnProperty.call(this.classTypes.h,id)) { + var bytes = this.getBytes(id); + if(bytes == null) { + return lime_app_Future.withValue(null); + } else { + var text = bytes.getString(0,bytes.length); + this.cachedText.h[id] = text; + return lime_app_Future.withValue(text); + } + } else { + var request = new lime_net__$HTTPRequest_$String(); + return request.load(this.getPath(id)); + } + } + ,unload: function() { + this.cachedBytes.h = Object.create(null); + this.cachedFonts.h = Object.create(null); + this.cachedImages.h = Object.create(null); + this.cachedAudioBuffers.h = Object.create(null); + this.cachedText.h = Object.create(null); + } + ,__assetLoaded: function(id) { + this.assetsLoaded++; + if(id != null) { + lime_utils_Log.verbose("Loaded asset: " + id + " [" + this.types.h[id] + "] (" + (this.assetsLoaded - 1) + "/" + (this.assetsTotal - 1) + ")",{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 637, className : "lime.utils.AssetLibrary", methodName : "__assetLoaded"}); + } + if(id != null) { + var size = Object.prototype.hasOwnProperty.call(this.sizes.h,id) ? this.sizes.h[id] : 0; + if(!Object.prototype.hasOwnProperty.call(this.bytesLoadedCache.h,id)) { + this.bytesLoaded += size; + } else { + var cache = this.bytesLoadedCache.h[id]; + if(cache < size) { + this.bytesLoaded += size - cache; + } + } + this.bytesLoadedCache.h[id] = size; + } + if(this.assetsLoaded < this.assetsTotal) { + this.promise.progress(this.bytesLoaded,this.bytesTotal); + } else { + this.loaded = true; + this.promise.progress(this.bytesTotal,this.bytesTotal); + this.promise.complete(this); + } + } + ,__cacheBreak: function(path) { + return lime_utils_Assets.__cacheBreak(path); + } + ,__fromBundle: function(bundle,manifest) { + if(manifest != null) { + var id; + var data; + var type; + var _g = 0; + var _g1 = manifest.assets; + while(_g < _g1.length) { + var asset = _g1[_g]; + ++_g; + id = Object.prototype.hasOwnProperty.call(asset,"id") ? asset.id : asset.path; + data = bundle.data.h[asset.path]; + if(Object.prototype.hasOwnProperty.call(asset,"type")) { + type = asset.type; + if(type == "TEXT") { + this.cachedText.h[id] = data != null ? Std.string(data) : null; + } else { + this.cachedBytes.h[id] = data; + } + this.types.h[id] = asset.type; + } else { + this.cachedBytes.h[id] = data; + this.types.h[id] = "BINARY"; + } + } + } else { + var _g = 0; + var _g1 = bundle.paths; + while(_g < _g1.length) { + var path = _g1[_g]; + ++_g; + this.cachedBytes.h[path] = bundle.data.h[path]; + this.types.h[path] = "BINARY"; + } + } + } + ,__fromManifest: function(manifest) { + var hasSize = manifest.version >= 2; + var size; + var id; + var pathGroup; + var classRef; + var basePath = manifest.rootPath; + if(basePath == null) { + basePath = ""; + } + if(basePath != "") { + basePath += "/"; + } + var _g = 0; + var _g1 = manifest.assets; + while(_g < _g1.length) { + var asset = _g1[_g]; + ++_g; + size = hasSize && Object.prototype.hasOwnProperty.call(asset,"size") ? asset.size : 100; + id = Object.prototype.hasOwnProperty.call(asset,"id") ? asset.id : asset.path; + if(Object.prototype.hasOwnProperty.call(asset,"path")) { + var this1 = this.paths; + var value = this.__cacheBreak(this.__resolvePath(basePath + Std.string(Reflect.field(asset,"path")))); + this1.h[id] = value; + } + if(Object.prototype.hasOwnProperty.call(asset,"pathGroup")) { + pathGroup = Reflect.field(asset,"pathGroup"); + var _g2 = 0; + var _g3 = pathGroup.length; + while(_g2 < _g3) { + var i = _g2++; + pathGroup[i] = this.__cacheBreak(this.__resolvePath(basePath + pathGroup[i])); + } + this.pathGroups.h[id] = pathGroup; + } + this.sizes.h[id] = size; + this.types.h[id] = asset.type; + if(Object.prototype.hasOwnProperty.call(asset,"preload")) { + this.preload.h[id] = Reflect.field(asset,"preload"); + } + if(Object.prototype.hasOwnProperty.call(asset,"className")) { + var name = Reflect.field(asset,"className"); + classRef = $hxClasses[name]; + this.classTypes.h[id] = classRef; + } + } + this.bytesTotal = 0; + var _g = 0; + var _g1 = manifest.assets; + while(_g < _g1.length) { + var asset = _g1[_g]; + ++_g; + id = Object.prototype.hasOwnProperty.call(asset,"id") ? asset.id : asset.path; + if(Object.prototype.hasOwnProperty.call(this.preload.h,id) && this.preload.h[id] && Object.prototype.hasOwnProperty.call(this.sizes.h,id)) { + this.bytesTotal += this.sizes.h[id]; + } + } + } + ,__resolvePath: function(path) { + path = StringTools.replace(path,"\\","/"); + var colonIdx = path.indexOf(":"); + if(StringTools.startsWith(path,"http") && colonIdx > 0) { + var lastSlashIdx = colonIdx + 3; + var httpSection = HxOverrides.substr(path,0,lastSlashIdx); + path = httpSection + StringTools.replace(HxOverrides.substr(path,lastSlashIdx,null),"//","/"); + } else { + path = StringTools.replace(path,"//","/"); + } + if(path.indexOf("./") > -1) { + var split = path.split("/"); + var newPath = []; + var _g = 0; + var _g1 = split.length; + while(_g < _g1) { + var i = _g++; + if(split[i] == "..") { + if(i == 0 || newPath[i - 1] == "..") { + newPath.push(".."); + } else { + newPath.pop(); + } + } else if(split[i] == ".") { + if(i == 0) { + newPath.push("."); + } + } else { + newPath.push(split[i]); + } + } + path = newPath.join("/"); + } + return path; + } + ,loadAudioBuffer_onComplete: function(id,audioBuffer) { + this.cachedAudioBuffers.h[id] = audioBuffer; + if(Object.prototype.hasOwnProperty.call(this.pathGroups.h,id)) { + var pathGroup = this.pathGroups.h[id]; + var h = this.pathGroups.h; + var otherID_h = h; + var otherID_keys = Object.keys(h); + var otherID_length = otherID_keys.length; + var otherID_current = 0; + while(otherID_current < otherID_length) { + var otherID = otherID_keys[otherID_current++]; + if(otherID == id) { + continue; + } + var _g = 0; + while(_g < pathGroup.length) { + var path = pathGroup[_g]; + ++_g; + if(this.pathGroups.h[otherID].indexOf(path) > -1) { + this.cachedAudioBuffers.h[otherID] = audioBuffer; + break; + } + } + } + } + this.__assetLoaded(id); + } + ,loadAudioBuffer_onError: function(id,message) { + if(message != null && message != "") { + lime_utils_Log.warn("Could not load \"" + id + "\": " + Std.string(message),{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 883, className : "lime.utils.AssetLibrary", methodName : "loadAudioBuffer_onError"}); + } else { + lime_utils_Log.warn("Could not load \"" + id + "\"",{ fileName : "lime/utils/AssetLibrary.hx", lineNumber : 887, className : "lime.utils.AssetLibrary", methodName : "loadAudioBuffer_onError"}); + } + this.loadAudioBuffer_onComplete(id,new lime_media_AudioBuffer()); + } + ,loadBytes_onComplete: function(id,bytes) { + this.cachedBytes.h[id] = bytes; + this.__assetLoaded(id); + } + ,loadFont_onComplete: function(id,font) { + this.cachedFonts.h[id] = font; + this.__assetLoaded(id); + } + ,loadImage_onComplete: function(id,image) { + this.cachedImages.h[id] = image; + this.__assetLoaded(id); + } + ,loadText_onComplete: function(id,text) { + this.cachedText.h[id] = text; + this.__assetLoaded(id); + } + ,load_onError: function(id,message) { + if(message != null && message != "") { + this.promise.error("Error loading asset \"" + id + "\": " + Std.string(message)); + } else { + this.promise.error("Error loading asset \"" + id + "\""); + } + } + ,load_onProgress: function(id,bytesLoaded,bytesTotal) { + if(bytesLoaded > 0) { + var size = this.sizes.h[id]; + var percent; + if(bytesTotal > 0) { + percent = bytesLoaded / bytesTotal; + if(percent > 1) { + percent = 1; + } + bytesLoaded = Math.floor(percent * size); + } else if(bytesLoaded > size) { + bytesLoaded = size; + } + if(Object.prototype.hasOwnProperty.call(this.bytesLoadedCache.h,id)) { + var cache = this.bytesLoadedCache.h[id]; + if(bytesLoaded != cache) { + this.bytesLoaded += bytesLoaded - cache; + } + } else { + this.bytesLoaded += bytesLoaded; + } + this.bytesLoadedCache.h[id] = bytesLoaded; + this.promise.progress(this.bytesLoaded,this.bytesTotal); + } + } + ,__class__: lime_utils_AssetLibrary +}; +var lime_utils_AssetManifest = function() { + this.assets = []; + this.libraryArgs = []; + this.version = 2; +}; +$hxClasses["lime.utils.AssetManifest"] = lime_utils_AssetManifest; +lime_utils_AssetManifest.__name__ = "lime.utils.AssetManifest"; +lime_utils_AssetManifest.fromBytes = function(bytes,rootPath) { + if(bytes != null) { + return lime_utils_AssetManifest.parse(bytes.getString(0,bytes.length),rootPath); + } else { + return null; + } +}; +lime_utils_AssetManifest.fromFile = function(path,rootPath) { + path = lime_utils_AssetManifest.__resolvePath(path); + rootPath = lime_utils_AssetManifest.__resolveRootPath(rootPath,path); + if(path == null) { + return null; + } + return lime_utils_AssetManifest.fromBytes(lime_utils_Bytes.fromFile(path),rootPath); +}; +lime_utils_AssetManifest.loadFromBytes = function(bytes,rootPath) { + return lime_app_Future.withValue(lime_utils_AssetManifest.fromBytes(bytes,rootPath)); +}; +lime_utils_AssetManifest.loadFromFile = function(path,rootPath) { + path = lime_utils_AssetManifest.__resolvePath(path); + rootPath = lime_utils_AssetManifest.__resolveRootPath(rootPath,path); + if(path == null) { + return null; + } + return lime_utils_Bytes.loadFromFile(path).then(function(bytes) { + return lime_app_Future.withValue(lime_utils_AssetManifest.fromBytes(bytes,rootPath)); + }); +}; +lime_utils_AssetManifest.parse = function(data,rootPath) { + if(data == null || data == "") { + return null; + } + var manifestData = JSON.parse(data); + var manifest = new lime_utils_AssetManifest(); + if(Object.prototype.hasOwnProperty.call(manifestData,"name")) { + manifest.name = manifestData.name; + } + if(Object.prototype.hasOwnProperty.call(manifestData,"libraryType")) { + manifest.libraryType = manifestData.libraryType; + } + if(Object.prototype.hasOwnProperty.call(manifestData,"libraryArgs")) { + manifest.libraryArgs = manifestData.libraryArgs; + } + if(Object.prototype.hasOwnProperty.call(manifestData,"assets")) { + var assets = manifestData.assets; + if(Object.prototype.hasOwnProperty.call(manifestData,"version") && manifestData.version <= 2) { + manifest.assets = haxe_Unserializer.run(assets); + } else { + manifest.assets = assets; + } + } + if(Object.prototype.hasOwnProperty.call(manifestData,"rootPath")) { + manifest.rootPath = manifestData.rootPath; + } + if(rootPath != null && rootPath != "") { + if(manifest.rootPath == null || manifest.rootPath == "") { + manifest.rootPath = rootPath; + } else { + manifest.rootPath = rootPath + "/" + manifest.rootPath; + } + } + return manifest; +}; +lime_utils_AssetManifest.__resolvePath = function(path) { + if(path == null) { + return null; + } + var queryIndex = path.indexOf("?"); + var basePath; + if(queryIndex > -1) { + basePath = HxOverrides.substr(path,0,queryIndex); + } else { + basePath = path; + } + basePath = StringTools.replace(basePath,"\\","/"); + while(StringTools.endsWith(basePath,"/")) basePath = HxOverrides.substr(basePath,0,basePath.length - 1); + if(StringTools.endsWith(basePath,".bundle")) { + if(queryIndex > -1) { + return basePath + "/library.json" + HxOverrides.substr(path,queryIndex,null); + } else { + return basePath + "/library.json"; + } + } else { + return path; + } +}; +lime_utils_AssetManifest.__resolveRootPath = function(rootPath,path) { + if(rootPath != null) { + return rootPath; + } + var queryIndex = path.indexOf("?"); + if(queryIndex > -1) { + rootPath = HxOverrides.substr(path,0,queryIndex); + } else { + rootPath = path; + } + rootPath = StringTools.replace(rootPath,"\\","/"); + while(StringTools.endsWith(rootPath,"/")) { + if(rootPath == "/") { + return rootPath; + } + rootPath = HxOverrides.substr(rootPath,0,rootPath.length - 1); + } + if(StringTools.endsWith(rootPath,".bundle")) { + return rootPath; + } else { + return haxe_io_Path.directory(rootPath); + } +}; +lime_utils_AssetManifest.prototype = { + serialize: function() { + var manifestData = { }; + manifestData.version = this.version; + manifestData.libraryType = this.libraryType; + manifestData.libraryArgs = this.libraryArgs; + manifestData.name = this.name; + manifestData.assets = haxe_Serializer.run(this.assets); + manifestData.rootPath = this.rootPath; + return JSON.stringify(manifestData); + } + ,__class__: lime_utils_AssetManifest +}; +var lime_utils_Assets = function() { }; +$hxClasses["lime.utils.Assets"] = lime_utils_Assets; +lime_utils_Assets.__name__ = "lime.utils.Assets"; +lime_utils_Assets.exists = function(id,type) { + if(type == null) { + type = "BINARY"; + } + var id1 = id; + var colonIndex = id1.indexOf(":"); + var symbol_libraryName = id1.substring(0,colonIndex); + var symbol_symbolName = id1.substring(colonIndex + 1); + var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName); + if(symbol_library != null) { + return symbol_library.exists(symbol_symbolName,type); + } + return false; +}; +lime_utils_Assets.getAsset = function(id,type,useCache) { + if(useCache && lime_utils_Assets.cache.enabled) { + switch(type) { + case "FONT": + var font = lime_utils_Assets.cache.font.h[id]; + if(font != null) { + return font; + } + break; + case "IMAGE": + var image = lime_utils_Assets.cache.image.h[id]; + if(lime_utils_Assets.isValidImage(image)) { + return image; + } + break; + case "MUSIC":case "SOUND": + var audio = lime_utils_Assets.cache.audio.h[id]; + if(lime_utils_Assets.isValidAudio(audio)) { + return audio; + } + break; + case "TEMPLATE": + throw haxe_Exception.thrown("Not sure how to get template: " + id); + case "BINARY":case "TEXT": + useCache = false; + break; + default: + return null; + } + } + var id1 = id; + var colonIndex = id1.indexOf(":"); + var symbol_libraryName = id1.substring(0,colonIndex); + var symbol_symbolName = id1.substring(colonIndex + 1); + var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName); + if(symbol_library != null) { + if(symbol_library.exists(symbol_symbolName,type)) { + if(symbol_library.isLocal(symbol_symbolName,type)) { + var asset = symbol_library.getAsset(symbol_symbolName,type); + if(useCache && lime_utils_Assets.cache.enabled) { + lime_utils_Assets.cache.set(id,type,asset); + } + return asset; + } else { + lime_utils_Log.error(type + " asset \"" + id + "\" exists, but only asynchronously",{ fileName : "lime/utils/Assets.hx", lineNumber : 133, className : "lime.utils.Assets", methodName : "getAsset"}); + } + } else { + lime_utils_Log.error("There is no " + type + " asset with an ID of \"" + id + "\"",{ fileName : "lime/utils/Assets.hx", lineNumber : 138, className : "lime.utils.Assets", methodName : "getAsset"}); + } + } else { + lime_utils_Log.error(lime_utils_Assets.__libraryNotFound(symbol_libraryName),{ fileName : "lime/utils/Assets.hx", lineNumber : 143, className : "lime.utils.Assets", methodName : "getAsset"}); + } + return null; +}; +lime_utils_Assets.getAudioBuffer = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + return lime_utils_Assets.getAsset(id,"SOUND",useCache); +}; +lime_utils_Assets.getBytes = function(id) { + return lime_utils_Assets.getAsset(id,"BINARY",false); +}; +lime_utils_Assets.getFont = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + return lime_utils_Assets.getAsset(id,"FONT",useCache); +}; +lime_utils_Assets.getImage = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + return lime_utils_Assets.getAsset(id,"IMAGE",useCache); +}; +lime_utils_Assets.getLibrary = function(name) { + if(name == null || name == "") { + name = "default"; + } + return lime_utils_Assets.libraries.h[name]; +}; +lime_utils_Assets.getPath = function(id) { + var id1 = id; + var colonIndex = id1.indexOf(":"); + var symbol_libraryName = id1.substring(0,colonIndex); + var symbol_symbolName = id1.substring(colonIndex + 1); + var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName); + if(symbol_library != null) { + if(symbol_library.exists(symbol_symbolName,null)) { + return symbol_library.getPath(symbol_symbolName); + } else { + lime_utils_Log.error("There is no asset with an ID of \"" + id + "\"",{ fileName : "lime/utils/Assets.hx", lineNumber : 240, className : "lime.utils.Assets", methodName : "getPath"}); + } + } else { + lime_utils_Log.error(lime_utils_Assets.__libraryNotFound(symbol_libraryName),{ fileName : "lime/utils/Assets.hx", lineNumber : 245, className : "lime.utils.Assets", methodName : "getPath"}); + } + return null; +}; +lime_utils_Assets.getText = function(id) { + return lime_utils_Assets.getAsset(id,"TEXT",false); +}; +lime_utils_Assets.hasLibrary = function(name) { + if(name == null || name == "") { + name = "default"; + } + return Object.prototype.hasOwnProperty.call(lime_utils_Assets.libraries.h,name); +}; +lime_utils_Assets.isLocal = function(id,type,useCache) { + if(useCache == null) { + useCache = true; + } + if(useCache && lime_utils_Assets.cache.enabled) { + if(lime_utils_Assets.cache.exists(id,type)) { + return true; + } + } + var id1 = id; + var colonIndex = id1.indexOf(":"); + var symbol_libraryName = id1.substring(0,colonIndex); + var symbol_symbolName = id1.substring(colonIndex + 1); + var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName); + if(symbol_library != null) { + return symbol_library.isLocal(symbol_symbolName,type); + } else { + return false; + } +}; +lime_utils_Assets.isValidAudio = function(buffer) { + return buffer != null; +}; +lime_utils_Assets.isValidImage = function(image) { + if(image != null) { + return image.buffer != null; + } else { + return false; + } +}; +lime_utils_Assets.list = function(type) { + var items = []; + var h = lime_utils_Assets.libraries.h; + var library_h = h; + var library_keys = Object.keys(h); + var library_length = library_keys.length; + var library_current = 0; + while(library_current < library_length) { + var library = library_h[library_keys[library_current++]]; + var libraryItems = library.list(type); + if(libraryItems != null) { + items = items.concat(libraryItems); + } + } + return items; +}; +lime_utils_Assets.loadAsset = function(id,type,useCache) { + if(useCache && lime_utils_Assets.cache.enabled) { + switch(type) { + case "FONT": + var font = lime_utils_Assets.cache.font.h[id]; + if(font != null) { + return lime_app_Future.withValue(font); + } + break; + case "IMAGE": + var image = lime_utils_Assets.cache.image.h[id]; + if(lime_utils_Assets.isValidImage(image)) { + return lime_app_Future.withValue(image); + } + break; + case "MUSIC":case "SOUND": + var audio = lime_utils_Assets.cache.audio.h[id]; + if(lime_utils_Assets.isValidAudio(audio)) { + return lime_app_Future.withValue(audio); + } + break; + case "TEMPLATE": + throw haxe_Exception.thrown("Not sure how to get template: " + id); + case "BINARY":case "TEXT": + useCache = false; + break; + default: + return null; + } + } + var id1 = id; + var colonIndex = id1.indexOf(":"); + var symbol_libraryName = id1.substring(0,colonIndex); + var symbol_symbolName = id1.substring(colonIndex + 1); + var symbol_library = lime_utils_Assets.getLibrary(symbol_libraryName); + if(symbol_library != null) { + if(symbol_library.exists(symbol_symbolName,type)) { + var future = symbol_library.loadAsset(symbol_symbolName,type); + if(useCache && lime_utils_Assets.cache.enabled) { + future.onComplete(function(asset) { + lime_utils_Assets.cache.set(id,type,asset); + }); + } + return future; + } else { + return lime_app_Future.withError("There is no " + type + " asset with an ID of \"" + id + "\""); + } + } else { + return lime_app_Future.withError(lime_utils_Assets.__libraryNotFound(symbol_libraryName)); + } +}; +lime_utils_Assets.loadAudioBuffer = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + return lime_utils_Assets.loadAsset(id,"SOUND",useCache); +}; +lime_utils_Assets.loadBytes = function(id) { + return lime_utils_Assets.loadAsset(id,"BINARY",false); +}; +lime_utils_Assets.loadFont = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + return lime_utils_Assets.loadAsset(id,"FONT",useCache); +}; +lime_utils_Assets.loadImage = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + return lime_utils_Assets.loadAsset(id,"IMAGE",useCache); +}; +lime_utils_Assets.loadLibrary = function(id) { + var promise = new lime_app_Promise(); + var library = lime_utils_Assets.getLibrary(id); + if(library != null) { + return library.load(); + } + var path = id; + var rootPath = null; + if(Object.prototype.hasOwnProperty.call(lime_utils_Assets.bundlePaths.h,id)) { + lime_utils_AssetBundle.loadFromFile(lime_utils_Assets.bundlePaths.h[id]).onComplete(function(bundle) { + if(bundle == null) { + promise.error("Cannot load bundle for library \"" + id + "\""); + return; + } + var library = lime_utils_AssetLibrary.fromBundle(bundle); + if(library == null) { + promise.error("Cannot open library \"" + id + "\""); + } else { + lime_utils_Assets.libraries.h[id] = library; + library.onChange.add(($_=lime_utils_Assets.onChange,$bind($_,$_.dispatch))); + promise.completeWith(library.load()); + } + }).onError(function(_) { + promise.error("There is no asset library with an ID of \"" + id + "\""); + }); + } else { + if(Object.prototype.hasOwnProperty.call(lime_utils_Assets.libraryPaths.h,id)) { + path = lime_utils_Assets.libraryPaths.h[id]; + rootPath = haxe_io_Path.directory(path); + } else { + if(StringTools.endsWith(path,".bundle")) { + rootPath = path; + path += "/library.json"; + } else { + rootPath = haxe_io_Path.directory(path); + } + path = lime_utils_Assets.__cacheBreak(path); + } + lime_utils_AssetManifest.loadFromFile(path,rootPath).onComplete(function(manifest) { + if(manifest == null) { + promise.error("Cannot parse asset manifest for library \"" + id + "\""); + return; + } + var library = lime_utils_AssetLibrary.fromManifest(manifest); + if(library == null) { + promise.error("Cannot open library \"" + id + "\""); + } else { + lime_utils_Assets.libraries.h[id] = library; + library.onChange.add(($_=lime_utils_Assets.onChange,$bind($_,$_.dispatch))); + promise.completeWith(library.load()); + } + }).onError(function(_) { + promise.error("There is no asset library with an ID of \"" + id + "\""); + }); + } + return promise.future; +}; +lime_utils_Assets.loadText = function(id) { + return lime_utils_Assets.loadAsset(id,"TEXT",false); +}; +lime_utils_Assets.registerLibrary = function(name,library) { + if(name == null || name == "") { + name = "default"; + } + if(Object.prototype.hasOwnProperty.call(lime_utils_Assets.libraries.h,name)) { + if(lime_utils_Assets.libraries.h[name] == library) { + return; + } else { + lime_utils_Assets.unloadLibrary(name); + } + } + if(library != null) { + library.onChange.add(lime_utils_Assets.library_onChange); + } + lime_utils_Assets.libraries.h[name] = library; +}; +lime_utils_Assets.unloadLibrary = function(name) { + lime_utils_Assets.removeLibrary(name,true); +}; +lime_utils_Assets.removeLibrary = function(name,unload) { + if(unload == null) { + unload = true; + } + if(name == null || name == "") { + name = "default"; + } + var library = lime_utils_Assets.libraries.h[name]; + if(library != null) { + lime_utils_Assets.cache.clear(name + ":"); + library.onChange.remove(lime_utils_Assets.library_onChange); + if(unload) { + library.unload(); + } + } + var _this = lime_utils_Assets.libraries; + if(Object.prototype.hasOwnProperty.call(_this.h,name)) { + delete(_this.h[name]); + } +}; +lime_utils_Assets.__cacheBreak = function(path) { + if(lime_utils_Assets.cache.version > 0) { + if(path.indexOf("?") > -1) { + path += "&" + lime_utils_Assets.cache.version; + } else { + path += "?" + lime_utils_Assets.cache.version; + } + } + return path; +}; +lime_utils_Assets.__libraryNotFound = function(name) { + if(name == null || name == "") { + name = "default"; + } + if(lime_app_Application.current != null && lime_app_Application.current.__preloader != null && !lime_app_Application.current.__preloader.complete) { + return "There is no asset library named \"" + name + "\", or it is not yet preloaded"; + } else { + return "There is no asset library named \"" + name + "\""; + } +}; +lime_utils_Assets.library_onChange = function() { + lime_utils_Assets.cache.clear(); + lime_utils_Assets.onChange.dispatch(); +}; +var lime_utils__$Assets_LibrarySymbol = function(id) { + var colonIndex = id.indexOf(":"); + this.libraryName = id.substring(0,colonIndex); + this.symbolName = id.substring(colonIndex + 1); + this.library = lime_utils_Assets.getLibrary(this.libraryName); +}; +$hxClasses["lime.utils._Assets.LibrarySymbol"] = lime_utils__$Assets_LibrarySymbol; +lime_utils__$Assets_LibrarySymbol.__name__ = "lime.utils._Assets.LibrarySymbol"; +lime_utils__$Assets_LibrarySymbol.prototype = { + isLocal: function(type) { + return this.library.isLocal(this.symbolName,type); + } + ,exists: function(type) { + return this.library.exists(this.symbolName,type); + } + ,__class__: lime_utils__$Assets_LibrarySymbol +}; +var lime_utils_BytePointer = {}; +lime_utils_BytePointer._new = function(bytes,offset) { + if(offset == null) { + offset = 0; + } + return new lime_utils_BytePointerData(bytes,offset); +}; +lime_utils_BytePointer.set = function(this1,bytes,bufferView,buffer,offset) { + if(buffer != null) { + bytes = haxe_io_Bytes.ofData(buffer); + } + if(bytes != null || bufferView == null) { + this1.bytes = bytes; + this1.offset = offset != null ? offset : 0; + } else { + this1.bytes = haxe_io_Bytes.ofData(bufferView.buffer); + this1.offset = offset != null ? bufferView.byteOffset + offset : bufferView.byteOffset; + } +}; +lime_utils_BytePointer.__arrayGet = function(this1,index) { + if(this1.bytes != null) { + return this1.bytes.b[index + this1.offset]; + } else { + return 0; + } +}; +lime_utils_BytePointer.__arraySet = function(this1,index,value) { + if(this1.bytes == null) { + this1.bytes.b[index + this1.offset] = value & 255; + } + return value; +}; +lime_utils_BytePointer.fromArrayBufferView = function(arrayBufferView) { + if(arrayBufferView == null) { + return null; + } + return new lime_utils_BytePointerData(haxe_io_Bytes.ofData(arrayBufferView.buffer),arrayBufferView.byteOffset); +}; +lime_utils_BytePointer.fromArrayBuffer = function(buffer) { + if(buffer == null) { + return null; + } + return new lime_utils_BytePointerData(haxe_io_Bytes.ofData(buffer),0); +}; +lime_utils_BytePointer.fromBytes = function(bytes) { + return new lime_utils_BytePointerData(bytes,0); +}; +lime_utils_BytePointer.fromBytesData = function(bytesData) { + if(bytesData == null) { + return new lime_utils_BytePointerData(null,0); + } else { + return new lime_utils_BytePointerData(haxe_io_Bytes.ofData(bytesData),0); + } +}; +lime_utils_BytePointer.fromFile = function(path) { + return new lime_utils_BytePointerData(lime_utils_Bytes.fromFile(path),0); +}; +lime_utils_BytePointer.fromLimeBytes = function(bytes) { + return new lime_utils_BytePointerData(bytes,0); +}; +lime_utils_BytePointer.toUInt8Array = function(bytePointer) { + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytePointer.bytes.b.bufferValue; + var byteoffset = bytePointer.offset / 8 | 0; + var len = null; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,byteoffset); + } else { + this1 = new Uint8Array(buffer,byteoffset,len); + } + } else { + this1 = null; + } + return this1; +}; +lime_utils_BytePointer.toUInt8ClampedArray = function(bytePointer) { + if(bytePointer == null || bytePointer.bytes == null) { + return null; + } + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytePointer.bytes.b.bufferValue; + var byteoffset = bytePointer.offset / 8 | 0; + var len = null; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint8ClampedArray(elements); + } else if(array != null) { + this1 = new Uint8ClampedArray(array); + } else if(vector != null) { + this1 = new Uint8ClampedArray(vector.__array); + } else if(view != null) { + this1 = new Uint8ClampedArray(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8ClampedArray(buffer,byteoffset); + } else { + this1 = new Uint8ClampedArray(buffer,byteoffset,len); + } + } else { + this1 = null; + } + return this1; +}; +lime_utils_BytePointer.toInt8Array = function(bytePointer) { + if(bytePointer == null || bytePointer.bytes == null) { + return null; + } + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytePointer.bytes.b.bufferValue; + var byteoffset = bytePointer.offset / 8 | 0; + var len = null; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Int8Array(elements); + } else if(array != null) { + this1 = new Int8Array(array); + } else if(vector != null) { + this1 = new Int8Array(vector.__array); + } else if(view != null) { + this1 = new Int8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Int8Array(buffer,byteoffset); + } else { + this1 = new Int8Array(buffer,byteoffset,len); + } + } else { + this1 = null; + } + return this1; +}; +lime_utils_BytePointer.toUInt16Array = function(bytePointer) { + if(bytePointer == null || bytePointer.bytes == null) { + return null; + } + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytePointer.bytes.b.bufferValue; + var byteoffset = bytePointer.offset / 16 | 0; + var len = null; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint16Array(elements); + } else if(array != null) { + this1 = new Uint16Array(array); + } else if(vector != null) { + this1 = new Uint16Array(vector.__array); + } else if(view != null) { + this1 = new Uint16Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint16Array(buffer,byteoffset); + } else { + this1 = new Uint16Array(buffer,byteoffset,len); + } + } else { + this1 = null; + } + return this1; +}; +lime_utils_BytePointer.toInt16Array = function(bytePointer) { + if(bytePointer == null || bytePointer.bytes == null) { + return null; + } + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytePointer.bytes.b.bufferValue; + var byteoffset = bytePointer.offset / 16 | 0; + var len = null; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Int16Array(elements); + } else if(array != null) { + this1 = new Int16Array(array); + } else if(vector != null) { + this1 = new Int16Array(vector.__array); + } else if(view != null) { + this1 = new Int16Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Int16Array(buffer,byteoffset); + } else { + this1 = new Int16Array(buffer,byteoffset,len); + } + } else { + this1 = null; + } + return this1; +}; +lime_utils_BytePointer.toUInt32Array = function(bytePointer) { + if(bytePointer == null || bytePointer.bytes == null) { + return null; + } + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytePointer.bytes.b.bufferValue; + var byteoffset = bytePointer.offset / 32 | 0; + var len = null; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint32Array(elements); + } else if(array != null) { + this1 = new Uint32Array(array); + } else if(vector != null) { + this1 = new Uint32Array(vector.__array); + } else if(view != null) { + this1 = new Uint32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint32Array(buffer,byteoffset); + } else { + this1 = new Uint32Array(buffer,byteoffset,len); + } + } else { + this1 = null; + } + return this1; +}; +lime_utils_BytePointer.toInt32Array = function(bytePointer) { + if(bytePointer == null || bytePointer.bytes == null) { + return null; + } + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytePointer.bytes.b.bufferValue; + var byteoffset = bytePointer.offset / 32 | 0; + var len = null; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Int32Array(elements); + } else if(array != null) { + this1 = new Int32Array(array); + } else if(vector != null) { + this1 = new Int32Array(vector.__array); + } else if(view != null) { + this1 = new Int32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Int32Array(buffer,byteoffset); + } else { + this1 = new Int32Array(buffer,byteoffset,len); + } + } else { + this1 = null; + } + return this1; +}; +lime_utils_BytePointer.toFloat32Array = function(bytePointer) { + if(bytePointer == null || bytePointer.bytes == null) { + return null; + } + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytePointer.bytes.b.bufferValue; + var byteoffset = bytePointer.offset / 32 | 0; + var len = null; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Float32Array(elements); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Float32Array(buffer,byteoffset); + } else { + this1 = new Float32Array(buffer,byteoffset,len); + } + } else { + this1 = null; + } + return this1; +}; +lime_utils_BytePointer.toFloat64Array = function(bytePointer) { + if(bytePointer == null || bytePointer.bytes == null) { + return null; + } + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytePointer.bytes.b.bufferValue; + var byteoffset = bytePointer.offset / 64 | 0; + var len = null; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Float64Array(elements); + } else if(array != null) { + this1 = new Float64Array(array); + } else if(vector != null) { + this1 = new Float64Array(vector.__array); + } else if(view != null) { + this1 = new Float64Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Float64Array(buffer,byteoffset); + } else { + this1 = new Float64Array(buffer,byteoffset,len); + } + } else { + this1 = null; + } + return this1; +}; +var lime_utils_BytePointerData = function(bytes,offset) { + this.bytes = bytes; + this.offset = offset; +}; +$hxClasses["lime.utils.BytePointerData"] = lime_utils_BytePointerData; +lime_utils_BytePointerData.__name__ = "lime.utils.BytePointerData"; +lime_utils_BytePointerData.prototype = { + __class__: lime_utils_BytePointerData +}; +var lime_utils_Bytes = {}; +lime_utils_Bytes._new = function(length,bytesData) { + return new haxe_io_Bytes(bytesData); +}; +lime_utils_Bytes.alloc = function(length) { + return new haxe_io_Bytes(new ArrayBuffer(length)); +}; +lime_utils_Bytes.compress = function(this1,algorithm) { + switch(algorithm._hx_index) { + case 0: + return lime__$internal_format_Deflate.compress(this1); + case 1: + return lime__$internal_format_GZip.compress(this1); + case 2: + return lime__$internal_format_LZMA.compress(this1); + case 3: + return lime__$internal_format_Zlib.compress(this1); + } +}; +lime_utils_Bytes.decompress = function(this1,algorithm) { + switch(algorithm._hx_index) { + case 0: + return lime__$internal_format_Deflate.decompress(this1); + case 1: + return lime__$internal_format_GZip.decompress(this1); + case 2: + return lime__$internal_format_LZMA.decompress(this1); + case 3: + return lime__$internal_format_Zlib.decompress(this1); + } +}; +lime_utils_Bytes.fastGet = function(b,pos) { + return b.bytes[pos]; +}; +lime_utils_Bytes.fromBytes = function(bytes) { + if(bytes == null) { + return null; + } + return lime_utils_Bytes._new(bytes.length,bytes.b.bufferValue); +}; +lime_utils_Bytes.fromFile = function(path) { + return null; +}; +lime_utils_Bytes.loadFromBytes = function(bytes) { + return lime_app_Future.withValue(lime_utils_Bytes.fromBytes(bytes)); +}; +lime_utils_Bytes.loadFromFile = function(path) { + var request = new lime_net__$HTTPRequest_$lime_$utils_$Bytes(); + return request.load(path); +}; +lime_utils_Bytes.ofData = function(b) { + var bytes = haxe_io_Bytes.ofData(b); + return lime_utils_Bytes._new(bytes.length,bytes.b.bufferValue); +}; +lime_utils_Bytes.ofString = function(s) { + var bytes = haxe_io_Bytes.ofString(s); + return lime_utils_Bytes._new(bytes.length,bytes.b.bufferValue); +}; +var lime_utils_CompressionAlgorithm = $hxEnums["lime.utils.CompressionAlgorithm"] = { __ename__:"lime.utils.CompressionAlgorithm",__constructs__:null + ,DEFLATE: {_hx_name:"DEFLATE",_hx_index:0,__enum__:"lime.utils.CompressionAlgorithm",toString:$estr} + ,GZIP: {_hx_name:"GZIP",_hx_index:1,__enum__:"lime.utils.CompressionAlgorithm",toString:$estr} + ,LZMA: {_hx_name:"LZMA",_hx_index:2,__enum__:"lime.utils.CompressionAlgorithm",toString:$estr} + ,ZLIB: {_hx_name:"ZLIB",_hx_index:3,__enum__:"lime.utils.CompressionAlgorithm",toString:$estr} +}; +lime_utils_CompressionAlgorithm.__constructs__ = [lime_utils_CompressionAlgorithm.DEFLATE,lime_utils_CompressionAlgorithm.GZIP,lime_utils_CompressionAlgorithm.LZMA,lime_utils_CompressionAlgorithm.ZLIB]; +var lime_utils_DataPointer = {}; +lime_utils_DataPointer._new = function(data) { + return data; +}; +lime_utils_DataPointer.fromFloat = function(value) { + return value; +}; +lime_utils_DataPointer.fromBytesPointer = function(pointer) { + return lime_utils_DataPointer.fromFloat(0); +}; +lime_utils_DataPointer.fromArrayBufferView = function(arrayBufferView) { + return lime_utils_DataPointer.fromFloat(0); +}; +lime_utils_DataPointer.fromArrayBuffer = function(buffer) { + return lime_utils_DataPointer.fromFloat(0); +}; +lime_utils_DataPointer.fromBytes = function(bytes) { + return lime_utils_DataPointer.fromFloat(0); +}; +lime_utils_DataPointer.fromBytesData = function(bytesData) { + return lime_utils_DataPointer.fromFloat(0); +}; +lime_utils_DataPointer.fromLimeBytes = function(bytes) { + return lime_utils_DataPointer.fromBytes(bytes); +}; +lime_utils_DataPointer.fromCFFIPointer = function(pointer) { + return lime_utils_DataPointer.fromFloat(0); +}; +lime_utils_DataPointer.fromFile = function(path) { + return lime_utils_DataPointer.fromFloat(0); +}; +lime_utils_DataPointer.__withOffset = function(data,offset) { + return lime_utils_DataPointer.fromFloat(0); +}; +lime_utils_DataPointer.equals = function(a,b) { + return a == b; +}; +lime_utils_DataPointer.equalsPointer = function(a,b) { + return a == b; +}; +lime_utils_DataPointer.greaterThan = function(a,b) { + return a > b; +}; +lime_utils_DataPointer.greaterThanPointer = function(a,b) { + return lime_system_CFFIPointer.get(a) > lime_system_CFFIPointer.get(b); +}; +lime_utils_DataPointer.greaterThanOrEqual = function(a,b) { + return a >= b; +}; +lime_utils_DataPointer.greaterThanOrEqualPointer = function(a,b) { + return lime_system_CFFIPointer.get(a) >= lime_system_CFFIPointer.get(b); +}; +lime_utils_DataPointer.lessThan = function(a,b) { + return a < b; +}; +lime_utils_DataPointer.lessThanPointer = function(a,b) { + return lime_system_CFFIPointer.get(a) < lime_system_CFFIPointer.get(b); +}; +lime_utils_DataPointer.lessThanOrEqual = function(a,b) { + return a <= b; +}; +lime_utils_DataPointer.lessThanOrEqualPointer = function(a,b) { + return lime_system_CFFIPointer.get(a) <= lime_system_CFFIPointer.get(b); +}; +lime_utils_DataPointer.notEquals = function(a,b) { + return a != b; +}; +lime_utils_DataPointer.notEqualsPointer = function(a,b) { + return a != b; +}; +lime_utils_DataPointer.plus = function(a,b) { + return lime_utils_DataPointer.__withOffset(a,b); +}; +lime_utils_DataPointer.plusPointer = function(a,b) { + return lime_utils_DataPointer.__withOffset(a,b | 0); +}; +lime_utils_DataPointer.minus = function(a,b) { + return lime_utils_DataPointer.__withOffset(a,-b); +}; +lime_utils_DataPointer.minusPointer = function(a,b) { + return lime_utils_DataPointer.__withOffset(a,-(b | 0)); +}; +var lime_utils_Float32Array = {}; +lime_utils_Float32Array.toArrayBufferView = function(this1) { + return this1; +}; +lime_utils_Float32Array.fromBytes = function(bytes,byteOffset,len) { + if(byteOffset == null) { + byteOffset = 0; + } + if(byteOffset == null) { + return new Float32Array(bytes.b.bufferValue); + } + if(len == null) { + return new Float32Array(bytes.b.bufferValue,byteOffset); + } + return new Float32Array(bytes.b.bufferValue,byteOffset,len); +}; +lime_utils_Float32Array.toBytes = function(this1) { + return new haxe_io_Bytes(new Uint8Array(this1.buffer)); +}; +lime_utils_Float32Array.toString = function(this1) { + if(this1 != null) { + return "Float32Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]"; + } else { + return null; + } +}; +var lime_utils_Float64Array = {}; +lime_utils_Float64Array.toArrayBufferView = function(this1) { + return this1; +}; +lime_utils_Float64Array.fromBytes = function(bytes,byteOffset,len) { + if(byteOffset == null) { + byteOffset = 0; + } + if(byteOffset == null) { + return new Float64Array(bytes.b.bufferValue); + } + if(len == null) { + return new Float64Array(bytes.b.bufferValue,byteOffset); + } + return new Float64Array(bytes.b.bufferValue,byteOffset,len); +}; +lime_utils_Float64Array.toBytes = function(this1) { + return new haxe_io_Bytes(new Uint8Array(this1.buffer)); +}; +lime_utils_Float64Array.toString = function(this1) { + if(this1 != null) { + return "Float64Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]"; + } else { + return null; + } +}; +var lime_utils_Int16Array = {}; +lime_utils_Int16Array.toArrayBufferView = function(this1) { + return this1; +}; +lime_utils_Int16Array.fromBytes = function(bytes,byteOffset,len) { + if(byteOffset == null) { + byteOffset = 0; + } + if(byteOffset == null) { + return new Int16Array(bytes.b.bufferValue); + } + if(len == null) { + return new Int16Array(bytes.b.bufferValue,byteOffset); + } + return new Int16Array(bytes.b.bufferValue,byteOffset,len); +}; +lime_utils_Int16Array.toBytes = function(this1) { + return new haxe_io_Bytes(new Uint8Array(this1.buffer)); +}; +lime_utils_Int16Array.toString = function(this1) { + if(this1 != null) { + return "Int16Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]"; + } else { + return null; + } +}; +var lime_utils_Int32Array = {}; +lime_utils_Int32Array.toArrayBufferView = function(this1) { + return this1; +}; +lime_utils_Int32Array.fromBytes = function(bytes,byteOffset,len) { + if(byteOffset == null) { + byteOffset = 0; + } + if(byteOffset == null) { + return new Int32Array(bytes.b.bufferValue); + } + if(len == null) { + return new Int32Array(bytes.b.bufferValue,byteOffset); + } + return new Int32Array(bytes.b.bufferValue,byteOffset,len); +}; +lime_utils_Int32Array.toBytes = function(this1) { + return new haxe_io_Bytes(new Uint8Array(this1.buffer)); +}; +lime_utils_Int32Array.toString = function(this1) { + if(this1 != null) { + return "Int32Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]"; + } else { + return null; + } +}; +var lime_utils_Int8Array = {}; +lime_utils_Int8Array.toArrayBufferView = function(this1) { + return this1; +}; +lime_utils_Int8Array.fromBytes = function(bytes,byteOffset,len) { + if(byteOffset == null) { + byteOffset = 0; + } + return new Int8Array(bytes.b.bufferValue,byteOffset,len); +}; +lime_utils_Int8Array.toBytes = function(this1) { + return new haxe_io_Bytes(new Uint8Array(this1.buffer)); +}; +lime_utils_Int8Array.toString = function(this1) { + if(this1 != null) { + return "Int8Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]"; + } else { + return null; + } +}; +var lime_utils_Log = function() { }; +$hxClasses["lime.utils.Log"] = lime_utils_Log; +lime_utils_Log.__name__ = "lime.utils.Log"; +lime_utils_Log.debug = function(message,info) { + if(lime_utils_Log.level >= 4) { + console.debug("[" + info.className + "] " + Std.string(message)); + } +}; +lime_utils_Log.error = function(message,info) { + if(lime_utils_Log.level >= 1) { + var message1 = "[" + info.className + "] ERROR: " + Std.string(message); + if(lime_utils_Log.throwErrors) { + throw haxe_Exception.thrown(message1); + } else { + console.error(message1); + } + } +}; +lime_utils_Log.info = function(message,info) { + if(lime_utils_Log.level >= 3) { + console.info("[" + info.className + "] " + Std.string(message)); + } +}; +lime_utils_Log.print = function(message) { + console.log(message); +}; +lime_utils_Log.println = function(message) { + console.log(message); +}; +lime_utils_Log.verbose = function(message,info) { + if(lime_utils_Log.level >= 5) { + var message1 = "[" + info.className + "] " + Std.string(message); + console.log(message1); + } +}; +lime_utils_Log.warn = function(message,info) { + if(lime_utils_Log.level >= 2) { + console.warn("[" + info.className + "] WARNING: " + Std.string(message)); + } +}; +var lime_utils_LogLevel = {}; +lime_utils_LogLevel.gt = function(a,b) { + return a > b; +}; +lime_utils_LogLevel.gte = function(a,b) { + return a >= b; +}; +lime_utils_LogLevel.lt = function(a,b) { + return a < b; +}; +lime_utils_LogLevel.lte = function(a,b) { + return a <= b; +}; +var lime_utils_Preloader = function() { + this.bytesTotalCache = new haxe_ds_StringMap(); + this.bytesLoadedCache2 = new haxe_ds_StringMap(); + this.bytesLoadedCache = new haxe_ds_ObjectMap(); + this.onProgress = new lime_app__$Event_$Int_$Int_$Void(); + this.onComplete = new lime_app__$Event_$Void_$Void(); + this.bytesLoaded = 0; + this.bytesTotal = 0; + this.libraries = []; + this.libraryNames = []; + this.onProgress.add($bind(this,this.update)); +}; +$hxClasses["lime.utils.Preloader"] = lime_utils_Preloader; +lime_utils_Preloader.__name__ = "lime.utils.Preloader"; +lime_utils_Preloader.prototype = { + addLibrary: function(library) { + this.libraries.push(library); + } + ,addLibraryName: function(name) { + if(this.libraryNames.indexOf(name) == -1) { + this.libraryNames.push(name); + } + } + ,load: function() { + var _gthis = this; + var _g = 0; + var _g1 = this.libraries; + while(_g < _g1.length) { + var library = _g1[_g]; + ++_g; + this.bytesTotal += library.bytesTotal; + } + this.loadedLibraries = -1; + this.preloadStarted = false; + var _g = 0; + var _g1 = this.libraries; + while(_g < _g1.length) { + var library = [_g1[_g]]; + ++_g; + lime_utils_Log.verbose("Preloading asset library",{ fileName : "lime/utils/Preloader.hx", lineNumber : 134, className : "lime.utils.Preloader", methodName : "load"}); + library[0].load().onProgress((function(library) { + return function(loaded,total) { + if(_gthis.bytesLoadedCache.h.__keys__[library[0].__id__] == null) { + _gthis.bytesLoaded += loaded; + } else { + _gthis.bytesLoaded += loaded - _gthis.bytesLoadedCache.h[library[0].__id__]; + } + _gthis.bytesLoadedCache.set(library[0],loaded); + if(!_gthis.simulateProgress) { + _gthis.onProgress.dispatch(_gthis.bytesLoaded,_gthis.bytesTotal); + } + }; + })(library)).onComplete((function(library) { + return function(_) { + if(_gthis.bytesLoadedCache.h.__keys__[library[0].__id__] == null) { + _gthis.bytesLoaded += library[0].bytesTotal; + } else { + _gthis.bytesLoaded += (library[0].bytesTotal | 0) - _gthis.bytesLoadedCache.h[library[0].__id__]; + } + _gthis.loadedAssetLibrary(); + }; + })(library)).onError((function() { + return function(e) { + lime_utils_Log.error(e,{ fileName : "lime/utils/Preloader.hx", lineNumber : 170, className : "lime.utils.Preloader", methodName : "load"}); + }; + })()); + } + var _g = 0; + var _g1 = this.libraryNames; + while(_g < _g1.length) { + var name = _g1[_g]; + ++_g; + this.bytesTotal += 200; + } + this.loadedLibraries++; + this.preloadStarted = true; + this.updateProgress(); + } + ,loadedAssetLibrary: function(name) { + this.loadedLibraries++; + var current = this.loadedLibraries; + if(!this.preloadStarted) { + ++current; + } + var totalLibraries = this.libraries.length + this.libraryNames.length; + if(name != null) { + lime_utils_Log.verbose("Loaded asset library: " + name + " [" + current + "/" + totalLibraries + "]",{ fileName : "lime/utils/Preloader.hx", lineNumber : 197, className : "lime.utils.Preloader", methodName : "loadedAssetLibrary"}); + } else { + lime_utils_Log.verbose("Loaded asset library [" + current + "/" + totalLibraries + "]",{ fileName : "lime/utils/Preloader.hx", lineNumber : 201, className : "lime.utils.Preloader", methodName : "loadedAssetLibrary"}); + } + this.updateProgress(); + } + ,start: function() { + if(this.complete || this.simulateProgress || !this.preloadComplete) { + return; + } + this.complete = true; + this.onComplete.dispatch(); + } + ,update: function(loaded,total) { + } + ,updateProgress: function() { + var _gthis = this; + if(!this.simulateProgress) { + this.onProgress.dispatch(this.bytesLoaded,this.bytesTotal); + } + if(this.loadedLibraries == this.libraries.length && !this.initLibraryNames) { + this.initLibraryNames = true; + var _g = 0; + var _g1 = this.libraryNames; + while(_g < _g1.length) { + var name = [_g1[_g]]; + ++_g; + lime_utils_Log.verbose("Preloading asset library: " + name[0],{ fileName : "lime/utils/Preloader.hx", lineNumber : 239, className : "lime.utils.Preloader", methodName : "updateProgress"}); + lime_utils_Assets.loadLibrary(name[0]).onProgress((function(name) { + return function(loaded,total) { + if(total > 0) { + if(!Object.prototype.hasOwnProperty.call(_gthis.bytesTotalCache.h,name[0])) { + _gthis.bytesTotalCache.h[name[0]] = total; + _gthis.bytesTotal += total - 200; + } + if(loaded > total) { + loaded = total; + } + if(!Object.prototype.hasOwnProperty.call(_gthis.bytesLoadedCache2.h,name[0])) { + _gthis.bytesLoaded += loaded; + } else { + _gthis.bytesLoaded += loaded - _gthis.bytesLoadedCache2.h[name[0]]; + } + _gthis.bytesLoadedCache2.h[name[0]] = loaded; + if(!_gthis.simulateProgress) { + _gthis.onProgress.dispatch(_gthis.bytesLoaded,_gthis.bytesTotal); + } + } + }; + })(name)).onComplete((function(name) { + return function(library) { + var total = 200; + if(Object.prototype.hasOwnProperty.call(_gthis.bytesTotalCache.h,name[0])) { + total = _gthis.bytesTotalCache.h[name[0]]; + } + if(!Object.prototype.hasOwnProperty.call(_gthis.bytesLoadedCache2.h,name[0])) { + _gthis.bytesLoaded += total; + } else { + _gthis.bytesLoaded += total - _gthis.bytesLoadedCache2.h[name[0]]; + } + _gthis.loadedAssetLibrary(name[0]); + }; + })(name)).onError((function() { + return function(e) { + lime_utils_Log.error(e,{ fileName : "lime/utils/Preloader.hx", lineNumber : 293, className : "lime.utils.Preloader", methodName : "updateProgress"}); + }; + })()); + } + } + if(!this.simulateProgress && this.loadedLibraries == this.libraries.length + this.libraryNames.length) { + if(!this.preloadComplete) { + this.preloadComplete = true; + lime_utils_Log.verbose("Preload complete",{ fileName : "lime/utils/Preloader.hx", lineNumber : 306, className : "lime.utils.Preloader", methodName : "updateProgress"}); + } + this.start(); + } + } + ,__class__: lime_utils_Preloader +}; +var lime_utils_UInt16Array = {}; +lime_utils_UInt16Array.toArrayBufferView = function(this1) { + return this1; +}; +lime_utils_UInt16Array.fromBytes = function(bytes,byteOffset,len) { + if(byteOffset == null) { + byteOffset = 0; + } + if(byteOffset == null) { + return new Uint16Array(bytes.b.bufferValue); + } + if(len == null) { + return new Uint16Array(bytes.b.bufferValue,byteOffset); + } + return new Uint16Array(bytes.b.bufferValue,byteOffset,len); +}; +lime_utils_UInt16Array.toBytes = function(this1) { + return new haxe_io_Bytes(new Uint8Array(this1.buffer)); +}; +lime_utils_UInt16Array.toString = function(this1) { + if(this1 != null) { + return "UInt16Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]"; + } else { + return null; + } +}; +var lime_utils_UInt32Array = {}; +lime_utils_UInt32Array.toArrayBufferView = function(this1) { + return this1; +}; +lime_utils_UInt32Array.fromBytes = function(bytes,byteOffset,len) { + if(byteOffset == null) { + byteOffset = 0; + } + if(byteOffset == null) { + return new Uint32Array(bytes.b.bufferValue); + } + if(len == null) { + return new Uint32Array(bytes.b.bufferValue,byteOffset); + } + return new Uint32Array(bytes.b.bufferValue,byteOffset,len); +}; +lime_utils_UInt32Array.toBytes = function(this1) { + return new haxe_io_Bytes(new Uint8Array(this1.buffer)); +}; +lime_utils_UInt32Array.toString = function(this1) { + if(this1 != null) { + return "UInt32Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]"; + } else { + return null; + } +}; +var lime_utils_UInt8Array = {}; +lime_utils_UInt8Array.toArrayBufferView = function(this1) { + return this1; +}; +lime_utils_UInt8Array.fromBytes = function(bytes,byteOffset,len) { + if(byteOffset == null) { + return new Uint8Array(bytes.b.bufferValue); + } + if(len == null) { + return new Uint8Array(bytes.b.bufferValue,byteOffset); + } + return new Uint8Array(bytes.b.bufferValue,byteOffset,len); +}; +lime_utils_UInt8Array.toBytes = function(this1) { + return new haxe_io_Bytes(new Uint8Array(this1.buffer)); +}; +lime_utils_UInt8Array.toString = function(this1) { + if(this1 != null) { + return "UInt8Array [byteLength:" + this1.byteLength + ", length:" + this1.length + "]"; + } else { + return null; + } +}; +var lime_utils_UInt8ClampedArray = {}; +lime_utils_UInt8ClampedArray.toArrayBufferView = function(this1) { + return this1; +}; +lime_utils_UInt8ClampedArray.fromBytes = function(bytes,byteOffset,len) { + if(byteOffset == null) { + byteOffset = 0; + } + if(byteOffset == null) { + return new Uint8ClampedArray(bytes.b.bufferValue); + } + if(len == null) { + return new Uint8ClampedArray(bytes.b.bufferValue,byteOffset); + } + return new Uint8ClampedArray(bytes.b.bufferValue,byteOffset,len); +}; +lime_utils_UInt8ClampedArray.toBytes = function(this1) { + return new haxe_io_Bytes(new Uint8Array(this1.buffer)); +}; +lime_utils_UInt8ClampedArray.toString = function(this1) { + if(this1 != null) { + return "UInt8ClampedArray [byteLength:" + this1.byteLength + ", length:" + this1.length + "]"; + } else { + return null; + } +}; +lime_utils_UInt8ClampedArray._clamp = function(_in) { + var _out = _in | 0; + if(_out > 255) { + _out = 255; + } + if(_out < 0) { + return 0; + } else { + return _out; + } +}; +var model_Constants = function() { +}; +$hxClasses["model.Constants"] = model_Constants; +model_Constants.__name__ = "model.Constants"; +model_Constants.prototype = { + __class__: model_Constants +}; +var motion_easing_IEasing = function() { }; +$hxClasses["motion.easing.IEasing"] = motion_easing_IEasing; +motion_easing_IEasing.__name__ = "motion.easing.IEasing"; +motion_easing_IEasing.__isInterface__ = true; +motion_easing_IEasing.prototype = { + __class__: motion_easing_IEasing +}; +var motion_easing__$Expo_ExpoEaseIn = function() { +}; +$hxClasses["motion.easing._Expo.ExpoEaseIn"] = motion_easing__$Expo_ExpoEaseIn; +motion_easing__$Expo_ExpoEaseIn.__name__ = "motion.easing._Expo.ExpoEaseIn"; +motion_easing__$Expo_ExpoEaseIn.__interfaces__ = [motion_easing_IEasing]; +motion_easing__$Expo_ExpoEaseIn.prototype = { + calculate: function(k) { + if(k == 0) { + return 0; + } else { + return Math.exp(6.931471805599453 * (k - 1)); + } + } + ,ease: function(t,b,c,d) { + if(t == 0) { + return b; + } else { + return c * Math.exp(6.931471805599453 * (t / d - 1)) + b; + } + } + ,__class__: motion_easing__$Expo_ExpoEaseIn +}; +var motion_easing__$Expo_ExpoEaseInOut = function() { +}; +$hxClasses["motion.easing._Expo.ExpoEaseInOut"] = motion_easing__$Expo_ExpoEaseInOut; +motion_easing__$Expo_ExpoEaseInOut.__name__ = "motion.easing._Expo.ExpoEaseInOut"; +motion_easing__$Expo_ExpoEaseInOut.__interfaces__ = [motion_easing_IEasing]; +motion_easing__$Expo_ExpoEaseInOut.prototype = { + calculate: function(k) { + if(k == 0) { + return 0; + } + if(k == 1) { + return 1; + } + if((k /= 0.5) < 1.0) { + return 0.5 * Math.exp(6.931471805599453 * (k - 1)); + } + return 0.5 * (2 - Math.exp(-6.931471805599453 * --k)); + } + ,ease: function(t,b,c,d) { + if(t == 0) { + return b; + } + if(t == d) { + return b + c; + } + if((t /= d / 2.0) < 1.0) { + return c / 2 * Math.exp(6.931471805599453 * (t - 1)) + b; + } + return c / 2 * (2 - Math.exp(-6.931471805599453 * --t)) + b; + } + ,__class__: motion_easing__$Expo_ExpoEaseInOut +}; +var motion_easing__$Expo_ExpoEaseOut = function() { +}; +$hxClasses["motion.easing._Expo.ExpoEaseOut"] = motion_easing__$Expo_ExpoEaseOut; +motion_easing__$Expo_ExpoEaseOut.__name__ = "motion.easing._Expo.ExpoEaseOut"; +motion_easing__$Expo_ExpoEaseOut.__interfaces__ = [motion_easing_IEasing]; +motion_easing__$Expo_ExpoEaseOut.prototype = { + calculate: function(k) { + if(k == 1) { + return 1; + } else { + return 1 - Math.exp(-6.931471805599453 * k); + } + } + ,ease: function(t,b,c,d) { + if(t == d) { + return b + c; + } else { + return c * (1 - Math.exp(-6.931471805599453 * t / d)) + b; + } + } + ,__class__: motion_easing__$Expo_ExpoEaseOut +}; +var motion_easing_Expo = function() { }; +$hxClasses["motion.easing.Expo"] = motion_easing_Expo; +motion_easing_Expo.__name__ = "motion.easing.Expo"; +var motion_Actuate = function() { }; +$hxClasses["motion.Actuate"] = motion_Actuate; +motion_Actuate.__name__ = "motion.Actuate"; +motion_Actuate.apply = function(target,properties,customActuator) { + motion_Actuate.stop(target,properties); + if(customActuator == null) { + customActuator = motion_Actuate.defaultActuator; + } + var actuator = Type.createInstance(customActuator,[target,0,properties]); + actuator.apply(); + return actuator; +}; +motion_Actuate.effects = function(target,duration,overwrite) { + if(overwrite == null) { + overwrite = true; + } + return new motion__$Actuate_EffectsOptions(target,duration,overwrite); +}; +motion_Actuate.getLibrary = function(target,allowCreation) { + if(allowCreation == null) { + allowCreation = true; + } + if(motion_Actuate.targetLibraries.h.__keys__[target.__id__] == null && allowCreation) { + motion_Actuate.targetLibraries.set(target,[]); + } + return motion_Actuate.targetLibraries.h[target.__id__]; +}; +motion_Actuate.isActive = function() { + var result = false; + var library = motion_Actuate.targetLibraries.iterator(); + while(library.hasNext()) { + var library1 = library.next(); + result = true; + break; + } + return result; +}; +motion_Actuate.motionPath = function(target,duration,properties,overwrite) { + if(overwrite == null) { + overwrite = true; + } + return motion_Actuate.tween(target,duration,properties,overwrite,motion_actuators_MotionPathActuator); +}; +motion_Actuate.pause = function(target) { + if(js_Boot.__implements(target,motion_actuators_IGenericActuator)) { + var actuator = target; + actuator.pause(); + } else { + var library = motion_Actuate.getLibrary(target,false); + if(library != null) { + var _g = 0; + while(_g < library.length) { + var actuator = library[_g]; + ++_g; + actuator.pause(); + } + } + } +}; +motion_Actuate.pauseAll = function() { + var library = motion_Actuate.targetLibraries.iterator(); + while(library.hasNext()) { + var library1 = library.next(); + var _g = 0; + while(_g < library1.length) { + var actuator = library1[_g]; + ++_g; + actuator.pause(); + } + } +}; +motion_Actuate.reset = function() { + var library = motion_Actuate.targetLibraries.iterator(); + while(library.hasNext()) { + var library1 = library.next(); + var i = library1.length - 1; + while(i >= 0) { + library1[i].stop(null,false,false); + --i; + } + } + motion_Actuate.targetLibraries = new haxe_ds_ObjectMap(); +}; +motion_Actuate.resume = function(target) { + if(js_Boot.__implements(target,motion_actuators_IGenericActuator)) { + var actuator = target; + actuator.resume(); + } else { + var library = motion_Actuate.getLibrary(target,false); + if(library != null) { + var _g = 0; + while(_g < library.length) { + var actuator = library[_g]; + ++_g; + actuator.resume(); + } + } + } +}; +motion_Actuate.resumeAll = function() { + var library = motion_Actuate.targetLibraries.iterator(); + while(library.hasNext()) { + var library1 = library.next(); + var _g = 0; + while(_g < library1.length) { + var actuator = library1[_g]; + ++_g; + actuator.resume(); + } + } +}; +motion_Actuate.stop = function(target,properties,complete,sendEvent) { + if(sendEvent == null) { + sendEvent = true; + } + if(complete == null) { + complete = false; + } + if(target != null) { + if(js_Boot.__implements(target,motion_actuators_IGenericActuator)) { + var actuator = target; + actuator.stop(null,complete,sendEvent); + } else { + var library = motion_Actuate.getLibrary(target,false); + if(library != null) { + if(typeof(properties) == "string") { + var temp = { }; + temp[properties] = null; + properties = temp; + } else if(((properties) instanceof Array)) { + var temp = { }; + var _g = 0; + var _g1 = js_Boot.__cast(properties , Array); + while(_g < _g1.length) { + var property = _g1[_g]; + ++_g; + temp[property] = null; + } + properties = temp; + } + var i = library.length - 1; + while(i >= 0) { + library[i].stop(properties,complete,sendEvent); + --i; + } + } + } + } +}; +motion_Actuate.timer = function(duration,customActuator) { + return motion_Actuate.tween(new motion__$Actuate_TweenTimer(0),duration,new motion__$Actuate_TweenTimer(1),false,customActuator); +}; +motion_Actuate.transform = function(target,duration,overwrite) { + if(overwrite == null) { + overwrite = true; + } + if(duration == null) { + duration = 0; + } + return new motion__$Actuate_TransformOptions(target,duration,overwrite); +}; +motion_Actuate.tween = function(target,duration,properties,overwrite,customActuator) { + if(overwrite == null) { + overwrite = true; + } + if(target != null) { + if(duration > 0) { + if(customActuator == null) { + customActuator = motion_Actuate.defaultActuator; + } + var actuator = Type.createInstance(customActuator,[target,duration,properties]); + var library = motion_Actuate.getLibrary(actuator.target); + if(overwrite) { + var i = library.length - 1; + while(i >= 0) { + library[i].stop(actuator.properties,false,false); + --i; + } + library = motion_Actuate.getLibrary(actuator.target); + } + library.push(actuator); + actuator.move(); + return actuator; + } else { + return motion_Actuate.apply(target,properties,customActuator); + } + } + return null; +}; +motion_Actuate.unload = function(actuator) { + var target = actuator.target; + if(motion_Actuate.targetLibraries.h.__keys__[target.__id__] != null) { + HxOverrides.remove(motion_Actuate.targetLibraries.h[target.__id__],actuator); + if(motion_Actuate.targetLibraries.h[target.__id__].length == 0) { + motion_Actuate.targetLibraries.remove(target); + } + } +}; +motion_Actuate.update = function(target,duration,start,end,overwrite) { + if(overwrite == null) { + overwrite = true; + } + var properties = { start : start, end : end}; + return motion_Actuate.tween(target,duration,properties,overwrite,motion_actuators_MethodActuator); +}; +var motion__$Actuate_EffectsOptions = function(target,duration,overwrite) { + this.target = target; + this.duration = duration; + this.overwrite = overwrite; +}; +$hxClasses["motion._Actuate.EffectsOptions"] = motion__$Actuate_EffectsOptions; +motion__$Actuate_EffectsOptions.__name__ = "motion._Actuate.EffectsOptions"; +motion__$Actuate_EffectsOptions.prototype = { + filter: function(reference,properties) { + properties.filter = reference; + return motion_Actuate.tween(this.target,this.duration,properties,this.overwrite,motion_actuators_FilterActuator); + } + ,__class__: motion__$Actuate_EffectsOptions +}; +var motion__$Actuate_TransformOptions = function(target,duration,overwrite) { + this.target = target; + this.duration = duration; + this.overwrite = overwrite; +}; +$hxClasses["motion._Actuate.TransformOptions"] = motion__$Actuate_TransformOptions; +motion__$Actuate_TransformOptions.__name__ = "motion._Actuate.TransformOptions"; +motion__$Actuate_TransformOptions.prototype = { + color: function(value,strength,alpha) { + if(strength == null) { + strength = 1; + } + if(value == null) { + value = 0; + } + var properties = { colorValue : value, colorStrength : strength}; + if(alpha != null) { + properties.colorAlpha = alpha; + } + return motion_Actuate.tween(this.target,this.duration,properties,this.overwrite,motion_actuators_TransformActuator); + } + ,sound: function(volume,pan) { + var properties = { }; + if(volume != null) { + properties.soundVolume = volume; + } + if(pan != null) { + properties.soundPan = pan; + } + return motion_Actuate.tween(this.target,this.duration,properties,this.overwrite,motion_actuators_TransformActuator); + } + ,__class__: motion__$Actuate_TransformOptions +}; +var motion__$Actuate_TweenTimer = function(progress) { + this.progress = progress; +}; +$hxClasses["motion._Actuate.TweenTimer"] = motion__$Actuate_TweenTimer; +motion__$Actuate_TweenTimer.__name__ = "motion._Actuate.TweenTimer"; +motion__$Actuate_TweenTimer.prototype = { + __class__: motion__$Actuate_TweenTimer +}; +var motion_MotionPath = function() { + this._x = new motion__$MotionPath_ComponentPath(); + this._y = new motion__$MotionPath_ComponentPath(); + this._rotation = null; +}; +$hxClasses["motion.MotionPath"] = motion_MotionPath; +motion_MotionPath.__name__ = "motion.MotionPath"; +motion_MotionPath.prototype = { + bezier: function(x,y,controlX,controlY,strength) { + if(strength == null) { + strength = 1; + } + return this.bezierN(x,y,[controlX],[controlY],strength); + } + ,bezierN: function(x,y,controlX,controlY,strength) { + if(strength == null) { + strength = 1; + } + this._x.addPath(new motion__$MotionPath_BezierPath(x,controlX,strength)); + this._y.addPath(new motion__$MotionPath_BezierPath(y,controlY,strength)); + return this; + } + ,bezierSpline: function(x,y,strength) { + if(strength == null) { + strength = 1; + } + this._x.addPath(new motion__$MotionPath_BezierSplinePath(x,strength)); + this._y.addPath(new motion__$MotionPath_BezierSplinePath(y,strength)); + return this; + } + ,line: function(x,y,strength) { + if(strength == null) { + strength = 1; + } + return this.bezierN(x,y,[],[],strength); + } + ,get_rotation: function() { + if(this._rotation == null) { + this._rotation = new motion__$MotionPath_RotationPath(this._x,this._y); + } + return this._rotation; + } + ,get_x: function() { + return this._x; + } + ,get_y: function() { + return this._y; + } + ,__class__: motion_MotionPath + ,__properties__: {get_y:"get_y",get_x:"get_x",get_rotation:"get_rotation"} +}; +var motion_IComponentPath = function() { }; +$hxClasses["motion.IComponentPath"] = motion_IComponentPath; +motion_IComponentPath.__name__ = "motion.IComponentPath"; +motion_IComponentPath.__isInterface__ = true; +motion_IComponentPath.prototype = { + __class__: motion_IComponentPath + ,__properties__: {get_end:"get_end",set_start:"set_start",get_start:"get_start"} +}; +var motion__$MotionPath_ComponentPath = function() { + this.paths = []; + this.strength = 0; +}; +$hxClasses["motion._MotionPath.ComponentPath"] = motion__$MotionPath_ComponentPath; +motion__$MotionPath_ComponentPath.__name__ = "motion._MotionPath.ComponentPath"; +motion__$MotionPath_ComponentPath.__interfaces__ = [motion_IComponentPath]; +motion__$MotionPath_ComponentPath.prototype = { + addPath: function(path) { + if(this.paths.length > 0) { + path.set_start(this.paths[this.paths.length - 1].get_end()); + } + this.paths.push(path); + this.strength += path.strength; + } + ,calculate: function(k) { + if(this.paths.length == 1) { + return this.paths[0].calculate(k); + } else { + var ratio = k * this.strength; + var _g = 0; + var _g1 = this.paths; + while(_g < _g1.length) { + var path = _g1[_g]; + ++_g; + if(ratio - path.strength > 1e-7) { + ratio -= path.strength; + } else { + return path.calculate(ratio / path.strength); + } + } + } + return 0; + } + ,get_start: function() { + if(this.paths.length > 0) { + return this.paths[0].get_start(); + } else { + return 0; + } + } + ,set_start: function(value) { + if(this.paths.length > 0) { + return this.paths[0].set_start(value); + } else { + return 0; + } + } + ,get_end: function() { + if(this.paths.length > 0) { + var path = this.paths[this.paths.length - 1]; + return path.get_end(); + } else { + return this.get_start(); + } + } + ,__class__: motion__$MotionPath_ComponentPath + ,__properties__: {get_end:"get_end",set_start:"set_start",get_start:"get_start"} +}; +var motion__$MotionPath_BezierPath = function(end,control,strength) { + this._end = end; + this.control = control; + this.strength = strength; +}; +$hxClasses["motion._MotionPath.BezierPath"] = motion__$MotionPath_BezierPath; +motion__$MotionPath_BezierPath.__name__ = "motion._MotionPath.BezierPath"; +motion__$MotionPath_BezierPath.__interfaces__ = [motion_IComponentPath]; +motion__$MotionPath_BezierPath.prototype = { + calculate: function(k) { + var l = 1 - k; + switch(this.control.length) { + case 0: + return l * this._start + k * this._end; + case 1: + return l * l * this._start + 2 * l * k * this.control[0] + k * k * this._end; + case 2: + return l * l * l * this._start + 3 * l * l * k * this.control[0] + 3 * l * k * k * this.control[1] + k * k * k * this._end; + default: + if(l < 1e-7) { + return this._end; + } + var r = k / l; + var n = this.control.length + 1; + var coeff = Math.pow(l,n); + var res = coeff * this._start; + var _g = 1; + var _g1 = n; + while(_g < _g1) { + var i = _g++; + coeff *= r * (n + 1 - i) / i; + res += coeff * this.control[i - 1]; + } + coeff *= r / n; + return res + coeff * this._end; + } + } + ,get_start: function() { + return this._start; + } + ,set_start: function(value) { + return this._start = value; + } + ,get_end: function() { + return this._end; + } + ,__class__: motion__$MotionPath_BezierPath + ,__properties__: {get_end:"get_end",set_start:"set_start",get_start:"get_start"} +}; +var motion__$MotionPath_BezierSplinePath = function(through,strength) { + motion__$MotionPath_ComponentPath.call(this); + this.through = through; + this.strength = strength; +}; +$hxClasses["motion._MotionPath.BezierSplinePath"] = motion__$MotionPath_BezierSplinePath; +motion__$MotionPath_BezierSplinePath.__name__ = "motion._MotionPath.BezierSplinePath"; +motion__$MotionPath_BezierSplinePath.__super__ = motion__$MotionPath_ComponentPath; +motion__$MotionPath_BezierSplinePath.prototype = $extend(motion__$MotionPath_ComponentPath.prototype,{ + computeControlPoints: function(start) { + var K = [start].concat(this.through); + var n = K.length; + var _g = []; + var _g1 = 0; + var _g2 = n; + while(_g1 < _g2) { + var _ = _g1++; + _g.push([0.0,0.0]); + } + var control = _g; + var a = []; + var b = []; + var c = []; + var r = []; + a[0] = 0; + b[0] = 2; + c[0] = 1; + r[0] = K[0] + 2 * K[1]; + var _g = 1; + var _g1 = n - 1; + while(_g < _g1) { + var i = _g++; + a[i] = 1; + b[i] = 4; + c[i] = 1; + r[i] = 4 * K[i] + 2 * K[i + 1]; + } + a[n - 1] = 1; + b[n - 1] = 2; + c[n - 1] = 0; + r[n - 1] = 3 * K[n - 1]; + var _g = 1; + var _g1 = n; + while(_g < _g1) { + var i = _g++; + var m = a[i] / b[i - 1]; + b[i] -= m * c[i - 1]; + r[i] -= m * r[i - 1]; + } + control[n - 1][0] = r[n - 1] / b[n - 1]; + var i = n - 2; + while(i >= 0) { + control[i][0] = (r[i] - c[i] * control[i + 1][0]) / b[i]; + --i; + } + var _g = 0; + var _g1 = n - 1; + while(_g < _g1) { + var i = _g++; + control[i][1] = 2 * K[i + 1] - control[i + 1][0]; + } + control[n - 1][1] = 0.5 * (K[n] + control[n - 1][0]); + control.pop(); + return control; + } + ,set_start: function(value) { + if(this.paths.length == 0 || Math.abs(value - this.get_start()) > 1e-7) { + var control = this.computeControlPoints(value); + var pathStrength = this.strength / control.length; + this.strength = 0; + this.paths.splice(0,this.paths.length); + var _g = 0; + var _g1 = control.length; + while(_g < _g1) { + var i = _g++; + this.addPath(new motion__$MotionPath_BezierPath(this.through[i],control[i],pathStrength)); + } + } + return motion__$MotionPath_ComponentPath.prototype.set_start.call(this,value); + } + ,get_end: function() { + return this.through[this.through.length - 1]; + } + ,__class__: motion__$MotionPath_BezierSplinePath +}); +var motion__$MotionPath_RotationPath = function(x,y) { + this.step = 0.01; + this._x = x; + this._y = y; + this.offset = 0; + this.set_start(this.calculate(0.0)); +}; +$hxClasses["motion._MotionPath.RotationPath"] = motion__$MotionPath_RotationPath; +motion__$MotionPath_RotationPath.__name__ = "motion._MotionPath.RotationPath"; +motion__$MotionPath_RotationPath.__interfaces__ = [motion_IComponentPath]; +motion__$MotionPath_RotationPath.prototype = { + calculate: function(k) { + var dX = this._x.calculate(k) - this._x.calculate(k + this.step); + var dY = this._y.calculate(k) - this._y.calculate(k + this.step); + var angle = Math.atan2(dY,dX) * (180 / Math.PI); + angle = (angle + this.offset) % 360; + return angle; + } + ,get_start: function() { + return this._start; + } + ,set_start: function(value) { + return this._start; + } + ,get_end: function() { + return this.calculate(1.0); + } + ,__class__: motion__$MotionPath_RotationPath + ,__properties__: {set_start:"set_start",get_start:"get_start",get_end:"get_end"} +}; +var motion_actuators_FilterActuator = function(target,duration,properties) { + this.filterIndex = -1; + motion_actuators_SimpleActuator.call(this,target,duration,properties); + if(js_Boot.__instanceof(properties.filter,Class)) { + this.filterClass = properties.filter; + if(target.get_filters().length == 0) { + target.set_filters([Type.createInstance(this.filterClass,[])]); + } + var _g = 0; + var _g1 = target.get_filters(); + while(_g < _g1.length) { + var filter = _g1[_g]; + ++_g; + if(js_Boot.__instanceof(filter,this.filterClass)) { + this.filter = filter; + } + } + } else { + this.filterIndex = properties.filter; + this.filter = target.get_filters()[this.filterIndex]; + } +}; +$hxClasses["motion.actuators.FilterActuator"] = motion_actuators_FilterActuator; +motion_actuators_FilterActuator.__name__ = "motion.actuators.FilterActuator"; +motion_actuators_FilterActuator.__super__ = motion_actuators_SimpleActuator; +motion_actuators_FilterActuator.prototype = $extend(motion_actuators_SimpleActuator.prototype,{ + apply: function() { + var _g = 0; + var _g1 = Reflect.fields(this.properties); + while(_g < _g1.length) { + var propertyName = _g1[_g]; + ++_g; + if(propertyName != "filter") { + Reflect.setProperty(this.filter,propertyName,Reflect.field(this.properties,propertyName)); + } + } + this.setFilter(); + } + ,initialize: function() { + var details; + var start; + var _g = 0; + var _g1 = Reflect.fields(this.properties); + while(_g < _g1.length) { + var propertyName = _g1[_g]; + ++_g; + if(propertyName != "filter") { + var target = this.filter; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,propertyName)) { + value = Reflect.field(target,propertyName); + } else { + value = Reflect.getProperty(target,propertyName); + } + start = value; + details = new motion_actuators_PropertyDetails(this.filter,propertyName,start,Reflect.field(this.properties,propertyName) - start,Object.prototype.hasOwnProperty.call(this.filter,"set_" + propertyName)); + this.propertyDetails.push(details); + } + } + this.detailsLength = this.propertyDetails.length; + this.initialized = true; + } + ,setFilter: function() { + var filters = this.target.get_filters(); + if(this.filterIndex > -1) { + filters[this.filterIndex] = this.filter; + } else { + var _g = 0; + var _g1 = filters.length; + while(_g < _g1) { + var i = _g++; + if(js_Boot.__instanceof(filters[i],this.filterClass)) { + filters[i] = this.filter; + } + } + } + var target = this.target; + var value = filters; + if(Object.prototype.hasOwnProperty.call(target,"filters") && !(target.__properties__ && target.__properties__["set_" + "filters"])) { + target["filters"] = value; + } else { + Reflect.setProperty(target,"filters",value); + } + } + ,update: function(currentTime) { + motion_actuators_SimpleActuator.prototype.update.call(this,currentTime); + this.setFilter(); + } + ,__class__: motion_actuators_FilterActuator +}); +var motion_actuators_MotionPathActuator = function(target,duration,properties) { + motion_actuators_SimpleActuator.call(this,target,duration,properties); +}; +$hxClasses["motion.actuators.MotionPathActuator"] = motion_actuators_MotionPathActuator; +motion_actuators_MotionPathActuator.__name__ = "motion.actuators.MotionPathActuator"; +motion_actuators_MotionPathActuator.__super__ = motion_actuators_SimpleActuator; +motion_actuators_MotionPathActuator.prototype = $extend(motion_actuators_SimpleActuator.prototype,{ + apply: function() { + var _g = 0; + var _g1 = Reflect.fields(this.properties); + while(_g < _g1.length) { + var propertyName = _g1[_g]; + ++_g; + if(Object.prototype.hasOwnProperty.call(this.target,propertyName)) { + this.target[propertyName] = (js_Boot.__cast(Reflect.field(this.properties,propertyName) , motion_IComponentPath)).get_end(); + } else { + Reflect.setProperty(this.target,propertyName,(js_Boot.__cast(Reflect.field(this.properties,propertyName) , motion_IComponentPath)).get_end()); + } + } + } + ,initialize: function() { + var details; + var path; + var _g = 0; + var _g1 = Reflect.fields(this.properties); + while(_g < _g1.length) { + var propertyName = _g1[_g]; + ++_g; + path = js_Boot.__cast(Reflect.field(this.properties,propertyName) , motion_IComponentPath); + if(path != null) { + var isField = true; + if(Object.prototype.hasOwnProperty.call(this.target,propertyName)) { + path.set_start(Reflect.field(this.target,propertyName)); + } else { + isField = false; + path.set_start(Reflect.getProperty(this.target,propertyName)); + } + details = new motion_actuators_PropertyPathDetails(this.target,propertyName,path,isField); + this.propertyDetails.push(details); + } + } + this.detailsLength = this.propertyDetails.length; + this.initialized = true; + } + ,update: function(currentTime) { + if(!this.paused) { + var details; + var easing; + var tweenPosition = (currentTime - this.timeOffset) / this.duration; + if(tweenPosition > 1) { + tweenPosition = 1; + } + if(!this.initialized) { + this.initialize(); + } + if(!this.special) { + easing = this._ease.calculate(tweenPosition); + var _g = 0; + var _g1 = this.propertyDetails; + while(_g < _g1.length) { + var details = _g1[_g]; + ++_g; + if(details.isField) { + details.target[details.propertyName] = (js_Boot.__cast(details , motion_actuators_PropertyPathDetails)).path.calculate(easing); + } else { + Reflect.setProperty(details.target,details.propertyName,(js_Boot.__cast(details , motion_actuators_PropertyPathDetails)).path.calculate(easing)); + } + } + } else { + if(!this._reverse) { + easing = this._ease.calculate(tweenPosition); + } else { + easing = this._ease.calculate(1 - tweenPosition); + } + var endValue; + var _g = 0; + var _g1 = this.propertyDetails; + while(_g < _g1.length) { + var details = _g1[_g]; + ++_g; + if(!this._snapping) { + if(details.isField) { + details.target[details.propertyName] = (js_Boot.__cast(details , motion_actuators_PropertyPathDetails)).path.calculate(easing); + } else { + Reflect.setProperty(details.target,details.propertyName,(js_Boot.__cast(details , motion_actuators_PropertyPathDetails)).path.calculate(easing)); + } + } else if(details.isField) { + details.target[details.propertyName] = Math.round((js_Boot.__cast(details , motion_actuators_PropertyPathDetails)).path.calculate(easing)); + } else { + Reflect.setProperty(details.target,details.propertyName,Math.round((js_Boot.__cast(details , motion_actuators_PropertyPathDetails)).path.calculate(easing))); + } + } + } + if(tweenPosition == 1) { + if(this._repeat == 0) { + this.active = false; + var tmp; + if(this.toggleVisible) { + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"alpha")) { + value = Reflect.field(target,"alpha"); + } else { + value = Reflect.getProperty(target,"alpha"); + } + tmp = value == 0; + } else { + tmp = false; + } + if(tmp) { + var target = this.target; + var value = false; + if(Object.prototype.hasOwnProperty.call(target,"visible") && !(target.__properties__ && target.__properties__["set_" + "visible"])) { + target["visible"] = value; + } else { + Reflect.setProperty(target,"visible",value); + } + } + this.complete(true); + return; + } else { + if(this._onRepeat != null) { + var method = this._onRepeat; + var params = this._onRepeatParams; + if(params == null) { + params = []; + } + method.apply(method,params); + } + if(this._reflect) { + this._reverse = !this._reverse; + } + this.startTime = currentTime; + this.timeOffset = this.startTime + this._delay; + if(this._repeat > 0) { + this._repeat--; + } + } + } + if(this.sendChange) { + this.change(); + } + } + } + ,__class__: motion_actuators_MotionPathActuator +}); +var motion_actuators_PropertyDetails = function(target,propertyName,start,change,isField) { + if(isField == null) { + isField = true; + } + this.target = target; + this.propertyName = propertyName; + this.start = start; + this.change = change; + this.isField = isField; +}; +$hxClasses["motion.actuators.PropertyDetails"] = motion_actuators_PropertyDetails; +motion_actuators_PropertyDetails.__name__ = "motion.actuators.PropertyDetails"; +motion_actuators_PropertyDetails.prototype = { + __class__: motion_actuators_PropertyDetails +}; +var motion_actuators_PropertyPathDetails = function(target,propertyName,path,isField) { + if(isField == null) { + isField = true; + } + motion_actuators_PropertyDetails.call(this,target,propertyName,0,0,isField); + this.path = path; +}; +$hxClasses["motion.actuators.PropertyPathDetails"] = motion_actuators_PropertyPathDetails; +motion_actuators_PropertyPathDetails.__name__ = "motion.actuators.PropertyPathDetails"; +motion_actuators_PropertyPathDetails.__super__ = motion_actuators_PropertyDetails; +motion_actuators_PropertyPathDetails.prototype = $extend(motion_actuators_PropertyDetails.prototype,{ + __class__: motion_actuators_PropertyPathDetails +}); +var motion_actuators_TransformActuator = function(target,duration,properties) { + motion_actuators_SimpleActuator.call(this,target,duration,properties); +}; +$hxClasses["motion.actuators.TransformActuator"] = motion_actuators_TransformActuator; +motion_actuators_TransformActuator.__name__ = "motion.actuators.TransformActuator"; +motion_actuators_TransformActuator.__super__ = motion_actuators_SimpleActuator; +motion_actuators_TransformActuator.prototype = $extend(motion_actuators_SimpleActuator.prototype,{ + apply: function() { + this.initialize(); + if(this.endColorTransform != null) { + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"transform")) { + value = Reflect.field(target,"transform"); + } else { + value = Reflect.getProperty(target,"transform"); + } + var transform = value; + var value = this.endColorTransform; + if(Object.prototype.hasOwnProperty.call(transform,"colorTransform") && !(transform.__properties__ && transform.__properties__["set_" + "colorTransform"])) { + transform["colorTransform"] = value; + } else { + Reflect.setProperty(transform,"colorTransform",value); + } + } + if(this.endSoundTransform != null) { + var target = this.target; + var value = this.endSoundTransform; + if(Object.prototype.hasOwnProperty.call(target,"soundTransform") && !(target.__properties__ && target.__properties__["set_" + "soundTransform"])) { + target["soundTransform"] = value; + } else { + Reflect.setProperty(target,"soundTransform",value); + } + } + } + ,initialize: function() { + if(Object.prototype.hasOwnProperty.call(this.properties,"colorValue") && ((this.target) instanceof openfl_display_DisplayObject)) { + this.initializeColor(); + } + if(Object.prototype.hasOwnProperty.call(this.properties,"soundVolume") || Object.prototype.hasOwnProperty.call(this.properties,"soundPan")) { + this.initializeSound(); + } + this.detailsLength = this.propertyDetails.length; + this.initialized = true; + } + ,initializeColor: function() { + this.endColorTransform = new openfl_geom_ColorTransform(); + var color = this.properties.colorValue; + var strength = this.properties.colorStrength; + if(strength < 1) { + var multiplier; + var offset; + if(strength < 0.5) { + multiplier = 1; + offset = strength * 2; + } else { + multiplier = 1 - (strength - 0.5) * 2; + offset = 1; + } + this.endColorTransform.redMultiplier = multiplier; + this.endColorTransform.greenMultiplier = multiplier; + this.endColorTransform.blueMultiplier = multiplier; + this.endColorTransform.redOffset = offset * (color >> 16 & 255); + this.endColorTransform.greenOffset = offset * (color >> 8 & 255); + this.endColorTransform.blueOffset = offset * (color & 255); + } else { + this.endColorTransform.redMultiplier = 0; + this.endColorTransform.greenMultiplier = 0; + this.endColorTransform.blueMultiplier = 0; + this.endColorTransform.redOffset = color >> 16 & 255; + this.endColorTransform.greenOffset = color >> 8 & 255; + this.endColorTransform.blueOffset = color & 255; + } + var propertyNames = ["redMultiplier","greenMultiplier","blueMultiplier","redOffset","greenOffset","blueOffset"]; + if(Object.prototype.hasOwnProperty.call(this.properties,"colorAlpha")) { + this.endColorTransform.alphaMultiplier = this.properties.colorAlpha; + propertyNames.push("alphaMultiplier"); + } else { + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"alpha")) { + value = Reflect.field(target,"alpha"); + } else { + value = Reflect.getProperty(target,"alpha"); + } + this.endColorTransform.alphaMultiplier = value; + } + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"transform")) { + value = Reflect.field(target,"transform"); + } else { + value = Reflect.getProperty(target,"transform"); + } + var transform = value; + var value = null; + if(Object.prototype.hasOwnProperty.call(transform,"colorTransform")) { + value = Reflect.field(transform,"colorTransform"); + } else { + value = Reflect.getProperty(transform,"colorTransform"); + } + var begin = value; + this.tweenColorTransform = new openfl_geom_ColorTransform(); + var details; + var start; + var _g = 0; + while(_g < propertyNames.length) { + var propertyName = propertyNames[_g]; + ++_g; + var value = null; + if(Object.prototype.hasOwnProperty.call(begin,propertyName)) { + value = Reflect.field(begin,propertyName); + } else { + value = Reflect.getProperty(begin,propertyName); + } + start = value; + var details1 = this.tweenColorTransform; + var target = this.endColorTransform; + var value1 = null; + if(Object.prototype.hasOwnProperty.call(target,propertyName)) { + value1 = Reflect.field(target,propertyName); + } else { + value1 = Reflect.getProperty(target,propertyName); + } + details = new motion_actuators_PropertyDetails(details1,propertyName,start,value1 - start); + this.propertyDetails.push(details); + } + } + ,initializeSound: function() { + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"soundTransform")) { + value = Reflect.field(target,"soundTransform"); + } else { + value = Reflect.getProperty(target,"soundTransform"); + } + if(value == null) { + var target = this.target; + var value = new openfl_media_SoundTransform(); + if(Object.prototype.hasOwnProperty.call(target,"soundTransform") && !(target.__properties__ && target.__properties__["set_" + "soundTransform"])) { + target["soundTransform"] = value; + } else { + Reflect.setProperty(target,"soundTransform",value); + } + } + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"soundTransform")) { + value = Reflect.field(target,"soundTransform"); + } else { + value = Reflect.getProperty(target,"soundTransform"); + } + var start = value; + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"soundTransform")) { + value = Reflect.field(target,"soundTransform"); + } else { + value = Reflect.getProperty(target,"soundTransform"); + } + this.endSoundTransform = value; + this.tweenSoundTransform = new openfl_media_SoundTransform(); + if(Object.prototype.hasOwnProperty.call(this.properties,"soundVolume")) { + this.endSoundTransform.volume = this.properties.soundVolume; + this.propertyDetails.push(new motion_actuators_PropertyDetails(this.tweenSoundTransform,"volume",start.volume,this.endSoundTransform.volume - start.volume)); + } + if(Object.prototype.hasOwnProperty.call(this.properties,"soundPan")) { + this.endSoundTransform.pan = this.properties.soundPan; + this.propertyDetails.push(new motion_actuators_PropertyDetails(this.tweenSoundTransform,"pan",start.pan,this.endSoundTransform.pan - start.pan)); + } + } + ,update: function(currentTime) { + motion_actuators_SimpleActuator.prototype.update.call(this,currentTime); + if(this.endColorTransform != null) { + var target = this.target; + var value = null; + if(Object.prototype.hasOwnProperty.call(target,"transform")) { + value = Reflect.field(target,"transform"); + } else { + value = Reflect.getProperty(target,"transform"); + } + var transform = value; + var value = this.tweenColorTransform; + if(Object.prototype.hasOwnProperty.call(transform,"colorTransform") && !(transform.__properties__ && transform.__properties__["set_" + "colorTransform"])) { + transform["colorTransform"] = value; + } else { + Reflect.setProperty(transform,"colorTransform",value); + } + } + if(this.endSoundTransform != null) { + var target = this.target; + var value = this.tweenSoundTransform; + if(Object.prototype.hasOwnProperty.call(target,"soundTransform") && !(target.__properties__ && target.__properties__["set_" + "soundTransform"])) { + target["soundTransform"] = value; + } else { + Reflect.setProperty(target,"soundTransform",value); + } + } + } + ,__class__: motion_actuators_TransformActuator +}); +var motion_easing_Linear = function() { }; +$hxClasses["motion.easing.Linear"] = motion_easing_Linear; +motion_easing_Linear.__name__ = "motion.easing.Linear"; +motion_easing_Linear.__properties__ = {get_easeNone:"get_easeNone"}; +motion_easing_Linear.get_easeNone = function() { + return new motion_easing_LinearEaseNone(); +}; +var motion_easing_LinearEaseNone = function() { +}; +$hxClasses["motion.easing.LinearEaseNone"] = motion_easing_LinearEaseNone; +motion_easing_LinearEaseNone.__name__ = "motion.easing.LinearEaseNone"; +motion_easing_LinearEaseNone.__interfaces__ = [motion_easing_IEasing]; +motion_easing_LinearEaseNone.prototype = { + calculate: function(k) { + return k; + } + ,ease: function(t,b,c,d) { + return c * t / d + b; + } + ,__class__: motion_easing_LinearEaseNone +}; +var motion_easing__$Quart_QuartEaseIn = function() { +}; +$hxClasses["motion.easing._Quart.QuartEaseIn"] = motion_easing__$Quart_QuartEaseIn; +motion_easing__$Quart_QuartEaseIn.__name__ = "motion.easing._Quart.QuartEaseIn"; +motion_easing__$Quart_QuartEaseIn.__interfaces__ = [motion_easing_IEasing]; +motion_easing__$Quart_QuartEaseIn.prototype = { + calculate: function(k) { + return k * k * k * k; + } + ,ease: function(t,b,c,d) { + return c * (t /= d) * t * t * t + b; + } + ,__class__: motion_easing__$Quart_QuartEaseIn +}; +var motion_easing__$Quart_QuartEaseInOut = function() { +}; +$hxClasses["motion.easing._Quart.QuartEaseInOut"] = motion_easing__$Quart_QuartEaseInOut; +motion_easing__$Quart_QuartEaseInOut.__name__ = "motion.easing._Quart.QuartEaseInOut"; +motion_easing__$Quart_QuartEaseInOut.__interfaces__ = [motion_easing_IEasing]; +motion_easing__$Quart_QuartEaseInOut.prototype = { + calculate: function(k) { + if((k *= 2) < 1) { + return 0.5 * k * k * k * k; + } + return -0.5 * ((k -= 2) * k * k * k - 2); + } + ,ease: function(t,b,c,d) { + if((t /= d / 2) < 1) { + return c / 2 * t * t * t * t + b; + } + return -c / 2 * ((t -= 2) * t * t * t - 2) + b; + } + ,__class__: motion_easing__$Quart_QuartEaseInOut +}; +var motion_easing__$Quart_QuartEaseOut = function() { +}; +$hxClasses["motion.easing._Quart.QuartEaseOut"] = motion_easing__$Quart_QuartEaseOut; +motion_easing__$Quart_QuartEaseOut.__name__ = "motion.easing._Quart.QuartEaseOut"; +motion_easing__$Quart_QuartEaseOut.__interfaces__ = [motion_easing_IEasing]; +motion_easing__$Quart_QuartEaseOut.prototype = { + calculate: function(k) { + return -(--k * k * k * k - 1); + } + ,ease: function(t,b,c,d) { + t = t / d - 1; + return -c * (t * t * t * t - 1) + b; + } + ,__class__: motion_easing__$Quart_QuartEaseOut +}; +var motion_easing_Quart = function() { }; +$hxClasses["motion.easing.Quart"] = motion_easing_Quart; +motion_easing_Quart.__name__ = "motion.easing.Quart"; +var openfl_utils_Dictionary = {}; +openfl_utils_Dictionary.exists = function(this1,key) { + return this1.exists(key); +}; +openfl_utils_Dictionary.get = function(this1,key) { + return this1.get(key); +}; +openfl_utils_Dictionary.keyValueIterator = function(this1) { + return this1.keyValueIterator(); +}; +openfl_utils_Dictionary.remove = function(this1,key) { + return this1.remove(key); +}; +openfl_utils_Dictionary.set = function(this1,key,value) { + this1.set(key,value); + return value; +}; +openfl_utils_Dictionary.iterator = function(this1) { + return this1.keys(); +}; +openfl_utils_Dictionary.each = function(this1) { + return this1.iterator(); +}; +openfl_utils_Dictionary.toStringMap = function(t,weakKeys) { + return new haxe_ds_StringMap(); +}; +openfl_utils_Dictionary.toIntMap = function(t,weakKeys) { + return new haxe_ds_IntMap(); +}; +openfl_utils_Dictionary.toFloatMap = function(t,weakKeys) { + return new openfl_utils__$Dictionary_FloatMap(); +}; +openfl_utils_Dictionary.toEnumValueMapMap = function(t,weakKeys) { + return new haxe_ds_EnumValueMap(); +}; +openfl_utils_Dictionary.toObjectMap = function(t,weakKeys) { + return new haxe_ds_ObjectMap(); +}; +openfl_utils_Dictionary.toUtilsObjectMap = function(t,weakKeys) { + return new openfl_utils__$Dictionary_UtilsObjectMap(); +}; +openfl_utils_Dictionary.toClassMap = function(t,weakKeys) { + return new openfl_utils__$Dictionary_ClassMap(); +}; +openfl_utils_Dictionary.fromStringMap = function(map) { + return map; +}; +openfl_utils_Dictionary.fromIntMap = function(map) { + return map; +}; +openfl_utils_Dictionary.fromFloatMap = function(map) { + return map; +}; +openfl_utils_Dictionary.fromObjectMap = function(map) { + return map; +}; +openfl_utils_Dictionary.fromUtilsObjectMap = function(map) { + return map; +}; +openfl_utils_Dictionary.fromClassMap = function(map) { + return map; +}; +var openfl_Lib = function() { }; +$hxClasses["openfl.Lib"] = openfl_Lib; +openfl_Lib.__name__ = "openfl.Lib"; +openfl_Lib.__properties__ = {get_current:"get_current",get_application:"get_application"}; +openfl_Lib.as = function(v,c) { + if(js_Boot.__instanceof(v,c)) { + return v; + } else { + return null; + } +}; +openfl_Lib.attach = function(name) { + return new openfl_display_MovieClip(); +}; +openfl_Lib.clearInterval = function(id) { + if(openfl_Lib.__timers.h.hasOwnProperty(id)) { + var timer = openfl_Lib.__timers.h[id]; + timer.stop(); + openfl_Lib.__timers.remove(id); + } +}; +openfl_Lib.clearTimeout = function(id) { + if(openfl_Lib.__timers.h.hasOwnProperty(id)) { + var timer = openfl_Lib.__timers.h[id]; + timer.stop(); + openfl_Lib.__timers.remove(id); + } +}; +openfl_Lib.getDefinitionByName = function(name) { + if(name == null) { + return null; + } + name = StringTools.replace(name,"::","."); + return $hxClasses[name]; +}; +openfl_Lib.getQualifiedClassName = function(value) { + if(value == null) { + return null; + } + var ref = js_Boot.__instanceof(value,Class) ? value : js_Boot.getClass(value); + if(ref == null) { + if(typeof(value) == "boolean" || value == Bool) { + return "Bool"; + } else if(typeof(value) == "number" && ((value | 0) === value) || value == Int) { + return "Int"; + } else if(typeof(value) == "number" || value == Float) { + return "Float"; + } else { + return null; + } + } + return ref.__name__; +}; +openfl_Lib.getQualifiedSuperclassName = function(value) { + if(value == null) { + return null; + } + var ref = js_Boot.__instanceof(value,Class) ? value : js_Boot.getClass(value); + if(ref == null) { + return null; + } + var parentRef = ref.__super__; + if(parentRef == null) { + return null; + } + return parentRef.__name__; +}; +openfl_Lib.getTimer = function() { + return lime_system_System.getTimer(); +}; +openfl_Lib.describeType = function(value) { + openfl_Lib.notImplemented({ fileName : "openfl/Lib.hx", lineNumber : 272, className : "openfl.Lib", methodName : "describeType"}); + return null; +}; +openfl_Lib.getURL = function(request,target) { + openfl_Lib.navigateToURL(request,target); +}; +openfl_Lib.navigateToURL = function(request,$window) { + if($window == null) { + $window = "_blank"; + } + var uri = request.url; + if(Type.typeof(request.data) == ValueType.TObject) { + var query = ""; + var fields = Reflect.fields(request.data); + var _g = 0; + while(_g < fields.length) { + var field = fields[_g]; + ++_g; + if(query.length > 0) { + query += "&"; + } + var query1 = encodeURIComponent(field) + "="; + var s = Std.string(Reflect.field(request.data,field)); + query += query1 + encodeURIComponent(s); + } + if(uri.indexOf("?") > -1) { + uri += "&" + query; + } else { + uri += "?" + query; + } + } + lime_system_System.openURL(uri,$window); +}; +openfl_Lib.encodeURIComponent = function(value) { + return encodeURIComponent(value); +}; +openfl_Lib.decodeURIComponent = function(value) { + return decodeURIComponent(value.split("+").join(" ")); +}; +openfl_Lib.notImplemented = function(posInfo) { + var api = posInfo.className + "." + posInfo.methodName; + if(!Object.prototype.hasOwnProperty.call(openfl_Lib.__sentWarnings.h,api)) { + openfl_Lib.__sentWarnings.h[api] = true; + lime_utils_Log.warn(posInfo.methodName + " is not implemented",posInfo); + } +}; +openfl_Lib.preventDefaultTouchMove = function() { + window.document.addEventListener("touchmove",function(evt) { + evt.preventDefault(); + },false); +}; +openfl_Lib.sendToURL = function(request) { + var urlLoader = new openfl_net_URLLoader(); + urlLoader.load(request); +}; +openfl_Lib.setInterval = function(closure,delay,args) { + var id = ++openfl_Lib.__lastTimerID; + var timer = new haxe_Timer(delay); + openfl_Lib.__timers.h[id] = timer; + timer.run = function() { + if(openfl_Lib.get_current() != null && openfl_Lib.get_current().stage != null && openfl_Lib.get_current().stage.__uncaughtErrorEvents.__enabled) { + try { + closure.apply(closure,args == null ? [] : args); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + openfl_Lib.get_current().stage.__handleError(e); + } + } else { + closure.apply(closure,args == null ? [] : args); + } + }; + return id; +}; +openfl_Lib.setTimeout = function(closure,delay,args) { + var id = ++openfl_Lib.__lastTimerID; + var this1 = openfl_Lib.__timers; + var v = haxe_Timer.delay(function() { + openfl_Lib.__timers.remove(id); + if(openfl_Lib.get_current() != null && openfl_Lib.get_current().stage != null && openfl_Lib.get_current().stage.__uncaughtErrorEvents.__enabled) { + try { + closure.apply(closure,args == null ? [] : args); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + openfl_Lib.get_current().stage.__handleError(e); + } + } else { + closure.apply(closure,args == null ? [] : args); + } + },delay); + this1.h[id] = v; + return id; +}; +openfl_Lib.trace = function(arg) { + haxe_Log.trace(arg,{ fileName : "openfl/Lib.hx", lineNumber : 672, className : "openfl.Lib", methodName : "trace"}); +}; +openfl_Lib.isXMLName = function(name) { + if(name == null) { + return false; + } + if(!new EReg("^[a-zA-Z_]","").match(name)) { + return false; + } + if(new EReg("^[xX][mM][lL]","").match(name)) { + return false; + } + if(!new EReg("^[a-zA-Z0-9_\\-\\.]+$","").match(name)) { + return false; + } + return true; +}; +openfl_Lib.getClassByAlias = function(aliasName) { + if(!Object.prototype.hasOwnProperty.call(openfl_Lib.__registeredClassAliases.h,aliasName)) { + throw new openfl_errors_Error("Class " + aliasName + " could not be found."); + } + return openfl_Lib.__registeredClassAliases.h[aliasName]; +}; +openfl_Lib.registerClassAlias = function(aliasName,classObject) { + if(classObject == null) { + throw new openfl_errors_TypeError("Parameter classObject must be non-null"); + } + if(aliasName == null) { + throw new openfl_errors_TypeError("Parameter aliasName must be non-null"); + } + openfl_Lib.__registeredClassAliases.h[aliasName] = classObject; + openfl_Lib.__registeredClasses.set(classObject,aliasName); +}; +openfl_Lib.get_application = function() { + return openfl_utils__$internal_Lib.application; +}; +openfl_Lib.get_current = function() { + if(openfl_utils__$internal_Lib.current == null) { + openfl_utils__$internal_Lib.current = new openfl_display_MovieClip(); + } + return openfl_utils__$internal_Lib.current; +}; +var openfl__$Vector_IVector = function() { }; +$hxClasses["openfl._Vector.IVector"] = openfl__$Vector_IVector; +openfl__$Vector_IVector.__name__ = "openfl._Vector.IVector"; +openfl__$Vector_IVector.__isInterface__ = true; +openfl__$Vector_IVector.prototype = { + __class__: openfl__$Vector_IVector + ,__properties__: {set_length:"set_length",get_length:"get_length"} +}; +var openfl__$Vector_BoolVector = function(length,fixed,array) { + if(fixed == null) { + fixed = false; + } + if(length == null) { + length = 0; + } + if(array == null) { + array = []; + } + this.__array = array; + if(length > 0) { + this.set_length(length); + } + this.fixed = fixed; +}; +$hxClasses["openfl._Vector.BoolVector"] = openfl__$Vector_BoolVector; +openfl__$Vector_BoolVector.__name__ = "openfl._Vector.BoolVector"; +openfl__$Vector_BoolVector.__interfaces__ = [openfl__$Vector_IVector]; +openfl__$Vector_BoolVector.prototype = { + concat: function(a) { + if(a == null) { + return new openfl__$Vector_BoolVector(0,false,this.__array.slice()); + } else { + var other = a; + if(other.__array.length > 0) { + return new openfl__$Vector_BoolVector(0,false,this.__array.concat(other.__array)); + } else { + return new openfl__$Vector_BoolVector(0,false,this.__array.slice()); + } + } + } + ,copy: function() { + return new openfl__$Vector_BoolVector(0,this.fixed,this.__array.slice()); + } + ,filter: function(callback) { + var tmp = this.fixed; + var _g = []; + var _g1 = 0; + var _g2 = this.__array; + while(_g1 < _g2.length) { + var v = _g2[_g1]; + ++_g1; + if(callback(v)) { + _g.push(v); + } + } + return new openfl__$Vector_BoolVector(0,tmp,_g); + } + ,get: function(index) { + if(index >= this.__array.length) { + return false; + } else { + return this.__array[index]; + } + } + ,indexOf: function(x,from) { + if(from == null) { + from = 0; + } + var _g = from; + var _g1 = this.__array.length; + while(_g < _g1) { + var i = _g++; + if(this.__array[i] == x) { + return i; + } + } + return -1; + } + ,insertAt: function(index,element) { + if(!this.fixed || index < this.__array.length) { + this.__array.splice(index,0,element); + } + } + ,iterator: function() { + return new haxe_iterators_ArrayIterator(this.__array); + } + ,join: function(sep) { + if(sep == null) { + sep = ","; + } + return this.__array.join(sep); + } + ,lastIndexOf: function(x,from) { + var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from; + while(i >= 0) { + if(this.__array[i] == x) { + return i; + } + --i; + } + return -1; + } + ,pop: function() { + if(!this.fixed) { + return this.__array.pop(); + } else { + return null; + } + } + ,push: function(x) { + if(!this.fixed) { + return this.__array.push(x); + } else { + return this.__array.length; + } + } + ,removeAt: function(index) { + if(!this.fixed || index < this.__array.length) { + return this.__array.splice(index,1)[0]; + } + return false; + } + ,reverse: function() { + this.__array.reverse(); + return this; + } + ,set: function(index,value) { + if(!this.fixed || index < this.__array.length) { + return this.__array[index] = value; + } else { + return value; + } + } + ,shift: function() { + if(!this.fixed) { + return this.__array.shift(); + } else { + return null; + } + } + ,slice: function(startIndex,endIndex) { + if(startIndex == null) { + startIndex = 0; + } + if(endIndex == null) { + endIndex = 16777215; + } + return new openfl__$Vector_BoolVector(0,false,this.__array.slice(startIndex,endIndex)); + } + ,sort: function(f) { + this.__array.sort(f); + } + ,splice: function(pos,len) { + return new openfl__$Vector_BoolVector(0,false,this.__array.splice(pos,len)); + } + ,toJSON: function() { + return this.__array; + } + ,toString: function() { + if(this.__array != null) { + return this.__array.toString(); + } else { + return null; + } + } + ,unshift: function(x) { + if(!this.fixed) { + this.__array.unshift(x); + } + } + ,get_length: function() { + return this.__array.length; + } + ,set_length: function(value) { + if(!this.fixed) { + var currentLength = this.__array.length; + if(value < 0) { + value = 0; + } + if(value > currentLength) { + var _g = currentLength; + var _g1 = value; + while(_g < _g1) { + var i = _g++; + this.__array[i] = false; + } + } else { + while(this.__array.length > value) this.__array.pop(); + } + } + return this.__array.length; + } + ,__class__: openfl__$Vector_BoolVector + ,__properties__: {set_length:"set_length",get_length:"get_length"} +}; +var openfl__$Vector_FloatVector = function(length,fixed,array,forceCopy) { + if(forceCopy == null) { + forceCopy = false; + } + if(fixed == null) { + fixed = false; + } + if(length == null) { + length = 0; + } + if(forceCopy) { + this.__array = []; + if(array != null) { + var _g = 0; + var _g1 = array.length; + while(_g < _g1) { + var i = _g++; + this.__array[i] = array[i]; + } + } + } else { + if(array == null) { + array = []; + } + this.__array = array; + } + if(length > 0) { + this.set_length(length); + } + this.fixed = fixed; +}; +$hxClasses["openfl._Vector.FloatVector"] = openfl__$Vector_FloatVector; +openfl__$Vector_FloatVector.__name__ = "openfl._Vector.FloatVector"; +openfl__$Vector_FloatVector.__interfaces__ = [openfl__$Vector_IVector]; +openfl__$Vector_FloatVector.prototype = { + concat: function(a) { + if(a == null) { + return new openfl__$Vector_FloatVector(0,false,this.__array.slice()); + } else { + var other = a; + if(other.__array.length > 0) { + return new openfl__$Vector_FloatVector(0,false,this.__array.concat(other.__array)); + } else { + return new openfl__$Vector_FloatVector(0,false,this.__array.slice()); + } + } + } + ,copy: function() { + return new openfl__$Vector_FloatVector(0,this.fixed,this.__array.slice()); + } + ,filter: function(callback) { + var tmp = this.fixed; + var _g = []; + var _g1 = 0; + var _g2 = this.__array; + while(_g1 < _g2.length) { + var v = _g2[_g1]; + ++_g1; + if(callback(v)) { + _g.push(v); + } + } + return new openfl__$Vector_FloatVector(0,tmp,_g); + } + ,get: function(index) { + return this.__array[index]; + } + ,indexOf: function(x,from) { + if(from == null) { + from = 0; + } + var _g = from; + var _g1 = this.__array.length; + while(_g < _g1) { + var i = _g++; + if(this.__array[i] == x) { + return i; + } + } + return -1; + } + ,insertAt: function(index,element) { + if(!this.fixed || index < this.__array.length) { + this.__array.splice(index,0,element); + } + } + ,iterator: function() { + return new haxe_iterators_ArrayIterator(this.__array); + } + ,join: function(sep) { + if(sep == null) { + sep = ","; + } + return this.__array.join(sep); + } + ,lastIndexOf: function(x,from) { + var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from; + while(i >= 0) { + if(this.__array[i] == x) { + return i; + } + --i; + } + return -1; + } + ,pop: function() { + if(!this.fixed) { + return this.__array.pop(); + } else { + return null; + } + } + ,push: function(x) { + if(!this.fixed) { + return this.__array.push(x); + } else { + return this.__array.length; + } + } + ,removeAt: function(index) { + if(!this.fixed || index < this.__array.length) { + return this.__array.splice(index,1)[0]; + } + return 0; + } + ,reverse: function() { + this.__array.reverse(); + return this; + } + ,set: function(index,value) { + if(!this.fixed || index < this.__array.length) { + return this.__array[index] = value; + } else { + return value; + } + } + ,shift: function() { + if(!this.fixed) { + return this.__array.shift(); + } else { + return null; + } + } + ,slice: function(startIndex,endIndex) { + if(startIndex == null) { + startIndex = 0; + } + if(endIndex == null) { + endIndex = 16777215; + } + return new openfl__$Vector_FloatVector(0,false,this.__array.slice(startIndex,endIndex)); + } + ,sort: function(f) { + this.__array.sort(f); + } + ,splice: function(pos,len) { + return new openfl__$Vector_FloatVector(0,false,this.__array.splice(pos,len)); + } + ,toJSON: function() { + return this.__array; + } + ,toString: function() { + if(this.__array != null) { + return this.__array.toString(); + } else { + return null; + } + } + ,unshift: function(x) { + if(!this.fixed) { + this.__array.unshift(x); + } + } + ,get_length: function() { + return this.__array.length; + } + ,set_length: function(value) { + if(value != this.__array.length && !this.fixed) { + var currentLength = this.__array.length; + if(value < 0) { + value = 0; + } + if(value > currentLength) { + var _g = currentLength; + var _g1 = value; + while(_g < _g1) { + var i = _g++; + this.__array[i] = 0; + } + } else { + while(this.__array.length > value) this.__array.pop(); + } + } + return this.__array.length; + } + ,__class__: openfl__$Vector_FloatVector + ,__properties__: {set_length:"set_length",get_length:"get_length"} +}; +var openfl__$Vector_FunctionVector = function(length,fixed,array) { + if(fixed == null) { + fixed = false; + } + if(length == null) { + length = 0; + } + if(array == null) { + array = []; + } + this.__array = array; + if(length > 0) { + this.set_length(length); + } + this.fixed = fixed; +}; +$hxClasses["openfl._Vector.FunctionVector"] = openfl__$Vector_FunctionVector; +openfl__$Vector_FunctionVector.__name__ = "openfl._Vector.FunctionVector"; +openfl__$Vector_FunctionVector.__interfaces__ = [openfl__$Vector_IVector]; +openfl__$Vector_FunctionVector.prototype = { + concat: function(a) { + if(a == null) { + return new openfl__$Vector_FunctionVector(0,false,this.__array.slice()); + } else { + var other = a; + if(other.__array.length > 0) { + return new openfl__$Vector_FunctionVector(0,false,this.__array.concat(other.__array)); + } else { + return new openfl__$Vector_FunctionVector(0,false,this.__array.slice()); + } + } + } + ,copy: function() { + return new openfl__$Vector_FunctionVector(0,this.fixed,this.__array.slice()); + } + ,filter: function(callback) { + var tmp = this.fixed; + var _g = []; + var _g1 = 0; + var _g2 = this.__array; + while(_g1 < _g2.length) { + var v = _g2[_g1]; + ++_g1; + if(callback(v)) { + _g.push(v); + } + } + return new openfl__$Vector_FunctionVector(0,tmp,_g); + } + ,get: function(index) { + if(index >= this.__array.length) { + return null; + } else { + return this.__array[index]; + } + } + ,indexOf: function(x,from) { + if(from == null) { + from = 0; + } + var _g = from; + var _g1 = this.__array.length; + while(_g < _g1) { + var i = _g++; + if(this.__array[i] == x) { + return i; + } + } + return -1; + } + ,insertAt: function(index,element) { + if(!this.fixed || index < this.__array.length) { + this.__array.splice(index,0,element); + } + } + ,iterator: function() { + return new haxe_iterators_ArrayIterator(this.__array); + } + ,join: function(sep) { + if(sep == null) { + sep = ","; + } + return this.__array.join(sep); + } + ,lastIndexOf: function(x,from) { + var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from; + while(i >= 0) { + if(this.__array[i] == x) { + return i; + } + --i; + } + return -1; + } + ,pop: function() { + if(!this.fixed) { + return this.__array.pop(); + } else { + return null; + } + } + ,push: function(x) { + if(!this.fixed) { + return this.__array.push(x); + } else { + return this.__array.length; + } + } + ,removeAt: function(index) { + if(!this.fixed || index < this.__array.length) { + return this.__array.splice(index,1)[0]; + } + return null; + } + ,reverse: function() { + this.__array.reverse(); + return this; + } + ,set: function(index,value) { + if(!this.fixed || index < this.__array.length) { + return this.__array[index] = value; + } else { + return value; + } + } + ,shift: function() { + if(!this.fixed) { + return this.__array.shift(); + } else { + return null; + } + } + ,slice: function(startIndex,endIndex) { + if(startIndex == null) { + startIndex = 0; + } + if(endIndex == null) { + endIndex = 16777215; + } + return new openfl__$Vector_FunctionVector(0,false,this.__array.slice(startIndex,endIndex)); + } + ,sort: function(f) { + this.__array.sort(f); + } + ,splice: function(pos,len) { + return new openfl__$Vector_FunctionVector(0,false,this.__array.splice(pos,len)); + } + ,toJSON: function() { + return this.__array; + } + ,toString: function() { + if(this.__array != null) { + return this.__array.toString(); + } else { + return null; + } + } + ,unshift: function(x) { + if(!this.fixed) { + this.__array.unshift(x); + } + } + ,get_length: function() { + return this.__array.length; + } + ,set_length: function(value) { + if(!this.fixed) { + var currentLength = this.__array.length; + if(value < 0) { + value = 0; + } + if(value > currentLength) { + var _g = currentLength; + var _g1 = value; + while(_g < _g1) { + var i = _g++; + this.__array[i] = null; + } + } else { + while(this.__array.length > value) this.__array.pop(); + } + } + return this.__array.length; + } + ,__class__: openfl__$Vector_FunctionVector + ,__properties__: {set_length:"set_length",get_length:"get_length"} +}; +var openfl__$Vector_IntVector = function(length,fixed,array) { + if(fixed == null) { + fixed = false; + } + if(length == null) { + length = 0; + } + if(array == null) { + array = []; + } + this.__array = array; + if(length > 0) { + this.set_length(length); + } + this.fixed = fixed; +}; +$hxClasses["openfl._Vector.IntVector"] = openfl__$Vector_IntVector; +openfl__$Vector_IntVector.__name__ = "openfl._Vector.IntVector"; +openfl__$Vector_IntVector.__interfaces__ = [openfl__$Vector_IVector]; +openfl__$Vector_IntVector.prototype = { + concat: function(a) { + if(a == null) { + return new openfl__$Vector_IntVector(0,false,this.__array.slice()); + } else { + var other = a; + if(other.__array.length > 0) { + return new openfl__$Vector_IntVector(0,false,this.__array.concat(other.__array)); + } else { + return new openfl__$Vector_IntVector(0,false,this.__array.slice()); + } + } + } + ,copy: function() { + return new openfl__$Vector_IntVector(0,this.fixed,this.__array.slice()); + } + ,filter: function(callback) { + var tmp = this.fixed; + var _g = []; + var _g1 = 0; + var _g2 = this.__array; + while(_g1 < _g2.length) { + var v = _g2[_g1]; + ++_g1; + if(callback(v)) { + _g.push(v); + } + } + return new openfl__$Vector_IntVector(0,tmp,_g); + } + ,get: function(index) { + return this.__array[index]; + } + ,indexOf: function(x,from) { + if(from == null) { + from = 0; + } + var _g = from; + var _g1 = this.__array.length; + while(_g < _g1) { + var i = _g++; + if(this.__array[i] == x) { + return i; + } + } + return -1; + } + ,insertAt: function(index,element) { + if(!this.fixed || index < this.__array.length) { + this.__array.splice(index,0,element); + } + } + ,iterator: function() { + return new haxe_iterators_ArrayIterator(this.__array); + } + ,join: function(sep) { + if(sep == null) { + sep = ","; + } + return this.__array.join(sep); + } + ,lastIndexOf: function(x,from) { + var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from; + while(i >= 0) { + if(this.__array[i] == x) { + return i; + } + --i; + } + return -1; + } + ,pop: function() { + if(!this.fixed) { + return this.__array.pop(); + } else { + return null; + } + } + ,push: function(x) { + if(!this.fixed) { + return this.__array.push(x); + } else { + return this.__array.length; + } + } + ,removeAt: function(index) { + if(!this.fixed || index < this.__array.length) { + return this.__array.splice(index,1)[0]; + } + return 0; + } + ,reverse: function() { + this.__array.reverse(); + return this; + } + ,set: function(index,value) { + if(!this.fixed || index < this.__array.length) { + return this.__array[index] = value; + } else { + return value; + } + } + ,shift: function() { + if(!this.fixed) { + return this.__array.shift(); + } else { + return null; + } + } + ,slice: function(startIndex,endIndex) { + if(startIndex == null) { + startIndex = 0; + } + if(endIndex == null) { + endIndex = 16777215; + } + return new openfl__$Vector_IntVector(0,false,this.__array.slice(startIndex,endIndex)); + } + ,sort: function(f) { + this.__array.sort(f); + } + ,splice: function(pos,len) { + return new openfl__$Vector_IntVector(0,false,this.__array.splice(pos,len)); + } + ,toJSON: function() { + return this.__array; + } + ,toString: function() { + if(this.__array != null) { + return this.__array.toString(); + } else { + return null; + } + } + ,unshift: function(x) { + if(!this.fixed) { + this.__array.unshift(x); + } + } + ,get_length: function() { + return this.__array.length; + } + ,set_length: function(value) { + if(!this.fixed) { + var currentLength = this.__array.length; + if(value < 0) { + value = 0; + } + if(value > currentLength) { + var _g = currentLength; + var _g1 = value; + while(_g < _g1) { + var i = _g++; + this.__array[i] = 0; + } + } else { + while(this.__array.length > value) this.__array.pop(); + } + } + return this.__array.length; + } + ,__class__: openfl__$Vector_IntVector + ,__properties__: {set_length:"set_length",get_length:"get_length"} +}; +var openfl__$Vector_ObjectVector = function(length,fixed,array,forceCopy) { + if(forceCopy == null) { + forceCopy = false; + } + if(fixed == null) { + fixed = false; + } + if(length == null) { + length = 0; + } + if(forceCopy) { + this.__array = []; + if(array != null) { + var _g = 0; + var _g1 = array.length; + while(_g < _g1) { + var i = _g++; + this.__array[i] = array[i]; + } + } + } else { + if(array == null) { + array = []; + } + this.__array = array; + } + if(length > 0) { + this.set_length(length); + } + this.fixed = fixed; +}; +$hxClasses["openfl._Vector.ObjectVector"] = openfl__$Vector_ObjectVector; +openfl__$Vector_ObjectVector.__name__ = "openfl._Vector.ObjectVector"; +openfl__$Vector_ObjectVector.__interfaces__ = [openfl__$Vector_IVector]; +openfl__$Vector_ObjectVector.prototype = { + concat: function(a) { + if(a == null) { + return new openfl__$Vector_ObjectVector(0,false,this.__array.slice()); + } else { + var other = a; + if(other.__array.length > 0) { + return new openfl__$Vector_ObjectVector(0,false,this.__array.concat(other.__array)); + } else { + return new openfl__$Vector_ObjectVector(0,false,this.__array.slice()); + } + } + } + ,copy: function() { + return new openfl__$Vector_ObjectVector(0,this.fixed,this.__array.slice()); + } + ,filter: function(callback) { + var tmp = this.fixed; + var _g = []; + var _g1 = 0; + var _g2 = this.__array; + while(_g1 < _g2.length) { + var v = _g2[_g1]; + ++_g1; + if(callback(v)) { + _g.push(v); + } + } + return new openfl__$Vector_ObjectVector(0,tmp,_g); + } + ,get: function(index) { + return this.__array[index]; + } + ,indexOf: function(x,from) { + if(from == null) { + from = 0; + } + var _g = from; + var _g1 = this.__array.length; + while(_g < _g1) { + var i = _g++; + if(this.__array[i] == x) { + return i; + } + } + return -1; + } + ,insertAt: function(index,element) { + if(!this.fixed || index < this.__array.length) { + this.__array.splice(index,0,element); + } + } + ,iterator: function() { + return new haxe_iterators_ArrayIterator(this.__array); + } + ,join: function(sep) { + if(sep == null) { + sep = ","; + } + return this.__array.join(sep); + } + ,lastIndexOf: function(x,from) { + var i = from == null || from >= this.__array.length ? this.__array.length - 1 : from; + while(i >= 0) { + if(this.__array[i] == x) { + return i; + } + --i; + } + return -1; + } + ,pop: function() { + if(!this.fixed) { + return this.__array.pop(); + } else { + return null; + } + } + ,push: function(x) { + if(!this.fixed) { + return this.__array.push(x); + } else { + return this.__array.length; + } + } + ,removeAt: function(index) { + if(!this.fixed || index < this.__array.length) { + return this.__array.splice(index,1)[0]; + } + return null; + } + ,reverse: function() { + this.__array.reverse(); + return this; + } + ,set: function(index,value) { + if(!this.fixed || index < this.__array.length) { + return this.__array[index] = value; + } else { + return value; + } + } + ,shift: function() { + if(!this.fixed) { + return this.__array.shift(); + } else { + return null; + } + } + ,slice: function(startIndex,endIndex) { + if(startIndex == null) { + startIndex = 0; + } + if(endIndex == null) { + endIndex = 16777215; + } + return new openfl__$Vector_ObjectVector(0,false,this.__array.slice(startIndex,endIndex)); + } + ,sort: function(f) { + this.__array.sort(f); + } + ,splice: function(pos,len) { + return new openfl__$Vector_ObjectVector(0,false,this.__array.splice(pos,len)); + } + ,toJSON: function() { + return this.__array; + } + ,toString: function() { + if(this.__array != null) { + return this.__array.toString(); + } else { + return null; + } + } + ,unshift: function(x) { + if(!this.fixed) { + this.__array.unshift(x); + } + } + ,get_length: function() { + return this.__array.length; + } + ,set_length: function(value) { + if(!this.fixed) { + var currentLength = this.__array.length; + if(value < 0) { + value = 0; + } + if(value > currentLength) { + var _g = currentLength; + var _g1 = value; + while(_g < _g1) { + var i = _g++; + this.__array.push(null); + } + } else { + while(this.__array.length > value) this.__array.pop(); + } + } + return this.__array.length; + } + ,__class__: openfl__$Vector_ObjectVector + ,__properties__: {set_length:"set_length",get_length:"get_length"} +}; +var openfl_display_Application = function() { + lime_app_Application.call(this); + if(openfl_utils__$internal_Lib.application == null) { + openfl_utils__$internal_Lib.application = this; + } + if(openfl_utils__$internal_Lib.current == null) { + openfl_utils__$internal_Lib.current = new openfl_display_MovieClip(); + } + openfl_utils__$internal_Lib.current.__loaderInfo = openfl_display_LoaderInfo.create(null); + openfl_utils__$internal_Lib.current.__loaderInfo.content = openfl_utils__$internal_Lib.current; +}; +$hxClasses["openfl.display.Application"] = openfl_display_Application; +openfl_display_Application.__name__ = "openfl.display.Application"; +openfl_display_Application.__super__ = lime_app_Application; +openfl_display_Application.prototype = $extend(lime_app_Application.prototype,{ + createWindow: function(attributes) { + var $window = new openfl_display_Window(this,attributes); + this.__windows.push($window); + this.__windowByID.h[$window.id] = $window; + var _g = this; + var window1 = $window; + var tmp = function() { + _g.__onWindowClose(window1); + }; + $window.onClose.add(tmp,false,-10000); + if(this.__window == null) { + this.__window = $window; + $window.onActivate.add($bind(this,this.onWindowActivate)); + $window.onRenderContextLost.add($bind(this,this.onRenderContextLost)); + $window.onRenderContextRestored.add($bind(this,this.onRenderContextRestored)); + $window.onDeactivate.add($bind(this,this.onWindowDeactivate)); + $window.onDropFile.add($bind(this,this.onWindowDropFile)); + $window.onEnter.add($bind(this,this.onWindowEnter)); + $window.onExpose.add($bind(this,this.onWindowExpose)); + $window.onFocusIn.add($bind(this,this.onWindowFocusIn)); + $window.onFocusOut.add($bind(this,this.onWindowFocusOut)); + $window.onFullscreen.add($bind(this,this.onWindowFullscreen)); + $window.onKeyDown.add($bind(this,this.onKeyDown)); + $window.onKeyUp.add($bind(this,this.onKeyUp)); + $window.onLeave.add($bind(this,this.onWindowLeave)); + $window.onMinimize.add($bind(this,this.onWindowMinimize)); + $window.onMouseDown.add($bind(this,this.onMouseDown)); + $window.onMouseMove.add($bind(this,this.onMouseMove)); + $window.onMouseMoveRelative.add($bind(this,this.onMouseMoveRelative)); + $window.onMouseUp.add($bind(this,this.onMouseUp)); + $window.onMouseWheel.add($bind(this,this.onMouseWheel)); + $window.onMove.add($bind(this,this.onWindowMove)); + $window.onRender.add($bind(this,this.render)); + $window.onResize.add($bind(this,this.onWindowResize)); + $window.onRestore.add($bind(this,this.onWindowRestore)); + $window.onTextEdit.add($bind(this,this.onTextEdit)); + $window.onTextInput.add($bind(this,this.onTextInput)); + this.onWindowCreate(); + } + this.onCreateWindow.dispatch($window); + return $window; + } + ,exec: function() { + return lime_app_Application.prototype.exec.call(this); + } + ,__checkForAllWindowsClosed: function() { + if(this.__windows.length > 0) { + return; + } + lime_app_Application.prototype.__checkForAllWindowsClosed.call(this); + } + ,__onModuleExit: function(code) { + if(this.onExit.canceled) { + return; + } + if(openfl_utils__$internal_Lib.application == this) { + openfl_utils__$internal_Lib.application = null; + } + lime_app_Application.prototype.__onModuleExit.call(this,code); + } + ,__class__: openfl_display_Application +}); +var openfl_display_Bitmap = function(bitmapData,pixelSnapping,smoothing) { + if(smoothing == null) { + smoothing = false; + } + openfl_display_DisplayObject.call(this); + this.__drawableType = 2; + this.__bitmapData = bitmapData; + this.pixelSnapping = pixelSnapping; + this.smoothing = smoothing; + if(pixelSnapping == null) { + this.pixelSnapping = 1; + } +}; +$hxClasses["openfl.display.Bitmap"] = openfl_display_Bitmap; +openfl_display_Bitmap.__name__ = "openfl.display.Bitmap"; +openfl_display_Bitmap.__super__ = openfl_display_DisplayObject; +openfl_display_Bitmap.prototype = $extend(openfl_display_DisplayObject.prototype,{ + __enterFrame: function(deltaTime) { + if(this.__bitmapData != null && this.__bitmapData.image != null && this.__bitmapData.image.version != this.__imageVersion) { + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + } + ,__getBounds: function(rect,matrix) { + var bounds = openfl_geom_Rectangle.__pool.get(); + if(this.__bitmapData != null) { + bounds.setTo(0,0,this.__bitmapData.width,this.__bitmapData.height); + } else { + bounds.setTo(0,0,0,0); + } + bounds.__transform(bounds,matrix); + rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height); + openfl_geom_Rectangle.__pool.release(bounds); + } + ,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { + if(!hitObject.get_visible() || this.__isMask || this.__bitmapData == null) { + return false; + } + if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) { + return false; + } + this.__getRenderTransform(); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx)); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x)); + if(px > 0 && py > 0 && px <= this.__bitmapData.width && py <= this.__bitmapData.height) { + if(this.__scrollRect != null && !this.__scrollRect.contains(px,py)) { + return false; + } + if(stack != null && !interactiveOnly) { + stack.push(hitObject); + } + return true; + } + return false; + } + ,__hitTestMask: function(x,y) { + if(this.__bitmapData == null) { + return false; + } + this.__getRenderTransform(); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx)); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x)); + if(px > 0 && py > 0 && px <= this.__bitmapData.width && py <= this.__bitmapData.height) { + return true; + } + return false; + } + ,get_bitmapData: function() { + return this.__bitmapData; + } + ,set_bitmapData: function(value) { + this.__bitmapData = value; + this.smoothing = false; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + var tmp = this.__filters != null; + this.__imageVersion = -1; + return this.__bitmapData; + } + ,set_height: function(value) { + if(this.__bitmapData != null) { + this.set_scaleY(value / this.__bitmapData.height); + } else { + this.set_scaleY(0); + } + return value; + } + ,set_width: function(value) { + if(this.__bitmapData != null) { + this.set_scaleX(value / this.__bitmapData.width); + } else { + this.set_scaleX(0); + } + return value; + } + ,__class__: openfl_display_Bitmap + ,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{set_bitmapData:"set_bitmapData",get_bitmapData:"get_bitmapData"}) +}); +var openfl_display_BitmapData = function(width,height,transparent,fillColor) { + if(fillColor == null) { + fillColor = -1; + } + if(transparent == null) { + transparent = true; + } + this.__drawableType = 0; + this.transparent = transparent; + if(width == null) { + width = 0; + } + if(height == null) { + height = 0; + } + if(width < 0) { + width = 0; + } + if(height < 0) { + height = 0; + } + this.width = width; + this.height = height; + this.rect = new openfl_geom_Rectangle(0,0,width,height); + this.__textureWidth = width; + this.__textureHeight = height; + if(width > 0 && height > 0) { + if(transparent) { + if((fillColor & -16777216) == 0) { + fillColor = 0; + } + } else { + fillColor = -16777216 | fillColor & 16777215; + } + fillColor = fillColor << 8 | fillColor >>> 24 & 255; + this.image = new lime_graphics_Image(null,0,0,width,height,fillColor); + this.image.set_transparent(transparent); + this.__isValid = true; + this.readable = true; + } + this.__renderTransform = new openfl_geom_Matrix(); + this.__worldAlpha = 1; + this.__worldTransform = new openfl_geom_Matrix(); + this.__worldColorTransform = new openfl_geom_ColorTransform(); + this.__renderable = true; + this.__asset = false; +}; +$hxClasses["openfl.display.BitmapData"] = openfl_display_BitmapData; +openfl_display_BitmapData.__name__ = "openfl.display.BitmapData"; +openfl_display_BitmapData.__interfaces__ = [openfl_display_IBitmapDrawable]; +openfl_display_BitmapData.fromBase64 = function(base64,type) { + return null; +}; +openfl_display_BitmapData.fromBytes = function(bytes,rawAlpha) { + return null; +}; +openfl_display_BitmapData.fromCanvas = function(canvas,transparent) { + if(transparent == null) { + transparent = true; + } + if(canvas == null) { + return null; + } + var bitmapData = new openfl_display_BitmapData(0,0,transparent,0); + bitmapData.__fromImage(lime_graphics_Image.fromCanvas(canvas)); + bitmapData.image.set_transparent(transparent); + return bitmapData; +}; +openfl_display_BitmapData.fromFile = function(path) { + return null; +}; +openfl_display_BitmapData.fromImage = function(image,transparent) { + if(transparent == null) { + transparent = true; + } + if(image == null || image.buffer == null) { + return null; + } + var bitmapData = new openfl_display_BitmapData(0,0,transparent,0); + bitmapData.__fromImage(image); + bitmapData.image.set_transparent(transparent); + if(bitmapData.image != null) { + return bitmapData; + } else { + return null; + } +}; +openfl_display_BitmapData.fromTexture = function(texture) { + if(texture == null) { + return null; + } + var bitmapData = new openfl_display_BitmapData(texture.__width,texture.__height,true,0); + bitmapData.readable = false; + bitmapData.__texture = texture; + bitmapData.__textureContext = texture.__textureContext; + bitmapData.image = null; + return bitmapData; +}; +openfl_display_BitmapData.loadFromBase64 = function(base64,type) { + return lime_graphics_Image.loadFromBase64(base64,type).then(function(image) { + return lime_app_Future.withValue(openfl_display_BitmapData.fromImage(image)); + }); +}; +openfl_display_BitmapData.loadFromBytes = function(bytes,rawAlpha) { + return lime_graphics_Image.loadFromBytes(openfl_utils_ByteArray.toBytes(bytes)).then(function(image) { + var bitmapData = openfl_display_BitmapData.fromImage(image); + if(rawAlpha != null) { + bitmapData.__applyAlpha(rawAlpha); + } + return lime_app_Future.withValue(bitmapData); + }); +}; +openfl_display_BitmapData.loadFromFile = function(path) { + return lime_graphics_Image.loadFromFile(path).then(function(image) { + return lime_app_Future.withValue(openfl_display_BitmapData.fromImage(image)); + }); +}; +openfl_display_BitmapData.prototype = { + applyFilter: function(sourceBitmapData,sourceRect,destPoint,filter) { + if(!this.readable || sourceBitmapData == null || !sourceBitmapData.readable) { + return; + } + var needSecondBitmapData = filter.__needSecondBitmapData; + var needCopyOfOriginal = filter.__preserveObject; + var bitmapData2 = null; + var bitmapData3 = null; + if(needSecondBitmapData) { + bitmapData2 = new openfl_display_BitmapData(this.width,this.height,true,0); + } else { + bitmapData2 = this; + } + if(needCopyOfOriginal) { + bitmapData3 = new openfl_display_BitmapData(this.width,this.height,true,0); + } + if(filter.__preserveObject) { + bitmapData3.copyPixels(this,this.rect,destPoint); + } + var lastBitmap = filter.__applyFilter(bitmapData2,this,sourceRect,destPoint); + if(filter.__preserveObject) { + lastBitmap.draw(bitmapData3,null,null); + } + if(needSecondBitmapData && lastBitmap == bitmapData2) { + bitmapData2.image.version = this.image.version; + this.image = bitmapData2.image; + } + this.image.dirty = true; + this.image.version++; + } + ,clone: function() { + var bitmapData; + if(!this.__isValid) { + bitmapData = new openfl_display_BitmapData(this.width,this.height,this.transparent,0); + } else if(!this.readable && this.image == null) { + bitmapData = new openfl_display_BitmapData(0,0,this.transparent,0); + bitmapData.width = this.width; + bitmapData.height = this.height; + bitmapData.__textureWidth = this.__textureWidth; + bitmapData.__textureHeight = this.__textureHeight; + bitmapData.rect.copyFrom(this.rect); + bitmapData.__framebuffer = this.__framebuffer; + bitmapData.__framebufferContext = this.__framebufferContext; + bitmapData.__texture = this.__texture; + bitmapData.__textureContext = this.__textureContext; + bitmapData.__isValid = true; + } else { + bitmapData = openfl_display_BitmapData.fromImage(this.image.clone(),this.transparent); + } + bitmapData.__worldTransform.copyFrom(this.__worldTransform); + bitmapData.__renderTransform.copyFrom(this.__renderTransform); + return bitmapData; + } + ,colorTransform: function(rect,colorTransform) { + if(!this.readable) { + return; + } + this.image.colorTransform(rect.__toLimeRectangle(),colorTransform.__toLimeColorMatrix()); + } + ,compare: function(otherBitmapData) { + if(otherBitmapData == this) { + return 0; + } else if(otherBitmapData == null) { + return -1; + } else if(this.readable == false || otherBitmapData.readable == false) { + return -2; + } else if(this.width != otherBitmapData.width) { + return -3; + } else if(this.height != otherBitmapData.height) { + return -4; + } + if(this.image != null && otherBitmapData.image != null && this.image.get_format() == otherBitmapData.image.get_format()) { + var bytes = this.image.get_data(); + var otherBytes = otherBitmapData.image.get_data(); + var equal = true; + var _g = 0; + var _g1 = bytes.length; + while(_g < _g1) { + var i = _g++; + if(bytes[i] != otherBytes[i]) { + equal = false; + break; + } + } + if(equal) { + return 0; + } + } + var bitmapData = null; + var foundDifference = false; + var pixel; + var otherPixel; + var comparePixel; + var _g = 0; + var _g1 = this.height; + while(_g < _g1) { + var y = _g++; + var _g2 = 0; + var _g3 = this.width; + while(_g2 < _g3) { + var x = _g2++; + foundDifference = false; + pixel = this.getPixel32(x,y); + otherPixel = otherBitmapData.getPixel32(x,y); + comparePixel = 0; + if(pixel != otherPixel) { + var r = (pixel >>> 16 & 255) - (otherPixel >>> 16 & 255); + var g = (pixel >>> 8 & 255) - (otherPixel >>> 8 & 255); + var b = (pixel & 255) - (otherPixel & 255); + if(r < 0) { + r *= -1; + } + if(g < 0) { + g *= -1; + } + if(b < 0) { + b *= -1; + } + if(r == 0 && g == 0 && b == 0) { + var a = (pixel >>> 24 & 255) - (otherPixel >>> 24 & 255); + if(a != 0) { + comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | 16711680 | (comparePixel >>> 8 & 255 & 255) << 8 | comparePixel & 255 & 255; + comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | 65280 | comparePixel & 255 & 255; + comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | 255; + comparePixel = (a & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | comparePixel & 255 & 255; + foundDifference = true; + } + } else { + comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (r & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | comparePixel & 255 & 255; + comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | (g & 255) << 8 | comparePixel & 255 & 255; + comparePixel = (comparePixel >>> 24 & 255 & 255) << 24 | (comparePixel >>> 16 & 255 & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | b & 255; + comparePixel = -16777216 | (comparePixel >>> 16 & 255 & 255) << 16 | (comparePixel >>> 8 & 255 & 255) << 8 | comparePixel & 255 & 255; + foundDifference = true; + } + } + if(foundDifference) { + if(bitmapData == null) { + bitmapData = new openfl_display_BitmapData(this.width,this.height,this.transparent || otherBitmapData.transparent,0); + } + bitmapData.setPixel32(x,y,comparePixel); + } + } + } + if(bitmapData == null) { + return 0; + } + return bitmapData; + } + ,copyChannel: function(sourceBitmapData,sourceRect,destPoint,sourceChannel,destChannel) { + if(!this.readable) { + return; + } + var sourceChannel1; + switch(sourceChannel) { + case 1: + sourceChannel1 = lime_graphics_ImageChannel.RED; + break; + case 2: + sourceChannel1 = lime_graphics_ImageChannel.GREEN; + break; + case 4: + sourceChannel1 = lime_graphics_ImageChannel.BLUE; + break; + case 8: + sourceChannel1 = lime_graphics_ImageChannel.ALPHA; + break; + default: + return; + } + var destChannel1; + switch(destChannel) { + case 1: + destChannel1 = lime_graphics_ImageChannel.RED; + break; + case 2: + destChannel1 = lime_graphics_ImageChannel.GREEN; + break; + case 4: + destChannel1 = lime_graphics_ImageChannel.BLUE; + break; + case 8: + destChannel1 = lime_graphics_ImageChannel.ALPHA; + break; + default: + return; + } + this.image.copyChannel(sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),sourceChannel1,destChannel1); + } + ,copyPixels: function(sourceBitmapData,sourceRect,destPoint,alphaBitmapData,alphaPoint,mergeAlpha) { + if(mergeAlpha == null) { + mergeAlpha = false; + } + if(!this.readable || sourceBitmapData == null) { + return; + } + if(alphaPoint != null) { + openfl_display_BitmapData.__tempVector.x = alphaPoint.x; + openfl_display_BitmapData.__tempVector.y = alphaPoint.y; + } + this.image.copyPixels(sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),alphaBitmapData != null ? alphaBitmapData.image : null,alphaPoint != null ? openfl_display_BitmapData.__tempVector : null,mergeAlpha); + } + ,dispose: function() { + if(this.image != null && this.image.type == lime_graphics_ImageType.CANVAS && !this.__asset) { + var canvas = this.image.buffer.__srcCanvas; + var context = this.image.buffer.__srcContext; + if(canvas != null) { + canvas.width = 0; + canvas.height = 0; + canvas = null; + } + if(context != null) { + context.clearRect(0,0,0,0); + context = null; + } + } + this.image = null; + this.width = 0; + this.height = 0; + this.rect = null; + this.__isValid = false; + this.readable = false; + this.__surface = null; + this.__vertexBuffer = null; + this.__framebuffer = null; + this.__framebufferContext = null; + this.__texture = null; + this.__textureContext = null; + } + ,disposeImage: function() { + this.readable = false; + } + ,draw: function(source,matrix,colorTransform,blendMode,clipRect,smoothing) { + if(smoothing == null) { + smoothing = false; + } + if(source == null) { + return; + } + var wasVisible = true; + var sourceAsDisplayObject = null; + if(((source) instanceof openfl_display_DisplayObject)) { + sourceAsDisplayObject = js_Boot.__cast(source , openfl_display_DisplayObject); + if(!sourceAsDisplayObject.get_visible()) { + wasVisible = false; + sourceAsDisplayObject.set_visible(true); + } + } + source.__update(false,true); + var transform = openfl_geom_Matrix.__pool.get(); + transform.copyFrom(source.__renderTransform); + transform.invert(); + if(matrix != null) { + transform.concat(matrix); + } + var clipMatrix = null; + if(clipRect != null) { + clipMatrix = openfl_geom_Matrix.__pool.get(); + clipMatrix.copyFrom(transform); + clipMatrix.invert(); + } + var _colorTransform = new openfl_geom_ColorTransform(); + _colorTransform.__copyFrom(source.__worldColorTransform); + _colorTransform.__invert(); + if(!this.readable && openfl_Lib.get_current().stage.context3D != null) { + if(this.__textureContext == null) { + this.__textureContext = lime_app_Application.current.__window.context; + } + if(colorTransform != null) { + _colorTransform.__combine(colorTransform); + } + var renderer = new openfl_display_OpenGLRenderer(openfl_Lib.get_current().stage.context3D,this); + renderer.__allowSmoothing = smoothing; + renderer.__pixelRatio = openfl_Lib.get_current().stage.window.__scale; + renderer.__overrideBlendMode = blendMode; + renderer.__worldTransform = transform; + renderer.__worldAlpha = 1 / source.__worldAlpha; + renderer.__worldColorTransform = _colorTransform; + renderer.__resize(this.width,this.height); + if(clipRect != null) { + renderer.__pushMaskRect(clipRect,clipMatrix); + } + this.__drawGL(source,renderer); + if(clipRect != null) { + renderer.__popMaskRect(); + openfl_geom_Matrix.__pool.release(clipMatrix); + } + } else { + if(colorTransform != null) { + var bounds = openfl_geom_Rectangle.__pool.get(); + var boundsMatrix = openfl_geom_Matrix.__pool.get(); + source.__getBounds(bounds,boundsMatrix); + var width = Math.ceil(bounds.width); + var height = Math.ceil(bounds.height); + boundsMatrix.tx = -bounds.x; + boundsMatrix.ty = -bounds.y; + var copy = new openfl_display_BitmapData(width,height,true,0); + copy.draw(source,boundsMatrix); + copy.colorTransform(copy.rect,colorTransform); + copy.__renderTransform.identity(); + copy.__renderTransform.tx = bounds.x; + copy.__renderTransform.ty = bounds.y; + copy.__renderTransform.concat(source.__renderTransform); + copy.__worldAlpha = source.__worldAlpha; + copy.__worldColorTransform.__copyFrom(source.__worldColorTransform); + source = copy; + openfl_geom_Rectangle.__pool.release(bounds); + openfl_geom_Matrix.__pool.release(boundsMatrix); + } + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this.image); + var renderer = new openfl_display_CanvasRenderer(this.image.buffer.__srcContext); + renderer.__allowSmoothing = smoothing; + renderer.__overrideBlendMode = blendMode; + renderer.__worldTransform = transform; + renderer.__worldAlpha = 1 / source.__worldAlpha; + renderer.__worldColorTransform = _colorTransform; + if(clipRect != null) { + renderer.__pushMaskRect(clipRect,clipMatrix); + } + this.__drawCanvas(source,renderer); + if(clipRect != null) { + renderer.__popMaskRect(); + openfl_geom_Matrix.__pool.release(clipMatrix); + } + } + openfl_geom_Matrix.__pool.release(transform); + if(sourceAsDisplayObject != null && !wasVisible) { + sourceAsDisplayObject.set_visible(false); + } + } + ,drawWithQuality: function(source,matrix,colorTransform,blendMode,clipRect,smoothing,quality) { + if(smoothing == null) { + smoothing = false; + } + this.draw(source,matrix,colorTransform,blendMode,clipRect,quality != 2 && smoothing); + } + ,encode: function(rect,compressor,byteArray) { + if(!this.readable || rect == null) { + byteArray = null; + return byteArray; + } + if(byteArray == null) { + byteArray = new openfl_utils_ByteArrayData(0); + } + var image = this.image; + if(!rect.equals(this.rect)) { + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.tx = Math.round(-rect.x); + matrix.ty = Math.round(-rect.y); + var bitmapData = new openfl_display_BitmapData(Math.ceil(rect.width),Math.ceil(rect.height),true,0); + bitmapData.draw(this,matrix); + image = bitmapData.image; + openfl_geom_Matrix.__pool.release(matrix); + } + if(((compressor) instanceof openfl_display_PNGEncoderOptions)) { + byteArray.writeBytes(openfl_utils_ByteArray.fromBytes(image.encode(lime_graphics_ImageFileFormat.PNG)),0,0); + return byteArray; + } else if(((compressor) instanceof openfl_display_JPEGEncoderOptions)) { + byteArray.writeBytes(openfl_utils_ByteArray.fromBytes(image.encode(lime_graphics_ImageFileFormat.JPEG,(js_Boot.__cast(compressor , openfl_display_JPEGEncoderOptions)).quality)),0,0); + return byteArray; + } + byteArray = null; + return byteArray; + } + ,fillRect: function(rect,color) { + this.__fillRect(rect,color,true); + } + ,floodFill: function(x,y,color) { + if(!this.readable) { + return; + } + this.image.floodFill(x,y,color,1); + } + ,generateFilterRect: function(sourceRect,filter) { + return sourceRect.clone(); + } + ,getIndexBuffer: function(context,scale9Grid) { + var gl = context.gl; + if(this.__indexBuffer == null || this.__indexBufferContext != context.__context || scale9Grid != null && this.__indexBufferGrid == null || this.__indexBufferGrid != null && !this.__indexBufferGrid.equals(scale9Grid)) { + this.__indexBufferContext = context.__context; + this.__indexBuffer = null; + if(scale9Grid != null) { + if(this.__indexBufferGrid == null) { + this.__indexBufferGrid = new openfl_geom_Rectangle(); + } + this.__indexBufferGrid.copyFrom(scale9Grid); + var centerX = scale9Grid.width; + var centerY = scale9Grid.height; + if(centerX != 0 && centerY != 0) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__indexBufferData = new Uint16Array(54); + this.__indexBufferData[0] = 0; + this.__indexBufferData[1] = 1; + this.__indexBufferData[2] = 2; + this.__indexBufferData[3] = 2; + this.__indexBufferData[4] = 1; + this.__indexBufferData[5] = 3; + this.__indexBufferData[6] = 4; + this.__indexBufferData[7] = 0; + this.__indexBufferData[8] = 5; + this.__indexBufferData[9] = 5; + this.__indexBufferData[10] = 0; + this.__indexBufferData[11] = 2; + this.__indexBufferData[12] = 6; + this.__indexBufferData[13] = 4; + this.__indexBufferData[14] = 7; + this.__indexBufferData[15] = 7; + this.__indexBufferData[16] = 4; + this.__indexBufferData[17] = 5; + this.__indexBufferData[18] = 8; + this.__indexBufferData[19] = 9; + this.__indexBufferData[20] = 0; + this.__indexBufferData[21] = 0; + this.__indexBufferData[22] = 9; + this.__indexBufferData[23] = 1; + this.__indexBufferData[24] = 10; + this.__indexBufferData[25] = 8; + this.__indexBufferData[26] = 4; + this.__indexBufferData[27] = 4; + this.__indexBufferData[28] = 8; + this.__indexBufferData[29] = 0; + this.__indexBufferData[30] = 11; + this.__indexBufferData[31] = 10; + this.__indexBufferData[32] = 6; + this.__indexBufferData[33] = 6; + this.__indexBufferData[34] = 10; + this.__indexBufferData[35] = 4; + this.__indexBufferData[36] = 12; + this.__indexBufferData[37] = 13; + this.__indexBufferData[38] = 8; + this.__indexBufferData[39] = 8; + this.__indexBufferData[40] = 13; + this.__indexBufferData[41] = 9; + this.__indexBufferData[42] = 14; + this.__indexBufferData[43] = 12; + this.__indexBufferData[44] = 10; + this.__indexBufferData[45] = 10; + this.__indexBufferData[46] = 12; + this.__indexBufferData[47] = 8; + this.__indexBufferData[48] = 15; + this.__indexBufferData[49] = 14; + this.__indexBufferData[50] = 11; + this.__indexBufferData[51] = 11; + this.__indexBufferData[52] = 14; + this.__indexBufferData[53] = 10; + this.__indexBuffer = context.createIndexBuffer(54); + } else if(centerX == 0 && centerY != 0) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__indexBufferData = new Uint16Array(18); + this.__indexBufferData[0] = 0; + this.__indexBufferData[1] = 1; + this.__indexBufferData[2] = 2; + this.__indexBufferData[3] = 2; + this.__indexBufferData[4] = 1; + this.__indexBufferData[5] = 3; + this.__indexBufferData[6] = 4; + this.__indexBufferData[7] = 5; + this.__indexBufferData[8] = 0; + this.__indexBufferData[9] = 0; + this.__indexBufferData[10] = 5; + this.__indexBufferData[11] = 1; + this.__indexBufferData[12] = 6; + this.__indexBufferData[13] = 7; + this.__indexBufferData[14] = 4; + this.__indexBufferData[15] = 4; + this.__indexBufferData[16] = 7; + this.__indexBufferData[17] = 5; + this.__indexBuffer = context.createIndexBuffer(18); + } else if(centerX != 0 && centerY == 0) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__indexBufferData = new Uint16Array(18); + this.__indexBufferData[0] = 0; + this.__indexBufferData[1] = 1; + this.__indexBufferData[2] = 2; + this.__indexBufferData[3] = 2; + this.__indexBufferData[4] = 1; + this.__indexBufferData[5] = 3; + this.__indexBufferData[6] = 4; + this.__indexBufferData[7] = 0; + this.__indexBufferData[8] = 5; + this.__indexBufferData[9] = 5; + this.__indexBufferData[10] = 0; + this.__indexBufferData[11] = 2; + this.__indexBufferData[12] = 6; + this.__indexBufferData[13] = 4; + this.__indexBufferData[14] = 7; + this.__indexBufferData[15] = 7; + this.__indexBufferData[16] = 4; + this.__indexBufferData[17] = 5; + this.__indexBuffer = context.createIndexBuffer(18); + } + } else { + this.__indexBufferGrid = null; + } + if(this.__indexBuffer == null) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__indexBufferData = new Uint16Array(6); + this.__indexBufferData[0] = 0; + this.__indexBufferData[1] = 1; + this.__indexBufferData[2] = 2; + this.__indexBufferData[3] = 2; + this.__indexBufferData[4] = 1; + this.__indexBufferData[5] = 3; + this.__indexBuffer = context.createIndexBuffer(6); + } + this.__indexBuffer.uploadFromTypedArray(this.__indexBufferData); + } + return this.__indexBuffer; + } + ,getVertexBuffer: function(context,scale9Grid,targetObject) { + var gl = context.gl; + if(this.__vertexBuffer == null || this.__vertexBufferContext != context.__context || scale9Grid != null && this.__vertexBufferGrid == null || this.__vertexBufferGrid != null && !this.__vertexBufferGrid.equals(scale9Grid) || targetObject != null && (this.__vertexBufferWidth != targetObject.get_width() || this.__vertexBufferHeight != targetObject.get_height() || this.__vertexBufferScaleX != targetObject.get_scaleX() || this.__vertexBufferScaleY != targetObject.get_scaleY())) { + this.__uvRect = new openfl_geom_Rectangle(0,0,this.width,this.height); + var uvWidth = 1; + var uvHeight = 1; + this.__vertexBufferContext = context.__context; + this.__vertexBuffer = null; + if(targetObject != null) { + this.__vertexBufferWidth = targetObject.get_width(); + this.__vertexBufferHeight = targetObject.get_height(); + this.__vertexBufferScaleX = targetObject.get_scaleX(); + this.__vertexBufferScaleY = targetObject.get_scaleY(); + } + if(scale9Grid != null && targetObject != null) { + if(this.__vertexBufferGrid == null) { + this.__vertexBufferGrid = new openfl_geom_Rectangle(); + } + this.__vertexBufferGrid.copyFrom(scale9Grid); + this.__vertexBufferWidth = targetObject.get_width(); + this.__vertexBufferHeight = targetObject.get_height(); + this.__vertexBufferScaleX = targetObject.get_scaleX(); + this.__vertexBufferScaleY = targetObject.get_scaleY(); + var centerX = scale9Grid.width; + var centerY = scale9Grid.height; + if(centerX != 0 && centerY != 0) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__vertexBufferData = new Float32Array(224); + var left = scale9Grid.x; + var top = scale9Grid.y; + var right = this.width - centerX - left; + var bottom = this.height - centerY - top; + var uvLeft = left / this.width; + var uvTop = top / this.height; + var uvCenterX = centerX / this.width; + var uvCenterY = centerY / this.height; + var uvRight = right / this.width; + var uvBottom = bottom / this.height; + var renderedLeft = left / targetObject.get_scaleX(); + var renderedTop = top / targetObject.get_scaleY(); + var renderedRight = right / targetObject.get_scaleX(); + var renderedBottom = bottom / targetObject.get_scaleY(); + var renderedCenterX = targetObject.get_width() / targetObject.get_scaleX() - renderedLeft - renderedRight; + var renderedCenterY = targetObject.get_height() / targetObject.get_scaleY() - renderedTop - renderedBottom; + this.__vertexBufferData[0] = renderedLeft; + this.__vertexBufferData[1] = renderedTop; + this.__vertexBufferData[3] = uvWidth * uvLeft; + this.__vertexBufferData[4] = uvHeight * uvTop; + this.__vertexBufferData[15] = renderedTop; + this.__vertexBufferData[18] = uvHeight * uvTop; + this.__vertexBufferData[28] = renderedLeft; + this.__vertexBufferData[31] = uvWidth * uvLeft; + this.__vertexBufferData[56] = renderedLeft + renderedCenterX; + this.__vertexBufferData[57] = renderedTop; + this.__vertexBufferData[59] = uvWidth * (uvLeft + uvCenterX); + this.__vertexBufferData[60] = uvHeight * uvTop; + this.__vertexBufferData[70] = renderedLeft + renderedCenterX; + this.__vertexBufferData[73] = uvWidth * (uvLeft + uvCenterX); + this.__vertexBufferData[84] = this.width; + this.__vertexBufferData[85] = renderedTop; + this.__vertexBufferData[87] = uvWidth; + this.__vertexBufferData[88] = uvHeight * uvTop; + this.__vertexBufferData[98] = this.width; + this.__vertexBufferData[101] = uvWidth; + this.__vertexBufferData[112] = renderedLeft; + this.__vertexBufferData[113] = renderedTop + renderedCenterY; + this.__vertexBufferData[115] = uvWidth * uvLeft; + this.__vertexBufferData[116] = uvHeight * (uvTop + uvCenterY); + this.__vertexBufferData[127] = renderedTop + renderedCenterY; + this.__vertexBufferData[130] = uvHeight * (uvTop + uvCenterY); + this.__vertexBufferData[140] = renderedLeft + renderedCenterX; + this.__vertexBufferData[141] = renderedTop + renderedCenterY; + this.__vertexBufferData[143] = uvWidth * (uvLeft + uvCenterX); + this.__vertexBufferData[144] = uvHeight * (uvTop + uvCenterY); + this.__vertexBufferData[154] = this.width; + this.__vertexBufferData[155] = renderedTop + renderedCenterY; + this.__vertexBufferData[157] = uvWidth; + this.__vertexBufferData[158] = uvHeight * (uvTop + uvCenterY); + this.__vertexBufferData[168] = renderedLeft; + this.__vertexBufferData[169] = this.height; + this.__vertexBufferData[171] = uvWidth * uvLeft; + this.__vertexBufferData[172] = uvHeight; + this.__vertexBufferData[183] = this.height; + this.__vertexBufferData[186] = uvHeight; + this.__vertexBufferData[196] = renderedLeft + renderedCenterX; + this.__vertexBufferData[197] = this.height; + this.__vertexBufferData[199] = uvWidth * (uvLeft + uvCenterX); + this.__vertexBufferData[200] = uvHeight; + this.__vertexBufferData[210] = this.width; + this.__vertexBufferData[211] = this.height; + this.__vertexBufferData[213] = uvWidth; + this.__vertexBufferData[214] = uvHeight; + this.__vertexBuffer = context.createVertexBuffer(16,14); + } else if(centerX == 0 && centerY != 0) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__vertexBufferData = new Float32Array(112); + var top = scale9Grid.y; + var bottom = this.height - centerY - top; + var uvTop = top / this.height; + var uvCenterY = centerY / this.height; + var uvBottom = bottom / this.height; + var renderedTop = top / targetObject.get_scaleY(); + var renderedBottom = bottom / targetObject.get_scaleY(); + var renderedCenterY = targetObject.get_height() / targetObject.get_scaleY() - renderedTop - renderedBottom; + var renderedWidth = targetObject.get_width() / targetObject.get_scaleX(); + this.__vertexBufferData[0] = renderedWidth; + this.__vertexBufferData[1] = renderedTop; + this.__vertexBufferData[3] = uvWidth; + this.__vertexBufferData[4] = uvHeight * uvTop; + this.__vertexBufferData[15] = renderedTop; + this.__vertexBufferData[18] = uvHeight * uvTop; + this.__vertexBufferData[28] = renderedWidth; + this.__vertexBufferData[31] = uvWidth; + this.__vertexBufferData[56] = renderedWidth; + this.__vertexBufferData[57] = renderedTop + renderedCenterY; + this.__vertexBufferData[59] = uvWidth; + this.__vertexBufferData[60] = uvHeight * (uvTop + uvCenterY); + this.__vertexBufferData[71] = renderedTop + renderedCenterY; + this.__vertexBufferData[74] = uvHeight * (uvTop + uvCenterY); + this.__vertexBufferData[84] = renderedWidth; + this.__vertexBufferData[85] = this.height; + this.__vertexBufferData[87] = uvWidth; + this.__vertexBufferData[88] = uvHeight; + this.__vertexBufferData[99] = this.height; + this.__vertexBufferData[102] = uvHeight; + this.__vertexBuffer = context.createVertexBuffer(8,14); + } else if(centerY == 0 && centerX != 0) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__vertexBufferData = new Float32Array(112); + var left = scale9Grid.x; + var right = this.width - centerX - left; + var uvLeft = left / this.width; + var uvCenterX = centerX / this.width; + var uvRight = right / this.width; + var renderedLeft = left / targetObject.get_scaleX(); + var renderedRight = right / targetObject.get_scaleX(); + var renderedCenterX = targetObject.get_width() / targetObject.get_scaleX() - renderedLeft - renderedRight; + var renderedHeight = targetObject.get_height() / targetObject.get_scaleY(); + this.__vertexBufferData[0] = renderedLeft; + this.__vertexBufferData[1] = renderedHeight; + this.__vertexBufferData[3] = uvWidth * uvLeft; + this.__vertexBufferData[4] = uvHeight; + this.__vertexBufferData[15] = renderedHeight; + this.__vertexBufferData[18] = uvHeight; + this.__vertexBufferData[28] = renderedLeft; + this.__vertexBufferData[31] = uvWidth * uvLeft; + this.__vertexBufferData[56] = renderedLeft + renderedCenterX; + this.__vertexBufferData[57] = renderedHeight; + this.__vertexBufferData[59] = uvWidth * (uvLeft + uvCenterX); + this.__vertexBufferData[60] = uvHeight; + this.__vertexBufferData[70] = renderedLeft + renderedCenterX; + this.__vertexBufferData[73] = uvWidth * (uvLeft + uvCenterX); + this.__vertexBufferData[84] = this.width; + this.__vertexBufferData[85] = renderedHeight; + this.__vertexBufferData[87] = uvWidth; + this.__vertexBufferData[88] = uvHeight; + this.__vertexBufferData[98] = this.width; + this.__vertexBufferData[101] = uvWidth; + this.__vertexBuffer = context.createVertexBuffer(8,14); + } + } else { + this.__vertexBufferGrid = null; + } + if(this.__vertexBuffer == null) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__vertexBufferData = new Float32Array(56); + this.__vertexBufferData[0] = this.width; + this.__vertexBufferData[1] = this.height; + this.__vertexBufferData[3] = uvWidth; + this.__vertexBufferData[4] = uvHeight; + this.__vertexBufferData[15] = this.height; + this.__vertexBufferData[18] = uvHeight; + this.__vertexBufferData[28] = this.width; + this.__vertexBufferData[31] = uvWidth; + this.__vertexBuffer = context.createVertexBuffer(3,14); + } + this.__vertexBuffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.__vertexBufferData)); + } + return this.__vertexBuffer; + } + ,getColorBoundsRect: function(mask,color,findColor) { + if(findColor == null) { + findColor = true; + } + if(!this.readable) { + return new openfl_geom_Rectangle(0,0,this.width,this.height); + } + if(!this.transparent || (mask >> 24 & 255) > 0) { + var color1 = color; + if((color1 >>> 24 & 255) == 0) { + color1 = 0; + } + } + var rect = this.image.getColorBoundsRect(mask,color,findColor,1); + return new openfl_geom_Rectangle(rect.x,rect.y,rect.width,rect.height); + } + ,getPixel: function(x,y) { + if(!this.readable) { + return 0; + } + return this.image.getPixel(x,y,1); + } + ,getPixel32: function(x,y) { + if(!this.readable) { + return 0; + } + return this.image.getPixel32(x,y,1); + } + ,getPixels: function(rect) { + if(!this.readable) { + return null; + } + if(rect == null) { + rect = this.rect; + } + var byteArray = openfl_utils_ByteArray.fromBytes(this.image.getPixels(rect.__toLimeRectangle(),1)); + byteArray.__endian = 0; + return byteArray; + } + ,getSurface: function() { + if(!this.readable) { + return null; + } + if(this.__surface == null) { + this.__surface = lime_graphics_cairo_CairoImageSurface.fromImage(this.image); + } + return this.__surface; + } + ,getTexture: function(context) { + if(!this.__isValid) { + return null; + } + if(this.__texture == null || this.__textureContext != context.__context) { + this.__textureContext = context.__context; + this.__texture = context.createRectangleTexture(this.width,this.height,1,false); + this.__textureVersion = -1; + } + lime__$internal_graphics_ImageCanvasUtil.sync(this.image,false); + if(this.image != null && this.image.version > this.__textureVersion) { + if(this.__surface != null) { + lime_graphics_cairo_CairoSurface.flush(this.__surface); + } + var textureImage = this.image; + if(!openfl_display3D_textures_TextureBase.__supportsBGRA && textureImage.get_format() != 0) { + textureImage = textureImage.clone(); + textureImage.set_format(0); + } + this.__texture.__uploadFromImage(textureImage); + this.__textureVersion = this.image.version; + this.__textureWidth = textureImage.buffer.width; + this.__textureHeight = textureImage.buffer.height; + } + if(!this.readable && this.image != null) { + this.__surface = null; + this.image = null; + } + return this.__texture; + } + ,getVector: function(rect) { + var pixels = this.getPixels(rect); + var length = UInt.toFloat(openfl_utils_ByteArray.get_length(pixels)) / UInt.toFloat(4) | 0; + var result = openfl_Vector.toIntVector(null,length,true); + var _g = 0; + var _g1 = length; + while(_g < _g1) { + var i = _g++; + result.set(i,pixels.readUnsignedInt()); + } + return result; + } + ,histogram: function(hRect) { + var rect = hRect != null ? hRect : new openfl_geom_Rectangle(0,0,this.width,this.height); + var pixels = this.getPixels(rect); + var _g = []; + var _g1 = []; + var _g2 = 0; + while(_g2 < 256) { + var j = _g2++; + _g1.push(0); + } + _g.push(_g1); + var _g1 = []; + var _g2 = 0; + while(_g2 < 256) { + var j = _g2++; + _g1.push(0); + } + _g.push(_g1); + var _g1 = []; + var _g2 = 0; + while(_g2 < 256) { + var j = _g2++; + _g1.push(0); + } + _g.push(_g1); + var _g1 = []; + var _g2 = 0; + while(_g2 < 256) { + var j = _g2++; + _g1.push(0); + } + _g.push(_g1); + var result = _g; + var _g = 0; + var _g1 = openfl_utils_ByteArray.get_length(pixels); + while(_g < _g1) { + var i = _g++; + var result1 = result[i % 4]; + ++result1[pixels.readUnsignedByte()]; + } + return result; + } + ,hitTest: function(firstPoint,firstAlphaThreshold,secondObject,secondBitmapDataPoint,secondAlphaThreshold) { + if(secondAlphaThreshold == null) { + secondAlphaThreshold = 1; + } + if(!this.readable) { + return false; + } + if(((secondObject) instanceof openfl_display_Bitmap)) { + secondObject = (js_Boot.__cast(secondObject , openfl_display_Bitmap)).__bitmapData; + } + if(((secondObject) instanceof openfl_geom_Point)) { + var secondPoint = secondObject; + var x = secondPoint.x - firstPoint.x | 0; + var y = secondPoint.y - firstPoint.y | 0; + if(this.rect.contains(x,y)) { + var pixel = this.getPixel32(x,y); + if((pixel >> 24 & 255) > firstAlphaThreshold) { + return true; + } + } + } else if(((secondObject) instanceof openfl_display_BitmapData)) { + var secondBitmapData = secondObject; + var x; + var y; + if(secondBitmapDataPoint == null) { + x = 0; + y = 0; + } else { + x = Math.round(secondBitmapDataPoint.x - firstPoint.x); + y = Math.round(secondBitmapDataPoint.y - firstPoint.y); + } + var hitRect = openfl_geom_Rectangle.__pool.get(); + hitRect.setTo(x,y,secondBitmapData.width,secondBitmapData.height); + if(this.rect.intersects(hitRect)) { + if(x < 0) { + hitRect.x = 0; + hitRect.width = Math.min(secondBitmapData.width + x,this.width); + } else { + hitRect.width = Math.min(secondBitmapData.width,this.width - x); + } + if(y < 0) { + hitRect.y = 0; + hitRect.height = Math.min(secondBitmapData.height + y,this.height); + } else { + hitRect.height = Math.min(secondBitmapData.height,this.height - y); + } + var pixels = this.getPixels(hitRect); + hitRect.x = x < 0 ? -x : 0; + hitRect.y = y < 0 ? -y : 0; + var testPixels = secondBitmapData.getPixels(hitRect); + var length = hitRect.width * hitRect.height | 0; + var pixel; + var testPixel; + var _g = 0; + var _g1 = length; + while(_g < _g1) { + var i = _g++; + pixel = pixels.readUnsignedInt(); + testPixel = testPixels.readUnsignedInt(); + if(UInt.gt(pixel >>> 24 & 255,firstAlphaThreshold) && UInt.gt(testPixel >>> 24 & 255,secondAlphaThreshold)) { + openfl_geom_Rectangle.__pool.release(hitRect); + return true; + } + } + } + openfl_geom_Rectangle.__pool.release(hitRect); + } else if(((secondObject) instanceof openfl_geom_Rectangle)) { + var secondRectangle = openfl_geom_Rectangle.__pool.get(); + secondRectangle.copyFrom(secondObject); + secondRectangle.offset(-firstPoint.x,-firstPoint.y); + secondRectangle.__contract(0,0,this.width,this.height); + if(secondRectangle.width > 0 && secondRectangle.height > 0) { + var pixels = this.getPixels(secondRectangle); + var length = UInt.toFloat(openfl_utils_ByteArray.get_length(pixels)) / UInt.toFloat(4) | 0; + var pixel; + var _g = 0; + var _g1 = length; + while(_g < _g1) { + var i = _g++; + pixel = pixels.readUnsignedInt(); + if(UInt.gt(pixel >>> 24 & 255,firstAlphaThreshold)) { + openfl_geom_Rectangle.__pool.release(secondRectangle); + return true; + } + } + } + openfl_geom_Rectangle.__pool.release(secondRectangle); + } + return false; + } + ,lock: function() { + } + ,merge: function(sourceBitmapData,sourceRect,destPoint,redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier) { + if(!this.readable || sourceBitmapData == null || !sourceBitmapData.readable || sourceRect == null || destPoint == null) { + return; + } + this.image.merge(sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier); + } + ,noise: function(randomSeed,low,high,channelOptions,grayScale) { + if(grayScale == null) { + grayScale = false; + } + if(channelOptions == null) { + channelOptions = 7; + } + if(high == null) { + high = 255; + } + if(low == null) { + low = 0; + } + if(!this.readable) { + return; + } + var func = function() { + randomSeed = randomSeed * 1103515245 + 12345; + return (Math.abs(randomSeed / 65536) | 0) % 32768; + }; + var rand = func; + rand(); + var range = high - low; + var redChannel = (channelOptions & 1) == 1; + var greenChannel = (channelOptions & 2) >> 1 == 1; + var blueChannel = (channelOptions & 4) >> 2 == 1; + var alphaChannel = (channelOptions & 8) >> 3 == 1; + var _g = 0; + var _g1 = this.height; + while(_g < _g1) { + var y = _g++; + var _g2 = 0; + var _g3 = this.width; + while(_g2 < _g3) { + var x = _g2++; + var red = 0; + var blue = 0; + var green = 0; + var alpha = 255; + if(grayScale) { + blue = low + rand() % range; + green = blue; + red = green; + alpha = 255; + } else { + if(redChannel) { + red = low + rand() % range; + } + if(greenChannel) { + green = low + rand() % range; + } + if(blueChannel) { + blue = low + rand() % range; + } + if(alphaChannel) { + alpha = low + rand() % range; + } + } + var rgb = alpha; + rgb = (rgb << 8) + red; + rgb = (rgb << 8) + green; + rgb = (rgb << 8) + blue; + this.setPixel32(x,y,rgb); + } + } + } + ,paletteMap: function(sourceBitmapData,sourceRect,destPoint,redArray,greenArray,blueArray,alphaArray) { + var sw = sourceRect.width | 0; + var sh = sourceRect.height | 0; + var pixels = sourceBitmapData.getPixels(sourceRect); + var pixelValue; + var r; + var g; + var b; + var a; + var color; + var _g = 0; + var _g1 = sh * sw; + while(_g < _g1) { + var i = _g++; + pixelValue = pixels.readUnsignedInt(); + a = alphaArray == null ? pixelValue & -16777216 : alphaArray[pixelValue >> 24 & 255]; + r = redArray == null ? pixelValue & 16711680 : redArray[pixelValue >> 16 & 255]; + g = greenArray == null ? pixelValue & 65280 : greenArray[pixelValue >> 8 & 255]; + b = blueArray == null ? pixelValue & 255 : blueArray[pixelValue & 255]; + color = a + r + g + b; + pixels.position = i * 4; + pixels.writeUnsignedInt(color); + } + pixels.position = 0; + var destRect = openfl_geom_Rectangle.__pool.get(); + destRect.setTo(destPoint.x,destPoint.y,sw,sh); + this.setPixels(destRect,pixels); + openfl_geom_Rectangle.__pool.release(destRect); + } + ,perlinNoise: function(baseX,baseY,numOctaves,randomSeed,stitch,fractalNoise,channelOptions,grayScale,offsets) { + if(grayScale == null) { + grayScale = false; + } + if(channelOptions == null) { + channelOptions = 7; + } + if(!this.readable) { + return; + } + var noise = new openfl_display__$internal_PerlinNoise(randomSeed,numOctaves,channelOptions,grayScale,0.5,stitch,0.15); + noise.fill(this,baseX,baseY,0); + } + ,scroll: function(x,y) { + if(!this.readable) { + return; + } + this.image.scroll(x,y); + } + ,setPixel: function(x,y,color) { + if(!this.readable) { + return; + } + this.image.setPixel(x,y,color,1); + } + ,setPixel32: function(x,y,color) { + if(!this.readable) { + return; + } + this.image.setPixel32(x,y,color,1); + } + ,setPixels: function(rect,byteArray) { + if(!this.readable || rect == null) { + return; + } + var length = rect.width * rect.height * 4; + if(UInt.toFloat(byteArray.length - byteArray.position) < length) { + throw new openfl_errors_Error("End of file was encountered.",2030); + } + this.image.setPixels(rect.__toLimeRectangle(),openfl_utils_ByteArray.toBytePointer(byteArray),1,openfl_utils_Endian.toLimeEndian(byteArray.__endian)); + } + ,setVector: function(rect,inputVector) { + var byteArray = new openfl_utils_ByteArrayData(0); + openfl_utils_ByteArray.set_length(byteArray,inputVector.get_length() * 4); + var color = inputVector.iterator(); + while(color.hasNext()) { + var color1 = color.next(); + byteArray.writeUnsignedInt(color1); + } + byteArray.position = 0; + this.setPixels(rect,byteArray); + } + ,threshold: function(sourceBitmapData,sourceRect,destPoint,operation,threshold,color,mask,copySource) { + if(copySource == null) { + copySource = false; + } + if(mask == null) { + mask = -1; + } + if(color == null) { + color = 0; + } + if(sourceBitmapData == null || sourceRect == null || destPoint == null || sourceRect.x > sourceBitmapData.width || sourceRect.y > sourceBitmapData.height || destPoint.x > this.width || destPoint.y > this.height) { + return 0; + } + return this.image.threshold(sourceBitmapData.image,sourceRect.__toLimeRectangle(),destPoint.__toLimeVector2(),operation,threshold,color,mask,copySource,1); + } + ,unlock: function(changeRect) { + } + ,__applyAlpha: function(alpha) { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(this.image); + lime__$internal_graphics_ImageCanvasUtil.createImageData(this.image); + var data = this.image.buffer.data; + var _g = 0; + var _g1 = openfl_utils_ByteArray.get_length(alpha); + while(_g < _g1) { + var i = _g++; + data[i * 4 + 3] = alpha.readUnsignedByte(); + } + this.image.version++; + } + ,__drawCairo: function(source,renderer) { + } + ,__drawCanvas: function(source,renderer) { + var buffer = this.image.buffer; + if(!renderer.__allowSmoothing) { + renderer.applySmoothing(buffer.__srcContext,false); + } + renderer.__render(source); + if(!renderer.__allowSmoothing) { + renderer.applySmoothing(buffer.__srcContext,true); + } + buffer.__srcContext.setTransform(1,0,0,1,0,0); + buffer.__srcImageData = null; + buffer.data = null; + this.image.dirty = true; + this.image.version++; + } + ,__drawGL: function(source,renderer) { + var context = renderer.__context3D; + var cacheRTT = context.__state.renderToTexture; + var cacheRTTDepthStencil = context.__state.renderToTextureDepthStencil; + var cacheRTTAntiAlias = context.__state.renderToTextureAntiAlias; + var cacheRTTSurfaceSelector = context.__state.renderToTextureSurfaceSelector; + context.setRenderToTexture(this.getTexture(context),true); + renderer.__render(source); + if(cacheRTT != null) { + context.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector); + } else { + context.setRenderToBackBuffer(); + } + } + ,__fillRect: function(rect,color,allowFramebuffer) { + if(rect == null) { + return; + } + if(this.transparent && (color & -16777216) == 0) { + color = 0; + } + if(allowFramebuffer && this.__texture != null && this.__texture.__glFramebuffer != null && openfl_Lib.get_current().stage.__renderer.__type == "opengl") { + var renderer = openfl_Lib.get_current().stage.__renderer; + var context = renderer.__context3D; + var color1 = color; + var useScissor = !this.rect.equals(rect); + var cacheRTT = context.__state.renderToTexture; + var cacheRTTDepthStencil = context.__state.renderToTextureDepthStencil; + var cacheRTTAntiAlias = context.__state.renderToTextureAntiAlias; + var cacheRTTSurfaceSelector = context.__state.renderToTextureSurfaceSelector; + context.setRenderToTexture(this.__texture); + if(useScissor) { + context.setScissorRectangle(rect); + } + context.clear((color1 >>> 16 & 255) / 255,(color1 >>> 8 & 255) / 255,(color1 & 255) / 255,this.transparent ? (color1 >>> 24 & 255) / 255 : 1,0,0,1); + if(useScissor) { + context.setScissorRectangle(null); + } + if(cacheRTT != null) { + context.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector); + } else { + context.setRenderToBackBuffer(); + } + } else if(this.readable) { + this.image.fillRect(rect.__toLimeRectangle(),color,1); + } + } + ,__fromBase64: function(base64,type) { + var image = lime_graphics_Image.fromBase64(base64,type); + this.__fromImage(image); + } + ,__fromBytes: function(bytes,rawAlpha) { + var image = lime_graphics_Image.fromBytes(openfl_utils_ByteArray.toBytes(bytes)); + this.__fromImage(image); + if(rawAlpha != null) { + this.__applyAlpha(rawAlpha); + } + } + ,__fromFile: function(path) { + var image = lime_graphics_Image.fromFile(path); + this.__fromImage(image); + } + ,__fromImage: function(image) { + if(image != null && image.buffer != null) { + this.image = image; + this.width = image.width; + this.height = image.height; + this.rect = new openfl_geom_Rectangle(0,0,image.width,image.height); + this.__textureWidth = this.width; + this.__textureHeight = this.height; + this.readable = true; + this.__isValid = true; + } + } + ,__getBounds: function(rect,matrix) { + var bounds = openfl_geom_Rectangle.__pool.get(); + this.rect.__transform(bounds,matrix); + rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height); + openfl_geom_Rectangle.__pool.release(bounds); + } + ,__loadFromBase64: function(base64,type) { + var _gthis = this; + return lime_graphics_Image.loadFromBase64(base64,type).then(function(image) { + _gthis.__fromImage(image); + return lime_app_Future.withValue(_gthis); + }); + } + ,__loadFromBytes: function(bytes,rawAlpha) { + var _gthis = this; + return lime_graphics_Image.loadFromBytes(openfl_utils_ByteArray.toBytes(bytes)).then(function(image) { + _gthis.__fromImage(image); + if(rawAlpha != null) { + _gthis.__applyAlpha(rawAlpha); + } + return lime_app_Future.withValue(_gthis); + }); + } + ,__loadFromFile: function(path) { + var _gthis = this; + return lime_graphics_Image.loadFromFile(path).then(function(image) { + _gthis.__fromImage(image); + return lime_app_Future.withValue(_gthis); + }); + } + ,__resize: function(width,height) { + this.width = width; + this.height = height; + this.rect.width = width; + this.rect.height = height; + this.__textureWidth = width; + this.__textureHeight = height; + } + ,__setUVRect: function(context,x,y,width,height) { + var buffer = this.getVertexBuffer(context); + if(buffer != null && (width != this.__uvRect.width || height != this.__uvRect.height || x != this.__uvRect.x || y != this.__uvRect.y)) { + var gl = context.gl; + if(this.__uvRect == null) { + this.__uvRect = new openfl_geom_Rectangle(); + } + this.__uvRect.setTo(x,y,width,height); + var uvX = this.__textureWidth > 0 ? x / this.__textureWidth : 0; + var uvY = this.__textureHeight > 0 ? y / this.__textureHeight : 0; + var uvWidth = this.__textureWidth > 0 ? width / this.__textureWidth : 0; + var uvHeight = this.__textureHeight > 0 ? height / this.__textureHeight : 0; + this.__vertexBufferData[0] = width; + this.__vertexBufferData[1] = height; + this.__vertexBufferData[3] = uvX + uvWidth; + this.__vertexBufferData[4] = uvY + uvHeight; + this.__vertexBufferData[15] = height; + this.__vertexBufferData[17] = uvX; + this.__vertexBufferData[18] = uvY + uvHeight; + this.__vertexBufferData[28] = width; + this.__vertexBufferData[31] = uvX + uvWidth; + this.__vertexBufferData[32] = uvY; + this.__vertexBufferData[45] = uvX; + this.__vertexBufferData[46] = uvY; + this.__vertexBuffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.__vertexBufferData)); + } + } + ,__sync: function() { + lime__$internal_graphics_ImageCanvasUtil.sync(this.image,false); + } + ,__update: function(transformOnly,updateChildren) { + this.__updateTransforms(); + } + ,__updateTransforms: function(overrideTransform) { + if(overrideTransform == null) { + this.__worldTransform.identity(); + } else { + this.__worldTransform.copyFrom(overrideTransform); + } + this.__renderTransform.copyFrom(this.__worldTransform); + } + ,__class__: openfl_display_BitmapData +}; +var openfl_display_BlendMode = {}; +openfl_display_BlendMode.fromString = function(value) { + switch(value) { + case "add": + return 0; + case "alpha": + return 1; + case "darken": + return 2; + case "difference": + return 3; + case "erase": + return 4; + case "hardlight": + return 5; + case "invert": + return 6; + case "layer": + return 7; + case "lighten": + return 8; + case "multiply": + return 9; + case "normal": + return 10; + case "overlay": + return 11; + case "screen": + return 12; + case "shader": + return 13; + case "subtract": + return 14; + default: + return null; + } +}; +openfl_display_BlendMode.toString = function(this1) { + switch(this1) { + case 0: + return "add"; + case 1: + return "alpha"; + case 2: + return "darken"; + case 3: + return "difference"; + case 4: + return "erase"; + case 5: + return "hardlight"; + case 6: + return "invert"; + case 7: + return "layer"; + case 8: + return "lighten"; + case 9: + return "multiply"; + case 10: + return "normal"; + case 11: + return "overlay"; + case 12: + return "screen"; + case 13: + return "shader"; + case 14: + return "subtract"; + default: + return null; + } +}; +var openfl_display_DisplayObjectRenderer = function() { + openfl_events_EventDispatcher.call(this); + this.__allowSmoothing = true; + this.__pixelRatio = 1; + this.__tempColorTransform = new openfl_geom_ColorTransform(); + this.__worldAlpha = 1; + this.__blendMode = 10; +}; +$hxClasses["openfl.display.DisplayObjectRenderer"] = openfl_display_DisplayObjectRenderer; +openfl_display_DisplayObjectRenderer.__name__ = "openfl.display.DisplayObjectRenderer"; +openfl_display_DisplayObjectRenderer.__super__ = openfl_events_EventDispatcher; +openfl_display_DisplayObjectRenderer.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + __clear: function() { + } + ,__getAlpha: function(value) { + return value * this.__worldAlpha; + } + ,__getColorTransform: function(value) { + if(this.__worldColorTransform != null) { + this.__tempColorTransform.__copyFrom(this.__worldColorTransform); + this.__tempColorTransform.__combine(value); + return this.__tempColorTransform; + } else { + return value; + } + } + ,__popMask: function() { + } + ,__popMaskObject: function(object,handleScrollRect) { + if(handleScrollRect == null) { + handleScrollRect = true; + } + } + ,__popMaskRect: function() { + } + ,__pushMask: function(mask) { + } + ,__pushMaskObject: function(object,handleScrollRect) { + if(handleScrollRect == null) { + handleScrollRect = true; + } + } + ,__pushMaskRect: function(rect,transform) { + } + ,__render: function(object) { + } + ,__renderEvent: function(displayObject) { + var renderer = this; + if(displayObject.__customRenderEvent != null && displayObject.__renderable) { + displayObject.__customRenderEvent.allowSmoothing = renderer.__allowSmoothing; + displayObject.__customRenderEvent.objectMatrix.copyFrom(displayObject.__renderTransform); + displayObject.__customRenderEvent.objectColorTransform.__copyFrom(displayObject.__worldColorTransform); + displayObject.__customRenderEvent.renderer = renderer; + switch(renderer.__type) { + case "cairo": + displayObject.__customRenderEvent.type = "renderCairo"; + break; + case "canvas": + displayObject.__customRenderEvent.type = "renderCanvas"; + break; + case "dom": + if(displayObject.stage != null && displayObject.__worldVisible) { + displayObject.__customRenderEvent.type = "renderDOM"; + } else { + displayObject.__customRenderEvent.type = "clearDOM"; + } + break; + case "opengl": + if(!renderer.__cleared) { + renderer.__clear(); + } + var renderer1 = renderer; + renderer1.setShader(displayObject.__worldShader); + renderer1.__context3D.__flushGL(); + displayObject.__customRenderEvent.type = "renderOpenGL"; + break; + default: + return; + } + renderer.__setBlendMode(displayObject.__worldBlendMode); + renderer.__pushMaskObject(displayObject); + displayObject.dispatchEvent(displayObject.__customRenderEvent); + renderer.__popMaskObject(displayObject); + if(renderer.__type == "opengl") { + var renderer1 = renderer; + renderer1.setViewport(); + } + } + } + ,__resize: function(width,height) { + } + ,__setBlendMode: function(value) { + } + ,__shouldCacheHardware: function(displayObject,value) { + if(displayObject == null) { + return null; + } + switch(displayObject.__drawableType) { + case 4:case 5: + if(value == true) { + return true; + } + value = this.__shouldCacheHardware_DisplayObject(displayObject,value); + if(value == true) { + return true; + } + if(displayObject.__children != null) { + var _g = 0; + var _g1 = displayObject.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + value = this.__shouldCacheHardware_DisplayObject(child,value); + if(value == true) { + return true; + } + } + } + return value; + case 7: + if(value == true) { + return true; + } else { + return false; + } + break; + case 9: + return true; + default: + return this.__shouldCacheHardware_DisplayObject(displayObject,value); + } + } + ,__shouldCacheHardware_DisplayObject: function(displayObject,value) { + if(value == true || displayObject.__filters != null) { + return true; + } + if(value == false || displayObject.__graphics != null && !openfl_display__$internal_Context3DGraphics.isCompatible(displayObject.__graphics)) { + return false; + } + return null; + } + ,__updateCacheBitmap: function(displayObject,force) { + if(displayObject == null) { + return false; + } + var renderer = this; + switch(displayObject.__drawableType) { + case 2: + var bitmap = displayObject; + if(bitmap.__bitmapData == null || bitmap.__filters == null && renderer.__type == "opengl" && bitmap.__cacheBitmap == null) { + return false; + } + force = bitmap.__bitmapData.image != null && bitmap.__bitmapData.image.version != bitmap.__imageVersion; + break; + case 7: + var textField = displayObject; + if(textField.__filters == null && renderer.__type == "opengl" && textField.__cacheBitmap == null && !textField.__domRender) { + return false; + } + if(force) { + textField.__renderDirty = true; + } + force = force || textField.__dirty; + break; + case 9: + var tilemap = displayObject; + if(tilemap.__filters == null && renderer.__type == "opengl" && tilemap.__cacheBitmap == null) { + return false; + } + break; + default: + } + if(displayObject.__isCacheBitmapRender) { + return false; + } + var colorTransform = openfl_geom_ColorTransform.__pool.get(); + colorTransform.__copyFrom(displayObject.__worldColorTransform); + if(renderer.__worldColorTransform != null) { + colorTransform.__combine(renderer.__worldColorTransform); + } + var updated = false; + if(displayObject.get_cacheAsBitmap() || renderer.__type != "opengl" && !colorTransform.__isDefault(true)) { + var rect = null; + var needRender = displayObject.__cacheBitmap == null || displayObject.__renderDirty && (force || displayObject.__children != null && displayObject.__children.length > 0) || displayObject.opaqueBackground != displayObject.__cacheBitmapBackground; + var softwareDirty = needRender || displayObject.__graphics != null && displayObject.__graphics.__softwareDirty || !displayObject.__cacheBitmapColorTransform.__equals(colorTransform,true); + var hardwareDirty = needRender || displayObject.__graphics != null && displayObject.__graphics.__hardwareDirty; + var renderType = renderer.__type; + if(softwareDirty || hardwareDirty) { + if(renderType == "opengl") { + if(this.__shouldCacheHardware(displayObject,null) == false) { + renderType = "canvas"; + } + } + if(softwareDirty && (renderType == "canvas" || renderType == "cairo")) { + needRender = true; + } + if(hardwareDirty && renderType == "opengl") { + needRender = true; + } + } + var updateTransform = needRender || !displayObject.__cacheBitmap.__worldTransform.equals(displayObject.__worldTransform); + var hasFilters = displayObject.__filters != null; + if(renderer.__type == "dom" && !hasFilters) { + return false; + } + if(hasFilters && !needRender) { + var affineChanged; + if(updateTransform) { + var a = displayObject.__cacheBitmap.__worldTransform; + var b = displayObject.__worldTransform; + affineChanged = Math.abs(a.a - b.a) > 1e-4 || Math.abs(a.b - b.b) > 1e-4 || Math.abs(a.c - b.c) > 1e-4 || Math.abs(a.d - b.d) > 1e-4; + } else { + affineChanged = false; + } + var _g = 0; + var _g1 = displayObject.__filters; + while(_g < _g1.length) { + var filter = _g1[_g]; + ++_g; + if(filter.__renderDirty) { + needRender = true; + break; + } + if(affineChanged && ((filter) instanceof openfl_filters_ShaderFilter)) { + displayObject.__cacheBitmapData = null; + needRender = true; + break; + } + } + } + if(displayObject.__cacheBitmapMatrix == null) { + displayObject.__cacheBitmapMatrix = new openfl_geom_Matrix(); + } + var bitmapMatrix = displayObject.__cacheAsBitmapMatrix != null ? displayObject.__cacheAsBitmapMatrix : displayObject.__renderTransform; + if(!needRender && (bitmapMatrix.a != displayObject.__cacheBitmapMatrix.a || bitmapMatrix.b != displayObject.__cacheBitmapMatrix.b || bitmapMatrix.c != displayObject.__cacheBitmapMatrix.c || bitmapMatrix.d != displayObject.__cacheBitmapMatrix.d)) { + needRender = true; + } + if(!needRender && renderer.__type != "opengl" && displayObject.__cacheBitmapData != null && displayObject.__cacheBitmapData.image != null && displayObject.__cacheBitmapData.image.version < displayObject.__cacheBitmapData.__textureVersion) { + needRender = true; + } + if(!needRender) { + var current = displayObject; + while(current != null) { + if(current.get_scrollRect() != null) { + updateTransform = true; + break; + } + current = current.parent; + } + } + displayObject.__cacheBitmapMatrix.copyFrom(bitmapMatrix); + displayObject.__cacheBitmapMatrix.tx = 0; + displayObject.__cacheBitmapMatrix.ty = 0; + var bitmapWidth = 0; + var bitmapHeight = 0; + var filterWidth = 0; + var filterHeight = 0; + var offsetX = 0.; + var offsetY = 0.; + var pixelRatio = this.__pixelRatio; + if(updateTransform || needRender) { + rect = openfl_geom_Rectangle.__pool.get(); + displayObject.__getFilterBounds(rect,displayObject.__cacheBitmapMatrix); + filterWidth = rect.width > 0 ? Math.ceil((rect.width + 1) * pixelRatio) : 0; + filterHeight = rect.height > 0 ? Math.ceil((rect.height + 1) * pixelRatio) : 0; + offsetX = rect.x > 0 ? Math.ceil(rect.x) : Math.floor(rect.x); + offsetY = rect.y > 0 ? Math.ceil(rect.y) : Math.floor(rect.y); + if(displayObject.__cacheBitmapData != null) { + if(filterWidth > displayObject.__cacheBitmapData.width || filterHeight > displayObject.__cacheBitmapData.height) { + bitmapWidth = Math.ceil(Math.max(filterWidth * 1.25,displayObject.__cacheBitmapData.width)); + bitmapHeight = Math.ceil(Math.max(filterHeight * 1.25,displayObject.__cacheBitmapData.height)); + needRender = true; + } else { + bitmapWidth = displayObject.__cacheBitmapData.width; + bitmapHeight = displayObject.__cacheBitmapData.height; + } + } else { + bitmapWidth = filterWidth; + bitmapHeight = filterHeight; + } + } + if(needRender) { + updateTransform = true; + displayObject.__cacheBitmapBackground = displayObject.opaqueBackground; + if(filterWidth >= 0.5 && filterHeight >= 0.5) { + var needsFill = displayObject.opaqueBackground != null && (bitmapWidth != filterWidth || bitmapHeight != filterHeight); + var fillColor = displayObject.opaqueBackground != null ? -16777216 | displayObject.opaqueBackground : 0; + var bitmapColor = needsFill ? 0 : fillColor; + var allowFramebuffer = renderer.__type == "opengl"; + if(displayObject.__cacheBitmapData == null || bitmapWidth > displayObject.__cacheBitmapData.width || bitmapHeight > displayObject.__cacheBitmapData.height) { + displayObject.__cacheBitmapData = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,bitmapColor); + if(displayObject.__cacheBitmap == null) { + displayObject.__cacheBitmap = new openfl_display_Bitmap(); + } + displayObject.__cacheBitmap.__bitmapData = displayObject.__cacheBitmapData; + displayObject.__cacheBitmapRenderer = null; + } else { + displayObject.__cacheBitmapData.__fillRect(displayObject.__cacheBitmapData.rect,bitmapColor,allowFramebuffer); + } + if(needsFill) { + rect.setTo(0,0,filterWidth,filterHeight); + displayObject.__cacheBitmapData.__fillRect(rect,fillColor,allowFramebuffer); + } + } else { + openfl_geom_ColorTransform.__pool.release(colorTransform); + displayObject.__cacheBitmap = null; + displayObject.__cacheBitmapData = null; + displayObject.__cacheBitmapData2 = null; + displayObject.__cacheBitmapData3 = null; + displayObject.__cacheBitmapRenderer = null; + if(displayObject.__drawableType == 7) { + var textField = displayObject; + if(textField.__cacheBitmap != null) { + textField.__cacheBitmap.__renderTransform.tx -= textField.__offsetX * pixelRatio; + textField.__cacheBitmap.__renderTransform.ty -= textField.__offsetY * pixelRatio; + } + } + return true; + } + } else { + displayObject.__cacheBitmapData = displayObject.__cacheBitmap.get_bitmapData(); + displayObject.__cacheBitmapData2 = null; + displayObject.__cacheBitmapData3 = null; + } + if(updateTransform || needRender) { + displayObject.__cacheBitmap.__worldTransform.copyFrom(displayObject.__worldTransform); + if(bitmapMatrix == displayObject.__renderTransform) { + displayObject.__cacheBitmap.__renderTransform.identity(); + displayObject.__cacheBitmap.__renderTransform.scale(1 / pixelRatio,1 / pixelRatio); + displayObject.__cacheBitmap.__renderTransform.tx = displayObject.__renderTransform.tx + offsetX; + displayObject.__cacheBitmap.__renderTransform.ty = displayObject.__renderTransform.ty + offsetY; + } else { + displayObject.__cacheBitmap.__renderTransform.copyFrom(displayObject.__cacheBitmapMatrix); + displayObject.__cacheBitmap.__renderTransform.invert(); + displayObject.__cacheBitmap.__renderTransform.concat(displayObject.__renderTransform); + displayObject.__cacheBitmap.__renderTransform.a *= 1 / pixelRatio; + displayObject.__cacheBitmap.__renderTransform.d *= 1 / pixelRatio; + displayObject.__cacheBitmap.__renderTransform.tx += offsetX; + displayObject.__cacheBitmap.__renderTransform.ty += offsetY; + } + } + displayObject.__cacheBitmap.smoothing = renderer.__allowSmoothing; + displayObject.__cacheBitmap.__renderable = displayObject.__renderable; + displayObject.__cacheBitmap.__worldAlpha = displayObject.__worldAlpha; + displayObject.__cacheBitmap.__worldBlendMode = displayObject.__worldBlendMode; + displayObject.__cacheBitmap.__worldShader = displayObject.__worldShader; + displayObject.__cacheBitmap.set_mask(displayObject.__mask); + if(needRender) { + if(displayObject.__cacheBitmapRenderer == null || renderType != displayObject.__cacheBitmapRenderer.__type) { + if(renderType == "opengl") { + displayObject.__cacheBitmapRenderer = new openfl_display_OpenGLRenderer((js_Boot.__cast(renderer , openfl_display_OpenGLRenderer)).__context3D,displayObject.__cacheBitmapData); + } else { + if(displayObject.__cacheBitmapData.image == null) { + var color = displayObject.opaqueBackground != null ? -16777216 | displayObject.opaqueBackground : 0; + displayObject.__cacheBitmapData = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,color); + displayObject.__cacheBitmap.__bitmapData = displayObject.__cacheBitmapData; + } + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(displayObject.__cacheBitmapData.image); + displayObject.__cacheBitmapRenderer = new openfl_display_CanvasRenderer(displayObject.__cacheBitmapData.image.buffer.__srcContext); + } + displayObject.__cacheBitmapRenderer.__worldTransform = new openfl_geom_Matrix(); + displayObject.__cacheBitmapRenderer.__worldColorTransform = new openfl_geom_ColorTransform(); + } + if(displayObject.__cacheBitmapColorTransform == null) { + displayObject.__cacheBitmapColorTransform = new openfl_geom_ColorTransform(); + } + displayObject.__cacheBitmapRenderer.__stage = displayObject.stage; + displayObject.__cacheBitmapRenderer.__allowSmoothing = renderer.__allowSmoothing; + displayObject.__cacheBitmapRenderer.__setBlendMode(10); + displayObject.__cacheBitmapRenderer.__worldAlpha = 1 / displayObject.__worldAlpha; + displayObject.__cacheBitmapRenderer.__worldTransform.copyFrom(displayObject.__renderTransform); + displayObject.__cacheBitmapRenderer.__worldTransform.invert(); + displayObject.__cacheBitmapRenderer.__worldTransform.concat(displayObject.__cacheBitmapMatrix); + displayObject.__cacheBitmapRenderer.__worldTransform.tx -= offsetX; + displayObject.__cacheBitmapRenderer.__worldTransform.ty -= offsetY; + displayObject.__cacheBitmapRenderer.__worldTransform.scale(pixelRatio,pixelRatio); + displayObject.__cacheBitmapRenderer.__pixelRatio = pixelRatio; + displayObject.__cacheBitmapRenderer.__worldColorTransform.__copyFrom(colorTransform); + displayObject.__cacheBitmapRenderer.__worldColorTransform.__invert(); + displayObject.__isCacheBitmapRender = true; + if(displayObject.__cacheBitmapRenderer.__type == "opengl") { + var parentRenderer = renderer; + var childRenderer = displayObject.__cacheBitmapRenderer; + var context = childRenderer.__context3D; + var cacheRTT = context.__state.renderToTexture; + var cacheRTTDepthStencil = context.__state.renderToTextureDepthStencil; + var cacheRTTAntiAlias = context.__state.renderToTextureAntiAlias; + var cacheRTTSurfaceSelector = context.__state.renderToTextureSurfaceSelector; + var cacheBlendMode = parentRenderer.__blendMode; + parentRenderer.__suspendClipAndMask(); + childRenderer.__copyShader(parentRenderer); + displayObject.__cacheBitmapData.__setUVRect(context,0,0,filterWidth,filterHeight); + childRenderer.__setRenderTarget(displayObject.__cacheBitmapData); + if(displayObject.__cacheBitmapData.image != null) { + displayObject.__cacheBitmapData.__textureVersion = displayObject.__cacheBitmapData.image.version + 1; + } + displayObject.__cacheBitmapData.__drawGL(displayObject,childRenderer); + if(hasFilters) { + var needSecondBitmapData = true; + var needCopyOfOriginal = false; + var _g = 0; + var _g1 = displayObject.__filters; + while(_g < _g1.length) { + var filter = _g1[_g]; + ++_g; + if(filter.__preserveObject) { + needCopyOfOriginal = true; + } + } + var bitmap = displayObject.__cacheBitmapData; + var bitmap2 = null; + var bitmap3 = null; + if(displayObject.__cacheBitmapData2 == null || bitmapWidth > displayObject.__cacheBitmapData2.width || bitmapHeight > displayObject.__cacheBitmapData2.height) { + displayObject.__cacheBitmapData2 = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,0); + } else { + displayObject.__cacheBitmapData2.fillRect(displayObject.__cacheBitmapData2.rect,0); + if(displayObject.__cacheBitmapData2.image != null) { + displayObject.__cacheBitmapData2.__textureVersion = displayObject.__cacheBitmapData2.image.version + 1; + } + } + displayObject.__cacheBitmapData2.__setUVRect(context,0,0,filterWidth,filterHeight); + bitmap2 = displayObject.__cacheBitmapData2; + if(needCopyOfOriginal) { + if(displayObject.__cacheBitmapData3 == null || bitmapWidth > displayObject.__cacheBitmapData3.width || bitmapHeight > displayObject.__cacheBitmapData3.height) { + displayObject.__cacheBitmapData3 = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,0); + } else { + displayObject.__cacheBitmapData3.fillRect(displayObject.__cacheBitmapData3.rect,0); + if(displayObject.__cacheBitmapData3.image != null) { + displayObject.__cacheBitmapData3.__textureVersion = displayObject.__cacheBitmapData3.image.version + 1; + } + } + displayObject.__cacheBitmapData3.__setUVRect(context,0,0,filterWidth,filterHeight); + bitmap3 = displayObject.__cacheBitmapData3; + } + childRenderer.__setBlendMode(10); + childRenderer.__worldAlpha = 1; + childRenderer.__worldTransform.identity(); + childRenderer.__worldColorTransform.__identity(); + var shader; + var cacheBitmap; + var _g = 0; + var _g1 = displayObject.__filters; + while(_g < _g1.length) { + var filter = _g1[_g]; + ++_g; + if(filter.__preserveObject) { + childRenderer.__setRenderTarget(bitmap3); + childRenderer.__renderFilterPass(bitmap,childRenderer.__defaultDisplayShader,filter.__smooth); + } + var _g2 = 0; + var _g3 = filter.__numShaderPasses; + while(_g2 < _g3) { + var i = _g2++; + shader = filter.__initShader(childRenderer,i,filter.__preserveObject ? bitmap3 : null); + childRenderer.__setBlendMode(filter.__shaderBlendMode); + childRenderer.__setRenderTarget(bitmap2); + childRenderer.__renderFilterPass(bitmap,shader,filter.__smooth); + cacheBitmap = bitmap; + bitmap = bitmap2; + bitmap2 = cacheBitmap; + } + filter.__renderDirty = false; + } + displayObject.__cacheBitmap.__bitmapData = bitmap; + } + parentRenderer.__blendMode = 10; + parentRenderer.__setBlendMode(cacheBlendMode); + parentRenderer.__copyShader(childRenderer); + if(cacheRTT != null) { + context.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector); + } else { + context.setRenderToBackBuffer(); + } + parentRenderer.__resumeClipAndMask(childRenderer); + parentRenderer.setViewport(); + displayObject.__cacheBitmapColorTransform.__copyFrom(colorTransform); + } else { + displayObject.__cacheBitmapData.__drawCanvas(displayObject,displayObject.__cacheBitmapRenderer); + if(hasFilters) { + var needSecondBitmapData = false; + var needCopyOfOriginal = false; + var _g = 0; + var _g1 = displayObject.__filters; + while(_g < _g1.length) { + var filter = _g1[_g]; + ++_g; + if(filter.__needSecondBitmapData) { + needSecondBitmapData = true; + } + if(filter.__preserveObject) { + needCopyOfOriginal = true; + } + } + var bitmap = displayObject.__cacheBitmapData; + var bitmap2 = null; + var bitmap3 = null; + if(needSecondBitmapData) { + if(displayObject.__cacheBitmapData2 == null || displayObject.__cacheBitmapData2.image == null || bitmapWidth > displayObject.__cacheBitmapData2.width || bitmapHeight > displayObject.__cacheBitmapData2.height) { + displayObject.__cacheBitmapData2 = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,0); + } else { + displayObject.__cacheBitmapData2.fillRect(displayObject.__cacheBitmapData2.rect,0); + } + bitmap2 = displayObject.__cacheBitmapData2; + } else { + bitmap2 = bitmap; + } + if(needCopyOfOriginal) { + if(displayObject.__cacheBitmapData3 == null || displayObject.__cacheBitmapData3.image == null || bitmapWidth > displayObject.__cacheBitmapData3.width || bitmapHeight > displayObject.__cacheBitmapData3.height) { + displayObject.__cacheBitmapData3 = new openfl_display_BitmapData(bitmapWidth,bitmapHeight,true,0); + } else { + displayObject.__cacheBitmapData3.fillRect(displayObject.__cacheBitmapData3.rect,0); + } + bitmap3 = displayObject.__cacheBitmapData3; + } + if(displayObject.__tempPoint == null) { + displayObject.__tempPoint = new openfl_geom_Point(); + } + var destPoint = displayObject.__tempPoint; + var cacheBitmap; + var lastBitmap; + var _g = 0; + var _g1 = displayObject.__filters; + while(_g < _g1.length) { + var filter = _g1[_g]; + ++_g; + if(filter.__preserveObject) { + bitmap3.copyPixels(bitmap,bitmap.rect,destPoint); + } + lastBitmap = filter.__applyFilter(bitmap2,bitmap,bitmap.rect,destPoint); + if(filter.__preserveObject) { + lastBitmap.draw(bitmap3,null,displayObject.__objectTransform != null ? displayObject.__objectTransform.__colorTransform : null); + } + filter.__renderDirty = false; + if(needSecondBitmapData && lastBitmap == bitmap2) { + cacheBitmap = bitmap; + bitmap = bitmap2; + bitmap2 = cacheBitmap; + } + } + if(displayObject.__cacheBitmapData != bitmap) { + cacheBitmap = displayObject.__cacheBitmapData; + displayObject.__cacheBitmapData = bitmap; + displayObject.__cacheBitmapData2 = cacheBitmap; + displayObject.__cacheBitmap.__bitmapData = displayObject.__cacheBitmapData; + displayObject.__cacheBitmapRenderer = null; + } + displayObject.__cacheBitmap.__imageVersion = displayObject.__cacheBitmapData.__textureVersion; + } + displayObject.__cacheBitmapColorTransform.__copyFrom(colorTransform); + if(!displayObject.__cacheBitmapColorTransform.__isDefault(true)) { + displayObject.__cacheBitmapColorTransform.alphaMultiplier = 1; + displayObject.__cacheBitmapData.colorTransform(displayObject.__cacheBitmapData.rect,displayObject.__cacheBitmapColorTransform); + } + } + displayObject.__isCacheBitmapRender = false; + } + if(updateTransform || needRender) { + openfl_geom_Rectangle.__pool.release(rect); + } + updated = updateTransform; + } else if(displayObject.__cacheBitmap != null) { + if(renderer.__type == "dom") { + var domRenderer = renderer; + domRenderer.__renderDrawableClear(displayObject.__cacheBitmap); + } + displayObject.__cacheBitmap = null; + displayObject.__cacheBitmapData = null; + displayObject.__cacheBitmapData2 = null; + displayObject.__cacheBitmapData3 = null; + displayObject.__cacheBitmapColorTransform = null; + displayObject.__cacheBitmapRenderer = null; + updated = true; + } + openfl_geom_ColorTransform.__pool.release(colorTransform); + if(updated && displayObject.__drawableType == 7) { + var textField = displayObject; + if(textField.__cacheBitmap != null) { + textField.__cacheBitmap.__renderTransform.tx -= textField.__offsetX; + textField.__cacheBitmap.__renderTransform.ty -= textField.__offsetY; + } + } + return updated; + } + ,__affineChanged: function(a,b,eps) { + if(eps == null) { + eps = 1e-4; + } + if(!(Math.abs(a.a - b.a) > eps || Math.abs(a.b - b.b) > eps || Math.abs(a.c - b.c) > eps)) { + return Math.abs(a.d - b.d) > eps; + } else { + return true; + } + } + ,__isShaderFilter: function(f) { + return ((f) instanceof openfl_filters_ShaderFilter); + } + ,__class__: openfl_display_DisplayObjectRenderer +}); +var openfl_display_CairoRenderer = function(cairo) { + openfl_display_DisplayObjectRenderer.call(this); +}; +$hxClasses["openfl.display.CairoRenderer"] = openfl_display_CairoRenderer; +openfl_display_CairoRenderer.__name__ = "openfl.display.CairoRenderer"; +openfl_display_CairoRenderer.__super__ = openfl_display_DisplayObjectRenderer; +openfl_display_CairoRenderer.prototype = $extend(openfl_display_DisplayObjectRenderer.prototype,{ + applyMatrix: function(transform,cairo) { + if(cairo == null) { + cairo = this.cairo; + } + this.__matrix.copyFrom(transform); + if(this.cairo == cairo && this.__worldTransform != null) { + this.__matrix.concat(this.__worldTransform); + } + this.__matrix3[0] = this.__matrix.a; + this.__matrix3[1] = this.__matrix.b; + this.__matrix3[3] = this.__matrix.c; + this.__matrix3[4] = this.__matrix.d; + if(this.__roundPixels) { + this.__matrix3[6] = Math.round(this.__matrix.tx); + this.__matrix3[7] = Math.round(this.__matrix.ty); + } else { + this.__matrix3[6] = this.__matrix.tx; + this.__matrix3[7] = this.__matrix.ty; + } + cairo.set_matrix(this.__matrix3); + } + ,__clear: function() { + if(this.cairo == null) { + return; + } + this.cairo.identityMatrix(); + if(this.__stage != null && this.__stage.__clearBeforeRender) { + var cacheBlendMode = this.__blendMode; + this.__setBlendMode(10); + this.cairo.setSourceRGB(this.__stage.__colorSplit[0],this.__stage.__colorSplit[1],this.__stage.__colorSplit[2]); + this.cairo.paint(); + this.__setBlendMode(cacheBlendMode); + } + } + ,__popMask: function() { + this.cairo.restore(); + } + ,__popMaskObject: function(object,handleScrollRect) { + if(handleScrollRect == null) { + handleScrollRect = true; + } + if(!object.__isCacheBitmapRender && object.__mask != null) { + this.__popMask(); + } + if(handleScrollRect && object.__scrollRect != null) { + this.__popMaskRect(); + } + } + ,__popMaskRect: function() { + this.cairo.restore(); + } + ,__pushMask: function(mask) { + this.cairo.save(); + this.applyMatrix(mask.__renderTransform,this.cairo); + this.cairo.newPath(); + this.__renderDrawableMask(mask); + this.cairo.clip(); + } + ,__pushMaskObject: function(object,handleScrollRect) { + if(handleScrollRect == null) { + handleScrollRect = true; + } + if(handleScrollRect && object.__scrollRect != null) { + this.__pushMaskRect(object.__scrollRect,object.__renderTransform); + } + if(!object.__isCacheBitmapRender && object.__mask != null) { + this.__pushMask(object.__mask); + } + } + ,__pushMaskRect: function(rect,transform) { + this.cairo.save(); + this.applyMatrix(transform,this.cairo); + this.cairo.newPath(); + this.cairo.rectangle(rect.x,rect.y,rect.width,rect.height); + this.cairo.clip(); + } + ,__render: function(object) { + if(this.cairo == null) { + return; + } + this.__renderDrawable(object); + } + ,__renderDrawable: function(object) { + if(object == null) { + return; + } + switch(object.__drawableType) { + case 0: + break; + case 2: + break; + case 3: + break; + case 4:case 5: + break; + case 6: + var simpleButton = object; + if(!(!simpleButton.__renderable || simpleButton.__worldAlpha <= 0 || simpleButton.__currentState == null)) { + this.__pushMaskObject(simpleButton); + this.__renderDrawable(simpleButton.__currentState); + this.__popMaskObject(simpleButton); + this.__renderEvent(simpleButton); + } + break; + case 7: + break; + case 8: + break; + case 9: + break; + default: + } + } + ,__renderDrawableMask: function(object) { + if(object == null) { + return; + } + switch(object.__drawableType) { + case 0: + break; + case 2: + var bitmap = object; + this.cairo.rectangle(0,0,bitmap.get_width(),bitmap.get_height()); + break; + case 3: + break; + case 4:case 5: + break; + case 6: + this.__renderDrawableMask(object.__currentState); + break; + case 7: + break; + case 8: + break; + case 9: + break; + default: + } + } + ,__setBlendMode: function(value) { + if(this.__overrideBlendMode != null) { + value = this.__overrideBlendMode; + } + if(this.__blendMode == value) { + return; + } + this.__blendMode = value; + this.__setBlendModeCairo(this.cairo,value); + } + ,__setBlendModeCairo: function(cairo,value) { + switch(value) { + case 0: + cairo.setOperator(12); + break; + case 2: + cairo.setOperator(17); + break; + case 3: + cairo.setOperator(23); + break; + case 5: + cairo.setOperator(21); + break; + case 7: + cairo.setOperator(2); + break; + case 8: + cairo.setOperator(18); + break; + case 9: + cairo.setOperator(14); + break; + case 11: + cairo.setOperator(16); + break; + case 12: + cairo.setOperator(15); + break; + default: + cairo.setOperator(2); + } + } + ,__class__: openfl_display_CairoRenderer +}); +var openfl_display_CanvasRenderer = function(context) { + openfl_display_DisplayObjectRenderer.call(this); + this.context = context; + this.__tempMatrix = new openfl_geom_Matrix(); + this.__type = "canvas"; +}; +$hxClasses["openfl.display.CanvasRenderer"] = openfl_display_CanvasRenderer; +openfl_display_CanvasRenderer.__name__ = "openfl.display.CanvasRenderer"; +openfl_display_CanvasRenderer.__super__ = openfl_display_DisplayObjectRenderer; +openfl_display_CanvasRenderer.prototype = $extend(openfl_display_DisplayObjectRenderer.prototype,{ + applySmoothing: function(context,value) { + context.imageSmoothingEnabled = value; + } + ,setTransform: function(transform,context) { + if(context == null) { + context = this.context; + } else if(this.context == context && this.__worldTransform != null) { + this.__tempMatrix.copyFrom(transform); + this.__tempMatrix.concat(this.__worldTransform); + transform = this.__tempMatrix; + } + if(this.__roundPixels) { + context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx | 0,transform.ty | 0); + } else { + context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty); + } + } + ,__clear: function() { + if(this.__stage != null) { + var cacheBlendMode = this.__blendMode; + this.__blendMode = null; + this.__setBlendMode(10); + this.context.setTransform(1,0,0,1,0,0); + this.context.globalAlpha = 1; + if(!this.__stage.__transparent && this.__stage.__clearBeforeRender) { + this.context.fillStyle = this.__stage.__colorString; + this.context.fillRect(0,0,this.__stage.stageWidth * this.__stage.window.__scale,this.__stage.stageHeight * this.__stage.window.__scale); + } else if(this.__stage.__transparent && this.__stage.__clearBeforeRender) { + this.context.clearRect(0,0,this.__stage.stageWidth * this.__stage.window.__scale,this.__stage.stageHeight * this.__stage.window.__scale); + } + this.__setBlendMode(cacheBlendMode); + } + } + ,__popMask: function() { + this.context.restore(); + } + ,__popMaskObject: function(object,handleScrollRect) { + if(handleScrollRect == null) { + handleScrollRect = true; + } + if(!object.__isCacheBitmapRender && object.__mask != null) { + this.__popMask(); + } + if(handleScrollRect && object.__scrollRect != null) { + this.__popMaskRect(); + } + } + ,__popMaskRect: function() { + this.context.restore(); + } + ,__pushMask: function(mask) { + this.context.save(); + this.setTransform(mask.__renderTransform,this.context); + this.context.beginPath(); + this.__renderDrawableMask(mask); + this.context.closePath(); + this.context.clip(); + } + ,__pushMaskObject: function(object,handleScrollRect) { + if(handleScrollRect == null) { + handleScrollRect = true; + } + if(handleScrollRect && object.__scrollRect != null) { + this.__pushMaskRect(object.__scrollRect,object.__renderTransform); + } + if(!object.__isCacheBitmapRender && object.__mask != null) { + this.__pushMask(object.__mask); + } + } + ,__pushMaskRect: function(rect,transform) { + this.context.save(); + this.setTransform(transform,this.context); + this.context.beginPath(); + this.context.rect(rect.x,rect.y,rect.width,rect.height); + this.context.clip(); + } + ,__render: function(object) { + this.__renderDrawable(object); + } + ,__renderDrawable: function(object) { + if(object == null) { + return; + } + switch(object.__drawableType) { + case 0: + openfl_display__$internal_CanvasBitmapData.renderDrawable(object,this); + break; + case 2: + openfl_display__$internal_CanvasBitmap.renderDrawable(object,this); + break; + case 3: + openfl_display__$internal_CanvasDisplayObject.renderDrawable(object,this); + break; + case 4:case 5: + openfl_display__$internal_CanvasDisplayObjectContainer.renderDrawable(object,this); + break; + case 6: + openfl_display__$internal_CanvasSimpleButton.renderDrawable(object,this); + break; + case 7: + openfl_display__$internal_CanvasTextField.renderDrawable(object,this); + break; + case 8: + openfl_display__$internal_CanvasVideo.renderDrawable(object,this); + break; + case 9: + openfl_display__$internal_CanvasTilemap.renderDrawable(object,this); + break; + default: + } + } + ,__renderDrawableMask: function(object) { + if(object == null) { + return; + } + switch(object.__drawableType) { + case 0: + openfl_display__$internal_CanvasBitmapData.renderDrawableMask(object,this); + break; + case 2: + openfl_display__$internal_CanvasBitmap.renderDrawableMask(object,this); + break; + case 3: + openfl_display__$internal_CanvasDisplayObject.renderDrawableMask(object,this); + break; + case 4:case 5: + openfl_display__$internal_CanvasDisplayObjectContainer.renderDrawableMask(object,this); + break; + case 6: + openfl_display__$internal_CanvasSimpleButton.renderDrawableMask(object,this); + break; + case 7: + openfl_display__$internal_CanvasTextField.renderDrawableMask(object,this); + break; + case 8: + openfl_display__$internal_CanvasVideo.renderDrawableMask(object,this); + break; + case 9: + openfl_display__$internal_CanvasTilemap.renderDrawableMask(object,this); + break; + default: + } + } + ,__setBlendMode: function(value) { + if(this.__overrideBlendMode != null) { + value = this.__overrideBlendMode; + } + if(this.__blendMode == value) { + return; + } + this.__blendMode = value; + this.__setBlendModeContext(this.context,value); + } + ,__setBlendModeContext: function(context,value) { + switch(value) { + case 0: + context.globalCompositeOperation = "lighter"; + break; + case 2: + context.globalCompositeOperation = "darken"; + break; + case 3: + context.globalCompositeOperation = "difference"; + break; + case 5: + context.globalCompositeOperation = "hard-light"; + break; + case 8: + context.globalCompositeOperation = "lighten"; + break; + case 9: + context.globalCompositeOperation = "multiply"; + break; + case 11: + context.globalCompositeOperation = "overlay"; + break; + case 12: + context.globalCompositeOperation = "screen"; + break; + default: + context.globalCompositeOperation = "source-over"; + } + } + ,__class__: openfl_display_CanvasRenderer +}); +var openfl_display_CapsStyle = {}; +openfl_display_CapsStyle.fromInt = function(value) { + return value; +}; +openfl_display_CapsStyle.fromString = function(value) { + switch(value) { + case "none": + return 0; + case "round": + return 1; + case "square": + return 2; + default: + return null; + } +}; +openfl_display_CapsStyle.toInt = function(this1) { + return this1; +}; +openfl_display_CapsStyle.toString = function(this1) { + switch(this1) { + case 0: + return "none"; + case 1: + return "round"; + case 2: + return "square"; + default: + return null; + } +}; +var openfl_display_DOMElement = function(element) { + openfl_display_DisplayObject.call(this); + this.__drawableType = 10; + this.__element = element; +}; +$hxClasses["openfl.display.DOMElement"] = openfl_display_DOMElement; +openfl_display_DOMElement.__name__ = "openfl.display.DOMElement"; +openfl_display_DOMElement.__super__ = openfl_display_DisplayObject; +openfl_display_DOMElement.prototype = $extend(openfl_display_DisplayObject.prototype,{ + __class__: openfl_display_DOMElement +}); +var openfl_display_DOMRenderer = function(element) { + openfl_display_DisplayObjectRenderer.call(this); + this.element = element; + openfl_display_DisplayObject.__supportDOM = true; + var prefix = (function () { + var styles = window.getComputedStyle(document.documentElement, ''), + pre = (Array.prototype.slice + .call(styles) + .join('') + .match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o']) + )[1], + dom = ('WebKit|Moz|MS|O').match(new RegExp('(' + pre + ')', 'i'))[1]; + return { + dom: dom, + lowercase: pre, + css: '-' + pre + '-', + js: pre[0].toUpperCase() + pre.substr(1) + }; + })(); + this.__vendorPrefix = prefix.lowercase; + this.__transformProperty = prefix.lowercase == "webkit" ? "-webkit-transform" : "transform"; + this.__transformOriginProperty = prefix.lowercase == "webkit" ? "-webkit-transform-origin" : "transform-origin"; + this.__clipRects = []; + this.__numClipRects = 0; + this.__z = 0; + this.__type = "dom"; + this.__canvasRenderer = new openfl_display_CanvasRenderer(null); + this.__canvasRenderer.__isDOM = true; +}; +$hxClasses["openfl.display.DOMRenderer"] = openfl_display_DOMRenderer; +openfl_display_DOMRenderer.__name__ = "openfl.display.DOMRenderer"; +openfl_display_DOMRenderer.__super__ = openfl_display_DisplayObjectRenderer; +openfl_display_DOMRenderer.prototype = $extend(openfl_display_DisplayObjectRenderer.prototype,{ + applyStyle: function(parent,childElement) { + if(parent != null && childElement != null) { + if(parent.__style == null || childElement.parentElement != this.element) { + this.__initializeElement(parent,childElement); + } + parent.__style = childElement.style; + this.__updateClip(parent); + this.__applyStyle(parent,true,true,true); + } + } + ,clearStyle: function(childElement) { + if(childElement != null && childElement.parentElement == this.element) { + this.element.removeChild(childElement); + } + } + ,__applyStyle: function(displayObject,setTransform,setAlpha,setClip) { + var style = displayObject.__style; + if(setTransform && displayObject.__renderTransformChanged) { + var _this = displayObject.__renderTransform; + var roundPixels = this.__roundPixels; + if(roundPixels == null) { + roundPixels = false; + } + style.setProperty(this.__transformProperty,roundPixels ? "matrix3d(" + _this.a + ", " + _this.b + ", 0, 0, " + _this.c + ", " + _this.d + ", 0, 0, 0, 0, 1, 0, " + (_this.tx | 0) + ", " + (_this.ty | 0) + ", 0, 1)" : "matrix3d(" + _this.a + ", " + _this.b + ", 0, 0, " + _this.c + ", " + _this.d + ", 0, 0, 0, 0, 1, 0, " + _this.tx + ", " + _this.ty + ", 0, 1)",null); + } + if(displayObject.__worldZ != ++this.__z) { + displayObject.__worldZ = this.__z; + style.setProperty("z-index",displayObject.__worldZ == null ? "null" : "" + displayObject.__worldZ,null); + } + if(setAlpha && displayObject.__worldAlphaChanged) { + if(displayObject.__worldAlpha < 1) { + style.setProperty("opacity",displayObject.__worldAlpha == null ? "null" : "" + displayObject.__worldAlpha,null); + } else { + style.removeProperty("opacity"); + } + } + if(setClip && displayObject.__worldClipChanged) { + if(displayObject.__worldClip == null) { + style.removeProperty("clip"); + } else { + var clip = displayObject.__worldClip; + style.setProperty("clip","rect(" + clip.y + "px, " + clip.get_right() + "px, " + clip.get_bottom() + "px, " + clip.x + "px)",null); + } + } + } + ,__initializeElement: function(displayObject,element) { + var style = displayObject.__style = element.style; + style.setProperty("position","absolute",null); + style.setProperty("top","0",null); + style.setProperty("left","0",null); + style.setProperty(this.__transformOriginProperty,"0 0 0",null); + this.element.appendChild(element); + displayObject.__worldAlphaChanged = true; + displayObject.__renderTransformChanged = true; + displayObject.__worldVisibleChanged = true; + displayObject.__worldClipChanged = true; + displayObject.__worldClip = null; + displayObject.__worldZ = -1; + } + ,__popMask: function() { + this.__popMaskRect(); + } + ,__popMaskObject: function(object,handleScrollRect) { + if(handleScrollRect == null) { + handleScrollRect = true; + } + if(object.__mask != null) { + this.__popMask(); + } + if(handleScrollRect && object.__scrollRect != null) { + this.__popMaskRect(); + } + } + ,__popMaskRect: function() { + if(this.__numClipRects > 0) { + this.__numClipRects--; + if(this.__numClipRects > 0) { + this.__currentClipRect = this.__clipRects[this.__numClipRects - 1]; + } else { + this.__currentClipRect = null; + } + } + } + ,__pushMask: function(mask) { + this.__pushMaskRect(mask.getBounds(mask),mask.__renderTransform); + } + ,__pushMaskObject: function(object,handleScrollRect) { + if(handleScrollRect == null) { + handleScrollRect = true; + } + if(handleScrollRect && object.__scrollRect != null) { + this.__pushMaskRect(object.__scrollRect,object.__renderTransform); + } + if(object.__mask != null) { + this.__pushMask(object.__mask); + } + } + ,__pushMaskRect: function(rect,transform) { + if(this.__numClipRects == this.__clipRects.length) { + this.__clipRects[this.__numClipRects] = new openfl_geom_Rectangle(); + } + var clipRect = this.__clipRects[this.__numClipRects]; + rect.__transform(clipRect,transform); + if(this.__numClipRects > 0) { + var parentClipRect = this.__clipRects[this.__numClipRects - 1]; + clipRect.__contract(parentClipRect.x,parentClipRect.y,parentClipRect.width,parentClipRect.height); + } + if(clipRect.height < 0) { + clipRect.height = 0; + } + if(clipRect.width < 0) { + clipRect.width = 0; + } + this.__currentClipRect = clipRect; + this.__numClipRects++; + } + ,__render: function(object) { + if(!this.__stage.__transparent) { + this.element.style.background = this.__stage.__colorString; + } else { + this.element.style.background = "none"; + } + this.__z = 1; + this.__renderDrawable(object); + } + ,__renderDrawable: function(object) { + if(object == null) { + return; + } + switch(object.__drawableType) { + case 0: + break; + case 2: + openfl_display__$internal_DOMBitmap.renderDrawable(object,this); + break; + case 3: + openfl_display__$internal_DOMDisplayObject.renderDrawable(object,this); + break; + case 4:case 5: + openfl_display__$internal_DOMDisplayObjectContainer.renderDrawable(object,this); + break; + case 6: + openfl_display__$internal_DOMSimpleButton.renderDrawable(object,this); + break; + case 7: + openfl_display__$internal_DOMTextField.renderDrawable(object,this); + break; + case 8: + openfl_display__$internal_DOMVideo.renderDrawable(object,this); + break; + case 9: + openfl_display__$internal_DOMTilemap.renderDrawable(object,this); + break; + case 10: + var domElement = object; + if(domElement.stage != null && domElement.__worldVisible && domElement.__renderable) { + if(!domElement.__active) { + this.__initializeElement(domElement,domElement.__element); + domElement.__active = true; + } + this.__updateClip(domElement); + this.__applyStyle(domElement,true,true,true); + } else if(domElement.__active) { + this.element.removeChild(domElement.__element); + domElement.__active = false; + } + openfl_display__$internal_DOMDisplayObject.renderDrawable(domElement,this); + break; + default: + } + } + ,__renderDrawableClear: function(object) { + if(object == null) { + return; + } + switch(object.__drawableType) { + case 0: + break; + case 2: + openfl_display__$internal_DOMBitmap.renderDrawableClear(object,this); + break; + case 3: + openfl_display__$internal_DOMDisplayObject.renderDrawableClear(object,this); + break; + case 4:case 5: + openfl_display__$internal_DOMDisplayObjectContainer.renderDrawableClear(object,this); + break; + case 6: + openfl_display__$internal_DOMSimpleButton.renderDrawableClear(object,this); + break; + case 7: + openfl_display__$internal_DOMTextField.renderDrawableClear(object,this); + break; + case 8: + openfl_display__$internal_DOMVideo.renderDrawableClear(object,this); + break; + case 9: + openfl_display__$internal_DOMTilemap.renderDrawableClear(object,this); + break; + default: + } + } + ,__setBlendMode: function(value) { + if(this.__overrideBlendMode != null) { + value = this.__overrideBlendMode; + } + if(this.__blendMode == value) { + return; + } + this.__blendMode = value; + } + ,__updateClip: function(displayObject) { + if(this.__currentClipRect == null) { + displayObject.__worldClipChanged = displayObject.__worldClip != null; + displayObject.__worldClip = null; + } else { + if(displayObject.__worldClip == null) { + displayObject.__worldClip = new openfl_geom_Rectangle(); + } + var clip = openfl_geom_Rectangle.__pool.get(); + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.copyFrom(displayObject.__renderTransform); + matrix.invert(); + this.__currentClipRect.__transform(clip,matrix); + if(clip.equals(displayObject.__worldClip)) { + displayObject.__worldClipChanged = false; + } else { + displayObject.__worldClip.copyFrom(clip); + displayObject.__worldClipChanged = true; + } + openfl_geom_Rectangle.__pool.release(clip); + openfl_geom_Matrix.__pool.release(matrix); + } + } + ,__class__: openfl_display_DOMRenderer +}); +var openfl_display_Shader = function(code) { + this.byteCode = code; + this.precisionHint = 1; + this.__glSourceDirty = true; + this.__numPasses = 1; + this.__data = openfl_display_ShaderData._new(code); +}; +$hxClasses["openfl.display.Shader"] = openfl_display_Shader; +openfl_display_Shader.__name__ = "openfl.display.Shader"; +openfl_display_Shader.prototype = { + __clearUseArray: function() { + var _g = 0; + var _g1 = this.__paramBool; + while(_g < _g1.length) { + var parameter = _g1[_g]; + ++_g; + parameter.__useArray = false; + } + var _g = 0; + var _g1 = this.__paramFloat; + while(_g < _g1.length) { + var parameter = _g1[_g]; + ++_g; + parameter.__useArray = false; + } + var _g = 0; + var _g1 = this.__paramInt; + while(_g < _g1.length) { + var parameter = _g1[_g]; + ++_g; + parameter.__useArray = false; + } + } + ,__createGLShader: function(source,type) { + var gl = this.__context.gl; + var shader = gl.createShader(type); + gl.shaderSource(shader,source); + gl.compileShader(shader); + var shaderInfoLog = gl.getShaderInfoLog(shader); + var hasInfoLog = shaderInfoLog != null && StringTools.trim(shaderInfoLog) != ""; + var compileStatus = gl.getShaderParameter(shader,gl.COMPILE_STATUS); + if(hasInfoLog || compileStatus == 0) { + var message = compileStatus == 0 ? "Error" : "Info"; + message += type == gl.VERTEX_SHADER ? " compiling vertex shader" : " compiling fragment shader"; + message += "\n" + shaderInfoLog; + message += "\n" + source; + if(compileStatus == 0) { + lime_utils_Log.error(message,{ fileName : "openfl/display/Shader.hx", lineNumber : 337, className : "openfl.display.Shader", methodName : "__createGLShader"}); + } else if(hasInfoLog) { + lime_utils_Log.debug(message,{ fileName : "openfl/display/Shader.hx", lineNumber : 338, className : "openfl.display.Shader", methodName : "__createGLShader"}); + } + } + return shader; + } + ,__createGLProgram: function(vertexSource,fragmentSource) { + var gl = this.__context.gl; + var vertexShader = this.__createGLShader(vertexSource,gl.VERTEX_SHADER); + var fragmentShader = this.__createGLShader(fragmentSource,gl.FRAGMENT_SHADER); + var program = gl.createProgram(); + var _g = 0; + var _g1 = this.__paramFloat; + while(_g < _g1.length) { + var param = _g1[_g]; + ++_g; + if(param.name.indexOf("Position") > -1 && StringTools.startsWith(param.name,"openfl_")) { + gl.bindAttribLocation(program,0,param.name); + break; + } + } + gl.attachShader(program,vertexShader); + gl.attachShader(program,fragmentShader); + gl.linkProgram(program); + if(gl.getProgramParameter(program,gl.LINK_STATUS) == 0) { + var message = "Unable to initialize the shader program"; + message += "\n" + gl.getProgramInfoLog(program); + lime_utils_Log.error(message,{ fileName : "openfl/display/Shader.hx", lineNumber : 371, className : "openfl.display.Shader", methodName : "__createGLProgram"}); + } + return program; + } + ,__disable: function() { + if(this.program != null) { + this.__disableGL(); + } + } + ,__disableGL: function() { + var gl = this.__context.gl; + var textureCount = 0; + var _g = 0; + var _g1 = this.__inputBitmapData; + while(_g < _g1.length) { + var input = _g1[_g]; + ++_g; + input.__disableGL(this.__context,textureCount); + ++textureCount; + if(textureCount == gl.MAX_TEXTURE_IMAGE_UNITS) { + break; + } + } + var _g = 0; + var _g1 = this.__paramBool; + while(_g < _g1.length) { + var parameter = _g1[_g]; + ++_g; + parameter.__disableGL(this.__context); + } + var _g = 0; + var _g1 = this.__paramFloat; + while(_g < _g1.length) { + var parameter = _g1[_g]; + ++_g; + parameter.__disableGL(this.__context); + } + var _g = 0; + var _g1 = this.__paramInt; + while(_g < _g1.length) { + var parameter = _g1[_g]; + ++_g; + parameter.__disableGL(this.__context); + } + this.__context.__bindGLArrayBuffer(null); + if(this.__context.__context.type == "opengl") { + gl.disable(gl.TEXTURE_2D); + } + } + ,__enable: function() { + this.__init(); + if(this.program != null) { + this.__enableGL(); + } + } + ,__enableGL: function() { + var textureCount = 0; + var gl = this.__context.gl; + var _g = 0; + var _g1 = this.__inputBitmapData; + while(_g < _g1.length) { + var input = _g1[_g]; + ++_g; + gl.uniform1i(input.index,textureCount); + ++textureCount; + } + if(this.__context.__context.type == "opengl" && textureCount > 0) { + gl.enable(gl.TEXTURE_2D); + } + } + ,__init: function() { + if(this.__data == null) { + this.__data = openfl_display_ShaderData._new(null); + } + if(this.__glFragmentSource != null && this.__glVertexSource != null && (this.program == null || this.__glSourceDirty)) { + this.__initGL(); + } + } + ,__initGL: function() { + if(this.__glSourceDirty || this.__paramBool == null) { + this.__glSourceDirty = false; + this.program = null; + this.__inputBitmapData = []; + this.__paramBool = []; + this.__paramFloat = []; + this.__paramInt = []; + this.__processGLData(this.get_glVertexSource(),"attribute"); + this.__processGLData(this.get_glVertexSource(),"uniform"); + this.__processGLData(this.get_glFragmentSource(),"uniform"); + } + if(this.__context != null && this.program == null) { + var gl = this.__context.gl; + var prefix = this.precisionHint == 1 ? "precision mediump float;\n" : "precision lowp float;\n"; + var vertex = prefix + this.get_glVertexSource(); + var fragment = prefix + this.get_glFragmentSource(); + var id = vertex + fragment; + if(Object.prototype.hasOwnProperty.call(this.__context.__programs.h,id)) { + this.program = this.__context.__programs.h[id]; + } else { + this.program = this.__context.createProgram(1); + this.program.__glProgram = this.__createGLProgram(vertex,fragment); + this.__context.__programs.h[id] = this.program; + } + if(this.program != null) { + this.glProgram = this.program.__glProgram; + var _g = 0; + var _g1 = this.__inputBitmapData; + while(_g < _g1.length) { + var input = _g1[_g]; + ++_g; + if(input.__isUniform) { + input.index = gl.getUniformLocation(this.glProgram,input.name); + } else { + input.index = gl.getAttribLocation(this.glProgram,input.name); + } + } + var _g = 0; + var _g1 = this.__paramBool; + while(_g < _g1.length) { + var parameter = _g1[_g]; + ++_g; + if(parameter.__isUniform) { + parameter.index = gl.getUniformLocation(this.glProgram,parameter.name); + } else { + parameter.index = gl.getAttribLocation(this.glProgram,parameter.name); + } + } + var _g = 0; + var _g1 = this.__paramFloat; + while(_g < _g1.length) { + var parameter = _g1[_g]; + ++_g; + if(parameter.__isUniform) { + parameter.index = gl.getUniformLocation(this.glProgram,parameter.name); + } else { + parameter.index = gl.getAttribLocation(this.glProgram,parameter.name); + } + } + var _g = 0; + var _g1 = this.__paramInt; + while(_g < _g1.length) { + var parameter = _g1[_g]; + ++_g; + if(parameter.__isUniform) { + parameter.index = gl.getUniformLocation(this.glProgram,parameter.name); + } else { + parameter.index = gl.getAttribLocation(this.glProgram,parameter.name); + } + } + } + } + } + ,__processGLData: function(source,storageType) { + var lastMatch = 0; + var position; + var regex; + var name; + var type; + if(storageType == "uniform") { + regex = new EReg("uniform ([A-Za-z0-9]+) ([A-Za-z0-9_]+)",""); + } else { + regex = new EReg("attribute ([A-Za-z0-9]+) ([A-Za-z0-9_]+)",""); + } + while(regex.matchSub(source,lastMatch)) { + type = regex.matched(1); + name = regex.matched(2); + if(StringTools.startsWith(name,"gl_")) { + continue; + } + var isUniform = storageType == "uniform"; + if(StringTools.startsWith(type,"sampler")) { + var input = new openfl_display_ShaderInput(); + input.name = name; + input.__isUniform = isUniform; + this.__inputBitmapData.push(input); + switch(name) { + case "bitmap": + this.__bitmap = input; + break; + case "openfl_Texture": + this.__texture = input; + break; + default: + } + this.__data[name] = input; + if(this.__isGenerated) { + this[name] = input; + } + } else if(!Object.prototype.hasOwnProperty.call(this.__data,name) || Reflect.field(this.__data,name) == null) { + var parameterType; + switch(type) { + case "bool": + parameterType = 0; + break; + case "bvec2": + parameterType = 1; + break; + case "bvec3": + parameterType = 2; + break; + case "bvec4": + parameterType = 3; + break; + case "dvec2":case "vec2": + parameterType = 5; + break; + case "dvec3":case "vec3": + parameterType = 6; + break; + case "dvec4":case "vec4": + parameterType = 7; + break; + case "double":case "float": + parameterType = 4; + break; + case "mat2":case "mat2x2": + parameterType = 12; + break; + case "mat2x3": + parameterType = 13; + break; + case "mat2x4": + parameterType = 14; + break; + case "mat3x2": + parameterType = 15; + break; + case "mat3":case "mat3x3": + parameterType = 16; + break; + case "mat3x4": + parameterType = 17; + break; + case "mat4x2": + parameterType = 18; + break; + case "mat4x3": + parameterType = 19; + break; + case "mat4":case "mat4x4": + parameterType = 20; + break; + case "int":case "uint": + parameterType = 8; + break; + case "ivec2":case "uvec2": + parameterType = 9; + break; + case "ivec3":case "uvec3": + parameterType = 10; + break; + case "ivec4":case "uvec4": + parameterType = 11; + break; + default: + parameterType = null; + } + var length; + switch(parameterType) { + case 1:case 5:case 9: + length = 2; + break; + case 2:case 6:case 10: + length = 3; + break; + case 3:case 7:case 11:case 12: + length = 4; + break; + case 16: + length = 9; + break; + case 20: + length = 16; + break; + default: + length = 1; + } + var arrayLength; + switch(parameterType) { + case 12: + arrayLength = 2; + break; + case 16: + arrayLength = 3; + break; + case 20: + arrayLength = 4; + break; + default: + arrayLength = 1; + } + switch(parameterType) { + case 0:case 1:case 2:case 3: + var parameter = new openfl_display_ShaderParameter(); + parameter.set_name(name); + parameter.type = parameterType; + parameter.__arrayLength = arrayLength; + parameter.__isBool = true; + parameter.__isUniform = isUniform; + parameter.__length = length; + this.__paramBool.push(parameter); + if(name == "openfl_HasColorTransform") { + this.__hasColorTransform = parameter; + } + this.__data[name] = parameter; + if(this.__isGenerated) { + this[name] = parameter; + } + break; + case 8:case 9:case 10:case 11: + var parameter1 = new openfl_display_ShaderParameter(); + parameter1.set_name(name); + parameter1.type = parameterType; + parameter1.__arrayLength = arrayLength; + parameter1.__isInt = true; + parameter1.__isUniform = isUniform; + parameter1.__length = length; + this.__paramInt.push(parameter1); + this.__data[name] = parameter1; + if(this.__isGenerated) { + this[name] = parameter1; + } + break; + default: + var parameter2 = new openfl_display_ShaderParameter(); + parameter2.set_name(name); + parameter2.type = parameterType; + parameter2.__arrayLength = arrayLength; + if(arrayLength > 0) { + var elements = arrayLength * arrayLength; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Float32Array(elements); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Float32Array(buffer,0); + } else { + this1 = new Float32Array(buffer,0,len); + } + } else { + this1 = null; + } + parameter2.__uniformMatrix = this1; + } + parameter2.__isFloat = true; + parameter2.__isUniform = isUniform; + parameter2.__length = length; + this.__paramFloat.push(parameter2); + if(StringTools.startsWith(name,"openfl_")) { + switch(name) { + case "openfl_Alpha": + this.__alpha = parameter2; + break; + case "openfl_ColorMultiplier": + this.__colorMultiplier = parameter2; + break; + case "openfl_ColorOffset": + this.__colorOffset = parameter2; + break; + case "openfl_Matrix": + this.__matrix = parameter2; + break; + case "openfl_Position": + this.__position = parameter2; + break; + case "openfl_TextureCoord": + this.__textureCoord = parameter2; + break; + case "openfl_TextureSize": + this.__textureSize = parameter2; + break; + default: + } + } + this.__data[name] = parameter2; + if(this.__isGenerated) { + this[name] = parameter2; + } + } + } + position = regex.matchedPos(); + lastMatch = position.pos + position.len; + } + } + ,__update: function() { + if(this.program != null) { + this.__updateGL(); + } + } + ,__updateFromBuffer: function(shaderBuffer,bufferOffset) { + if(this.program != null) { + this.__updateGLFromBuffer(shaderBuffer,bufferOffset); + } + } + ,__updateGL: function() { + var textureCount = 0; + var _g = 0; + var _g1 = this.__inputBitmapData; + while(_g < _g1.length) { + var input = _g1[_g]; + ++_g; + input.__updateGL(this.__context,textureCount); + ++textureCount; + } + var _g = 0; + var _g1 = this.__paramBool; + while(_g < _g1.length) { + var parameter = _g1[_g]; + ++_g; + parameter.__updateGL(this.__context); + } + var _g = 0; + var _g1 = this.__paramFloat; + while(_g < _g1.length) { + var parameter = _g1[_g]; + ++_g; + parameter.__updateGL(this.__context); + } + var _g = 0; + var _g1 = this.__paramInt; + while(_g < _g1.length) { + var parameter = _g1[_g]; + ++_g; + parameter.__updateGL(this.__context); + } + } + ,__updateGLFromBuffer: function(shaderBuffer,bufferOffset) { + var textureCount = 0; + var input; + var inputData; + var inputFilter; + var inputMipFilter; + var inputWrap; + var _g = 0; + var _g1 = shaderBuffer.inputCount; + while(_g < _g1) { + var i = _g++; + input = shaderBuffer.inputRefs[i]; + inputData = shaderBuffer.inputs[i]; + inputFilter = shaderBuffer.inputFilter[i]; + inputMipFilter = shaderBuffer.inputMipFilter[i]; + inputWrap = shaderBuffer.inputWrap[i]; + if(inputData != null) { + input.__updateGL(this.__context,textureCount,inputData,inputFilter,inputMipFilter,inputWrap); + ++textureCount; + } + } + var gl = this.__context.gl; + if(shaderBuffer.paramDataLength > 0) { + if(shaderBuffer.paramDataBuffer == null) { + shaderBuffer.paramDataBuffer = gl.createBuffer(); + } + this.__context.__bindGLArrayBuffer(shaderBuffer.paramDataBuffer); + lime_graphics_WebGLRenderContext.bufferData(gl,gl.ARRAY_BUFFER,shaderBuffer.paramData,gl.DYNAMIC_DRAW); + } else { + this.__context.__bindGLArrayBuffer(null); + } + var boolIndex = 0; + var floatIndex = 0; + var intIndex = 0; + var boolCount = shaderBuffer.paramBoolCount; + var floatCount = shaderBuffer.paramFloatCount; + var paramData = shaderBuffer.paramData; + var boolRef; + var floatRef; + var intRef; + var hasOverride; + var overrideBoolValue = null; + var overrideFloatValue = null; + var overrideIntValue = null; + var _g = 0; + var _g1 = shaderBuffer.paramCount; + while(_g < _g1) { + var i = _g++; + hasOverride = false; + if(i < boolCount) { + boolRef = shaderBuffer.paramRefs_Bool[boolIndex]; + var _g2 = 0; + var _g3 = shaderBuffer.overrideBoolCount; + while(_g2 < _g3) { + var j = _g2++; + if(boolRef.name == shaderBuffer.overrideBoolNames[j]) { + overrideBoolValue = shaderBuffer.overrideBoolValues[j]; + hasOverride = true; + break; + } + } + if(hasOverride) { + boolRef.__updateGL(this.__context,overrideBoolValue); + } else { + boolRef.__updateGLFromBuffer(this.__context,paramData,shaderBuffer.paramPositions[i],shaderBuffer.paramLengths[i],bufferOffset); + } + ++boolIndex; + } else if(i < boolCount + floatCount) { + floatRef = shaderBuffer.paramRefs_Float[floatIndex]; + var _g4 = 0; + var _g5 = shaderBuffer.overrideFloatCount; + while(_g4 < _g5) { + var j1 = _g4++; + if(floatRef.name == shaderBuffer.overrideFloatNames[j1]) { + overrideFloatValue = shaderBuffer.overrideFloatValues[j1]; + hasOverride = true; + break; + } + } + if(hasOverride) { + floatRef.__updateGL(this.__context,overrideFloatValue); + } else { + floatRef.__updateGLFromBuffer(this.__context,paramData,shaderBuffer.paramPositions[i],shaderBuffer.paramLengths[i],bufferOffset); + } + ++floatIndex; + } else { + intRef = shaderBuffer.paramRefs_Int[intIndex]; + var _g6 = 0; + var _g7 = shaderBuffer.overrideIntCount; + while(_g6 < _g7) { + var j2 = _g6++; + if(intRef.name == shaderBuffer.overrideIntNames[j2]) { + overrideIntValue = shaderBuffer.overrideIntValues[j2]; + hasOverride = true; + break; + } + } + if(hasOverride) { + intRef.__updateGL(this.__context,overrideIntValue); + } else { + intRef.__updateGLFromBuffer(this.__context,paramData,shaderBuffer.paramPositions[i],shaderBuffer.paramLengths[i],bufferOffset); + } + ++intIndex; + } + } + } + ,get_data: function() { + if(this.__glSourceDirty || this.__data == null) { + this.__init(); + } + return this.__data; + } + ,set_data: function(value) { + return this.__data = value; + } + ,get_glFragmentSource: function() { + return this.__glFragmentSource; + } + ,set_glFragmentSource: function(value) { + if(value != this.__glFragmentSource) { + this.__glSourceDirty = true; + } + return this.__glFragmentSource = value; + } + ,get_glVertexSource: function() { + return this.__glVertexSource; + } + ,set_glVertexSource: function(value) { + if(value != this.__glVertexSource) { + this.__glSourceDirty = true; + } + return this.__glVertexSource = value; + } + ,__class__: openfl_display_Shader + ,__properties__: {set_glVertexSource:"set_glVertexSource",get_glVertexSource:"get_glVertexSource",set_glFragmentSource:"set_glFragmentSource",get_glFragmentSource:"get_glFragmentSource",set_data:"set_data",get_data:"get_data"} +}; +var openfl_display_DisplayObjectShader = function(code) { + if(this.__glFragmentSource == null) { + this.__glFragmentSource = "varying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform sampler2D openfl_Texture;\n\t\tuniform vec2 openfl_TextureSize;\n\n\t\tvoid main(void) {\n\n\t\t\tvec4 color = texture2D (openfl_Texture, openfl_TextureCoordv);\n\n\t\tif (color.a == 0.0) {\n\n\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\n\n\t\t} else if (openfl_HasColorTransform) {\n\n\t\t\tcolor = vec4 (color.rgb / color.a, color.a);\n\n\t\t\tmat4 colorMultiplier = mat4 (0);\n\t\t\tcolorMultiplier[0][0] = openfl_ColorMultiplierv.x;\n\t\t\tcolorMultiplier[1][1] = openfl_ColorMultiplierv.y;\n\t\t\tcolorMultiplier[2][2] = openfl_ColorMultiplierv.z;\n\t\t\tcolorMultiplier[3][3] = 1.0; // openfl_ColorMultiplierv.w;\n\n\t\t\tcolor = clamp (openfl_ColorOffsetv + (color * colorMultiplier), 0.0, 1.0);\n\n\t\t\tif (color.a > 0.0) {\n\n\t\t\t\tgl_FragColor = vec4 (color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);\n\n\t\t\t} else {\n\n\t\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tgl_FragColor = color * openfl_Alphav;\n\n\t\t}\n\n\t\t}"; + } + if(this.__glVertexSource == null) { + this.__glVertexSource = "attribute float openfl_Alpha;\n\t\tattribute vec4 openfl_ColorMultiplier;\n\t\tattribute vec4 openfl_ColorOffset;\n\t\tattribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\n\t\tvarying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform vec2 openfl_TextureSize;\n\n\t\tvoid main(void) {\n\n\t\t\topenfl_Alphav = openfl_Alpha;\n\t\topenfl_TextureCoordv = openfl_TextureCoord;\n\n\t\tif (openfl_HasColorTransform) {\n\n\t\t\topenfl_ColorMultiplierv = openfl_ColorMultiplier;\n\t\t\topenfl_ColorOffsetv = openfl_ColorOffset / 255.0;\n\n\t\t}\n\n\t\tgl_Position = openfl_Matrix * openfl_Position;\n\n\t\t}"; + } + openfl_display_Shader.call(this,code); + this.__isGenerated = true; + this.__initGL(); +}; +$hxClasses["openfl.display.DisplayObjectShader"] = openfl_display_DisplayObjectShader; +openfl_display_DisplayObjectShader.__name__ = "openfl.display.DisplayObjectShader"; +openfl_display_DisplayObjectShader.__super__ = openfl_display_Shader; +openfl_display_DisplayObjectShader.prototype = $extend(openfl_display_Shader.prototype,{ + __class__: openfl_display_DisplayObjectShader +}); +var openfl_display_FrameLabel = function(name,frame) { + openfl_events_EventDispatcher.call(this); + this.name = name; + this.frame = frame; +}; +$hxClasses["openfl.display.FrameLabel"] = openfl_display_FrameLabel; +openfl_display_FrameLabel.__name__ = "openfl.display.FrameLabel"; +openfl_display_FrameLabel.__super__ = openfl_events_EventDispatcher; +openfl_display_FrameLabel.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + __class__: openfl_display_FrameLabel +}); +var openfl_display_FrameScript = function(script,frame) { + this.script = script; + this.frame = frame; +}; +$hxClasses["openfl.display.FrameScript"] = openfl_display_FrameScript; +openfl_display_FrameScript.__name__ = "openfl.display.FrameScript"; +openfl_display_FrameScript.prototype = { + __class__: openfl_display_FrameScript +}; +var openfl_display_GradientType = {}; +openfl_display_GradientType.fromInt = function(value) { + return value; +}; +openfl_display_GradientType.fromString = function(value) { + switch(value) { + case "linear": + return 0; + case "radial": + return 1; + default: + return null; + } +}; +openfl_display_GradientType.toInt = function(this1) { + return this1; +}; +openfl_display_GradientType.toString = function(this1) { + switch(this1) { + case 0: + return "linear"; + case 1: + return "radial"; + default: + return null; + } +}; +var openfl_display_Graphics = function(owner) { + this.__dirty = true; + this.__owner = owner; + this.__commands = new openfl_display__$internal_DrawCommandBuffer(); + this.__strokePadding = 0; + this.__positionX = 0; + this.__positionY = 0; + this.__renderTransform = new openfl_geom_Matrix(); + this.__usedShaderBuffers = new haxe_ds_List(); + this.__worldTransform = new openfl_geom_Matrix(); + this.__width = 0; + this.__height = 0; + this.__bitmapScale = 1; + this.__shaderBufferPool = new lime_utils_ObjectPool(function() { + return new openfl_display__$internal_ShaderBuffer(); + }); + this.moveTo(0,0); +}; +$hxClasses["openfl.display.Graphics"] = openfl_display_Graphics; +openfl_display_Graphics.__name__ = "openfl.display.Graphics"; +openfl_display_Graphics.prototype = { + beginBitmapFill: function(bitmap,matrix,repeat,smooth) { + if(smooth == null) { + smooth = false; + } + if(repeat == null) { + repeat = true; + } + this.__commands.beginBitmapFill(bitmap,matrix != null ? matrix.clone() : null,repeat,smooth); + this.__visible = true; + } + ,beginFill: function(color,alpha) { + if(alpha == null) { + alpha = 1; + } + if(color == null) { + color = 0; + } + this.__commands.beginFill(color & 16777215,alpha); + if(alpha > 0) { + this.__visible = true; + } + } + ,beginGradientFill: function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) { + if(focalPointRatio == null) { + focalPointRatio = 0; + } + if(interpolationMethod == null) { + interpolationMethod = 1; + } + if(spreadMethod == null) { + spreadMethod = 0; + } + if(colors == null || colors.length == 0) { + return; + } + if(alphas == null) { + alphas = []; + var _g = 0; + var _g1 = colors.length; + while(_g < _g1) { + var i = _g++; + alphas.push(1); + } + } + if(ratios == null) { + ratios = []; + var _g = 0; + var _g1 = colors.length; + while(_g < _g1) { + var i = _g++; + ratios.push(Math.ceil(i / (colors.length - 1) * 255)); + } + } + if(alphas.length < colors.length || ratios.length < colors.length) { + return; + } + this.__commands.beginGradientFill(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio); + var _g = 0; + while(_g < alphas.length) { + var alpha = alphas[_g]; + ++_g; + if(alpha > 0) { + this.__visible = true; + break; + } + } + } + ,beginShaderFill: function(shader,matrix) { + if(shader != null) { + var shaderBuffer = this.__shaderBufferPool.get(); + this.__usedShaderBuffers.add(shaderBuffer); + shaderBuffer.update(shader); + this.__commands.beginShaderFill(shaderBuffer); + } + } + ,clear: function() { + var _g_head = this.__usedShaderBuffers.h; + while(_g_head != null) { + var val = _g_head.item; + _g_head = _g_head.next; + var shaderBuffer = val; + this.__shaderBufferPool.release(shaderBuffer); + } + this.__usedShaderBuffers.clear(); + this.__commands.clear(); + this.__strokePadding = 0; + if(this.__bounds != null) { + this.set___dirty(true); + this.__transformDirty = true; + this.__bounds = null; + } + this.__visible = false; + this.__positionX = 0; + this.__positionY = 0; + this.moveTo(0,0); + } + ,copyFrom: function(sourceGraphics) { + this.__bounds = sourceGraphics.__bounds != null ? sourceGraphics.__bounds.clone() : null; + this.__commands = sourceGraphics.__commands.copy(); + this.set___dirty(true); + this.__strokePadding = sourceGraphics.__strokePadding; + this.__positionX = sourceGraphics.__positionX; + this.__positionY = sourceGraphics.__positionY; + this.__transformDirty = true; + this.__visible = sourceGraphics.__visible; + } + ,cubicCurveTo: function(controlX1,controlY1,controlX2,controlY2,anchorX,anchorY) { + var xs = this.__findExtrema(this.__positionX,controlX1,controlX2,anchorX); + var ys = this.__findExtrema(this.__positionY,controlY1,controlY2,anchorY); + this.__inflateBounds(xs.min - this.__strokePadding,ys.min - this.__strokePadding); + this.__inflateBounds(xs.max + this.__strokePadding,ys.max + this.__strokePadding); + this.__positionX = anchorX; + this.__positionY = anchorY; + this.__commands.cubicCurveTo(controlX1,controlY1,controlX2,controlY2,anchorX,anchorY); + this.set___dirty(true); + } + ,curveTo: function(controlX,controlY,anchorX,anchorY) { + this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding); + this.__inflateBounds(this.__positionX + this.__strokePadding,this.__positionY + this.__strokePadding); + var ix; + var iy; + if(controlX < anchorX && controlX > this.__positionX || controlX > anchorX && controlX < this.__positionX) { + ix = anchorX; + } else { + var tx = (this.__positionX - controlX) / (this.__positionX - 2 * controlX + anchorX); + ix = this.__calculateBezierQuadPoint(tx,this.__positionX,controlX,anchorX); + } + if(controlY < anchorY && controlY > this.__positionY || controlY > anchorY && controlY < this.__positionY) { + iy = anchorY; + } else { + var ty = (this.__positionY - controlY) / (this.__positionY - 2 * controlY + anchorY); + iy = this.__calculateBezierQuadPoint(ty,this.__positionY,controlY,anchorY); + } + this.__inflateBounds(ix - this.__strokePadding,iy - this.__strokePadding); + this.__inflateBounds(ix + this.__strokePadding,iy + this.__strokePadding); + this.__positionX = anchorX; + this.__positionY = anchorY; + this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding); + this.__inflateBounds(this.__positionX + this.__strokePadding,this.__positionY + this.__strokePadding); + this.__commands.curveTo(controlX,controlY,anchorX,anchorY); + this.set___dirty(true); + } + ,drawCircle: function(x,y,radius) { + if(radius <= 0) { + return; + } + this.__inflateBounds(x - radius - this.__strokePadding,y - radius - this.__strokePadding); + this.__inflateBounds(x + radius + this.__strokePadding,y + radius + this.__strokePadding); + this.__commands.drawCircle(x,y,radius); + this.set___dirty(true); + } + ,drawEllipse: function(x,y,width,height) { + if(width <= 0 || height <= 0) { + return; + } + this.__inflateBounds(x - this.__strokePadding,y - this.__strokePadding); + this.__inflateBounds(x + width + this.__strokePadding,y + height + this.__strokePadding); + this.__commands.drawEllipse(x,y,width,height); + this.set___dirty(true); + } + ,drawGraphicsData: function(graphicsData) { + var fill; + var bitmapFill; + var gradientFill; + var shaderFill; + var stroke; + var path; + var trianglePath; + var quadPath; + var graphics = graphicsData.iterator(); + while(graphics.hasNext()) { + var graphics1 = graphics.next(); + switch(graphics1.__graphicsDataType) { + case 0: + stroke = graphics1; + if(stroke.fill != null) { + var thickness = stroke.thickness; + if(isNaN(thickness)) { + thickness = null; + } + switch(stroke.fill.__graphicsFillType) { + case 0: + fill = stroke.fill; + this.lineStyle(thickness,fill.color,fill.alpha,stroke.pixelHinting,stroke.scaleMode,stroke.caps,stroke.joints,stroke.miterLimit); + break; + case 1: + gradientFill = stroke.fill; + this.lineStyle(thickness,0,1,stroke.pixelHinting,stroke.scaleMode,stroke.caps,stroke.joints,stroke.miterLimit); + this.lineGradientStyle(gradientFill.type,gradientFill.colors,gradientFill.alphas,gradientFill.ratios,gradientFill.matrix,gradientFill.spreadMethod,gradientFill.interpolationMethod,gradientFill.focalPointRatio); + break; + case 2: + bitmapFill = stroke.fill; + this.lineStyle(thickness,0,1,stroke.pixelHinting,stroke.scaleMode,stroke.caps,stroke.joints,stroke.miterLimit); + this.lineBitmapStyle(bitmapFill.bitmapData,bitmapFill.matrix,bitmapFill.repeat,bitmapFill.smooth); + break; + default: + } + } else { + this.lineStyle(); + } + break; + case 1: + fill = graphics1; + this.beginFill(fill.color,fill.alpha); + break; + case 2: + gradientFill = graphics1; + this.beginGradientFill(gradientFill.type,gradientFill.colors,gradientFill.alphas,gradientFill.ratios,gradientFill.matrix,gradientFill.spreadMethod,gradientFill.interpolationMethod,gradientFill.focalPointRatio); + break; + case 3: + path = graphics1; + this.drawPath(path.commands,path.data,path.winding); + break; + case 4: + bitmapFill = graphics1; + this.beginBitmapFill(bitmapFill.bitmapData,bitmapFill.matrix,bitmapFill.repeat,bitmapFill.smooth); + break; + case 5: + this.endFill(); + break; + case 6: + quadPath = graphics1; + this.drawQuads(quadPath.rects,quadPath.indices,quadPath.transforms); + break; + case 7: + trianglePath = graphics1; + this.drawTriangles(trianglePath.vertices,trianglePath.indices,trianglePath.uvtData,trianglePath.culling); + break; + case 8: + shaderFill = graphics1; + this.beginShaderFill(shaderFill.shader,shaderFill.matrix); + break; + } + } + } + ,drawPath: function(commands,data,winding) { + if(winding == null) { + winding = 0; + } + var dataIndex = 0; + if(winding == 1) { + this.__commands.windingNonZero(); + } + var command = commands.iterator(); + _hx_loop1: while(command.hasNext()) { + var command1 = command.next(); + switch(command1) { + case 1: + this.moveTo(data.get(dataIndex),data.get(dataIndex + 1)); + dataIndex += 2; + break; + case 2: + this.lineTo(data.get(dataIndex),data.get(dataIndex + 1)); + dataIndex += 2; + break; + case 3: + this.curveTo(data.get(dataIndex),data.get(dataIndex + 1),data.get(dataIndex + 2),data.get(dataIndex + 3)); + dataIndex += 4; + break; + case 4: + this.moveTo(data.get(dataIndex + 2),data.get(dataIndex + 3)); + break _hx_loop1; + case 5: + this.lineTo(data.get(dataIndex + 2),data.get(dataIndex + 3)); + break _hx_loop1; + case 6: + this.cubicCurveTo(data.get(dataIndex),data.get(dataIndex + 1),data.get(dataIndex + 2),data.get(dataIndex + 3),data.get(dataIndex + 4),data.get(dataIndex + 5)); + dataIndex += 6; + break; + default: + } + } + } + ,drawQuads: function(rects,indices,transforms) { + if(rects == null) { + return; + } + var hasIndices = indices != null; + var transformABCD = false; + var transformXY = false; + var length = hasIndices ? indices.get_length() : Math.floor(rects.get_length() / 4); + if(length == 0) { + return; + } + if(transforms != null) { + if(transforms.get_length() >= length * 6) { + transformABCD = true; + transformXY = true; + } else if(transforms.get_length() >= length * 4) { + transformABCD = true; + } else if(transforms.get_length() >= length * 2) { + transformXY = true; + } + } + var tileRect = openfl_geom_Rectangle.__pool.get(); + var tileTransform = openfl_geom_Matrix.__pool.get(); + var minX = Infinity; + var minY = Infinity; + var maxX = -Infinity; + var maxY = -Infinity; + var ri; + var ti; + var _g = 0; + var _g1 = length; + while(_g < _g1) { + var i = _g++; + ri = hasIndices ? indices.get(i) * 4 : i * 4; + if(ri < 0) { + continue; + } + tileRect.setTo(0,0,rects.get(ri + 2),rects.get(ri + 3)); + if(tileRect.width <= 0 || tileRect.height <= 0) { + continue; + } + if(transformABCD && transformXY) { + ti = i * 6; + tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),transforms.get(ti + 4),transforms.get(ti + 5)); + } else if(transformABCD) { + ti = i * 4; + tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),tileRect.x,tileRect.y); + } else if(transformXY) { + ti = i * 2; + tileTransform.tx = transforms.get(ti); + tileTransform.ty = transforms.get(ti + 1); + } else { + tileTransform.tx = tileRect.x; + tileTransform.ty = tileRect.y; + } + tileRect.__transform(tileRect,tileTransform); + if(minX > tileRect.x) { + minX = tileRect.x; + } + if(minY > tileRect.y) { + minY = tileRect.y; + } + if(maxX < tileRect.get_right()) { + maxX = tileRect.get_right(); + } + if(maxY < tileRect.get_bottom()) { + maxY = tileRect.get_bottom(); + } + } + this.__inflateBounds(minX,minY); + this.__inflateBounds(maxX,maxY); + this.__commands.drawQuads(rects,indices,transforms); + this.set___dirty(true); + this.__visible = true; + openfl_geom_Rectangle.__pool.release(tileRect); + openfl_geom_Matrix.__pool.release(tileTransform); + } + ,drawRect: function(x,y,width,height) { + if(width == 0 && height == 0) { + return; + } + var xSign = width < 0 ? -1 : 1; + var ySign = height < 0 ? -1 : 1; + this.__inflateBounds(x - this.__strokePadding * xSign,y - this.__strokePadding * ySign); + this.__inflateBounds(x + width + this.__strokePadding * xSign,y + height + this.__strokePadding * ySign); + this.__commands.drawRect(x,y,width,height); + this.set___dirty(true); + } + ,drawRoundRect: function(x,y,width,height,ellipseWidth,ellipseHeight) { + if(width == 0 && height == 0) { + return; + } + var xSign = width < 0 ? -1 : 1; + var ySign = height < 0 ? -1 : 1; + this.__inflateBounds(x - this.__strokePadding * xSign,y - this.__strokePadding * ySign); + this.__inflateBounds(x + width + this.__strokePadding * xSign,y + height + this.__strokePadding * ySign); + this.__commands.drawRoundRect(x,y,width,height,ellipseWidth,ellipseHeight); + this.set___dirty(true); + } + ,drawRoundRectComplex: function(x,y,width,height,topLeftRadius,topRightRadius,bottomLeftRadius,bottomRightRadius) { + if(width <= 0 || height <= 0) { + return; + } + this.__inflateBounds(x - this.__strokePadding,y - this.__strokePadding); + this.__inflateBounds(x + width + this.__strokePadding,y + height + this.__strokePadding); + var xw = x + width; + var yh = y + height; + var minSize = width < height ? width * 2 : height * 2; + if(!(topLeftRadius < minSize)) { + topLeftRadius = minSize; + } + if(!(topRightRadius < minSize)) { + topRightRadius = minSize; + } + if(!(bottomLeftRadius < minSize)) { + bottomLeftRadius = minSize; + } + if(!(bottomRightRadius < minSize)) { + bottomRightRadius = minSize; + } + var anchor = 1 - Math.sin(45 * (Math.PI / 180)); + var control = 1 - Math.tan(22.5 * (Math.PI / 180)); + var a = bottomRightRadius * anchor; + var s = bottomRightRadius * control; + this.moveTo(xw,yh - bottomRightRadius); + this.curveTo(xw,yh - s,xw - a,yh - a); + this.curveTo(xw - s,yh,xw - bottomRightRadius,yh); + a = bottomLeftRadius * anchor; + s = bottomLeftRadius * control; + this.lineTo(x + bottomLeftRadius,yh); + this.curveTo(x + s,yh,x + a,yh - a); + this.curveTo(x,yh - s,x,yh - bottomLeftRadius); + a = topLeftRadius * anchor; + s = topLeftRadius * control; + this.lineTo(x,y + topLeftRadius); + this.curveTo(x,y + s,x + a,y + a); + this.curveTo(x + s,y,x + topLeftRadius,y); + a = topRightRadius * anchor; + s = topRightRadius * control; + this.lineTo(xw - topRightRadius,y); + this.curveTo(xw - s,y,xw - a,y + a); + this.curveTo(xw,y + s,xw,y + topRightRadius); + this.lineTo(xw,yh - bottomRightRadius); + this.set___dirty(true); + } + ,drawTriangles: function(vertices,indices,uvtData,culling) { + if(culling == null) { + culling = 1; + } + if(vertices == null || vertices.get_length() == 0) { + return; + } + var vertLength = vertices.get_length() / 2 | 0; + if(indices == null) { + if(vertLength % 3 != 0) { + throw new openfl_errors_ArgumentError("Not enough vertices to close a triangle."); + } + indices = openfl_Vector.toIntVector(null); + var _g = 0; + var _g1 = vertLength; + while(_g < _g1) { + var i = _g++; + indices.push(i); + } + } + if(culling == null) { + culling = 1; + } + var x; + var y; + var minX = Infinity; + var minY = Infinity; + var maxX = -Infinity; + var maxY = -Infinity; + var _g = 0; + var _g1 = vertLength; + while(_g < _g1) { + var i = _g++; + x = vertices.get(i * 2); + y = vertices.get(i * 2 + 1); + if(minX > x) { + minX = x; + } + if(minY > y) { + minY = y; + } + if(maxX < x) { + maxX = x; + } + if(maxY < y) { + maxY = y; + } + } + this.__inflateBounds(minX,minY); + this.__inflateBounds(maxX,maxY); + this.__commands.drawTriangles(vertices,indices,uvtData,culling); + this.set___dirty(true); + this.__visible = true; + } + ,endFill: function() { + this.__commands.endFill(); + } + ,lineBitmapStyle: function(bitmap,matrix,repeat,smooth) { + if(smooth == null) { + smooth = false; + } + if(repeat == null) { + repeat = true; + } + this.__commands.lineBitmapStyle(bitmap,matrix != null ? matrix.clone() : null,repeat,smooth); + } + ,lineGradientStyle: function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) { + if(focalPointRatio == null) { + focalPointRatio = 0; + } + if(interpolationMethod == null) { + interpolationMethod = 1; + } + if(spreadMethod == null) { + spreadMethod = 0; + } + if(alphas == null) { + alphas = []; + var _g = 0; + var _g1 = colors.length; + while(_g < _g1) { + var i = _g++; + alphas.push(1); + } + } + if(ratios == null) { + ratios = []; + var _g = 0; + var _g1 = colors.length; + while(_g < _g1) { + var i = _g++; + ratios.push(Math.ceil(i / (colors.length - 1) * 255)); + } + } + this.__commands.lineGradientStyle(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio); + } + ,lineStyle: function(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit) { + if(miterLimit == null) { + miterLimit = 3; + } + if(scaleMode == null) { + scaleMode = 2; + } + if(pixelHinting == null) { + pixelHinting = false; + } + if(alpha == null) { + alpha = 1; + } + if(color == null) { + color = 0; + } + if(caps == null) { + caps = 1; + } + if(joints == null) { + joints = 2; + } + if(thickness != null) { + if(joints == 1) { + if(thickness > this.__strokePadding) { + this.__strokePadding = Math.ceil(thickness); + } + } else if(thickness / 2 > this.__strokePadding) { + this.__strokePadding = Math.ceil(thickness / 2); + } + } + this.__commands.lineStyle(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit); + if(thickness != null) { + this.__visible = true; + } + } + ,lineTo: function(x,y) { + if(!isFinite(x) || !isFinite(y)) { + return; + } + this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding); + this.__inflateBounds(this.__positionX + this.__strokePadding,this.__positionY + this.__strokePadding); + this.__positionX = x; + this.__positionY = y; + this.__inflateBounds(this.__positionX - this.__strokePadding,this.__positionY - this.__strokePadding); + this.__inflateBounds(this.__positionX + this.__strokePadding * 2,this.__positionY + this.__strokePadding); + this.__commands.lineTo(x,y); + this.set___dirty(true); + } + ,moveTo: function(x,y) { + this.__positionX = x; + this.__positionY = y; + this.__commands.moveTo(x,y); + } + ,overrideBlendMode: function(blendMode) { + if(blendMode == null) { + blendMode = 10; + } + this.__commands.overrideBlendMode(blendMode); + } + ,readGraphicsData: function(recurse) { + if(recurse == null) { + recurse = true; + } + var graphicsData = openfl_Vector.toObjectVector(null); + this.__owner.__readGraphicsData(graphicsData,recurse); + return graphicsData; + } + ,__calculateBezierCubicPoint: function(t,p1,p2,p3,p4) { + var iT = 1 - t; + return p1 * (iT * iT * iT) + 3 * p2 * t * (iT * iT) + 3 * p3 * iT * (t * t) + p4 * (t * t * t); + } + ,__calculateBezierQuadPoint: function(t,p1,p2,p3) { + var iT = 1 - t; + return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3; + } + ,__cleanup: function() { + if(this.__bounds != null && this.__canvas != null) { + this.set___dirty(true); + this.__transformDirty = true; + } + this.__bitmap = null; + if(this.__canvas != null) { + this.__canvas.width = 0; + this.__canvas.height = 0; + this.__canvas = null; + } + if(this.__context != null) { + this.__context.clearRect(0,0,0,0); + this.__context = null; + } + } + ,__getBounds: function(rect,matrix) { + if(this.__bounds == null) { + return; + } + var bounds = openfl_geom_Rectangle.__pool.get(); + this.__bounds.__transform(bounds,matrix); + rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height); + openfl_geom_Rectangle.__pool.release(bounds); + } + ,__hitTest: function(x,y,shapeFlag,matrix) { + if(this.__bounds == null) { + return false; + } + var norm = matrix.a * matrix.d - matrix.b * matrix.c; + var px = norm == 0 ? -matrix.tx : 1.0 / norm * (matrix.c * (matrix.ty - y) + matrix.d * (x - matrix.tx)); + var norm = matrix.a * matrix.d - matrix.b * matrix.c; + var py = norm == 0 ? -matrix.ty : 1.0 / norm * (matrix.a * (y - matrix.ty) + matrix.b * (matrix.tx - x)); + if(px > this.__bounds.x && py > this.__bounds.y && this.__bounds.contains(px,py)) { + if(shapeFlag) { + return openfl_display__$internal_CanvasGraphics.hitTest(this,px,py); + } + return true; + } + return false; + } + ,__findExtrema: function(p1,p2,p3,p4) { + var solutions = []; + if(!((p2 < p4 && p2 > p1 || p2 > p4 && p2 < p1) && (p3 < p4 && p3 > p1 || p3 > p4 && p3 < p1))) { + var a = -p1 + 3 * p2 + p4 - 3 * p3; + var b = 2 * p1 - 4 * p2 + 2 * p3; + var c = p2 - p1; + var d = b * b - 4 * a * c; + if(a == 0) { + var t = -c / b; + if(t > 0 && t < 1) { + solutions.push(this.__calculateBezierCubicPoint(t,p1,p2,p3,p4)); + } + } else if(d >= 0) { + var t1 = (-b + Math.sqrt(d)) / (2 * a); + var t2 = (-b - Math.sqrt(d)) / (2 * a); + if(t1 > 0 && t1 < 1) { + solutions.push(this.__calculateBezierCubicPoint(t1,p1,p2,p3,p4)); + } + if(t2 > 0 && t2 < 1) { + solutions.push(this.__calculateBezierCubicPoint(t2,p1,p2,p3,p4)); + } + } + } + var min = p1; + var max = p1; + solutions.push(p4); + var _g = 0; + while(_g < solutions.length) { + var val = solutions[_g]; + ++_g; + if(val < min) { + min = val; + } + if(val > max) { + max = val; + } + } + return { min : min, max : max}; + } + ,__inflateBounds: function(x,y) { + if(this.__bounds == null) { + this.__bounds = new openfl_geom_Rectangle(x,y,0,0); + this.__transformDirty = true; + return; + } + if(x < this.__bounds.x) { + this.__bounds.width += this.__bounds.x - x; + this.__bounds.x = x; + this.__transformDirty = true; + } + if(y < this.__bounds.y) { + this.__bounds.height += this.__bounds.y - y; + this.__bounds.y = y; + this.__transformDirty = true; + } + if(x > this.__bounds.x + this.__bounds.width) { + this.__bounds.width = x - this.__bounds.x; + } + if(y > this.__bounds.y + this.__bounds.height) { + this.__bounds.height = y - this.__bounds.y; + } + } + ,__readGraphicsData: function(graphicsData) { + var data = new openfl_display__$internal_DrawCommandReader(this.__commands); + var path = null; + var stroke; + var _g = 0; + var _g1 = this.__commands.types; + while(_g < _g1.length) { + var type = _g1[_g]; + ++_g; + switch(type._hx_index) { + case 4:case 5:case 6:case 7:case 9:case 10:case 17:case 18: + if(path == null) { + path = new openfl_display_GraphicsPath(); + } + break; + default: + if(path != null) { + graphicsData.push(path); + path = null; + } + } + switch(type._hx_index) { + case 0: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL; + var c = data; + graphicsData.push(new openfl_display_GraphicsBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1])); + break; + case 1: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL; + var c1 = data; + graphicsData.push(new openfl_display_GraphicsSolidFill(c1.buffer.i[c1.iPos],c1.buffer.f[c1.fPos])); + break; + case 2: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL; + var c2 = data; + graphicsData.push(new openfl_display_GraphicsGradientFill(c2.buffer.o[c2.oPos],c2.buffer.ii[c2.iiPos],c2.buffer.ff[c2.ffPos],c2.buffer.ii[c2.iiPos + 1],c2.buffer.o[c2.oPos + 1],c2.buffer.o[c2.oPos + 2],c2.buffer.o[c2.oPos + 3],c2.buffer.f[c2.fPos])); + break; + case 3: + break; + case 4: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO; + var c3 = data; + path.cubicCurveTo(c3.buffer.f[c3.fPos],c3.buffer.f[c3.fPos + 1],c3.buffer.f[c3.fPos + 2],c3.buffer.f[c3.fPos + 3],c3.buffer.f[c3.fPos + 4],c3.buffer.f[c3.fPos + 5]); + break; + case 5: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO; + var c4 = data; + path.curveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3]); + break; + case 6: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE; + var c5 = data; + path.__drawCircle(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2]); + break; + case 7: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE; + var c6 = data; + path.__drawEllipse(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2],c6.buffer.f[c6.fPos + 3]); + break; + case 9: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT; + var c7 = data; + path.__drawRect(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]); + break; + case 10: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT; + var c8 = data; + path.__drawRoundRect(c8.buffer.f[c8.fPos],c8.buffer.f[c8.fPos + 1],c8.buffer.f[c8.fPos + 2],c8.buffer.f[c8.fPos + 3],c8.buffer.f[c8.fPos + 4],c8.buffer.o[c8.oPos] != null ? c8.buffer.o[c8.oPos] : c8.buffer.f[c8.fPos + 4]); + break; + case 13: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.END_FILL; + var this1 = data; + graphicsData.push(new openfl_display_GraphicsEndFill()); + break; + case 14: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE; + var c9 = data; + path = null; + break; + case 15: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE; + var c10 = data; + break; + case 16: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE; + var c11 = data; + stroke = new openfl_display_GraphicsStroke(c11.buffer.o[c11.oPos],c11.buffer.b[c11.bPos],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3],c11.buffer.f[c11.fPos + 1]); + stroke.fill = new openfl_display_GraphicsSolidFill(c11.buffer.i[c11.iPos],c11.buffer.f[c11.fPos]); + graphicsData.push(stroke); + break; + case 17: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_TO; + var c12 = data; + path.lineTo(c12.buffer.f[c12.fPos],c12.buffer.f[c12.fPos + 1]); + break; + case 18: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO; + var c13 = data; + path.moveTo(c13.buffer.f[c13.fPos],c13.buffer.f[c13.fPos + 1]); + break; + default: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + } + } + if(path != null) { + graphicsData.push(path); + } + } + ,__update: function(displayMatrix,pixelRatio) { + if(this.__bounds == null || this.__bounds.width <= 0 || this.__bounds.height <= 0) { + if(this.__width >= 1 || this.__height >= 1) { + this.set___dirty(true); + } + this.__width = 0; + this.__height = 0; + return; + } + var parentTransform = this.__owner.__renderTransform; + if(parentTransform == null) { + return; + } + var scaleX = pixelRatio; + var scaleY = pixelRatio; + if(this.__owner.__worldScale9Grid == null) { + if(parentTransform.b == 0) { + scaleX = Math.abs(parentTransform.a); + } else { + scaleX = Math.sqrt(parentTransform.a * parentTransform.a + parentTransform.b * parentTransform.b); + } + if(parentTransform.c == 0) { + scaleY = Math.abs(parentTransform.d); + } else { + scaleY = Math.sqrt(parentTransform.c * parentTransform.c + parentTransform.d * parentTransform.d); + } + if(displayMatrix != null) { + if(displayMatrix.b == 0) { + scaleX *= displayMatrix.a; + } else { + scaleX *= Math.sqrt(displayMatrix.a * displayMatrix.a + displayMatrix.b * displayMatrix.b); + } + if(displayMatrix.c == 0) { + scaleY *= displayMatrix.d; + } else { + scaleY *= Math.sqrt(displayMatrix.c * displayMatrix.c + displayMatrix.d * displayMatrix.d); + } + } + } + var width = this.__bounds.width * scaleX; + var height = this.__bounds.height * scaleY; + if(width < 1 || height < 1) { + if(this.__width >= 1 || this.__height >= 1) { + this.set___dirty(true); + } + this.__width = 0; + this.__height = 0; + return; + } + if(openfl_display_Graphics.maxTextureWidth != null && width > openfl_display_Graphics.maxTextureWidth) { + width = openfl_display_Graphics.maxTextureWidth; + scaleX = openfl_display_Graphics.maxTextureWidth / this.__bounds.width; + } + if(openfl_display_Graphics.maxTextureWidth != null && height > openfl_display_Graphics.maxTextureHeight) { + height = openfl_display_Graphics.maxTextureHeight; + scaleY = openfl_display_Graphics.maxTextureHeight / this.__bounds.height; + } + var inverseA; + var inverseD; + if(this.__owner.__worldScale9Grid != null) { + this.__renderTransform.a = pixelRatio; + this.__renderTransform.d = pixelRatio; + inverseA = 1 / pixelRatio; + inverseD = 1 / pixelRatio; + } else { + this.__renderTransform.a = width / this.__bounds.width; + this.__renderTransform.d = height / this.__bounds.height; + inverseA = 1 / this.__renderTransform.a; + inverseD = 1 / this.__renderTransform.d; + } + this.__worldTransform.a = inverseA * parentTransform.a; + this.__worldTransform.b = inverseA * parentTransform.b; + this.__worldTransform.c = inverseD * parentTransform.c; + this.__worldTransform.d = inverseD * parentTransform.d; + var x = this.__bounds.x; + var y = this.__bounds.y; + var tx = x * parentTransform.a + y * parentTransform.c + parentTransform.tx; + var ty = x * parentTransform.b + y * parentTransform.d + parentTransform.ty; + if(pixelRatio > 1.0) { + var nativePixelSize = 1 / pixelRatio; + this.__worldTransform.tx = Math.round(tx / nativePixelSize) * nativePixelSize; + this.__worldTransform.ty = Math.round(ty / nativePixelSize) * nativePixelSize; + } else { + this.__worldTransform.tx = Math.round(tx); + this.__worldTransform.ty = Math.round(ty); + } + var _this = this.__worldTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + this.__renderTransform.tx = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - ty) + _this.d * (tx - _this.tx)); + var _this = this.__worldTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + this.__renderTransform.ty = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (ty - _this.ty) + _this.b * (_this.tx - tx)); + var newWidth = Math.ceil(width + 1.0); + var newHeight = Math.ceil(height + 1.0); + if(newWidth != this.__width || newHeight != this.__height) { + this.set___dirty(true); + } + this.__width = newWidth; + this.__height = newHeight; + } + ,set___dirty: function(value) { + if(value && this.__owner != null) { + var _this = this.__owner; + if(!_this.__renderDirty) { + _this.__renderDirty = true; + _this.__setParentRenderDirty(); + } + } + if(value) { + this.__softwareDirty = true; + this.__hardwareDirty = true; + } + return this.__dirty = value; + } + ,__class__: openfl_display_Graphics + ,__properties__: {set___dirty:"set___dirty"} +}; +var openfl_display_IGraphicsFill = function() { }; +$hxClasses["openfl.display.IGraphicsFill"] = openfl_display_IGraphicsFill; +openfl_display_IGraphicsFill.__name__ = "openfl.display.IGraphicsFill"; +openfl_display_IGraphicsFill.__isInterface__ = true; +openfl_display_IGraphicsFill.prototype = { + __class__: openfl_display_IGraphicsFill +}; +var openfl_display_IGraphicsData = function() { }; +$hxClasses["openfl.display.IGraphicsData"] = openfl_display_IGraphicsData; +openfl_display_IGraphicsData.__name__ = "openfl.display.IGraphicsData"; +openfl_display_IGraphicsData.__isInterface__ = true; +openfl_display_IGraphicsData.prototype = { + __class__: openfl_display_IGraphicsData +}; +var openfl_display_GraphicsBitmapFill = function(bitmapData,matrix,repeat,smooth) { + if(smooth == null) { + smooth = false; + } + if(repeat == null) { + repeat = true; + } + this.bitmapData = bitmapData; + this.matrix = matrix; + this.repeat = repeat; + this.smooth = smooth; + this.__graphicsDataType = 4; + this.__graphicsFillType = 2; +}; +$hxClasses["openfl.display.GraphicsBitmapFill"] = openfl_display_GraphicsBitmapFill; +openfl_display_GraphicsBitmapFill.__name__ = "openfl.display.GraphicsBitmapFill"; +openfl_display_GraphicsBitmapFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData]; +openfl_display_GraphicsBitmapFill.prototype = { + __class__: openfl_display_GraphicsBitmapFill +}; +var openfl_display_GraphicsEndFill = function() { + this.__graphicsDataType = 5; + this.__graphicsFillType = 3; +}; +$hxClasses["openfl.display.GraphicsEndFill"] = openfl_display_GraphicsEndFill; +openfl_display_GraphicsEndFill.__name__ = "openfl.display.GraphicsEndFill"; +openfl_display_GraphicsEndFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData]; +openfl_display_GraphicsEndFill.prototype = { + __class__: openfl_display_GraphicsEndFill +}; +var openfl_display_GraphicsGradientFill = function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) { + if(focalPointRatio == null) { + focalPointRatio = 0; + } + if(type == null) { + type = 0; + } + if(spreadMethod == null) { + spreadMethod = 0; + } + if(interpolationMethod == null) { + interpolationMethod = 1; + } + this.type = type; + this.colors = colors; + this.alphas = alphas; + this.ratios = ratios; + this.matrix = matrix; + this.spreadMethod = spreadMethod; + this.interpolationMethod = interpolationMethod; + this.focalPointRatio = focalPointRatio; + this.__graphicsDataType = 2; + this.__graphicsFillType = 1; +}; +$hxClasses["openfl.display.GraphicsGradientFill"] = openfl_display_GraphicsGradientFill; +openfl_display_GraphicsGradientFill.__name__ = "openfl.display.GraphicsGradientFill"; +openfl_display_GraphicsGradientFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData]; +openfl_display_GraphicsGradientFill.prototype = { + __class__: openfl_display_GraphicsGradientFill +}; +var openfl_display_IGraphicsPath = function() { }; +$hxClasses["openfl.display.IGraphicsPath"] = openfl_display_IGraphicsPath; +openfl_display_IGraphicsPath.__name__ = "openfl.display.IGraphicsPath"; +openfl_display_IGraphicsPath.__isInterface__ = true; +var openfl_display_GraphicsPath = function(commands,data,winding) { + if(winding == null) { + winding = 0; + } + this.commands = commands; + this.data = data; + this.winding = winding; + this.__graphicsDataType = 3; +}; +$hxClasses["openfl.display.GraphicsPath"] = openfl_display_GraphicsPath; +openfl_display_GraphicsPath.__name__ = "openfl.display.GraphicsPath"; +openfl_display_GraphicsPath.__interfaces__ = [openfl_display_IGraphicsPath,openfl_display_IGraphicsData]; +openfl_display_GraphicsPath.prototype = { + cubicCurveTo: function(controlX1,controlY1,controlX2,controlY2,anchorX,anchorY) { + if(this.commands == null) { + this.commands = openfl_Vector.toIntVector(null); + } + if(this.data == null) { + this.data = openfl_Vector.toFloatVector(null); + } + this.commands.push(6); + this.data.push(controlX1); + this.data.push(controlY1); + this.data.push(controlX2); + this.data.push(controlY2); + this.data.push(anchorX); + this.data.push(anchorY); + } + ,curveTo: function(controlX,controlY,anchorX,anchorY) { + if(this.commands == null) { + this.commands = openfl_Vector.toIntVector(null); + } + if(this.data == null) { + this.data = openfl_Vector.toFloatVector(null); + } + this.commands.push(3); + this.data.push(controlX); + this.data.push(controlY); + this.data.push(anchorX); + this.data.push(anchorY); + } + ,lineTo: function(x,y) { + if(this.commands == null) { + this.commands = openfl_Vector.toIntVector(null); + } + if(this.data == null) { + this.data = openfl_Vector.toFloatVector(null); + } + this.commands.push(2); + this.data.push(x); + this.data.push(y); + } + ,moveTo: function(x,y) { + if(this.commands == null) { + this.commands = openfl_Vector.toIntVector(null); + } + if(this.data == null) { + this.data = openfl_Vector.toFloatVector(null); + } + this.commands.push(1); + this.data.push(x); + this.data.push(y); + } + ,wideLineTo: function(x,y) { + if(this.commands == null) { + this.commands = openfl_Vector.toIntVector(null); + } + if(this.data == null) { + this.data = openfl_Vector.toFloatVector(null); + } + this.commands.push(2); + this.data.push(x); + this.data.push(y); + } + ,wideMoveTo: function(x,y) { + if(this.commands == null) { + this.commands = openfl_Vector.toIntVector(null); + } + if(this.data == null) { + this.data = openfl_Vector.toFloatVector(null); + } + this.commands.push(1); + this.data.push(x); + this.data.push(y); + } + ,__drawCircle: function(x,y,radius) { + this.__drawRoundRect(x - radius,y - radius,radius * 2,radius * 2,radius * 2,radius * 2); + } + ,__drawEllipse: function(x,y,width,height) { + this.__drawRoundRect(x,y,width,height,width,height); + } + ,__drawRect: function(x,y,width,height) { + this.moveTo(x,y); + this.lineTo(x + width,y); + this.lineTo(x + width,y + height); + this.lineTo(x,y + height); + this.lineTo(x,y); + } + ,__drawRoundRect: function(x,y,width,height,ellipseWidth,ellipseHeight) { + ellipseWidth *= 0.5; + ellipseHeight *= 0.5; + if(ellipseWidth > width / 2) { + ellipseWidth = width / 2; + } + if(ellipseHeight > height / 2) { + ellipseHeight = height / 2; + } + var xe = x + width; + var ye = y + height; + var cx1 = -ellipseWidth + ellipseWidth * 0.70710678118654752440084436210485; + var cx2 = -ellipseWidth + ellipseWidth * 0.4142135623730950488016887242097; + var cy1 = -ellipseHeight + ellipseHeight * 0.70710678118654752440084436210485; + var cy2 = -ellipseHeight + ellipseHeight * 0.4142135623730950488016887242097; + this.moveTo(xe,ye - ellipseHeight); + this.curveTo(xe,ye + cy2,xe + cx1,ye + cy1); + this.curveTo(xe + cx2,ye,xe - ellipseWidth,ye); + this.lineTo(x + ellipseWidth,ye); + this.curveTo(x - cx2,ye,x - cx1,ye + cy1); + this.curveTo(x,ye + cy2,x,ye - ellipseHeight); + this.lineTo(x,y + ellipseHeight); + this.curveTo(x,y - cy2,x - cx1,y - cy1); + this.curveTo(x - cx2,y,x + ellipseWidth,y); + this.lineTo(xe - ellipseWidth,y); + this.curveTo(xe + cx2,y,xe + cx1,y - cy1); + this.curveTo(xe,y - cy2,xe,y + ellipseHeight); + this.lineTo(xe,ye - ellipseHeight); + } + ,__class__: openfl_display_GraphicsPath +}; +var openfl_display_GraphicsPathWinding = {}; +openfl_display_GraphicsPathWinding.fromString = function(value) { + switch(value) { + case "evenOdd": + return 0; + case "nonZero": + return 1; + default: + return null; + } +}; +openfl_display_GraphicsPathWinding.toString = function(this1) { + switch(this1) { + case 0: + return "evenOdd"; + case 1: + return "nonZero"; + default: + return null; + } +}; +var openfl_display_GraphicsQuadPath = function(rects,indices,transforms) { + this.rects = rects; + this.indices = indices; + this.transforms = transforms; + this.__graphicsDataType = 6; +}; +$hxClasses["openfl.display.GraphicsQuadPath"] = openfl_display_GraphicsQuadPath; +openfl_display_GraphicsQuadPath.__name__ = "openfl.display.GraphicsQuadPath"; +openfl_display_GraphicsQuadPath.__interfaces__ = [openfl_display_IGraphicsPath,openfl_display_IGraphicsData]; +openfl_display_GraphicsQuadPath.prototype = { + __class__: openfl_display_GraphicsQuadPath +}; +var openfl_display_GraphicsShader = function(code) { + if(this.__glFragmentSource == null) { + this.__glFragmentSource = "varying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform vec2 openfl_TextureSize;\n\t\tuniform sampler2D bitmap;\n\n\t\tvoid main(void) {\n\n\t\t\tvec4 color = texture2D (bitmap, openfl_TextureCoordv);\n\n\t\tif (color.a == 0.0) {\n\n\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\n\n\t\t} else if (openfl_HasColorTransform) {\n\n\t\t\tcolor = vec4 (color.rgb / color.a, color.a);\n\n\t\t\tmat4 colorMultiplier = mat4 (0);\n\t\t\tcolorMultiplier[0][0] = openfl_ColorMultiplierv.x;\n\t\t\tcolorMultiplier[1][1] = openfl_ColorMultiplierv.y;\n\t\t\tcolorMultiplier[2][2] = openfl_ColorMultiplierv.z;\n\t\t\tcolorMultiplier[3][3] = 1.0; // openfl_ColorMultiplierv.w;\n\n\t\t\tcolor = clamp (openfl_ColorOffsetv + (color * colorMultiplier), 0.0, 1.0);\n\n\t\t\tif (color.a > 0.0) {\n\n\t\t\t\tgl_FragColor = vec4 (color.rgb * color.a * openfl_Alphav, color.a * openfl_Alphav);\n\n\t\t\t} else {\n\n\t\t\t\tgl_FragColor = vec4 (0.0, 0.0, 0.0, 0.0);\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tgl_FragColor = color * openfl_Alphav;\n\n\t\t}\n\n\t\t}"; + } + if(this.__glVertexSource == null) { + this.__glVertexSource = "attribute float openfl_Alpha;\n\t\tattribute vec4 openfl_ColorMultiplier;\n\t\tattribute vec4 openfl_ColorOffset;\n\t\tattribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\n\t\tvarying float openfl_Alphav;\n\t\tvarying vec4 openfl_ColorMultiplierv;\n\t\tvarying vec4 openfl_ColorOffsetv;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform mat4 openfl_Matrix;\n\t\tuniform bool openfl_HasColorTransform;\n\t\tuniform vec2 openfl_TextureSize;\n\n\t\tvoid main(void) {\n\n\t\t\topenfl_Alphav = openfl_Alpha;\n\t\topenfl_TextureCoordv = openfl_TextureCoord;\n\n\t\tif (openfl_HasColorTransform) {\n\n\t\t\topenfl_ColorMultiplierv = openfl_ColorMultiplier;\n\t\t\topenfl_ColorOffsetv = openfl_ColorOffset / 255.0;\n\n\t\t}\n\n\t\tgl_Position = openfl_Matrix * openfl_Position;\n\n\t\t}"; + } + openfl_display_Shader.call(this,code); + this.__isGenerated = true; + this.__initGL(); +}; +$hxClasses["openfl.display.GraphicsShader"] = openfl_display_GraphicsShader; +openfl_display_GraphicsShader.__name__ = "openfl.display.GraphicsShader"; +openfl_display_GraphicsShader.__super__ = openfl_display_Shader; +openfl_display_GraphicsShader.prototype = $extend(openfl_display_Shader.prototype,{ + __class__: openfl_display_GraphicsShader +}); +var openfl_display_GraphicsShaderFill = function(shader,matrix) { + this.shader = shader; + this.matrix = matrix; + this.__graphicsDataType = 8; + this.__graphicsFillType = 4; +}; +$hxClasses["openfl.display.GraphicsShaderFill"] = openfl_display_GraphicsShaderFill; +openfl_display_GraphicsShaderFill.__name__ = "openfl.display.GraphicsShaderFill"; +openfl_display_GraphicsShaderFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData]; +openfl_display_GraphicsShaderFill.prototype = { + __class__: openfl_display_GraphicsShaderFill +}; +var openfl_display_GraphicsSolidFill = function(color,alpha) { + if(alpha == null) { + alpha = 1; + } + if(color == null) { + color = 0; + } + this.alpha = alpha; + this.color = color; + this.__graphicsDataType = 1; + this.__graphicsFillType = 0; +}; +$hxClasses["openfl.display.GraphicsSolidFill"] = openfl_display_GraphicsSolidFill; +openfl_display_GraphicsSolidFill.__name__ = "openfl.display.GraphicsSolidFill"; +openfl_display_GraphicsSolidFill.__interfaces__ = [openfl_display_IGraphicsFill,openfl_display_IGraphicsData]; +openfl_display_GraphicsSolidFill.prototype = { + __class__: openfl_display_GraphicsSolidFill +}; +var openfl_display_IGraphicsStroke = function() { }; +$hxClasses["openfl.display.IGraphicsStroke"] = openfl_display_IGraphicsStroke; +openfl_display_IGraphicsStroke.__name__ = "openfl.display.IGraphicsStroke"; +openfl_display_IGraphicsStroke.__isInterface__ = true; +var openfl_display_GraphicsStroke = function(thickness,pixelHinting,scaleMode,caps,joints,miterLimit,fill) { + if(miterLimit == null) { + miterLimit = 3; + } + if(joints == null) { + joints = 2; + } + if(caps == null) { + caps = 0; + } + if(scaleMode == null) { + scaleMode = 2; + } + if(pixelHinting == null) { + pixelHinting = false; + } + if(thickness == null) { + thickness = NaN; + } + this.caps = caps; + this.fill = fill; + this.joints = joints; + this.miterLimit = miterLimit; + this.pixelHinting = pixelHinting; + this.scaleMode = scaleMode; + this.thickness = thickness; + this.__graphicsDataType = 0; +}; +$hxClasses["openfl.display.GraphicsStroke"] = openfl_display_GraphicsStroke; +openfl_display_GraphicsStroke.__name__ = "openfl.display.GraphicsStroke"; +openfl_display_GraphicsStroke.__interfaces__ = [openfl_display_IGraphicsStroke,openfl_display_IGraphicsData]; +openfl_display_GraphicsStroke.prototype = { + __class__: openfl_display_GraphicsStroke +}; +var openfl_display_GraphicsTrianglePath = function(vertices,indices,uvtData,culling) { + if(culling == null) { + culling = 1; + } + this.vertices = vertices; + this.indices = indices; + this.uvtData = uvtData; + this.culling = culling; + this.__graphicsDataType = 7; +}; +$hxClasses["openfl.display.GraphicsTrianglePath"] = openfl_display_GraphicsTrianglePath; +openfl_display_GraphicsTrianglePath.__name__ = "openfl.display.GraphicsTrianglePath"; +openfl_display_GraphicsTrianglePath.__interfaces__ = [openfl_display_IGraphicsPath,openfl_display_IGraphicsData]; +openfl_display_GraphicsTrianglePath.prototype = { + __class__: openfl_display_GraphicsTrianglePath +}; +var openfl_display_ITileContainer = function() { }; +$hxClasses["openfl.display.ITileContainer"] = openfl_display_ITileContainer; +openfl_display_ITileContainer.__name__ = "openfl.display.ITileContainer"; +openfl_display_ITileContainer.__isInterface__ = true; +openfl_display_ITileContainer.prototype = { + __class__: openfl_display_ITileContainer + ,__properties__: {get_numTiles:"get_numTiles"} +}; +var openfl_display_InterpolationMethod = {}; +openfl_display_InterpolationMethod.fromInt = function(value) { + return value; +}; +openfl_display_InterpolationMethod.fromString = function(value) { + switch(value) { + case "linearRGB": + return 0; + case "rgb": + return 1; + default: + return null; + } +}; +openfl_display_InterpolationMethod.toInt = function(this1) { + return this1; +}; +openfl_display_InterpolationMethod.toString = function(this1) { + switch(this1) { + case 0: + return "linearRGB"; + case 1: + return "rgb"; + default: + return null; + } +}; +var openfl_display_JPEGEncoderOptions = function(quality) { + if(quality == null) { + quality = 80; + } + this.quality = quality; +}; +$hxClasses["openfl.display.JPEGEncoderOptions"] = openfl_display_JPEGEncoderOptions; +openfl_display_JPEGEncoderOptions.__name__ = "openfl.display.JPEGEncoderOptions"; +openfl_display_JPEGEncoderOptions.prototype = { + __class__: openfl_display_JPEGEncoderOptions +}; +var openfl_display_JointStyle = {}; +openfl_display_JointStyle.fromInt = function(value) { + return value; +}; +openfl_display_JointStyle.fromString = function(value) { + switch(value) { + case "bevel": + return 0; + case "miter": + return 1; + case "round": + return 2; + default: + return null; + } +}; +openfl_display_JointStyle.toInt = function(this1) { + return this1; +}; +openfl_display_JointStyle.toString = function(this1) { + switch(this1) { + case 0: + return "bevel"; + case 1: + return "miter"; + case 2: + return "round"; + default: + return null; + } +}; +var openfl_display_LineScaleMode = {}; +openfl_display_LineScaleMode.fromInt = function(value) { + return value; +}; +openfl_display_LineScaleMode.fromString = function(value) { + switch(value) { + case "horizontal": + return 0; + case "none": + return 1; + case "normal": + return 2; + case "vertical": + return 3; + default: + return null; + } +}; +openfl_display_LineScaleMode.toInt = function(this1) { + return this1; +}; +openfl_display_LineScaleMode.toString = function(this1) { + switch(this1) { + case 0: + return "horizontal"; + case 1: + return "none"; + case 2: + return "normal"; + case 3: + return "vertical"; + default: + return null; + } +}; +var openfl_display_Loader = function() { + openfl_display_DisplayObjectContainer.call(this); + this.__drawableType = 4; + this.contentLoaderInfo = openfl_display_LoaderInfo.create(this); + this.uncaughtErrorEvents = this.contentLoaderInfo.uncaughtErrorEvents; + this.__unloaded = true; +}; +$hxClasses["openfl.display.Loader"] = openfl_display_Loader; +openfl_display_Loader.__name__ = "openfl.display.Loader"; +openfl_display_Loader.__super__ = openfl_display_DisplayObjectContainer; +openfl_display_Loader.prototype = $extend(openfl_display_DisplayObjectContainer.prototype,{ + addChild: function(child) { + throw new openfl_errors_Error("Error #2069: The Loader class does not implement this method.",2069); + } + ,addChildAt: function(child,index) { + throw new openfl_errors_Error("Error #2069: The Loader class does not implement this method.",2069); + } + ,close: function() { + openfl_utils__$internal_Lib.notImplemented({ fileName : "openfl/display/Loader.hx", lineNumber : 229, className : "openfl.display.Loader", methodName : "close"}); + } + ,load: function(request,context) { + this.unload(); + var openEvent = new openfl_events_Event("open"); + this.contentLoaderInfo.dispatchEvent(openEvent); + this.contentLoaderInfo.loaderURL = openfl_Lib.get_current().get_loaderInfo().url; + this.contentLoaderInfo.url = request.url; + this.__unloaded = false; + if(request.contentType == null || request.contentType == "") { + var extension = ""; + this.__path = request.url; + var queryIndex = this.__path.indexOf("?"); + if(queryIndex > -1) { + this.__path = this.__path.substring(0,queryIndex); + } + while(StringTools.endsWith(this.__path,"/")) this.__path = this.__path.substring(0,this.__path.length - 1); + if(StringTools.endsWith(this.__path,".bundle")) { + this.__path += "/library.json"; + if(queryIndex > -1) { + request.url = this.__path + request.url.substring(queryIndex); + } else { + request.url = this.__path; + } + } + var extIndex = this.__path.lastIndexOf("."); + if(extIndex > -1) { + extension = this.__path.substring(extIndex + 1); + } + var tmp; + switch(extension) { + case "gif": + tmp = "image/gif"; + break; + case "jpeg":case "jpg": + tmp = "image/jpeg"; + break; + case "js": + tmp = "application/javascript"; + break; + case "json": + tmp = "application/json"; + break; + case "png": + tmp = "image/png"; + break; + case "swf": + tmp = "application/x-shockwave-flash"; + break; + default: + tmp = "application/x-www-form-urlencoded"; + } + this.contentLoaderInfo.contentType = tmp; + } else { + this.contentLoaderInfo.contentType = request.contentType; + } + if(this.contentLoaderInfo.contentType.indexOf("image/") > -1 && request.method == "GET" && (request.requestHeaders == null || request.requestHeaders.length == 0) && request.userAgent == null) { + openfl_display_BitmapData.loadFromFile(request.url).onComplete($bind(this,this.BitmapData_onLoad)).onError($bind(this,this.BitmapData_onError)).onProgress($bind(this,this.BitmapData_onProgress)); + return; + } + var loader = new openfl_net_URLLoader(); + loader.dataFormat = 0; + if(this.contentLoaderInfo.contentType.indexOf("/json") > -1 || this.contentLoaderInfo.contentType.indexOf("/javascript") > -1 || this.contentLoaderInfo.contentType.indexOf("/ecmascript") > -1) { + loader.dataFormat = 1; + } + loader.addEventListener("complete",$bind(this,this.loader_onComplete)); + loader.addEventListener("ioError",$bind(this,this.loader_onError)); + loader.addEventListener("progress",$bind(this,this.loader_onProgress)); + loader.load(request); + } + ,loadBytes: function(buffer,context) { + openfl_display_BitmapData.loadFromBytes(buffer).onComplete($bind(this,this.BitmapData_onLoad)).onError($bind(this,this.BitmapData_onError)); + } + ,removeChild: function(child) { + if(child == this.content) { + return openfl_display_DisplayObjectContainer.prototype.removeChild.call(this,this.content); + } else { + throw new openfl_errors_Error("Error #2069: The Loader class does not implement this method.",2069); + } + } + ,removeChildAt: function(index) { + throw new openfl_errors_Error("Error #2069: The Loader class does not implement this method.",2069); + } + ,setChildIndex: function(child,index) { + throw new openfl_errors_Error("Error #2069: The Loader class does not implement this method.",2069); + } + ,unload: function() { + if(!this.__unloaded) { + if(this.content != null && this.content.parent == this) { + openfl_display_DisplayObjectContainer.prototype.removeChild.call(this,this.content); + } + if(this.__library != null) { + openfl_utils_Assets.unloadLibrary(this.contentLoaderInfo.url); + this.__library = null; + } + this.content = null; + this.contentLoaderInfo.url = null; + this.contentLoaderInfo.contentType = null; + this.contentLoaderInfo.content = null; + this.contentLoaderInfo.bytesLoaded = 0; + this.contentLoaderInfo.bytesTotal = 0; + this.contentLoaderInfo.width = 0; + this.contentLoaderInfo.height = 0; + this.__unloaded = true; + this.contentLoaderInfo.dispatchEvent(new openfl_events_Event("unload")); + } + } + ,unloadAndStop: function(gc) { + if(gc == null) { + gc = true; + } + if(this.content != null) { + this.content.__stopAllMovieClips(); + } + var _g = 0; + var _g1 = this.get_numChildren(); + while(_g < _g1) { + var i = _g++; + this.getChildAt(i).__stopAllMovieClips(); + } + this.unload(); + var gc1 = gc; + } + ,__dispatchError: function(text) { + var event = new openfl_events_IOErrorEvent("ioError"); + event.text = text; + this.contentLoaderInfo.dispatchEvent(event); + } + ,__setContent: function(content,width,height) { + this.content = content; + this.contentLoaderInfo.content = content; + this.contentLoaderInfo.width = width; + this.contentLoaderInfo.height = height; + if(content != null) { + openfl_display_DisplayObjectContainer.prototype.addChildAt.call(this,content,0); + } + } + ,BitmapData_onError: function(error) { + this.__dispatchError(Std.string(error)); + } + ,BitmapData_onLoad: function(bitmapData) { + if(bitmapData == null) { + this.__dispatchError("Unknown error"); + return; + } + this.__setContent(new openfl_display_Bitmap(bitmapData),bitmapData.width,bitmapData.height); + this.contentLoaderInfo.dispatchEvent(new openfl_events_Event("complete")); + } + ,BitmapData_onProgress: function(bytesLoaded,bytesTotal) { + var event = new openfl_events_ProgressEvent("progress"); + event.bytesLoaded = bytesLoaded; + event.bytesTotal = bytesTotal; + this.contentLoaderInfo.dispatchEvent(event); + } + ,loader_onComplete: function(event) { + var _gthis = this; + var loader = event.target; + if(this.contentLoaderInfo.contentType != null && this.contentLoaderInfo.contentType.indexOf("/json") > -1) { + var manifest = lime_utils_AssetManifest.parse(loader.data,haxe_io_Path.directory(this.__path)); + if(manifest == null) { + this.__dispatchError("Cannot parse asset manifest"); + return; + } + var library = lime_utils_AssetLibrary.fromManifest(manifest); + if(library == null) { + this.__dispatchError("Cannot open library"); + return; + } + if(((library) instanceof openfl_utils_AssetLibrary)) { + library.load().onComplete(function(_) { + _gthis.__library = library; + openfl_utils_Assets.registerLibrary(_gthis.contentLoaderInfo.url,_gthis.__library); + if(manifest.name != null && !openfl_utils_Assets.hasLibrary(manifest.name)) { + openfl_utils_Assets.registerLibrary(manifest.name,_gthis.__library); + } + var clip = _gthis.__library.getMovieClip(""); + _gthis.__setContent(clip,clip.get_width() | 0,clip.get_height() | 0); + _gthis.contentLoaderInfo.dispatchEvent(new openfl_events_Event("complete")); + }).onError(function(e) { + _gthis.__dispatchError(e); + }); + } + } else if(this.contentLoaderInfo.contentType != null && (this.contentLoaderInfo.contentType.indexOf("/javascript") > -1 || this.contentLoaderInfo.contentType.indexOf("/ecmascript") > -1)) { + this.__setContent(new openfl_display_Sprite(),0,0); + eval("(function () {" + Std.string(loader.data) + "})()"); + this.contentLoaderInfo.dispatchEvent(new openfl_events_Event("complete")); + } else { + this.contentLoaderInfo.bytes = loader.data; + openfl_display_BitmapData.loadFromBytes(loader.data).onComplete($bind(this,this.BitmapData_onLoad)).onError($bind(this,this.BitmapData_onError)); + } + } + ,loader_onError: function(event) { + event.target = this.contentLoaderInfo; + this.contentLoaderInfo.dispatchEvent(event); + } + ,loader_onProgress: function(event) { + event.target = this.contentLoaderInfo; + this.contentLoaderInfo.dispatchEvent(event); + } + ,__class__: openfl_display_Loader +}); +var openfl_display_LoaderInfo = function() { + openfl_events_EventDispatcher.call(this); + this.applicationDomain = openfl_system_ApplicationDomain.currentDomain; + this.bytesLoaded = 0; + this.bytesTotal = 0; + this.childAllowsParent = true; + this.parameters = { }; +}; +$hxClasses["openfl.display.LoaderInfo"] = openfl_display_LoaderInfo; +openfl_display_LoaderInfo.__name__ = "openfl.display.LoaderInfo"; +openfl_display_LoaderInfo.create = function(loader) { + var loaderInfo = new openfl_display_LoaderInfo(); + loaderInfo.uncaughtErrorEvents = new openfl_events_UncaughtErrorEvents(); + if(loader != null) { + loaderInfo.loader = loader; + } else { + loaderInfo.url = openfl_display_LoaderInfo.__rootURL; + } + return loaderInfo; +}; +openfl_display_LoaderInfo.__super__ = openfl_events_EventDispatcher; +openfl_display_LoaderInfo.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + __complete: function() { + if(!this.__completed) { + if(this.bytesLoaded < this.bytesTotal) { + this.bytesLoaded = this.bytesTotal; + } + this.__update(this.bytesLoaded,this.bytesTotal); + this.__completed = true; + this.dispatchEvent(new openfl_events_Event("complete")); + } + } + ,__update: function(bytesLoaded,bytesTotal) { + this.bytesLoaded = bytesLoaded; + this.bytesTotal = bytesTotal; + this.dispatchEvent(new openfl_events_ProgressEvent("progress",false,false,bytesLoaded,bytesTotal)); + } + ,__class__: openfl_display_LoaderInfo +}); +var openfl_display_MovieClip = function() { + openfl_display_Sprite.call(this); + this.__enabled = true; +}; +$hxClasses["openfl.display.MovieClip"] = openfl_display_MovieClip; +openfl_display_MovieClip.__name__ = "openfl.display.MovieClip"; +openfl_display_MovieClip.fromTimeline = function(timeline) { + var movieClip = new openfl_display_MovieClip(); + movieClip.attachTimeline(timeline); + return movieClip; +}; +openfl_display_MovieClip.__super__ = openfl_display_Sprite; +openfl_display_MovieClip.prototype = $extend(openfl_display_Sprite.prototype,{ + addFrameScript: function(index,method) { + if(this.__timeline != null) { + this.__timeline.__addFrameScript(index,method); + } + } + ,attachTimeline: function(timeline) { + this.__timeline = timeline; + if(timeline != null) { + timeline.__attachMovieClip(this); + this.play(); + } + } + ,gotoAndPlay: function(frame,scene) { + if(this.__timeline != null) { + this.__timeline.__gotoAndPlay(frame,scene); + } + } + ,gotoAndStop: function(frame,scene) { + if(this.__timeline != null) { + this.__timeline.__gotoAndStop(frame,scene); + } + } + ,nextFrame: function() { + if(this.__timeline != null) { + this.__timeline.__nextFrame(); + } + } + ,nextScene: function() { + if(this.__timeline != null) { + this.__timeline.__nextScene(); + } + } + ,play: function() { + if(this.__timeline != null) { + this.__timeline.__play(); + } + } + ,prevFrame: function() { + if(this.__timeline != null) { + this.__timeline.__prevFrame(); + } + } + ,prevScene: function() { + if(this.__timeline != null) { + this.__timeline.__prevScene(); + } + } + ,stop: function() { + if(this.__timeline != null) { + this.__timeline.__stop(); + } + } + ,__enterFrame: function(deltaTime) { + if(this.__timeline != null) { + this.__timeline.__enterFrame(deltaTime); + } + var _g = 0; + var _g1 = this.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + child.__enterFrame(deltaTime); + } + } + ,__stopAllMovieClips: function() { + openfl_display_Sprite.prototype.__stopAllMovieClips.call(this); + this.stop(); + } + ,__tabTest: function(stack) { + if(!this.__enabled) { + return; + } + openfl_display_Sprite.prototype.__tabTest.call(this,stack); + } + ,__onMouseDown: function(event) { + if(this.__enabled && this.__hasDown) { + this.gotoAndStop("_down"); + } + this.__mouseIsDown = true; + if(this.stage != null) { + this.stage.addEventListener("mouseUp",$bind(this,this.__onMouseUp),true); + } + } + ,__onMouseUp: function(event) { + this.__mouseIsDown = false; + if(this.stage != null) { + this.stage.removeEventListener("mouseUp",$bind(this,this.__onMouseUp)); + } + if(!this.__buttonMode) { + return; + } + if(openfl_utils_Object.__eq(event.target,this) && this.__enabled && this.__hasOver) { + this.gotoAndStop("_over"); + } else if(this.__enabled && this.__hasUp) { + this.gotoAndStop("_up"); + } + } + ,__onRollOut: function(event) { + if(!this.__enabled) { + return; + } + if(this.__mouseIsDown && this.__hasOver) { + this.gotoAndStop("_over"); + } else if(this.__hasUp) { + this.gotoAndStop("_up"); + } + } + ,__onRollOver: function(event) { + if(this.__enabled && this.__hasOver) { + this.gotoAndStop("_over"); + } + } + ,set_buttonMode: function(value) { + if(this.__buttonMode != value) { + if(value) { + this.__hasDown = false; + this.__hasOver = false; + this.__hasUp = false; + var _g = 0; + var _g1 = this.get_currentLabels(); + while(_g < _g1.length) { + var frameLabel = _g1[_g]; + ++_g; + switch(frameLabel.name) { + case "_down": + this.__hasDown = true; + break; + case "_over": + this.__hasOver = true; + break; + case "_up": + this.__hasUp = true; + break; + default: + } + } + if(this.__hasDown || this.__hasOver || this.__hasUp) { + this.addEventListener("rollOver",$bind(this,this.__onRollOver)); + this.addEventListener("rollOut",$bind(this,this.__onRollOut)); + this.addEventListener("mouseDown",$bind(this,this.__onMouseDown)); + } + } else { + this.removeEventListener("rollOver",$bind(this,this.__onRollOver)); + this.removeEventListener("rollOut",$bind(this,this.__onRollOut)); + this.removeEventListener("mouseDown",$bind(this,this.__onMouseDown)); + } + this.__buttonMode = value; + } + return value; + } + ,get_currentFrame: function() { + if(this.__timeline != null) { + return this.__timeline.__currentFrame; + } else { + return 1; + } + } + ,get_currentFrameLabel: function() { + if(this.__timeline != null) { + return this.__timeline.__currentFrameLabel; + } else { + return null; + } + } + ,get_currentLabel: function() { + if(this.__timeline != null) { + return this.__timeline.__currentLabel; + } else { + return null; + } + } + ,get_currentLabels: function() { + if(this.__timeline != null) { + return this.__timeline.__currentLabels.slice(); + } else { + return []; + } + } + ,get_currentScene: function() { + if(this.__timeline != null) { + return this.__timeline.__currentScene; + } else { + if(this.__scene == null) { + this.__scene = new openfl_display_Scene("",[],1); + } + return this.__scene; + } + } + ,get_enabled: function() { + return this.__enabled; + } + ,set_enabled: function(value) { + return this.__enabled = value; + } + ,get_framesLoaded: function() { + if(this.__timeline != null) { + return this.__timeline.__framesLoaded; + } else { + return 1; + } + } + ,get_isPlaying: function() { + if(this.__timeline != null) { + return this.__timeline.__isPlaying; + } else { + return false; + } + } + ,get_scenes: function() { + if(this.__timeline != null) { + return this.__timeline.scenes.slice(); + } else { + return [this.get_currentScene()]; + } + } + ,get_totalFrames: function() { + if(this.__timeline != null) { + return this.__timeline.__totalFrames; + } else { + return 1; + } + } + ,__class__: openfl_display_MovieClip + ,__properties__: $extend(openfl_display_Sprite.prototype.__properties__,{get_totalFrames:"get_totalFrames",get_scenes:"get_scenes",get_isPlaying:"get_isPlaying",get_framesLoaded:"get_framesLoaded",set_enabled:"set_enabled",get_enabled:"get_enabled",get_currentScene:"get_currentScene",get_currentLabels:"get_currentLabels",get_currentLabel:"get_currentLabel",get_currentFrameLabel:"get_currentFrameLabel",get_currentFrame:"get_currentFrame"}) +}); +var openfl_geom_Rectangle = function(x,y,width,height) { + if(height == null) { + height = 0; + } + if(width == null) { + width = 0; + } + if(y == null) { + y = 0; + } + if(x == null) { + x = 0; + } + this.x = x; + this.y = y; + this.width = width; + this.height = height; +}; +$hxClasses["openfl.geom.Rectangle"] = openfl_geom_Rectangle; +openfl_geom_Rectangle.__name__ = "openfl.geom.Rectangle"; +openfl_geom_Rectangle.prototype = { + clone: function() { + return new openfl_geom_Rectangle(this.x,this.y,this.width,this.height); + } + ,contains: function(x,y) { + if(x >= this.x && y >= this.y && x < this.get_right()) { + return y < this.get_bottom(); + } else { + return false; + } + } + ,containsPoint: function(point) { + return this.contains(point.x,point.y); + } + ,containsRect: function(rect) { + if(rect.width <= 0 || rect.height <= 0) { + if(rect.x > this.x && rect.y > this.y && rect.get_right() < this.get_right()) { + return rect.get_bottom() < this.get_bottom(); + } else { + return false; + } + } else if(rect.x >= this.x && rect.y >= this.y && rect.get_right() <= this.get_right()) { + return rect.get_bottom() <= this.get_bottom(); + } else { + return false; + } + } + ,copyFrom: function(sourceRect) { + this.x = sourceRect.x; + this.y = sourceRect.y; + this.width = sourceRect.width; + this.height = sourceRect.height; + } + ,equals: function(toCompare) { + if(toCompare == this) { + return true; + } else if(toCompare != null && this.x == toCompare.x && this.y == toCompare.y && this.width == toCompare.width) { + return this.height == toCompare.height; + } else { + return false; + } + } + ,inflate: function(dx,dy) { + this.x -= dx; + this.width += dx * 2; + this.y -= dy; + this.height += dy * 2; + } + ,inflatePoint: function(point) { + this.inflate(point.x,point.y); + } + ,intersection: function(toIntersect) { + var x0 = this.x < toIntersect.x ? toIntersect.x : this.x; + var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right(); + if(x1 <= x0) { + return new openfl_geom_Rectangle(); + } + var y0 = this.y < toIntersect.y ? toIntersect.y : this.y; + var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom(); + if(y1 <= y0) { + return new openfl_geom_Rectangle(); + } + return new openfl_geom_Rectangle(x0,y0,x1 - x0,y1 - y0); + } + ,intersectionToOutput: function(toIntersect,output) { + if(output == null) { + output = new openfl_geom_Rectangle(); + } + var x0 = this.x < toIntersect.x ? toIntersect.x : this.x; + var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right(); + if(x1 <= x0) { + output.setTo(0.0,0.0,0.0,0.0); + return output; + } + var y0 = this.y < toIntersect.y ? toIntersect.y : this.y; + var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom(); + if(y1 <= y0) { + output.setTo(0.0,0.0,0.0,0.0); + return output; + } + output.setTo(x0,y0,x1 - x0,y1 - y0); + return output; + } + ,intersects: function(toIntersect) { + var x0 = this.x < toIntersect.x ? toIntersect.x : this.x; + var x1 = this.get_right() > toIntersect.get_right() ? toIntersect.get_right() : this.get_right(); + if(x1 <= x0) { + return false; + } + var y0 = this.y < toIntersect.y ? toIntersect.y : this.y; + var y1 = this.get_bottom() > toIntersect.get_bottom() ? toIntersect.get_bottom() : this.get_bottom(); + return y1 > y0; + } + ,isEmpty: function() { + if(!(this.width <= 0)) { + return this.height <= 0; + } else { + return true; + } + } + ,offset: function(dx,dy) { + this.x += dx; + this.y += dy; + } + ,offsetPoint: function(point) { + this.x += point.x; + this.y += point.y; + } + ,setEmpty: function() { + this.x = this.y = this.width = this.height = 0; + } + ,setTo: function(xa,ya,widtha,heighta) { + this.x = xa; + this.y = ya; + this.width = widtha; + this.height = heighta; + } + ,toString: function() { + return "(x=" + this.x + ", y=" + this.y + ", width=" + this.width + ", height=" + this.height + ")"; + } + ,union: function(toUnion) { + if(this.width == 0 || this.height == 0) { + return toUnion.clone(); + } else if(toUnion.width == 0 || toUnion.height == 0) { + return this.clone(); + } + var x0 = this.x > toUnion.x ? toUnion.x : this.x; + var x1 = this.get_right() < toUnion.get_right() ? toUnion.get_right() : this.get_right(); + var y0 = this.y > toUnion.y ? toUnion.y : this.y; + var y1 = this.get_bottom() < toUnion.get_bottom() ? toUnion.get_bottom() : this.get_bottom(); + return new openfl_geom_Rectangle(x0,y0,x1 - x0,y1 - y0); + } + ,unionToOutput: function(toUnion,output) { + if(output == null) { + output = new openfl_geom_Rectangle(); + } + if(this.width == 0 || this.height == 0) { + output.setTo(toUnion.x,toUnion.y,toUnion.width,toUnion.height); + return output; + } else if(toUnion.width == 0 || toUnion.height == 0) { + output.setTo(this.x,this.y,this.width,this.height); + return output; + } + var x0 = this.x > toUnion.x ? toUnion.x : this.x; + var x1 = this.get_right() < toUnion.get_right() ? toUnion.get_right() : this.get_right(); + var y0 = this.y > toUnion.y ? toUnion.y : this.y; + var y1 = this.get_bottom() < toUnion.get_bottom() ? toUnion.get_bottom() : this.get_bottom(); + output.setTo(x0,y0,x1 - x0,y1 - y0); + return output; + } + ,__contract: function(x,y,width,height) { + if(this.width == 0 && this.height == 0) { + return; + } + var offsetX = 0.0; + var offsetY = 0.0; + var offsetRight = 0.0; + var offsetBottom = 0.0; + if(this.x < x) { + offsetX = x - this.x; + } + if(this.y < y) { + offsetY = y - this.y; + } + if(this.get_right() > x + width) { + offsetRight = x + width - this.get_right(); + } + if(this.get_bottom() > y + height) { + offsetBottom = y + height - this.get_bottom(); + } + this.x += offsetX; + this.y += offsetY; + this.width += offsetRight - offsetX; + this.height += offsetBottom - offsetY; + } + ,__expand: function(x,y,width,height) { + if(this.width == 0 && this.height == 0) { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + return; + } + var cacheRight = this.get_right(); + var cacheBottom = this.get_bottom(); + if(this.x > x) { + this.x = x; + this.width = cacheRight - x; + } + if(this.y > y) { + this.y = y; + this.height = cacheBottom - y; + } + if(cacheRight < x + width) { + this.width = x + width - this.x; + } + if(cacheBottom < y + height) { + this.height = y + height - this.y; + } + } + ,__toLimeRectangle: function() { + if(openfl_geom_Rectangle.__limeRectangle == null) { + openfl_geom_Rectangle.__limeRectangle = new lime_math_Rectangle(); + } + openfl_geom_Rectangle.__limeRectangle.setTo(this.x,this.y,this.width,this.height); + return openfl_geom_Rectangle.__limeRectangle; + } + ,__transform: function(rect,m) { + var tx0 = m.a * this.x + m.c * this.y; + var tx1 = tx0; + var ty0 = m.b * this.x + m.d * this.y; + var ty1 = ty0; + var tx = m.a * (this.x + this.width) + m.c * this.y; + var ty = m.b * (this.x + this.width) + m.d * this.y; + if(tx < tx0) { + tx0 = tx; + } + if(ty < ty0) { + ty0 = ty; + } + if(tx > tx1) { + tx1 = tx; + } + if(ty > ty1) { + ty1 = ty; + } + tx = m.a * (this.x + this.width) + m.c * (this.y + this.height); + ty = m.b * (this.x + this.width) + m.d * (this.y + this.height); + if(tx < tx0) { + tx0 = tx; + } + if(ty < ty0) { + ty0 = ty; + } + if(tx > tx1) { + tx1 = tx; + } + if(ty > ty1) { + ty1 = ty; + } + tx = m.a * this.x + m.c * (this.y + this.height); + ty = m.b * this.x + m.d * (this.y + this.height); + if(tx < tx0) { + tx0 = tx; + } + if(ty < ty0) { + ty0 = ty; + } + if(tx > tx1) { + tx1 = tx; + } + if(ty > ty1) { + ty1 = ty; + } + rect.setTo(tx0 + m.tx,ty0 + m.ty,tx1 - tx0,ty1 - ty0); + } + ,get_bottom: function() { + return this.y + this.height; + } + ,set_bottom: function(b) { + this.height = b - this.y; + return b; + } + ,get_bottomRight: function() { + return new openfl_geom_Point(this.x + this.width,this.y + this.height); + } + ,set_bottomRight: function(p) { + this.width = p.x - this.x; + this.height = p.y - this.y; + return p.clone(); + } + ,get_left: function() { + return this.x; + } + ,set_left: function(l) { + this.width -= l - this.x; + this.x = l; + return l; + } + ,get_right: function() { + return this.x + this.width; + } + ,set_right: function(r) { + this.width = r - this.x; + return r; + } + ,get_size: function() { + return new openfl_geom_Point(this.width,this.height); + } + ,set_size: function(p) { + this.width = p.x; + this.height = p.y; + return p.clone(); + } + ,get_top: function() { + return this.y; + } + ,set_top: function(t) { + this.height -= t - this.y; + this.y = t; + return t; + } + ,get_topLeft: function() { + return new openfl_geom_Point(this.x,this.y); + } + ,set_topLeft: function(p) { + this.x = p.x; + this.y = p.y; + return p.clone(); + } + ,__class__: openfl_geom_Rectangle + ,__properties__: {set_topLeft:"set_topLeft",get_topLeft:"get_topLeft",set_top:"set_top",get_top:"get_top",set_size:"set_size",get_size:"get_size",set_right:"set_right",get_right:"get_right",set_left:"set_left",get_left:"get_left",set_bottomRight:"set_bottomRight",get_bottomRight:"get_bottomRight",set_bottom:"set_bottom",get_bottom:"get_bottom"} +}; +var openfl_display_OpenGLRenderer = function(context,defaultRenderTarget) { + openfl_display_DisplayObjectRenderer.call(this); + this.__context3D = context; + this.__context = context.__context; + this.gl = context.__context.webgl; + this.__gl = this.gl; + this.__defaultRenderTarget = defaultRenderTarget; + this.__flipped = this.__defaultRenderTarget == null; + if(openfl_display_Graphics.maxTextureWidth == null) { + openfl_display_Graphics.maxTextureWidth = openfl_display_Graphics.maxTextureHeight = this.__gl.getParameter(this.__gl.MAX_TEXTURE_SIZE); + } + this.__matrix = lime_math_Matrix4._new(); + this.__values = []; + this.__softwareRenderer = new openfl_display_CanvasRenderer(null); + this.__type = "opengl"; + this.__setBlendMode(10); + this.__context3D.__setGLBlend(true); + this.__clipRects = []; + this.__maskObjects = []; + this.__numClipRects = 0; + this.__projection = lime_math_Matrix4._new(); + this.__projectionFlipped = lime_math_Matrix4._new(); + this.__stencilReference = 0; + this.__tempRect = new openfl_geom_Rectangle(); + this.__defaultDisplayShader = new openfl_display_DisplayObjectShader(); + this.__defaultGraphicsShader = new openfl_display_GraphicsShader(); + this.__defaultShader = this.__defaultDisplayShader; + this.__initShader(this.__defaultShader); + this.__scrollRectMasks = new lime_utils_ObjectPool(function() { + return new openfl_display_Shape(); + }); + this.__maskShader = new openfl_display__$internal_Context3DMaskShader(); +}; +$hxClasses["openfl.display.OpenGLRenderer"] = openfl_display_OpenGLRenderer; +openfl_display_OpenGLRenderer.__name__ = "openfl.display.OpenGLRenderer"; +openfl_display_OpenGLRenderer.__super__ = openfl_display_DisplayObjectRenderer; +openfl_display_OpenGLRenderer.prototype = $extend(openfl_display_DisplayObjectRenderer.prototype,{ + applyAlpha: function(alpha) { + openfl_display_OpenGLRenderer.__alphaValue[0] = alpha * this.__worldAlpha; + if(this.__currentShaderBuffer != null) { + this.__currentShaderBuffer.addFloatOverride("openfl_Alpha",openfl_display_OpenGLRenderer.__alphaValue); + } else if(this.__currentShader != null) { + if(this.__currentShader.__alpha != null) { + this.__currentShader.__alpha.value = openfl_display_OpenGLRenderer.__alphaValue; + } + } + } + ,applyBitmapData: function(bitmapData,smooth,repeat) { + if(repeat == null) { + repeat = false; + } + if(this.__currentShaderBuffer != null) { + if(bitmapData != null) { + openfl_display_OpenGLRenderer.__textureSizeValue[0] = bitmapData.__textureWidth; + openfl_display_OpenGLRenderer.__textureSizeValue[1] = bitmapData.__textureHeight; + this.__currentShaderBuffer.addFloatOverride("openfl_TextureSize",openfl_display_OpenGLRenderer.__textureSizeValue); + } + } else if(this.__currentShader != null) { + if(this.__currentShader.__bitmap != null) { + this.__currentShader.__bitmap.input = bitmapData; + this.__currentShader.__bitmap.filter = smooth && this.__allowSmoothing ? 4 : 5; + this.__currentShader.__bitmap.mipFilter = 2; + this.__currentShader.__bitmap.wrap = repeat ? 2 : 0; + } + if(this.__currentShader.__texture != null) { + this.__currentShader.__texture.input = bitmapData; + this.__currentShader.__texture.filter = smooth && this.__allowSmoothing ? 4 : 5; + this.__currentShader.__texture.mipFilter = 2; + this.__currentShader.__texture.wrap = repeat ? 2 : 0; + } + if(this.__currentShader.__textureSize != null) { + if(bitmapData != null) { + openfl_display_OpenGLRenderer.__textureSizeValue[0] = bitmapData.__textureWidth; + openfl_display_OpenGLRenderer.__textureSizeValue[1] = bitmapData.__textureHeight; + this.__currentShader.__textureSize.value = openfl_display_OpenGLRenderer.__textureSizeValue; + } else { + this.__currentShader.__textureSize.value = null; + } + } + } + } + ,applyColorTransform: function(colorTransform) { + var enabled = colorTransform != null && !colorTransform.__isDefault(true); + this.applyHasColorTransform(enabled); + if(enabled) { + colorTransform.__setArrays(openfl_display_OpenGLRenderer.__colorMultipliersValue,openfl_display_OpenGLRenderer.__colorOffsetsValue); + if(this.__currentShaderBuffer != null) { + this.__currentShaderBuffer.addFloatOverride("openfl_ColorMultiplier",openfl_display_OpenGLRenderer.__colorMultipliersValue); + this.__currentShaderBuffer.addFloatOverride("openfl_ColorOffset",openfl_display_OpenGLRenderer.__colorOffsetsValue); + } else if(this.__currentShader != null) { + if(this.__currentShader.__colorMultiplier != null) { + this.__currentShader.__colorMultiplier.value = openfl_display_OpenGLRenderer.__colorMultipliersValue; + } + if(this.__currentShader.__colorOffset != null) { + this.__currentShader.__colorOffset.value = openfl_display_OpenGLRenderer.__colorOffsetsValue; + } + } + } else if(this.__currentShaderBuffer != null) { + this.__currentShaderBuffer.addFloatOverride("openfl_ColorMultiplier",openfl_display_OpenGLRenderer.__emptyColorValue); + this.__currentShaderBuffer.addFloatOverride("openfl_ColorOffset",openfl_display_OpenGLRenderer.__emptyColorValue); + } else if(this.__currentShader != null) { + if(this.__currentShader.__colorMultiplier != null) { + this.__currentShader.__colorMultiplier.value = openfl_display_OpenGLRenderer.__emptyColorValue; + } + if(this.__currentShader.__colorOffset != null) { + this.__currentShader.__colorOffset.value = openfl_display_OpenGLRenderer.__emptyColorValue; + } + } + } + ,applyHasColorTransform: function(enabled) { + openfl_display_OpenGLRenderer.__hasColorTransformValue[0] = enabled; + if(this.__currentShaderBuffer != null) { + this.__currentShaderBuffer.addBoolOverride("openfl_HasColorTransform",openfl_display_OpenGLRenderer.__hasColorTransformValue); + } else if(this.__currentShader != null) { + if(this.__currentShader.__hasColorTransform != null) { + this.__currentShader.__hasColorTransform.value = openfl_display_OpenGLRenderer.__hasColorTransformValue; + } + } + } + ,applyMatrix: function(matrix) { + if(this.__currentShaderBuffer != null) { + this.__currentShaderBuffer.addFloatOverride("openfl_Matrix",matrix); + } else if(this.__currentShader != null) { + if(this.__currentShader.__matrix != null) { + this.__currentShader.__matrix.value = matrix; + } + } + } + ,getMatrix: function(transform) { + if(this.gl != null) { + var values = this.__getMatrix(transform,1); + lime_math_Matrix4.set(this.__matrix,0,values[0]); + lime_math_Matrix4.set(this.__matrix,1,values[1]); + lime_math_Matrix4.set(this.__matrix,2,values[2]); + lime_math_Matrix4.set(this.__matrix,3,values[3]); + lime_math_Matrix4.set(this.__matrix,4,values[4]); + lime_math_Matrix4.set(this.__matrix,5,values[5]); + lime_math_Matrix4.set(this.__matrix,6,values[6]); + lime_math_Matrix4.set(this.__matrix,7,values[7]); + lime_math_Matrix4.set(this.__matrix,8,values[8]); + lime_math_Matrix4.set(this.__matrix,9,values[9]); + lime_math_Matrix4.set(this.__matrix,10,values[10]); + lime_math_Matrix4.set(this.__matrix,11,values[11]); + lime_math_Matrix4.set(this.__matrix,12,values[12]); + lime_math_Matrix4.set(this.__matrix,13,values[13]); + lime_math_Matrix4.set(this.__matrix,14,values[14]); + lime_math_Matrix4.set(this.__matrix,15,values[15]); + return this.__matrix; + } else { + lime_math_Matrix4.identity(this.__matrix); + lime_math_Matrix4.set(this.__matrix,0,transform.a); + lime_math_Matrix4.set(this.__matrix,1,transform.b); + lime_math_Matrix4.set(this.__matrix,4,transform.c); + lime_math_Matrix4.set(this.__matrix,5,transform.d); + lime_math_Matrix4.set(this.__matrix,12,transform.tx); + lime_math_Matrix4.set(this.__matrix,13,transform.ty); + return this.__matrix; + } + } + ,setShader: function(shader) { + this.__currentShaderBuffer = null; + if(this.__currentShader == shader) { + return; + } + var tmp = this.__currentShader != null; + if(shader == null) { + this.__currentShader = null; + this.__context3D.setProgram(null); + return; + } else { + this.__currentShader = shader; + this.__initShader(shader); + this.__context3D.setProgram(shader.program); + this.__context3D.__flushGLProgram(); + this.__currentShader.__enable(); + this.__context3D.__state.shader = shader; + } + } + ,setViewport: function() { + this.__gl.viewport(this.__offsetX,this.__offsetY,this.__displayWidth,this.__displayHeight); + } + ,updateShader: function() { + if(this.__currentShader != null) { + if(this.__currentShader.__position != null) { + this.__currentShader.__position.__useArray = true; + } + if(this.__currentShader.__textureCoord != null) { + this.__currentShader.__textureCoord.__useArray = true; + } + this.__context3D.setProgram(this.__currentShader.program); + this.__context3D.__flushGLProgram(); + this.__context3D.__flushGLTextures(); + this.__currentShader.__update(); + } + } + ,useAlphaArray: function() { + if(this.__currentShader != null) { + if(this.__currentShader.__alpha != null) { + this.__currentShader.__alpha.__useArray = true; + } + } + } + ,useColorTransformArray: function() { + if(this.__currentShader != null) { + if(this.__currentShader.__colorMultiplier != null) { + this.__currentShader.__colorMultiplier.__useArray = true; + } + if(this.__currentShader.__colorOffset != null) { + this.__currentShader.__colorOffset.__useArray = true; + } + } + } + ,__cleanup: function() { + if(this.__stencilReference > 0) { + this.__stencilReference = 0; + this.__context3D.setStencilActions(); + this.__context3D.setStencilReferenceValue(0,0,0); + } + if(this.__numClipRects > 0) { + this.__numClipRects = 0; + this.__scissorRect(); + } + } + ,__clear: function() { + if(this.__stage == null || this.__stage.__transparent) { + this.__context3D.clear(0,0,0,0,0,0,1); + } else { + this.__context3D.clear(this.__stage.__colorSplit[0],this.__stage.__colorSplit[1],this.__stage.__colorSplit[2],1,0,0,1); + } + this.__cleared = true; + } + ,__clearShader: function() { + if(this.__currentShader != null) { + if(this.__currentShaderBuffer == null) { + if(this.__currentShader.__bitmap != null) { + this.__currentShader.__bitmap.input = null; + } + } else { + this.__currentShaderBuffer.clearOverride(); + } + if(this.__currentShader.__texture != null) { + this.__currentShader.__texture.input = null; + } + if(this.__currentShader.__textureSize != null) { + this.__currentShader.__textureSize.value = null; + } + if(this.__currentShader.__hasColorTransform != null) { + this.__currentShader.__hasColorTransform.value = null; + } + if(this.__currentShader.__position != null) { + this.__currentShader.__position.value = null; + } + if(this.__currentShader.__matrix != null) { + this.__currentShader.__matrix.value = null; + } + this.__currentShader.__clearUseArray(); + } + } + ,__copyShader: function(other) { + this.__currentShader = other.__currentShader; + this.__currentShaderBuffer = other.__currentShaderBuffer; + this.__currentDisplayShader = other.__currentDisplayShader; + this.__currentGraphicsShader = other.__currentGraphicsShader; + } + ,__getMatrix: function(transform,pixelSnapping) { + var _matrix = openfl_geom_Matrix.__pool.get(); + _matrix.copyFrom(transform); + _matrix.concat(this.__worldTransform); + if(pixelSnapping == 0 || pixelSnapping == 1 && _matrix.b == 0 && _matrix.c == 0 && (_matrix.a < 1.001 && _matrix.a > 0.999) && (_matrix.d < 1.001 && _matrix.d > 0.999)) { + _matrix.tx = Math.round(_matrix.tx); + _matrix.ty = Math.round(_matrix.ty); + } + lime_math_Matrix4.identity(this.__matrix); + lime_math_Matrix4.set(this.__matrix,0,_matrix.a); + lime_math_Matrix4.set(this.__matrix,1,_matrix.b); + lime_math_Matrix4.set(this.__matrix,4,_matrix.c); + lime_math_Matrix4.set(this.__matrix,5,_matrix.d); + lime_math_Matrix4.set(this.__matrix,12,_matrix.tx); + lime_math_Matrix4.set(this.__matrix,13,_matrix.ty); + lime_math_Matrix4.append(this.__matrix,this.__flipped ? this.__projectionFlipped : this.__projection); + this.__values[0] = lime_math_Matrix4.get(this.__matrix,0); + this.__values[1] = lime_math_Matrix4.get(this.__matrix,1); + this.__values[2] = lime_math_Matrix4.get(this.__matrix,2); + this.__values[3] = lime_math_Matrix4.get(this.__matrix,3); + this.__values[4] = lime_math_Matrix4.get(this.__matrix,4); + this.__values[5] = lime_math_Matrix4.get(this.__matrix,5); + this.__values[6] = lime_math_Matrix4.get(this.__matrix,6); + this.__values[7] = lime_math_Matrix4.get(this.__matrix,7); + this.__values[8] = lime_math_Matrix4.get(this.__matrix,8); + this.__values[9] = lime_math_Matrix4.get(this.__matrix,9); + this.__values[10] = lime_math_Matrix4.get(this.__matrix,10); + this.__values[11] = lime_math_Matrix4.get(this.__matrix,11); + this.__values[12] = lime_math_Matrix4.get(this.__matrix,12); + this.__values[13] = lime_math_Matrix4.get(this.__matrix,13); + this.__values[14] = lime_math_Matrix4.get(this.__matrix,14); + this.__values[15] = lime_math_Matrix4.get(this.__matrix,15); + openfl_geom_Matrix.__pool.release(_matrix); + return this.__values; + } + ,__initShader: function(shader) { + if(shader != null) { + if(shader.__context == null) { + shader.__context = this.__context3D; + shader.__init(); + } + return shader; + } + return this.__defaultShader; + } + ,__initDisplayShader: function(shader) { + if(shader != null) { + if(shader.__context == null) { + shader.__context = this.__context3D; + shader.__init(); + } + return shader; + } + return this.__defaultDisplayShader; + } + ,__initGraphicsShader: function(shader) { + if(shader != null) { + if(shader.__context == null) { + shader.__context = this.__context3D; + shader.__init(); + } + return shader; + } + return this.__defaultGraphicsShader; + } + ,__initShaderBuffer: function(shaderBuffer) { + if(shaderBuffer != null) { + return this.__initGraphicsShader(shaderBuffer.shader); + } + return this.__defaultGraphicsShader; + } + ,__popMask: function() { + if(this.__stencilReference == 0) { + return; + } + var mask = this.__maskObjects.pop(); + if(this.__stencilReference > 1) { + this.__context3D.setStencilActions(2,1,0,0,5); + this.__context3D.setStencilReferenceValue(this.__stencilReference,255,255); + this.__context3D.setColorMask(false,false,false,false); + this.__renderDrawableMask(mask); + this.__stencilReference--; + this.__context3D.setStencilActions(2,1,5,5,5); + this.__context3D.setStencilReferenceValue(this.__stencilReference,255,0); + this.__context3D.setColorMask(true,true,true,true); + } else { + this.__stencilReference = 0; + this.__context3D.setStencilActions(); + this.__context3D.setStencilReferenceValue(0,0,0); + } + } + ,__popMaskObject: function(object,handleScrollRect) { + if(handleScrollRect == null) { + handleScrollRect = true; + } + if(object.__mask != null) { + this.__popMask(); + } + if(handleScrollRect && object.__scrollRect != null) { + if(object.__renderTransform.b != 0 || object.__renderTransform.c != 0) { + this.__scrollRectMasks.release(this.__maskObjects[this.__maskObjects.length - 1]); + this.__popMask(); + } else { + this.__popMaskRect(); + } + } + } + ,__popMaskRect: function() { + if(this.__numClipRects > 0) { + this.__numClipRects--; + if(this.__numClipRects > 0) { + this.__scissorRect(this.__clipRects[this.__numClipRects - 1]); + } else { + this.__scissorRect(); + } + } + } + ,__pushMask: function(mask) { + if(this.__stencilReference == 0) { + this.__context3D.clear(0,0,0,0,0,0,4); + this.__updatedStencil = true; + } + this.__context3D.setStencilActions(2,1,2,5,5); + this.__context3D.setStencilReferenceValue(this.__stencilReference,255,255); + this.__context3D.setColorMask(false,false,false,false); + this.__renderDrawableMask(mask); + this.__maskObjects.push(mask); + this.__stencilReference++; + this.__context3D.setStencilActions(2,1,5,5,5); + this.__context3D.setStencilReferenceValue(this.__stencilReference,255,0); + this.__context3D.setColorMask(true,true,true,true); + } + ,__pushMaskObject: function(object,handleScrollRect) { + if(handleScrollRect == null) { + handleScrollRect = true; + } + if(handleScrollRect && object.__scrollRect != null) { + if(object.__renderTransform.b != 0 || object.__renderTransform.c != 0) { + var shape = this.__scrollRectMasks.get(); + shape.get_graphics().clear(); + shape.get_graphics().beginFill(65280); + shape.get_graphics().drawRect(object.__scrollRect.x,object.__scrollRect.y,object.__scrollRect.width,object.__scrollRect.height); + shape.__renderTransform.copyFrom(object.__renderTransform); + this.__pushMask(shape); + } else { + this.__pushMaskRect(object.__scrollRect,object.__renderTransform); + } + } + if(object.__mask != null) { + this.__pushMask(object.__mask); + } + } + ,__pushMaskRect: function(rect,transform) { + if(this.__numClipRects == this.__clipRects.length) { + this.__clipRects[this.__numClipRects] = new openfl_geom_Rectangle(); + } + var _matrix = openfl_geom_Matrix.__pool.get(); + _matrix.copyFrom(transform); + _matrix.concat(this.__worldTransform); + var clipRect = this.__clipRects[this.__numClipRects]; + rect.__transform(clipRect,_matrix); + if(this.__numClipRects > 0) { + var parentClipRect = this.__clipRects[this.__numClipRects - 1]; + clipRect.__contract(parentClipRect.x,parentClipRect.y,parentClipRect.width,parentClipRect.height); + } + if(clipRect.height < 0) { + clipRect.height = 0; + } + if(clipRect.width < 0) { + clipRect.width = 0; + } + openfl_geom_Matrix.__pool.release(_matrix); + this.__scissorRect(clipRect); + this.__numClipRects++; + } + ,__render: function(object) { + this.__context3D.setColorMask(true,true,true,true); + this.__context3D.setCulling(3); + this.__context3D.setDepthTest(false,0); + this.__context3D.setStencilActions(); + this.__context3D.setStencilReferenceValue(0,0,0); + this.__context3D.setScissorRectangle(null); + this.__blendMode = null; + this.__setBlendMode(10); + if(this.__defaultRenderTarget == null) { + if(this.__context3D.__backBufferWantsBestResolution) { + openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX / this.__pixelRatio,this.__offsetY / this.__pixelRatio,this.__displayWidth / this.__pixelRatio,this.__displayHeight / this.__pixelRatio); + } else { + openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX,this.__offsetY,this.__displayWidth,this.__displayHeight); + } + this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle); + this.__upscaled = this.__worldTransform.a != 1 || this.__worldTransform.d != 1; + this.__renderDrawable(object); + if(this.__offsetX > 0 || this.__offsetY > 0) { + if(this.__offsetX > 0) { + openfl_display_OpenGLRenderer.__scissorRectangle.setTo(0,0,this.__offsetX,this.__height); + this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle); + this.__context3D.__flushGL(); + this.__gl.clearColor(0,0,0,1); + this.__gl.clear(this.__gl.COLOR_BUFFER_BIT); + openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX + this.__displayWidth,0,this.__width,this.__height); + this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle); + this.__context3D.__flushGL(); + this.__gl.clearColor(0,0,0,1); + this.__gl.clear(this.__gl.COLOR_BUFFER_BIT); + } + if(this.__offsetY > 0) { + openfl_display_OpenGLRenderer.__scissorRectangle.setTo(0,0,this.__width,this.__offsetY); + this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle); + this.__context3D.__flushGL(); + this.__gl.clearColor(0,0,0,1); + this.__gl.clear(this.__gl.COLOR_BUFFER_BIT); + openfl_display_OpenGLRenderer.__scissorRectangle.setTo(0,this.__offsetY + this.__displayHeight,this.__width,this.__height); + this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle); + this.__context3D.__flushGL(); + this.__gl.clearColor(0,0,0,1); + this.__gl.clear(this.__gl.COLOR_BUFFER_BIT); + } + this.__context3D.setScissorRectangle(null); + } + } else { + if(this.__context3D.__backBufferWantsBestResolution) { + openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX / this.__pixelRatio,this.__offsetY / this.__pixelRatio,this.__displayWidth / this.__pixelRatio,this.__displayHeight / this.__pixelRatio); + } else { + openfl_display_OpenGLRenderer.__scissorRectangle.setTo(this.__offsetX,this.__offsetY,this.__displayWidth,this.__displayHeight); + } + this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle); + var cacheMask = object.__mask; + var cacheScrollRect = object.__scrollRect; + object.__mask = null; + object.__scrollRect = null; + this.__renderDrawable(object); + object.__mask = cacheMask; + object.__scrollRect = cacheScrollRect; + } + this.__context3D.present(); + } + ,__renderDrawable: function(object) { + if(object == null) { + return; + } + switch(object.__drawableType) { + case 0: + openfl_display__$internal_Context3DBitmapData.renderDrawable(object,this); + break; + case 2: + openfl_display__$internal_Context3DBitmap.renderDrawable(object,this); + break; + case 3: + openfl_display__$internal_Context3DDisplayObject.renderDrawable(object,this); + break; + case 4:case 5: + openfl_display__$internal_Context3DDisplayObjectContainer.renderDrawable(object,this); + break; + case 6: + openfl_display__$internal_Context3DSimpleButton.renderDrawable(object,this); + break; + case 7: + openfl_display__$internal_Context3DTextField.renderDrawable(object,this); + break; + case 8: + openfl_display__$internal_Context3DVideo.renderDrawable(object,this); + break; + case 9: + openfl_display__$internal_Context3DTilemap.renderDrawable(object,this); + break; + default: + } + } + ,__renderDrawableMask: function(object) { + if(object == null) { + return; + } + switch(object.__drawableType) { + case 0: + openfl_display__$internal_Context3DBitmapData.renderDrawableMask(object,this); + break; + case 2: + openfl_display__$internal_Context3DBitmap.renderDrawableMask(object,this); + break; + case 3: + openfl_display__$internal_Context3DDisplayObject.renderDrawableMask(object,this); + break; + case 4:case 5: + openfl_display__$internal_Context3DDisplayObjectContainer.renderDrawableMask(object,this); + break; + case 6: + openfl_display__$internal_Context3DSimpleButton.renderDrawableMask(object,this); + break; + case 7: + openfl_display__$internal_Context3DTextField.renderDrawableMask(object,this); + break; + case 8: + openfl_display__$internal_Context3DVideo.renderDrawableMask(object,this); + break; + case 9: + openfl_display__$internal_Context3DTilemap.renderDrawableMask(object,this); + break; + default: + } + } + ,__renderFilterPass: function(source,shader,smooth,clear) { + if(clear == null) { + clear = true; + } + if(source == null || shader == null) { + return; + } + if(this.__defaultRenderTarget == null) { + return; + } + var cacheRTT = this.__context3D.__state.renderToTexture; + var cacheRTTDepthStencil = this.__context3D.__state.renderToTextureDepthStencil; + var cacheRTTAntiAlias = this.__context3D.__state.renderToTextureAntiAlias; + var cacheRTTSurfaceSelector = this.__context3D.__state.renderToTextureSurfaceSelector; + this.__context3D.setRenderToTexture(this.__defaultRenderTarget.getTexture(this.__context3D),false); + if(clear) { + this.__context3D.clear(0,0,0,0,0,0,1); + } + var shader1 = this.__initShader(shader); + this.setShader(shader1); + this.applyAlpha(1); + this.applyBitmapData(source,smooth); + this.applyColorTransform(null); + this.applyMatrix(this.__getMatrix(source.__renderTransform,1)); + this.updateShader(); + var vertexBuffer = source.getVertexBuffer(this.__context3D); + if(shader1.__position != null) { + this.__context3D.setVertexBufferAt(shader1.__position.index,vertexBuffer,0,3); + } + if(shader1.__textureCoord != null) { + this.__context3D.setVertexBufferAt(shader1.__textureCoord.index,vertexBuffer,3,2); + } + var indexBuffer = source.getIndexBuffer(this.__context3D); + this.__context3D.drawTriangles(indexBuffer); + if(cacheRTT != null) { + this.__context3D.setRenderToTexture(cacheRTT,cacheRTTDepthStencil,cacheRTTAntiAlias,cacheRTTSurfaceSelector); + } else { + this.__context3D.setRenderToBackBuffer(); + } + this.__clearShader(); + } + ,__resize: function(width,height) { + this.__width = width; + this.__height = height; + var w = this.__defaultRenderTarget == null ? this.__stage.stageWidth : this.__defaultRenderTarget.width; + var h = this.__defaultRenderTarget == null ? this.__stage.stageHeight : this.__defaultRenderTarget.height; + var tmp; + if(this.__defaultRenderTarget == null) { + var _this = this.__worldTransform; + tmp = Math.round(0 * _this.a + 0 * _this.c + _this.tx); + } else { + tmp = 0; + } + this.__offsetX = tmp; + var tmp; + if(this.__defaultRenderTarget == null) { + var _this = this.__worldTransform; + tmp = Math.round(0 * _this.b + 0 * _this.d + _this.ty); + } else { + tmp = 0; + } + this.__offsetY = tmp; + var tmp; + if(this.__defaultRenderTarget == null) { + var _this = this.__worldTransform; + tmp = Math.round(w * _this.a + 0 * _this.c + _this.tx - this.__offsetX); + } else { + tmp = w; + } + this.__displayWidth = tmp; + var tmp; + if(this.__defaultRenderTarget == null) { + var _this = this.__worldTransform; + tmp = Math.round(0 * _this.b + h * _this.d + _this.ty - this.__offsetY); + } else { + tmp = h; + } + this.__displayHeight = tmp; + lime_math_Matrix4.createOrtho(this.__projection,0,this.__displayWidth + this.__offsetX * 2,0,this.__displayHeight + this.__offsetY * 2,-1000,1000); + lime_math_Matrix4.createOrtho(this.__projectionFlipped,0,this.__displayWidth + this.__offsetX * 2,this.__displayHeight + this.__offsetY * 2,0,-1000,1000); + } + ,__resumeClipAndMask: function(childRenderer) { + if(this.__stencilReference > 0) { + this.__context3D.setStencilActions(2,1,5,5,5); + this.__context3D.setStencilReferenceValue(this.__stencilReference,255,0); + } else { + this.__context3D.setStencilActions(); + this.__context3D.setStencilReferenceValue(0,0,0); + } + if(this.__numClipRects > 0) { + this.__scissorRect(this.__clipRects[this.__numClipRects - 1]); + } else { + this.__scissorRect(); + } + } + ,__scissorRect: function(clipRect) { + if(clipRect != null) { + var x = Math.floor(clipRect.x); + var y = Math.floor(clipRect.y); + var width = clipRect.width > 0 ? Math.ceil(clipRect.get_right()) - x : 0; + var height = clipRect.height > 0 ? Math.ceil(clipRect.get_bottom()) - y : 0; + if(this.__context3D.__backBufferWantsBestResolution) { + var uv = 1.5 / this.__pixelRatio; + x = clipRect.x / this.__pixelRatio; + y = clipRect.y / this.__pixelRatio; + width = clipRect.width > 0 ? clipRect.get_right() / this.__pixelRatio - x + uv : 0; + height = clipRect.height > 0 ? clipRect.get_bottom() / this.__pixelRatio - y + uv : 0; + } + if(width < 0) { + width = 0; + } + if(height < 0) { + height = 0; + } + openfl_display_OpenGLRenderer.__scissorRectangle.setTo(x,y,width,height); + this.__context3D.setScissorRectangle(openfl_display_OpenGLRenderer.__scissorRectangle); + } else { + this.__context3D.setScissorRectangle(null); + } + } + ,__setBlendMode: function(value) { + if(this.__overrideBlendMode != null) { + value = this.__overrideBlendMode; + } + if(this.__blendMode == value) { + return; + } + this.__blendMode = value; + switch(value) { + case 0: + this.__context3D.setBlendFactors(2,2); + break; + case 9: + this.__context3D.setBlendFactors(1,5); + break; + case 12: + this.__context3D.setBlendFactors(2,6); + break; + case 14: + this.__context3D.setBlendFactors(2,2); + this.__context3D.__setGLBlendEquation(this.__gl.FUNC_REVERSE_SUBTRACT); + break; + default: + this.__context3D.setBlendFactors(2,5); + } + } + ,__setRenderTarget: function(renderTarget) { + this.__defaultRenderTarget = renderTarget; + this.__flipped = renderTarget == null; + if(renderTarget != null) { + this.__resize(renderTarget.width,renderTarget.height); + } + } + ,__setShaderBuffer: function(shaderBuffer) { + this.setShader(shaderBuffer.shader); + this.__currentShaderBuffer = shaderBuffer; + } + ,__suspendClipAndMask: function() { + if(this.__stencilReference > 0) { + this.__context3D.setStencilActions(); + this.__context3D.setStencilReferenceValue(0,0,0); + } + if(this.__numClipRects > 0) { + this.__scissorRect(); + } + } + ,__updateShaderBuffer: function(bufferOffset) { + if(this.__currentShader != null && this.__currentShaderBuffer != null) { + this.__currentShader.__updateFromBuffer(this.__currentShaderBuffer,bufferOffset); + } + } + ,__class__: openfl_display_OpenGLRenderer +}); +var openfl_display_PNGEncoderOptions = function(fastCompression) { + if(fastCompression == null) { + fastCompression = false; + } + this.fastCompression = fastCompression; +}; +$hxClasses["openfl.display.PNGEncoderOptions"] = openfl_display_PNGEncoderOptions; +openfl_display_PNGEncoderOptions.__name__ = "openfl.display.PNGEncoderOptions"; +openfl_display_PNGEncoderOptions.prototype = { + __class__: openfl_display_PNGEncoderOptions +}; +var openfl_display_PixelSnapping = {}; +openfl_display_PixelSnapping.fromString = function(value) { + switch(value) { + case "always": + return 0; + case "auto": + return 1; + case "never": + return 2; + default: + return null; + } +}; +openfl_display_PixelSnapping.toString = function(this1) { + switch(this1) { + case 0: + return "always"; + case 1: + return "auto"; + case 2: + return "never"; + default: + return null; + } +}; +var openfl_display_Preloader = function(display) { + this.onComplete = new lime_app__$Event_$Void_$Void(); + this.display = display; + if(display != null) { + display.addEventListener("unload",$bind(this,this.display_onUnload)); + openfl_Lib.get_current().addChild(display); + } +}; +$hxClasses["openfl.display.Preloader"] = openfl_display_Preloader; +openfl_display_Preloader.__name__ = "openfl.display.Preloader"; +openfl_display_Preloader.prototype = { + start: function() { + this.ready = true; + openfl_Lib.get_current().get_loaderInfo().__complete(); + if(this.display != null) { + var complete = new openfl_events_Event("complete",true,true); + this.display.dispatchEvent(complete); + if(!complete.isDefaultPrevented()) { + this.display.dispatchEvent(new openfl_events_Event("unload")); + } + } else if(!this.complete) { + this.complete = true; + this.onComplete.dispatch(); + } + } + ,update: function(loaded,total) { + openfl_Lib.get_current().get_loaderInfo().__update(loaded,total); + if(this.display != null) { + this.display.dispatchEvent(new openfl_events_ProgressEvent("progress",true,true,loaded,total)); + } + } + ,display_onUnload: function(event) { + if(this.display != null) { + this.display.removeEventListener("unload",$bind(this,this.display_onUnload)); + if(this.display.parent == openfl_Lib.get_current()) { + openfl_Lib.get_current().removeChild(this.display); + } + openfl_Lib.get_current().stage.set_focus(null); + this.display = null; + } + if(this.ready) { + if(!this.complete) { + this.complete = true; + this.onComplete.dispatch(); + } + } + } + ,__class__: openfl_display_Preloader +}; +var openfl_display_DefaultPreloader = function() { + openfl_display_Sprite.call(this); + var backgroundColor = this.getBackgroundColor(); + var r = backgroundColor >> 16 & 255; + var g = backgroundColor >> 8 & 255; + var b = backgroundColor & 255; + var perceivedLuminosity = 0.299 * r + 0.587 * g + 0.114 * b; + var color = 0; + if(perceivedLuminosity < 70) { + color = 16777215; + } + var x = 30; + var height = 7; + var y = this.getHeight() / 2 - height / 2; + var width = this.getWidth() - x * 2; + var padding = 2; + this.outline = new openfl_display_Shape(); + this.outline.get_graphics().beginFill(color,0.07); + this.outline.get_graphics().drawRect(0,0,width,height); + this.outline.set_x(x); + this.outline.set_y(y); + this.outline.set_alpha(0); + this.addChild(this.outline); + this.progress = new openfl_display_Shape(); + this.progress.get_graphics().beginFill(color,0.35); + this.progress.get_graphics().drawRect(0,0,width - padding * 2,height - padding * 2); + this.progress.set_x(x + padding); + this.progress.set_y(y + padding); + this.progress.set_scaleX(0); + this.progress.set_alpha(0); + this.addChild(this.progress); + this.startAnimation = openfl_Lib.getTimer() + 100; + this.endAnimation = this.startAnimation + 1000; + this.addEventListener("addedToStage",$bind(this,this.this_onAddedToStage)); +}; +$hxClasses["openfl.display.DefaultPreloader"] = openfl_display_DefaultPreloader; +openfl_display_DefaultPreloader.__name__ = "openfl.display.DefaultPreloader"; +openfl_display_DefaultPreloader.__super__ = openfl_display_Sprite; +openfl_display_DefaultPreloader.prototype = $extend(openfl_display_Sprite.prototype,{ + getBackgroundColor: function() { + var attributes = openfl_Lib.get_current().stage.window.context.attributes; + if(Object.prototype.hasOwnProperty.call(attributes,"background") && attributes.background != null) { + return attributes.background; + } else { + return 0; + } + } + ,getHeight: function() { + var height = openfl_Lib.get_current().stage.window.__height; + if(height > 0) { + return height; + } else { + return openfl_Lib.get_current().stage.stageHeight; + } + } + ,getWidth: function() { + var width = openfl_Lib.get_current().stage.window.__width; + if(width > 0) { + return width; + } else { + return openfl_Lib.get_current().stage.stageWidth; + } + } + ,onInit: function() { + this.addEventListener("enterFrame",$bind(this,this.this_onEnterFrame)); + } + ,onLoaded: function() { + this.removeEventListener("enterFrame",$bind(this,this.this_onEnterFrame)); + this.dispatchEvent(new openfl_events_Event("unload")); + } + ,onUpdate: function(bytesLoaded,bytesTotal) { + var percentLoaded = 0.0; + if(bytesTotal > 0) { + percentLoaded = bytesLoaded / bytesTotal; + if(percentLoaded > 1) { + percentLoaded = 1; + } + } + this.progress.set_scaleX(percentLoaded); + } + ,this_onAddedToStage: function(event) { + this.removeEventListener("addedToStage",$bind(this,this.this_onAddedToStage)); + this.onInit(); + this.onUpdate(this.get_loaderInfo().bytesLoaded,this.get_loaderInfo().bytesTotal); + this.addEventListener("progress",$bind(this,this.this_onProgress)); + this.addEventListener("complete",$bind(this,this.this_onComplete)); + } + ,this_onComplete: function(event) { + event.preventDefault(); + this.removeEventListener("progress",$bind(this,this.this_onProgress)); + this.removeEventListener("complete",$bind(this,this.this_onComplete)); + this.onLoaded(); + } + ,this_onEnterFrame: function(event) { + var elapsed = openfl_Lib.getTimer() - this.startAnimation; + var total = this.endAnimation - this.startAnimation; + var percent = elapsed / total; + if(percent < 0) { + percent = 0; + } + if(percent > 1) { + percent = 1; + } + this.outline.set_alpha(this.progress.set_alpha(percent)); + } + ,this_onProgress: function(event) { + this.onUpdate(event.bytesLoaded | 0,event.bytesTotal | 0); + } + ,__class__: openfl_display_DefaultPreloader +}); +var openfl_display_Scene = function(name,labels,numFrames) { + this.name = name; + this.labels = labels; + this.numFrames = numFrames; +}; +$hxClasses["openfl.display.Scene"] = openfl_display_Scene; +openfl_display_Scene.__name__ = "openfl.display.Scene"; +openfl_display_Scene.prototype = { + __class__: openfl_display_Scene +}; +var openfl_display_ShaderData = {}; +openfl_display_ShaderData._new = function(byteArray) { + return { }; +}; +var openfl_display_ShaderInput = function() { + this.channels = 0; + this.filter = 5; + this.height = 0; + this.index = 0; + this.mipFilter = 2; + this.width = 0; + this.wrap = 0; +}; +$hxClasses["openfl.display.ShaderInput"] = openfl_display_ShaderInput; +openfl_display_ShaderInput.__name__ = "openfl.display.ShaderInput"; +openfl_display_ShaderInput.prototype = { + __disableGL: function(context,id) { + if(id < 0) { + return; + } + var gl = context.gl; + context.setTextureAt(id,null); + } + ,__updateGL: function(context,id,overrideInput,overrideFilter,overrideMipFilter,overrideWrap) { + var gl = context.gl; + var input = overrideInput != null ? overrideInput : this.input; + var filter = overrideFilter != null ? overrideFilter : this.filter; + var mipFilter = overrideMipFilter != null ? overrideMipFilter : this.mipFilter; + var wrap = overrideWrap != null ? overrideWrap : this.wrap; + if(input != null) { + var bitmapData = input; + context.setTextureAt(id,bitmapData.getTexture(context)); + context.setSamplerStateAt(id,wrap,filter,mipFilter); + } else { + context.setTextureAt(id,null); + } + } + ,__class__: openfl_display_ShaderInput +}; +var openfl_display_ShaderParameter = function() { + this.index = 0; +}; +$hxClasses["openfl.display.ShaderParameter"] = openfl_display_ShaderParameter; +openfl_display_ShaderParameter.__name__ = "openfl.display.ShaderParameter"; +openfl_display_ShaderParameter.prototype = { + __disableGL: function(context) { + if(this.index < 0) { + return; + } + var gl = context.gl; + if(!this.__isUniform) { + var _g = 0; + var _g1 = this.__arrayLength; + while(_g < _g1) { + var i = _g++; + gl.disableVertexAttribArray(this.index + i); + } + } + } + ,__updateGL: function(context,overrideValue) { + if(this.index < 0) { + return; + } + var gl = context.gl; + var value = overrideValue != null ? overrideValue : this.value; + var boolValue = this.__isBool ? value : null; + var floatValue = this.__isFloat ? value : null; + var intValue = this.__isInt ? value : null; + if(this.__isUniform) { + if(value != null && value.length >= this.__length) { + switch(this.type) { + case 0: + gl.uniform1i(this.index,boolValue[0] ? 1 : 0); + break; + case 1: + gl.uniform2i(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0); + break; + case 2: + gl.uniform3i(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0,boolValue[2] ? 1 : 0); + break; + case 3: + gl.uniform4i(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0,boolValue[2] ? 1 : 0,boolValue[3] ? 1 : 0); + break; + case 4: + gl.uniform1f(this.index,floatValue[0]); + break; + case 5: + gl.uniform2f(this.index,floatValue[0],floatValue[1]); + break; + case 6: + gl.uniform3f(this.index,floatValue[0],floatValue[1],floatValue[2]); + break; + case 7: + gl.uniform4f(this.index,floatValue[0],floatValue[1],floatValue[2],floatValue[3]); + break; + case 8: + gl.uniform1i(this.index,intValue[0]); + break; + case 9: + gl.uniform2i(this.index,intValue[0],intValue[1]); + break; + case 10: + gl.uniform3i(this.index,intValue[0],intValue[1],intValue[2]); + break; + case 11: + gl.uniform4i(this.index,intValue[0],intValue[1],intValue[2],intValue[3]); + break; + case 12: + this.__uniformMatrix[0] = floatValue[0]; + this.__uniformMatrix[1] = floatValue[1]; + this.__uniformMatrix[2] = floatValue[2]; + this.__uniformMatrix[3] = floatValue[3]; + lime_graphics_WebGLRenderContext.uniformMatrix2fv(gl,this.index,false,this.__uniformMatrix); + break; + case 16: + this.__uniformMatrix[0] = floatValue[0]; + this.__uniformMatrix[1] = floatValue[1]; + this.__uniformMatrix[2] = floatValue[2]; + this.__uniformMatrix[3] = floatValue[3]; + this.__uniformMatrix[4] = floatValue[4]; + this.__uniformMatrix[5] = floatValue[5]; + this.__uniformMatrix[6] = floatValue[6]; + this.__uniformMatrix[7] = floatValue[7]; + this.__uniformMatrix[8] = floatValue[8]; + lime_graphics_WebGLRenderContext.uniformMatrix3fv(gl,this.index,false,this.__uniformMatrix); + break; + case 20: + this.__uniformMatrix[0] = floatValue[0]; + this.__uniformMatrix[1] = floatValue[1]; + this.__uniformMatrix[2] = floatValue[2]; + this.__uniformMatrix[3] = floatValue[3]; + this.__uniformMatrix[4] = floatValue[4]; + this.__uniformMatrix[5] = floatValue[5]; + this.__uniformMatrix[6] = floatValue[6]; + this.__uniformMatrix[7] = floatValue[7]; + this.__uniformMatrix[8] = floatValue[8]; + this.__uniformMatrix[9] = floatValue[9]; + this.__uniformMatrix[10] = floatValue[10]; + this.__uniformMatrix[11] = floatValue[11]; + this.__uniformMatrix[12] = floatValue[12]; + this.__uniformMatrix[13] = floatValue[13]; + this.__uniformMatrix[14] = floatValue[14]; + this.__uniformMatrix[15] = floatValue[15]; + lime_graphics_WebGLRenderContext.uniformMatrix4fv(gl,this.index,false,this.__uniformMatrix); + break; + default: + } + } else { + switch(this.type) { + case 4: + gl.uniform1f(this.index,0); + break; + case 5: + gl.uniform2f(this.index,0,0); + break; + case 6: + gl.uniform3f(this.index,0,0,0); + break; + case 7: + gl.uniform4f(this.index,0,0,0,0); + break; + case 0:case 8: + gl.uniform1i(this.index,0); + break; + case 1:case 9: + gl.uniform2i(this.index,0,0); + break; + case 2:case 10: + gl.uniform3i(this.index,0,0,0); + break; + case 3:case 11: + gl.uniform4i(this.index,0,0,0,0); + break; + case 12: + this.__uniformMatrix[0] = 0; + this.__uniformMatrix[1] = 0; + this.__uniformMatrix[2] = 0; + this.__uniformMatrix[3] = 0; + lime_graphics_WebGLRenderContext.uniformMatrix2fv(gl,this.index,false,this.__uniformMatrix); + break; + case 16: + this.__uniformMatrix[0] = 0; + this.__uniformMatrix[1] = 0; + this.__uniformMatrix[2] = 0; + this.__uniformMatrix[3] = 0; + this.__uniformMatrix[4] = 0; + this.__uniformMatrix[5] = 0; + this.__uniformMatrix[6] = 0; + this.__uniformMatrix[7] = 0; + this.__uniformMatrix[8] = 0; + lime_graphics_WebGLRenderContext.uniformMatrix3fv(gl,this.index,false,this.__uniformMatrix); + break; + case 20: + this.__uniformMatrix[0] = 0; + this.__uniformMatrix[1] = 0; + this.__uniformMatrix[2] = 0; + this.__uniformMatrix[3] = 0; + this.__uniformMatrix[4] = 0; + this.__uniformMatrix[5] = 0; + this.__uniformMatrix[6] = 0; + this.__uniformMatrix[7] = 0; + this.__uniformMatrix[8] = 0; + this.__uniformMatrix[9] = 0; + this.__uniformMatrix[10] = 0; + this.__uniformMatrix[11] = 0; + this.__uniformMatrix[12] = 0; + this.__uniformMatrix[13] = 0; + this.__uniformMatrix[14] = 0; + this.__uniformMatrix[15] = 0; + lime_graphics_WebGLRenderContext.uniformMatrix4fv(gl,this.index,false,this.__uniformMatrix); + break; + default: + } + } + } else if(!this.__useArray && (value == null || value.length == this.__length)) { + var _g = 0; + var _g1 = this.__arrayLength; + while(_g < _g1) { + var i = _g++; + gl.disableVertexAttribArray(this.index + i); + } + if(value != null) { + switch(this.type) { + case 0: + gl.vertexAttrib1f(this.index,boolValue[0] ? 1 : 0); + break; + case 1: + gl.vertexAttrib2f(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0); + break; + case 2: + gl.vertexAttrib3f(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0,boolValue[2] ? 1 : 0); + break; + case 3: + gl.vertexAttrib4f(this.index,boolValue[0] ? 1 : 0,boolValue[1] ? 1 : 0,boolValue[2] ? 1 : 0,boolValue[3] ? 1 : 0); + break; + case 4: + gl.vertexAttrib1f(this.index,floatValue[0]); + break; + case 5: + gl.vertexAttrib2f(this.index,floatValue[0],floatValue[1]); + break; + case 6: + gl.vertexAttrib3f(this.index,floatValue[0],floatValue[1],floatValue[2]); + break; + case 7: + gl.vertexAttrib4f(this.index,floatValue[0],floatValue[1],floatValue[2],floatValue[3]); + break; + case 8: + gl.vertexAttrib1f(this.index,intValue[0]); + break; + case 9: + gl.vertexAttrib2f(this.index,intValue[0],intValue[1]); + break; + case 10: + gl.vertexAttrib3f(this.index,intValue[0],intValue[1],intValue[2]); + break; + case 11: + gl.vertexAttrib4f(this.index,intValue[0],intValue[1],intValue[2],intValue[3]); + break; + case 12: + gl.vertexAttrib2f(this.index + 0,floatValue[0],floatValue[1]); + gl.vertexAttrib2f(this.index + 1,floatValue[2],floatValue[3]); + break; + case 16: + gl.vertexAttrib3f(this.index + 0,floatValue[0],floatValue[1],floatValue[2]); + gl.vertexAttrib3f(this.index + 1,floatValue[3],floatValue[4],floatValue[5]); + gl.vertexAttrib3f(this.index + 2,floatValue[6],floatValue[7],floatValue[8]); + break; + case 20: + gl.vertexAttrib4f(this.index + 0,floatValue[0],floatValue[1],floatValue[2],floatValue[3]); + gl.vertexAttrib4f(this.index + 1,floatValue[4],floatValue[5],floatValue[6],floatValue[7]); + gl.vertexAttrib4f(this.index + 2,floatValue[8],floatValue[9],floatValue[10],floatValue[11]); + gl.vertexAttrib4f(this.index + 3,floatValue[12],floatValue[13],floatValue[14],floatValue[15]); + break; + default: + } + } else { + switch(this.type) { + case 0:case 4:case 8: + gl.vertexAttrib1f(this.index,0); + break; + case 1:case 5:case 9: + gl.vertexAttrib2f(this.index,0,0); + break; + case 2:case 6:case 10: + gl.vertexAttrib3f(this.index,0,0,0); + break; + case 3:case 7:case 11: + gl.vertexAttrib4f(this.index,0,0,0,0); + break; + case 12: + gl.vertexAttrib2f(this.index + 0,0,0); + gl.vertexAttrib2f(this.index + 1,0,0); + break; + case 16: + gl.vertexAttrib3f(this.index + 0,0,0,0); + gl.vertexAttrib3f(this.index + 1,0,0,0); + gl.vertexAttrib3f(this.index + 2,0,0,0); + break; + case 20: + gl.vertexAttrib4f(this.index + 0,0,0,0,0); + gl.vertexAttrib4f(this.index + 1,0,0,0,0); + gl.vertexAttrib4f(this.index + 2,0,0,0,0); + gl.vertexAttrib4f(this.index + 3,0,0,0,0); + break; + default: + } + } + } else { + var _g = 0; + var _g1 = this.__arrayLength; + while(_g < _g1) { + var i = _g++; + gl.enableVertexAttribArray(this.index + i); + } + } + } + ,__updateGLFromBuffer: function(context,buffer,position,length,bufferOffset) { + if(this.index < 0) { + return; + } + var gl = context.gl; + if(this.__isUniform) { + if(length >= this.__length) { + switch(this.type) { + case 4: + gl.uniform1f(this.index,buffer[position]); + break; + case 5: + gl.uniform2f(this.index,buffer[position],buffer[position + 1]); + break; + case 6: + gl.uniform3f(this.index,buffer[position],buffer[position + 1],buffer[position + 2]); + break; + case 7: + gl.uniform4f(this.index,buffer[position],buffer[position + 1],buffer[position + 2],buffer[position + 3]); + break; + case 0:case 8: + gl.uniform1i(this.index,buffer[position] | 0); + break; + case 1:case 9: + gl.uniform2i(this.index,buffer[position] | 0,buffer[position + 1] | 0); + break; + case 2:case 10: + gl.uniform3i(this.index,buffer[position] | 0,buffer[position + 1] | 0,buffer[position + 2] | 0); + break; + case 3:case 11: + gl.uniform4i(this.index,buffer[position] | 0,buffer[position + 1] | 0,buffer[position + 2] | 0,buffer[position + 3] | 0); + break; + case 12: + this.__uniformMatrix[0] = buffer[position]; + this.__uniformMatrix[1] = buffer[position + 1]; + this.__uniformMatrix[2] = buffer[position + 2]; + this.__uniformMatrix[3] = buffer[position + 3]; + lime_graphics_WebGLRenderContext.uniformMatrix2fv(gl,this.index,false,this.__uniformMatrix); + break; + case 16: + this.__uniformMatrix[0] = buffer[position]; + this.__uniformMatrix[1] = buffer[position + 1]; + this.__uniformMatrix[2] = buffer[position + 2]; + this.__uniformMatrix[3] = buffer[position + 3]; + this.__uniformMatrix[4] = buffer[position + 4]; + this.__uniformMatrix[5] = buffer[position + 5]; + this.__uniformMatrix[6] = buffer[position + 6]; + this.__uniformMatrix[7] = buffer[position + 7]; + this.__uniformMatrix[8] = buffer[position + 8]; + lime_graphics_WebGLRenderContext.uniformMatrix3fv(gl,this.index,false,this.__uniformMatrix); + break; + case 20: + this.__uniformMatrix[0] = buffer[position]; + this.__uniformMatrix[1] = buffer[position + 1]; + this.__uniformMatrix[2] = buffer[position + 2]; + this.__uniformMatrix[3] = buffer[position + 3]; + this.__uniformMatrix[4] = buffer[position + 4]; + this.__uniformMatrix[5] = buffer[position + 5]; + this.__uniformMatrix[6] = buffer[position + 6]; + this.__uniformMatrix[7] = buffer[position + 7]; + this.__uniformMatrix[8] = buffer[position + 8]; + this.__uniformMatrix[9] = buffer[position + 9]; + this.__uniformMatrix[10] = buffer[position + 10]; + this.__uniformMatrix[11] = buffer[position + 11]; + this.__uniformMatrix[12] = buffer[position + 12]; + this.__uniformMatrix[13] = buffer[position + 13]; + this.__uniformMatrix[14] = buffer[position + 14]; + this.__uniformMatrix[15] = buffer[position + 15]; + lime_graphics_WebGLRenderContext.uniformMatrix4fv(gl,this.index,false,this.__uniformMatrix); + break; + default: + } + } + } else if(!this.__internal && (length == 0 || length == this.__length)) { + var _g = 0; + var _g1 = this.__arrayLength; + while(_g < _g1) { + var i = _g++; + gl.disableVertexAttribArray(this.index + i); + } + if(length > 0) { + switch(this.type) { + case 0:case 4:case 8: + gl.vertexAttrib1f(this.index,buffer[position]); + break; + case 1:case 5:case 9: + gl.vertexAttrib2f(this.index,buffer[position],buffer[position + 1]); + break; + case 2:case 6:case 10: + gl.vertexAttrib3f(this.index,buffer[position],buffer[position + 1],buffer[position + 2]); + break; + case 3:case 7:case 11: + gl.vertexAttrib4f(this.index,buffer[position],buffer[position + 1],buffer[position + 2],buffer[position + 3]); + break; + case 12: + gl.vertexAttrib2f(this.index + 0,buffer[position],buffer[position + 1]); + gl.vertexAttrib2f(this.index + 1,buffer[position + 2],buffer[position + 2 + 1]); + break; + case 16: + gl.vertexAttrib3f(this.index + 0,buffer[position],buffer[position + 1],buffer[position + 2]); + gl.vertexAttrib3f(this.index + 1,buffer[position + 3],buffer[position + 3 + 1],buffer[position + 3 + 2]); + gl.vertexAttrib3f(this.index + 2,buffer[position + 6],buffer[position + 6 + 1],buffer[position + 6 + 2]); + break; + case 20: + gl.vertexAttrib4f(this.index + 0,buffer[position],buffer[position + 1],buffer[position + 2],buffer[position + 3]); + gl.vertexAttrib4f(this.index + 1,buffer[position + 4],buffer[position + 4 + 1],buffer[position + 4 + 2],buffer[position + 4 + 3]); + gl.vertexAttrib4f(this.index + 2,buffer[position + 8],buffer[position + 8 + 1],buffer[position + 8 + 2],buffer[position + 8 + 3]); + gl.vertexAttrib4f(this.index + 3,buffer[position + 12],buffer[position + 12 + 1],buffer[position + 12 + 2],buffer[position + 12 + 3]); + break; + default: + } + } else { + switch(this.type) { + case 0:case 4:case 8: + gl.vertexAttrib1f(this.index,0); + break; + case 1:case 5:case 9: + gl.vertexAttrib2f(this.index,0,0); + break; + case 2:case 6:case 10: + gl.vertexAttrib3f(this.index,0,0,0); + break; + case 3:case 7:case 11: + gl.vertexAttrib4f(this.index,0,0,0,0); + break; + case 12: + gl.vertexAttrib2f(this.index + 0,0,0); + gl.vertexAttrib2f(this.index + 1,0,0); + break; + case 16: + gl.vertexAttrib3f(this.index + 0,0,0,0); + gl.vertexAttrib3f(this.index + 1,0,0,0); + gl.vertexAttrib3f(this.index + 2,0,0,0); + break; + case 20: + gl.vertexAttrib4f(this.index + 0,0,0,0,0); + gl.vertexAttrib4f(this.index + 1,0,0,0,0); + gl.vertexAttrib4f(this.index + 2,0,0,0,0); + gl.vertexAttrib4f(this.index + 3,0,0,0,0); + break; + default: + } + } + } else { + var type = gl.FLOAT; + if(this.__isBool) { + type = gl.INT; + } else if(this.__isInt) { + type = gl.INT; + } + var _g = 0; + var _g1 = this.__arrayLength; + while(_g < _g1) { + var i = _g++; + gl.enableVertexAttribArray(this.index + i); + } + if(length > 0) { + var _g = 0; + var _g1 = this.__arrayLength; + while(_g < _g1) { + var i = _g++; + gl.vertexAttribPointer(this.index + i,this.__length,type,false,this.__length * 4,(position + bufferOffset * this.__length + i * this.__arrayLength) * 4); + } + } + } + } + ,set_name: function(value) { + this.__internal = StringTools.startsWith(value,"openfl_"); + return this.name = value; + } + ,__class__: openfl_display_ShaderParameter + ,__properties__: {set_name:"set_name"} +}; +var openfl_display_ShaderParameterType = {}; +openfl_display_ShaderParameterType.fromString = function(value) { + switch(value) { + case "bool": + return 0; + case "bool2": + return 1; + case "bool3": + return 1; + case "bool4": + return 1; + case "float": + return 4; + case "float2": + return 5; + case "float3": + return 6; + case "float4": + return 7; + case "int": + return 8; + case "int2": + return 9; + case "int3": + return 10; + case "int4": + return 11; + case "matrix2x2": + return 12; + case "matrix2x3": + return 13; + case "matrix2x4": + return 14; + case "matrix3x2": + return 15; + case "matrix3x3": + return 16; + case "matrix3x4": + return 17; + case "matrix4x2": + return 18; + case "matrix4x3": + return 19; + case "matrix4x4": + return 20; + default: + return null; + } +}; +openfl_display_ShaderParameterType.toString = function(this1) { + switch(this1) { + case 0: + return "bool"; + case 1: + return "bool2"; + case 2: + return "bool3"; + case 3: + return "bool4"; + case 4: + return "float"; + case 5: + return "float2"; + case 6: + return "float3"; + case 7: + return "float4"; + case 8: + return "int"; + case 9: + return "int2"; + case 10: + return "int3"; + case 11: + return "int4"; + case 12: + return "matrix2x2"; + case 13: + return "matrix2x3"; + case 14: + return "matrix2x4"; + case 15: + return "matrix3x2"; + case 16: + return "matrix3x3"; + case 17: + return "matrix3x4"; + case 18: + return "matrix4x2"; + case 19: + return "matrix4x3"; + case 20: + return "matrix4x4"; + default: + return null; + } +}; +var openfl_display_ShaderPrecision = {}; +openfl_display_ShaderPrecision.fromString = function(value) { + switch(value) { + case "fast": + return 0; + case "full": + return 1; + default: + return null; + } +}; +openfl_display_ShaderPrecision.toString = function(this1) { + switch(this1) { + case 0: + return "fast"; + case 1: + return "full"; + default: + return null; + } +}; +var openfl_display_SimpleButton = function(upState,overState,downState,hitTestState) { + openfl_display_InteractiveObject.call(this); + this.__drawableType = 6; + this.enabled = true; + this.trackAsMenu = false; + this.useHandCursor = true; + this.__upState = upState != null ? upState : new openfl_display_DisplayObject(); + this.__overState = overState; + this.__downState = downState; + this.set_hitTestState(hitTestState != null ? hitTestState : new openfl_display_DisplayObject()); + this.addEventListener("mouseDown",$bind(this,this.__this_onMouseDown)); + this.addEventListener("mouseOut",$bind(this,this.__this_onMouseOut)); + this.addEventListener("mouseOver",$bind(this,this.__this_onMouseOver)); + this.addEventListener("mouseUp",$bind(this,this.__this_onMouseUp)); + this.__tabEnabled = true; + this.set___currentState(this.__upState); + if(openfl_display_SimpleButton.__constructor != null) { + var method = openfl_display_SimpleButton.__constructor; + openfl_display_SimpleButton.__constructor = null; + method(this); + } +}; +$hxClasses["openfl.display.SimpleButton"] = openfl_display_SimpleButton; +openfl_display_SimpleButton.__name__ = "openfl.display.SimpleButton"; +openfl_display_SimpleButton.__super__ = openfl_display_InteractiveObject; +openfl_display_SimpleButton.prototype = $extend(openfl_display_InteractiveObject.prototype,{ + __getBounds: function(rect,matrix) { + openfl_display_InteractiveObject.prototype.__getBounds.call(this,rect,matrix); + var childWorldTransform = openfl_geom_Matrix.__pool.get(); + var local = this.__currentState.__transform; + childWorldTransform.a = local.a * matrix.a + local.b * matrix.c; + childWorldTransform.b = local.a * matrix.b + local.b * matrix.d; + childWorldTransform.c = local.c * matrix.a + local.d * matrix.c; + childWorldTransform.d = local.c * matrix.b + local.d * matrix.d; + childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx; + childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty; + this.__currentState.__getBounds(rect,childWorldTransform); + openfl_geom_Matrix.__pool.release(childWorldTransform); + } + ,__getRenderBounds: function(rect,matrix) { + if(this.__scrollRect != null) { + openfl_display_InteractiveObject.prototype.__getRenderBounds.call(this,rect,matrix); + return; + } else { + openfl_display_InteractiveObject.prototype.__getBounds.call(this,rect,matrix); + } + if(this.__currentState == null) { + return; + } + var childWorldTransform = openfl_geom_Matrix.__pool.get(); + var local = this.__currentState.__transform; + childWorldTransform.a = local.a * matrix.a + local.b * matrix.c; + childWorldTransform.b = local.a * matrix.b + local.b * matrix.d; + childWorldTransform.c = local.c * matrix.a + local.d * matrix.c; + childWorldTransform.d = local.c * matrix.b + local.d * matrix.d; + childWorldTransform.tx = local.tx * matrix.a + local.ty * matrix.c + matrix.tx; + childWorldTransform.ty = local.tx * matrix.b + local.ty * matrix.d + matrix.ty; + this.__currentState.__getRenderBounds(rect,childWorldTransform); + openfl_geom_Matrix.__pool.release(childWorldTransform); + } + ,__getCursor: function() { + if(this.useHandCursor && !this.__ignoreEvent && this.enabled) { + return "button"; + } else { + return null; + } + } + ,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { + var hitTest = false; + if(this.get_hitTestState() != null) { + if(this.get_hitTestState().__hitTest(x,y,shapeFlag,stack,interactiveOnly,hitObject)) { + if(stack != null) { + if(stack.length == 0) { + stack[0] = hitObject; + } else { + stack[stack.length - 1] = hitObject; + } + } + hitTest = !interactiveOnly || this.mouseEnabled; + } + } else if(this.__currentState != null) { + if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled || this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) { + hitTest = false; + } else if(this.__currentState.__hitTest(x,y,shapeFlag,stack,interactiveOnly,hitObject)) { + hitTest = interactiveOnly; + } + } + if(stack != null) { + while(stack.length > 1 && stack[stack.length - 1] == stack[stack.length - 2]) stack.pop(); + } + return hitTest; + } + ,__hitTestMask: function(x,y) { + var hitTest = false; + if(this.__currentState.__hitTestMask(x,y)) { + hitTest = true; + } + return hitTest; + } + ,__setStageReference: function(stage) { + openfl_display_InteractiveObject.prototype.__setStageReference.call(this,stage); + if(this.__currentState != null) { + this.__currentState.__setStageReference(stage); + } + if(this.get_hitTestState() != null && this.get_hitTestState() != this.__currentState) { + this.get_hitTestState().__setStageReference(stage); + } + } + ,__setTransformDirty: function() { + openfl_display_InteractiveObject.prototype.__setTransformDirty.call(this); + if(this.__currentState != null) { + this.__currentState.__setTransformDirty(); + } + if(this.get_hitTestState() != null && this.get_hitTestState() != this.__currentState) { + this.get_hitTestState().__setTransformDirty(); + } + } + ,__update: function(transformOnly,updateChildren) { + openfl_display_InteractiveObject.prototype.__update.call(this,transformOnly,updateChildren); + if(updateChildren) { + if(this.__currentState != null) { + this.__currentState.__update(transformOnly,true); + } + if(this.get_hitTestState() != null && this.get_hitTestState() != this.__currentState) { + this.get_hitTestState().__update(transformOnly,true); + } + } + } + ,__updateTransforms: function(overrideTransform) { + openfl_display_InteractiveObject.prototype.__updateTransforms.call(this,overrideTransform); + if(this.__currentState != null) { + this.__currentState.__updateTransforms(); + } + if(this.get_hitTestState() != null && this.get_hitTestState() != this.__currentState) { + this.get_hitTestState().__updateTransforms(); + } + } + ,get_downState: function() { + return this.__downState; + } + ,set_downState: function(downState) { + if(this.__downState != null && this.__currentState == this.__downState) { + this.set___currentState(downState); + } + return this.__downState = downState; + } + ,get_hitTestState: function() { + return this.__hitTestState; + } + ,set_hitTestState: function(hitTestState) { + if(this.__hitTestState != null && this.__hitTestState != hitTestState) { + if(this.__hitTestState != this.get_downState() && this.__hitTestState != this.get_upState() && this.__hitTestState != this.get_overState()) { + this.__hitTestState.__renderParent = null; + } + } + if(hitTestState != null) { + hitTestState.__renderParent = this; + if(!hitTestState.__renderDirty) { + hitTestState.__renderDirty = true; + hitTestState.__setParentRenderDirty(); + } + } + return this.__hitTestState = hitTestState; + } + ,get_overState: function() { + return this.__overState; + } + ,set_overState: function(overState) { + if(this.__overState != null && this.__currentState == this.__overState) { + this.set___currentState(overState); + } + return this.__overState = overState; + } + ,get_soundTransform: function() { + if(this.__soundTransform == null) { + this.__soundTransform = new openfl_media_SoundTransform(); + } + return new openfl_media_SoundTransform(this.__soundTransform.volume,this.__soundTransform.pan); + } + ,set_soundTransform: function(value) { + this.__soundTransform = new openfl_media_SoundTransform(value.volume,value.pan); + return value; + } + ,get_upState: function() { + return this.__upState; + } + ,set_upState: function(upState) { + if(this.__upState != null && this.__currentState == this.__upState) { + this.set___currentState(upState); + } + return this.__upState = upState; + } + ,set___currentState: function(value) { + if(this.__currentState != null && this.__currentState != this.get_hitTestState()) { + this.__currentState.__renderParent = null; + } + if(value != null && value.parent != null) { + value.parent.removeChild(value); + } + if(openfl_display_DisplayObject.__supportDOM && this.__previousStates == null) { + this.__previousStates = openfl_Vector.toObjectVector(null); + } + if(value != this.__currentState) { + if(openfl_display_DisplayObject.__supportDOM) { + if(this.__currentState != null) { + this.__currentState.__setStageReference(null); + this.__previousStates.push(this.__currentState); + } + var index = this.__previousStates.indexOf(value,0); + if(index > -1) { + var this1 = this.__previousStates; + this1.__tempIndex = index; + var _g_current = 0; + var _g_args = []; + while(_g_current < _g_args.length) { + var item = _g_args[_g_current++]; + this1.insertAt(this1.__tempIndex,item); + this1.__tempIndex++; + } + this1.splice(this1.__tempIndex,1); + } + } + if(value != null) { + value.__renderParent = this; + if(!value.__renderDirty) { + value.__renderDirty = true; + value.__setParentRenderDirty(); + } + } + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + this.__currentState = value; + return value; + } + ,__this_onMouseDown: function(event) { + if(this.enabled) { + this.set___currentState(this.get_downState()); + } + } + ,__this_onMouseOut: function(event) { + this.__ignoreEvent = false; + if(this.get_upState() != this.__currentState) { + this.set___currentState(this.get_upState()); + } + } + ,__this_onMouseOver: function(event) { + if(event.buttonDown) { + this.__ignoreEvent = true; + } + if(this.get_overState() != this.__currentState && this.get_overState() != null && !this.__ignoreEvent && this.enabled) { + this.set___currentState(this.get_overState()); + } + } + ,__this_onMouseUp: function(event) { + this.__ignoreEvent = false; + if(this.enabled && this.get_overState() != null) { + this.set___currentState(this.get_overState()); + } else { + this.set___currentState(this.get_upState()); + } + } + ,__class__: openfl_display_SimpleButton + ,__properties__: $extend(openfl_display_InteractiveObject.prototype.__properties__,{set___currentState:"set___currentState",set_upState:"set_upState",get_upState:"get_upState",set_soundTransform:"set_soundTransform",get_soundTransform:"get_soundTransform",set_overState:"set_overState",get_overState:"get_overState",set_hitTestState:"set_hitTestState",get_hitTestState:"get_hitTestState",set_downState:"set_downState",get_downState:"get_downState"}) +}); +var openfl_display_SpreadMethod = {}; +openfl_display_SpreadMethod.fromInt = function(value) { + return value; +}; +openfl_display_SpreadMethod.fromString = function(value) { + switch(value) { + case "pad": + return 0; + case "reflect": + return 1; + case "repeat": + return 2; + default: + return null; + } +}; +openfl_display_SpreadMethod.toInt = function(this1) { + return this1; +}; +openfl_display_SpreadMethod.toString = function(this1) { + switch(this1) { + case 0: + return "pad"; + case 1: + return "reflect"; + case 2: + return "repeat"; + default: + return null; + } +}; +var openfl_display_Stage = function($window,color) { + openfl_display_DisplayObjectContainer.call(this); + this.__drawableType = 5; + this.set_name(null); + this.__color = -1; + this.__colorSplit = [255,255,255]; + this.__colorString = "#FFFFFF"; + this.__contentsScaleFactor = 1; + this.__currentTabOrderIndex = 0; + this.__deltaTime = 0; + this.__displayState = 2; + this.__mouseX = 0; + this.__mouseY = 0; + this.__lastClickTime = 0; + this.__logicalWidth = 0; + this.__logicalHeight = 0; + this.__displayMatrix = new openfl_geom_Matrix(); + this.__displayRect = new openfl_geom_Rectangle(); + this.__renderDirty = true; + this.stage3Ds = openfl_Vector.toObjectVector(null); + this.stage3Ds.push(new openfl_display_Stage3D(this)); + this.stage3Ds.push(new openfl_display_Stage3D(this)); + this.stage3Ds.push(new openfl_display_Stage3D(this)); + this.stage3Ds.push(new openfl_display_Stage3D(this)); + this.stage = this; + this.align = 6; + this.allowsFullScreen = true; + this.allowsFullScreenInteractive = true; + this.__quality = 1; + this.__scaleMode = 2; + this.showDefaultContextMenu = true; + this.softKeyboardRect = new openfl_geom_Rectangle(); + this.stageFocusRect = true; + this.__macKeyboard = /AppleWebKit/.test (navigator.userAgent) && /Mobile\/\w+/.test (navigator.userAgent) || /Mac/.test (navigator.platform); + this.__clearBeforeRender = true; + this.__forceRender = false; + this.__stack = []; + this.__rollOutStack = []; + this.__mouseOutStack = []; + this.__touchData = new haxe_ds_IntMap(); + if(openfl_Lib.get_current().__loaderInfo == null) { + openfl_Lib.get_current().__loaderInfo = openfl_display_LoaderInfo.create(null); + openfl_Lib.get_current().__loaderInfo.content = openfl_Lib.get_current(); + } + this.__uncaughtErrorEvents = openfl_Lib.get_current().__loaderInfo.uncaughtErrorEvents; + this.application = $window.application; + this.window = $window; + this.set_color(color); + this.__contentsScaleFactor = $window.__scale; + this.__wasFullscreen = $window.__fullscreen; + this.__resize(); + if(openfl_Lib.get_current().stage == null) { + this.stage.addChild(openfl_Lib.get_current()); + } +}; +$hxClasses["openfl.display.Stage"] = openfl_display_Stage; +openfl_display_Stage.__name__ = "openfl.display.Stage"; +openfl_display_Stage.__interfaces__ = [lime_app_IModule]; +openfl_display_Stage.__super__ = openfl_display_DisplayObjectContainer; +openfl_display_Stage.prototype = $extend(openfl_display_DisplayObjectContainer.prototype,{ + invalidate: function() { + this.__invalidated = true; + this.__renderDirty = true; + } + ,localToGlobal: function(pos) { + return pos.clone(); + } + ,__broadcastEvent: function(event) { + if(Object.prototype.hasOwnProperty.call(openfl_display_DisplayObject.__broadcastEvents.h,event.type)) { + var dispatchers = openfl_display_DisplayObject.__broadcastEvents.h[event.type]; + var _g = 0; + while(_g < dispatchers.length) { + var dispatcher = dispatchers[_g]; + ++_g; + if(dispatcher.stage == this || dispatcher.stage == null) { + if(this.__uncaughtErrorEvents.__enabled) { + try { + dispatcher.__dispatch(event); + } catch( _g1 ) { + haxe_NativeStackTrace.lastError = _g1; + var e = haxe_Exception.caught(_g1).unwrap(); + this.__handleError(e); + } + } else { + dispatcher.__dispatch(event); + } + } + } + } + } + ,__createRenderer: function() { + var windowWidth = this.window.__width * this.window.__scale | 0; + var windowHeight = this.window.__height * this.window.__scale | 0; + switch(this.window.context.type) { + case "cairo": + break; + case "canvas": + this.__renderer = new openfl_display_CanvasRenderer(this.window.context.canvas2D); + break; + case "dom": + this.__renderer = new openfl_display_DOMRenderer(this.window.context.dom); + break; + case "opengl":case "opengles":case "webgl": + this.context3D = new openfl_display3D_Context3D(this); + this.context3D.configureBackBuffer(this.stageWidth,this.stageHeight,0,true,true,true); + this.context3D.present(); + this.__renderer = new openfl_display_OpenGLRenderer(this.context3D); + break; + default: + } + if(this.__renderer != null) { + var tmp = this.get_quality(); + this.__renderer.__allowSmoothing = tmp != 2; + this.__renderer.__pixelRatio = this.window.__scale; + this.__renderer.__worldTransform = this.__displayMatrix; + this.__renderer.__stage = this; + this.__renderer.__resize(windowWidth,windowHeight); + } + } + ,__dispatchEvent: function(event) { + var result; + if(this.__uncaughtErrorEvents.__enabled) { + try { + result = openfl_display_DisplayObjectContainer.prototype.__dispatchEvent.call(this,event); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + this.__handleError(e); + result = false; + } + } else { + result = openfl_display_DisplayObjectContainer.prototype.__dispatchEvent.call(this,event); + } + return result; + } + ,__dispatchPendingMouseEvent: function() { + if(this.__pendingMouseEvent) { + this.__onMouse("mouseMove",this.__pendingMouseX,this.__pendingMouseY,0); + this.__pendingMouseEvent = false; + } + } + ,__dispatchStack: function(event,stack) { + if(this.__uncaughtErrorEvents.__enabled) { + try { + var target; + var length = stack.length; + if(length == 0) { + event.eventPhase = 2; + target = event.target; + target.__dispatch(event); + } else { + event.eventPhase = 1; + event.target = stack[stack.length - 1]; + var _g = 0; + var _g1 = length - 1; + while(_g < _g1) { + var i = _g++; + stack[i].__dispatch(event); + if(event.__isCanceled) { + return; + } + } + event.eventPhase = 2; + target = event.target; + target.__dispatch(event); + if(event.__isCanceled) { + return; + } + if(event.bubbles) { + event.eventPhase = 3; + var i = length - 2; + while(i >= 0) { + stack[i].__dispatch(event); + if(event.__isCanceled) { + return; + } + --i; + } + } + } + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + this.__handleError(e); + } + } else { + var target; + var length = stack.length; + if(length == 0) { + event.eventPhase = 2; + target = event.target; + target.__dispatch(event); + } else { + event.eventPhase = 1; + event.target = stack[stack.length - 1]; + var _g = 0; + var _g1 = length - 1; + while(_g < _g1) { + var i = _g++; + stack[i].__dispatch(event); + if(event.__isCanceled) { + return; + } + } + event.eventPhase = 2; + target = event.target; + target.__dispatch(event); + if(event.__isCanceled) { + return; + } + if(event.bubbles) { + event.eventPhase = 3; + var i = length - 2; + while(i >= 0) { + stack[i].__dispatch(event); + if(event.__isCanceled) { + return; + } + --i; + } + } + } + } + } + ,__dispatchTarget: function(target,event) { + if(this.__uncaughtErrorEvents.__enabled) { + try { + return target.__dispatchEvent(event); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + this.__handleError(e); + return false; + } + } else { + return target.__dispatchEvent(event); + } + } + ,__drag: function(mouse) { + var parent = this.__dragObject.parent; + if(parent != null) { + var _this = parent.__getWorldTransform(); + var norm = _this.a * _this.d - _this.b * _this.c; + if(norm == 0) { + mouse.x = -_this.tx; + mouse.y = -_this.ty; + } else { + var px = 1.0 / norm * (_this.c * (_this.ty - mouse.y) + _this.d * (mouse.x - _this.tx)); + mouse.y = 1.0 / norm * (_this.a * (mouse.y - _this.ty) + _this.b * (_this.tx - mouse.x)); + mouse.x = px; + } + } + var x = mouse.x + this.__dragOffsetX; + var y = mouse.y + this.__dragOffsetY; + if(this.__dragBounds != null) { + if(x < this.__dragBounds.x) { + x = this.__dragBounds.x; + } else if(x > this.__dragBounds.get_right()) { + x = this.__dragBounds.get_right(); + } + if(y < this.__dragBounds.y) { + y = this.__dragBounds.y; + } else if(y > this.__dragBounds.get_bottom()) { + y = this.__dragBounds.get_bottom(); + } + } + this.__dragObject.set_x(x); + this.__dragObject.set_y(y); + } + ,__getInteractive: function(stack) { + if(stack != null) { + stack.push(this); + } + return true; + } + ,__globalToLocal: function(global,local) { + if(global != local) { + local.copyFrom(global); + } + return local; + } + ,__handleError: function(e) { + var event = new openfl_events_UncaughtErrorEvent("uncaughtError",true,true,e); + openfl_Lib.get_current().__loaderInfo.uncaughtErrorEvents.dispatchEvent(event); + if(!event.__preventDefault) { + var message = haxe_CallStack.toString(haxe_CallStack.exceptionStack()); + console.log(message); + var message = Std.string(e); + console.log(message); + try { + var exc = e; + if(exc != null && Object.prototype.hasOwnProperty.call(exc,"stack") && exc.stack != null && exc.stack != "") { + console.log(exc.stack); + e.stack = exc.stack; + } else { + var msg = haxe_CallStack.toString(haxe_CallStack.callStack()); + console.log(msg); + } + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + } + throw e; + } + } + ,__onKey: function(type,keyCode,modifier) { + this.__dispatchPendingMouseEvent(); + openfl_events_MouseEvent.__altKey = lime_ui_KeyModifier.get_altKey(modifier); + openfl_events_MouseEvent.__commandKey = lime_ui_KeyModifier.get_metaKey(modifier); + openfl_events_MouseEvent.__controlKey = lime_ui_KeyModifier.get_ctrlKey(modifier); + openfl_events_MouseEvent.__ctrlKey = this.__macKeyboard ? lime_ui_KeyModifier.get_ctrlKey(modifier) || lime_ui_KeyModifier.get_metaKey(modifier) : lime_ui_KeyModifier.get_ctrlKey(modifier); + openfl_events_MouseEvent.__shiftKey = lime_ui_KeyModifier.get_shiftKey(modifier); + var stack = []; + if(this.__focus == null) { + this.__getInteractive(stack); + } else { + this.__focus.__getInteractive(stack); + } + if(stack.length > 0) { + var keyLocation; + switch(keyCode) { + case 1073741908:case 1073741909:case 1073741910:case 1073741911:case 1073741912:case 1073741913:case 1073741914:case 1073741915:case 1073741916:case 1073741917:case 1073741918:case 1073741919:case 1073741920:case 1073741921:case 1073741922:case 1073741923:case 1073742044: + keyLocation = 3; + break; + case 1073742048:case 1073742049:case 1073742050:case 1073742051: + keyLocation = 1; + break; + case 1073742052:case 1073742053:case 1073742054:case 1073742055: + keyLocation = 2; + break; + default: + keyLocation = 0; + } + var keyCode1; + switch(keyCode) { + case 8: + keyCode1 = 8; + break; + case 9: + keyCode1 = 9; + break; + case 13: + keyCode1 = 13; + break; + case 27: + keyCode1 = 27; + break; + case 32: + keyCode1 = 32; + break; + case 33: + keyCode1 = 49; + break; + case 34: + keyCode1 = 222; + break; + case 35: + keyCode1 = 51; + break; + case 36: + keyCode1 = 52; + break; + case 37: + keyCode1 = 53; + break; + case 38: + keyCode1 = 55; + break; + case 39: + keyCode1 = 222; + break; + case 40: + keyCode1 = 57; + break; + case 41: + keyCode1 = 48; + break; + case 42: + keyCode1 = 56; + break; + case 44: + keyCode1 = 188; + break; + case 45: + keyCode1 = 189; + break; + case 46: + keyCode1 = 190; + break; + case 47: + keyCode1 = 191; + break; + case 48: + keyCode1 = 48; + break; + case 49: + keyCode1 = 49; + break; + case 50: + keyCode1 = 50; + break; + case 51: + keyCode1 = 51; + break; + case 52: + keyCode1 = 52; + break; + case 53: + keyCode1 = 53; + break; + case 54: + keyCode1 = 54; + break; + case 55: + keyCode1 = 55; + break; + case 56: + keyCode1 = 56; + break; + case 57: + keyCode1 = 57; + break; + case 58: + keyCode1 = 186; + break; + case 59: + keyCode1 = 186; + break; + case 60: + keyCode1 = 60; + break; + case 61: + keyCode1 = 187; + break; + case 62: + keyCode1 = 190; + break; + case 63: + keyCode1 = 191; + break; + case 64: + keyCode1 = 50; + break; + case 91: + keyCode1 = 219; + break; + case 92: + keyCode1 = 220; + break; + case 93: + keyCode1 = 221; + break; + case 94: + keyCode1 = 54; + break; + case 95: + keyCode1 = 189; + break; + case 96: + keyCode1 = 192; + break; + case 97: + keyCode1 = 65; + break; + case 98: + keyCode1 = 66; + break; + case 99: + keyCode1 = 67; + break; + case 100: + keyCode1 = 68; + break; + case 101: + keyCode1 = 69; + break; + case 102: + keyCode1 = 70; + break; + case 103: + keyCode1 = 71; + break; + case 104: + keyCode1 = 72; + break; + case 105: + keyCode1 = 73; + break; + case 106: + keyCode1 = 74; + break; + case 107: + keyCode1 = 75; + break; + case 108: + keyCode1 = 76; + break; + case 109: + keyCode1 = 77; + break; + case 110: + keyCode1 = 78; + break; + case 111: + keyCode1 = 79; + break; + case 112: + keyCode1 = 80; + break; + case 113: + keyCode1 = 81; + break; + case 114: + keyCode1 = 82; + break; + case 115: + keyCode1 = 83; + break; + case 116: + keyCode1 = 84; + break; + case 117: + keyCode1 = 85; + break; + case 118: + keyCode1 = 86; + break; + case 119: + keyCode1 = 87; + break; + case 120: + keyCode1 = 88; + break; + case 121: + keyCode1 = 89; + break; + case 122: + keyCode1 = 90; + break; + case 127: + keyCode1 = 46; + break; + case 1073741881: + keyCode1 = 20; + break; + case 1073741882: + keyCode1 = 112; + break; + case 1073741883: + keyCode1 = 113; + break; + case 1073741884: + keyCode1 = 114; + break; + case 1073741885: + keyCode1 = 115; + break; + case 1073741886: + keyCode1 = 116; + break; + case 1073741887: + keyCode1 = 117; + break; + case 1073741888: + keyCode1 = 118; + break; + case 1073741889: + keyCode1 = 119; + break; + case 1073741890: + keyCode1 = 120; + break; + case 1073741891: + keyCode1 = 121; + break; + case 1073741892: + keyCode1 = 122; + break; + case 1073741893: + keyCode1 = 123; + break; + case 1073741894: + keyCode1 = 301; + break; + case 1073741895: + keyCode1 = 145; + break; + case 1073741896: + keyCode1 = 19; + break; + case 1073741897: + keyCode1 = 45; + break; + case 1073741898: + keyCode1 = 36; + break; + case 1073741899: + keyCode1 = 33; + break; + case 1073741901: + keyCode1 = 35; + break; + case 1073741902: + keyCode1 = 34; + break; + case 1073741903: + keyCode1 = 39; + break; + case 1073741904: + keyCode1 = 37; + break; + case 1073741905: + keyCode1 = 40; + break; + case 1073741906: + keyCode1 = 38; + break; + case 1073741907: + keyCode1 = 144; + break; + case 1073741908: + keyCode1 = 111; + break; + case 1073741909: + keyCode1 = 106; + break; + case 1073741910: + keyCode1 = 109; + break; + case 1073741911: + keyCode1 = 107; + break; + case 1073741912: + keyCode1 = 13; + break; + case 1073741913: + keyCode1 = 97; + break; + case 1073741914: + keyCode1 = 98; + break; + case 1073741915: + keyCode1 = 99; + break; + case 1073741916: + keyCode1 = 100; + break; + case 1073741917: + keyCode1 = 101; + break; + case 1073741918: + keyCode1 = 102; + break; + case 1073741919: + keyCode1 = 103; + break; + case 1073741920: + keyCode1 = 104; + break; + case 1073741921: + keyCode1 = 105; + break; + case 1073741922: + keyCode1 = 96; + break; + case 1073741923: + keyCode1 = 110; + break; + case 1073741925: + keyCode1 = 302; + break; + case 1073741928: + keyCode1 = 124; + break; + case 1073741929: + keyCode1 = 125; + break; + case 1073741930: + keyCode1 = 126; + break; + case 1073741982: + keyCode1 = 13; + break; + case 1073742044: + keyCode1 = 110; + break; + case 1073742048: + keyCode1 = 17; + break; + case 1073742049: + keyCode1 = 16; + break; + case 1073742050: + keyCode1 = 18; + break; + case 1073742051: + keyCode1 = 15; + break; + case 1073742052: + keyCode1 = 17; + break; + case 1073742053: + keyCode1 = 16; + break; + case 1073742054: + keyCode1 = 18; + break; + case 1073742055: + keyCode1 = 15; + break; + default: + keyCode1 = keyCode; + } + var charCode = openfl_ui_Keyboard.__getCharCode(keyCode1,lime_ui_KeyModifier.get_shiftKey(modifier),lime_ui_KeyModifier.get_capsLock(modifier)); + if(type == "keyUp" && (keyCode1 == 32 || keyCode1 == 13) && ((this.__focus) instanceof openfl_display_Sprite)) { + var sprite = js_Boot.__cast(this.__focus , openfl_display_Sprite); + if(sprite.get_buttonMode() && sprite.focusRect == true) { + var localPoint = openfl_geom_Point.__pool.get(); + var targetPoint = openfl_geom_Point.__pool.get(); + targetPoint.x = this.__mouseX; + targetPoint.y = this.__mouseY; + var clickEvent = openfl_events_MouseEvent.__create("click",0,0,this.__mouseX,this.__mouseY,sprite.__globalToLocal(targetPoint,localPoint),sprite); + this.__dispatchStack(clickEvent,stack); + if(clickEvent.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + openfl_geom_Point.__pool.release(targetPoint); + openfl_geom_Point.__pool.release(localPoint); + } + } + var event = new openfl_events_KeyboardEvent(type,true,true,charCode,keyCode1,keyLocation,this.__macKeyboard ? lime_ui_KeyModifier.get_ctrlKey(modifier) || lime_ui_KeyModifier.get_metaKey(modifier) : lime_ui_KeyModifier.get_ctrlKey(modifier),lime_ui_KeyModifier.get_altKey(modifier),lime_ui_KeyModifier.get_shiftKey(modifier),lime_ui_KeyModifier.get_ctrlKey(modifier),lime_ui_KeyModifier.get_metaKey(modifier)); + stack.reverse(); + this.__dispatchStack(event,stack); + if(event.__preventDefault) { + if(type == "keyDown") { + this.window.onKeyDown.cancel(); + } else { + this.window.onKeyUp.cancel(); + } + } else if(type == "keyDown" && keyCode1 == 9) { + var tabStack = []; + this.__tabTest(tabStack); + var nextIndex = -1; + var nextObject = null; + var nextOffset = lime_ui_KeyModifier.get_shiftKey(modifier) ? -1 : 1; + if(tabStack.length > 1) { + haxe_ds_ArraySort.sort(tabStack,function(a,b) { + return a.get_tabIndex() - b.get_tabIndex(); + }); + if(tabStack[tabStack.length - 1].get_tabIndex() != -1) { + var i = 0; + while(i < tabStack.length) { + if(tabStack[i].get_tabIndex() > -1) { + if(i > 0) { + tabStack.splice(0,i); + } + break; + } + ++i; + } + } + if(this.get_focus() != null) { + var current = this.get_focus(); + var index = tabStack.indexOf(current); + while(index == -1 && current != null) { + var currentParent = current.parent; + if(currentParent != null && currentParent.get_tabChildren()) { + var currentIndex = currentParent.getChildIndex(current); + if(currentIndex == -1) { + current = currentParent; + continue; + } + var i = currentIndex + nextOffset; + while(lime_ui_KeyModifier.get_shiftKey(modifier) ? i >= 0 : i < currentParent.get_numChildren()) { + var sibling = currentParent.getChildAt(i); + if(((sibling) instanceof openfl_display_InteractiveObject)) { + var interactiveSibling = js_Boot.__cast(sibling , openfl_display_InteractiveObject); + index = tabStack.indexOf(interactiveSibling); + if(index != -1) { + nextOffset = 0; + break; + } + } + i += nextOffset; + } + } else if(lime_ui_KeyModifier.get_shiftKey(modifier)) { + index = tabStack.indexOf(currentParent); + if(index != -1) { + nextOffset = 0; + } + } + current = currentParent; + } + if(index < 0) { + nextIndex = 0; + } else { + nextIndex = index + nextOffset; + } + } else { + nextIndex = this.__currentTabOrderIndex; + } + } else if(tabStack.length == 1) { + nextObject = tabStack[0]; + if(this.get_focus() == nextObject) { + nextObject = null; + } + } + var cancelTab = nextIndex >= 0 && nextIndex < tabStack.length; + if(tabStack.length == 1 || tabStack.length == 0 && this.get_focus() != null) { + nextIndex = 0; + } else if(tabStack.length > 1) { + if(nextIndex < 0) { + nextIndex += tabStack.length; + } + nextIndex %= tabStack.length; + nextObject = tabStack[nextIndex]; + if(nextObject == this.get_focus()) { + nextIndex += nextOffset; + if(nextIndex < 0) { + nextIndex += tabStack.length; + } + nextIndex %= tabStack.length; + nextObject = tabStack[nextIndex]; + } + } + var focusEvent = null; + if(this.get_focus() != null) { + focusEvent = new openfl_events_FocusEvent("keyFocusChange",true,true,nextObject,lime_ui_KeyModifier.get_shiftKey(modifier),0); + stack = []; + this.get_focus().__getInteractive(stack); + stack.reverse(); + this.__dispatchStack(focusEvent,stack); + if(focusEvent.isDefaultPrevented()) { + this.window.onKeyDown.cancel(); + } + } + if(focusEvent == null || !focusEvent.isDefaultPrevented()) { + this.__currentTabOrderIndex = nextIndex; + if(nextObject != null) { + this.set_focus(nextObject); + } + if(cancelTab) { + this.window.onKeyDown.cancel(); + } + } + } else if(type == "keyDown" && this.get_focus() != null && !((this.get_focus()) instanceof openfl_text_TextField)) { + var ctrlKey = this.__macKeyboard ? lime_ui_KeyModifier.get_ctrlKey(modifier) || lime_ui_KeyModifier.get_metaKey(modifier) : lime_ui_KeyModifier.get_ctrlKey(modifier); + if(ctrlKey && !lime_ui_KeyModifier.get_altKey(modifier) && !lime_ui_KeyModifier.get_shiftKey(modifier)) { + switch(keyCode1) { + case 65: + var selectAllEvent = new openfl_events_Event("selectAll",true,true); + this.get_focus().dispatchEvent(selectAllEvent); + break; + case 67: + var copyEvent = new openfl_events_Event("copy",true,true); + this.get_focus().dispatchEvent(copyEvent); + break; + case 86: + var pasteEvent = new openfl_events_Event("paste",true,true); + this.get_focus().dispatchEvent(pasteEvent); + break; + case 88: + var cutEvent = new openfl_events_Event("cut",true,true); + this.get_focus().dispatchEvent(cutEvent); + break; + } + } + } + if(event.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + } + } + ,__onLimeCreateWindow: function($window) { + if(this.window != $window) { + return; + } + var _g = this; + var window1 = $window; + var tmp = function() { + _g.__onLimeWindowActivate(window1); + }; + $window.onActivate.add(tmp); + var _g1 = this; + var window2 = $window; + var tmp = function() { + _g1.__onLimeWindowClose(window2); + }; + $window.onClose.add(tmp,false,-9000); + var _g2 = this; + var window3 = $window; + var tmp = function() { + _g2.__onLimeWindowDeactivate(window3); + }; + $window.onDeactivate.add(tmp); + var _g3 = this; + var window4 = $window; + var tmp = function(file) { + _g3.__onLimeWindowDropFile(window4,file); + }; + $window.onDropFile.add(tmp); + var _g4 = this; + var window5 = $window; + var tmp = function() { + _g4.__onLimeWindowEnter(window5); + }; + $window.onEnter.add(tmp); + var _g5 = this; + var window6 = $window; + var tmp = function() { + _g5.__onLimeWindowExpose(window6); + }; + $window.onExpose.add(tmp); + var _g6 = this; + var window7 = $window; + var tmp = function() { + _g6.__onLimeWindowFocusIn(window7); + }; + $window.onFocusIn.add(tmp); + var _g7 = this; + var window8 = $window; + var tmp = function() { + _g7.__onLimeWindowFocusOut(window8); + }; + $window.onFocusOut.add(tmp); + var _g8 = this; + var window9 = $window; + var tmp = function() { + _g8.__onLimeWindowFullscreen(window9); + }; + $window.onFullscreen.add(tmp); + var _g9 = this; + var window10 = $window; + var tmp = function(keyCode,modifier) { + _g9.__onLimeKeyDown(window10,keyCode,modifier); + }; + $window.onKeyDown.add(tmp); + var _g10 = this; + var window11 = $window; + var tmp = function(keyCode,modifier) { + _g10.__onLimeKeyUp(window11,keyCode,modifier); + }; + $window.onKeyUp.add(tmp); + var _g11 = this; + var window12 = $window; + var tmp = function() { + _g11.__onLimeWindowLeave(window12); + }; + $window.onLeave.add(tmp); + var _g12 = this; + var window13 = $window; + var tmp = function() { + _g12.__onLimeWindowMinimize(window13); + }; + $window.onMinimize.add(tmp); + var _g13 = this; + var window14 = $window; + var tmp = function(x,y,button) { + _g13.__onLimeMouseDown(window14,x,y,button); + }; + $window.onMouseDown.add(tmp); + var _g14 = this; + var window15 = $window; + var tmp = function(x,y) { + _g14.__onLimeMouseMove(window15,x,y); + }; + $window.onMouseMove.add(tmp); + var _g15 = this; + var window16 = $window; + var tmp = function(x,y) { + _g15.__onLimeMouseMoveRelative(window16,x,y); + }; + $window.onMouseMoveRelative.add(tmp); + var _g16 = this; + var window17 = $window; + var tmp = function(x,y,button) { + _g16.__onLimeMouseUp(window17,x,y,button); + }; + $window.onMouseUp.add(tmp); + var _g17 = this; + var window18 = $window; + var tmp = function(deltaX,deltaY,deltaMode) { + _g17.__onLimeMouseWheel(window18,deltaX,deltaY,deltaMode); + }; + $window.onMouseWheel.add(tmp); + var _g18 = this; + var window19 = $window; + var tmp = function(x,y) { + _g18.__onLimeWindowMove(window19,x,y); + }; + $window.onMove.add(tmp); + $window.onRender.add($bind(this,this.__onLimeRender)); + $window.onRenderContextLost.add($bind(this,this.__onLimeRenderContextLost)); + $window.onRenderContextRestored.add($bind(this,this.__onLimeRenderContextRestored)); + var _g19 = this; + var window20 = $window; + var tmp = function(width,height) { + _g19.__onLimeWindowResize(window20,width,height); + }; + $window.onResize.add(tmp); + var _g20 = this; + var window21 = $window; + var tmp = function() { + _g20.__onLimeWindowRestore(window21); + }; + $window.onRestore.add(tmp); + var _g21 = this; + var window22 = $window; + var tmp = function(text,start,length) { + _g21.__onLimeTextEdit(window22,text,start,length); + }; + $window.onTextEdit.add(tmp); + var _g22 = this; + var window23 = $window; + var tmp = function(text) { + _g22.__onLimeTextInput(window23,text); + }; + $window.onTextInput.add(tmp); + this.__onLimeWindowCreate($window); + } + ,__onLimeGamepadAxisMove: function(gamepad,axis,value) { + if(this.__uncaughtErrorEvents.__enabled) { + try { + openfl_ui_GameInput.__onGamepadAxisMove(gamepad,axis,value); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + this.__handleError(e); + } + } else { + openfl_ui_GameInput.__onGamepadAxisMove(gamepad,axis,value); + } + } + ,__onLimeGamepadButtonDown: function(gamepad,button) { + if(this.__uncaughtErrorEvents.__enabled) { + try { + openfl_ui_GameInput.__onGamepadButtonDown(gamepad,button); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + this.__handleError(e); + } + } else { + openfl_ui_GameInput.__onGamepadButtonDown(gamepad,button); + } + } + ,__onLimeGamepadButtonUp: function(gamepad,button) { + if(this.__uncaughtErrorEvents.__enabled) { + try { + openfl_ui_GameInput.__onGamepadButtonUp(gamepad,button); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + this.__handleError(e); + } + } else { + openfl_ui_GameInput.__onGamepadButtonUp(gamepad,button); + } + } + ,__onLimeGamepadConnect: function(gamepad) { + if(this.__uncaughtErrorEvents.__enabled) { + try { + openfl_ui_GameInput.__onGamepadConnect(gamepad); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + this.__handleError(e); + } + } else { + openfl_ui_GameInput.__onGamepadConnect(gamepad); + } + var _g = this; + var gamepad1 = gamepad; + var tmp = function(axis,value) { + _g.__onLimeGamepadAxisMove(gamepad1,axis,value); + }; + gamepad.onAxisMove.add(tmp); + var _g1 = this; + var gamepad2 = gamepad; + var tmp = function(button) { + _g1.__onLimeGamepadButtonDown(gamepad2,button); + }; + gamepad.onButtonDown.add(tmp); + var _g2 = this; + var gamepad3 = gamepad; + var tmp = function(button) { + _g2.__onLimeGamepadButtonUp(gamepad3,button); + }; + gamepad.onButtonUp.add(tmp); + var _g3 = this; + var gamepad4 = gamepad; + var tmp = function() { + _g3.__onLimeGamepadDisconnect(gamepad4); + }; + gamepad.onDisconnect.add(tmp); + } + ,__onLimeGamepadDisconnect: function(gamepad) { + if(this.__uncaughtErrorEvents.__enabled) { + try { + openfl_ui_GameInput.__onGamepadDisconnect(gamepad); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + var e = haxe_Exception.caught(_g).unwrap(); + this.__handleError(e); + } + } else { + openfl_ui_GameInput.__onGamepadDisconnect(gamepad); + } + } + ,__onLimeKeyDown: function($window,keyCode,modifier) { + if(this.window == null || this.window != $window) { + return; + } + this.__onKey("keyDown",keyCode,modifier); + } + ,__onLimeKeyUp: function($window,keyCode,modifier) { + if(this.window == null || this.window != $window) { + return; + } + this.__onKey("keyUp",keyCode,modifier); + } + ,__onLimeModuleExit: function(code) { + if(this.window != null) { + var event = null; + event = new openfl_events_Event("deactivate"); + this.__broadcastEvent(event); + } + } + ,__onLimeMouseDown: function($window,x,y,button) { + if(this.window == null || this.window != $window) { + return; + } + this.__dispatchPendingMouseEvent(); + var type; + switch(button) { + case 1: + type = "middleMouseDown"; + break; + case 2: + type = "rightMouseDown"; + break; + default: + type = "mouseDown"; + } + this.__onMouse(type,x * $window.__scale | 0,y * $window.__scale | 0,button); + if(!this.showDefaultContextMenu && button == 2) { + $window.onMouseDown.cancel(); + } + } + ,__onLimeMouseMove: function($window,x,y) { + if(this.window == null || this.window != $window) { + return; + } + this.__pendingMouseEvent = true; + this.__pendingMouseX = x * $window.__scale | 0; + this.__pendingMouseY = y * $window.__scale | 0; + } + ,__onLimeMouseMoveRelative: function($window,x,y) { + } + ,__onLimeMouseUp: function($window,x,y,button) { + if(this.window == null || this.window != $window) { + return; + } + this.__dispatchPendingMouseEvent(); + var type; + switch(button) { + case 1: + type = "middleMouseUp"; + break; + case 2: + type = "rightMouseUp"; + break; + default: + type = "mouseUp"; + } + this.__onMouse(type,x * $window.__scale | 0,y * $window.__scale | 0,button); + if(!this.showDefaultContextMenu && button == 2) { + $window.onMouseUp.cancel(); + } + } + ,__onLimeMouseWheel: function($window,deltaX,deltaY,deltaMode) { + if(this.window == null || this.window != $window) { + return; + } + this.__dispatchPendingMouseEvent(); + if(deltaMode == lime_ui_MouseWheelMode.PIXELS) { + this.__onMouseWheel(deltaX * $window.__scale | 0,deltaY * $window.__scale | 0,deltaMode); + } else { + this.__onMouseWheel(deltaX | 0,deltaY | 0,deltaMode); + } + } + ,__renderAfterEvent: function() { + var cancelled = this.__render(this.window.context); + } + ,__render: function(context) { + var cancelled = false; + var event = null; + var shouldRender = this.__renderer != null && (this.__renderDirty || this.__forceRender); + if(this.__invalidated && shouldRender) { + this.__invalidated = false; + event = new openfl_events_Event("render"); + this.__broadcastEvent(event); + } + this.__update(false,true); + if(this.__renderer != null) { + if(this.context3D != null) { + var stage3D = this.stage3Ds.iterator(); + while(stage3D.hasNext()) { + var stage3D1 = stage3D.next(); + this.context3D.__renderStage3D(stage3D1); + } + if(this.context3D.__present) { + shouldRender = true; + } + } + if(shouldRender) { + var tmp = this.__renderer.__type == "cairo"; + if(this.context3D == null) { + this.__renderer.__clear(); + } + this.__renderer.__render(this); + } else if(this.context3D == null) { + cancelled = true; + } + if(this.context3D != null) { + if(!this.context3D.__present) { + cancelled = true; + } else { + if(!this.__renderer.__cleared) { + this.__renderer.__clear(); + } + this.context3D.__present = false; + this.context3D.__cleared = false; + } + } + this.__renderer.__cleared = false; + } + return cancelled; + } + ,__onLimeRender: function(context) { + if(this.__rendering) { + return; + } + this.__rendering = true; + var event = null; + this.__broadcastEvent(new openfl_events_Event("enterFrame")); + this.__broadcastEvent(new openfl_events_Event("frameConstructed")); + this.__broadcastEvent(new openfl_events_Event("exitFrame")); + this.__renderable = true; + this.__enterFrame(this.__deltaTime); + this.__deltaTime = 0; + var cancelled = this.__render(context); + if(cancelled) { + this.window.onRender.cancel(); + } + this.__rendering = false; + } + ,__onLimeRenderContextLost: function() { + this.__renderer = null; + this.context3D = null; + var stage3D = this.stage3Ds.iterator(); + while(stage3D.hasNext()) { + var stage3D1 = stage3D.next(); + stage3D1.__lostContext(); + } + } + ,__onLimeRenderContextRestored: function(context) { + this.__createRenderer(); + var stage3D = this.stage3Ds.iterator(); + while(stage3D.hasNext()) { + var stage3D1 = stage3D.next(); + stage3D1.__restoreContext(); + } + } + ,__onLimeTextEdit: function($window,text,start,length) { + } + ,__onLimeTextInput: function($window,text) { + if(this.window == null || this.window != $window) { + return; + } + var stack = []; + if(this.__focus == null) { + this.__getInteractive(stack); + } else { + this.__focus.__getInteractive(stack); + } + var event = new openfl_events_TextEvent("textInput",true,true,text); + if(stack.length > 0) { + stack.reverse(); + this.__dispatchStack(event,stack); + } else { + this.__dispatchEvent(event); + } + if(event.isDefaultPrevented()) { + $window.onTextInput.cancel(); + } + } + ,__onLimeTouchCancel: function(touch) { + var isPrimaryTouchPoint = this.__primaryTouch == touch; + if(isPrimaryTouchPoint) { + this.__primaryTouch = null; + } + this.__onTouch("touchEnd",touch,isPrimaryTouchPoint); + } + ,__onLimeTouchMove: function(touch) { + this.__onTouch("touchMove",touch,this.__primaryTouch == touch); + } + ,__onLimeTouchEnd: function(touch) { + var isPrimaryTouchPoint = this.__primaryTouch == touch; + if(isPrimaryTouchPoint) { + this.__primaryTouch = null; + } + this.__onTouch("touchEnd",touch,isPrimaryTouchPoint); + } + ,__onLimeTouchStart: function(touch) { + if(this.__primaryTouch == null) { + this.__primaryTouch = touch; + } + this.__onTouch("touchBegin",touch,this.__primaryTouch == touch); + } + ,__onLimeUpdate: function(deltaTime) { + this.__deltaTime = deltaTime; + this.__dispatchPendingMouseEvent(); + } + ,__onLimeWindowActivate: function($window) { + if(this.window == null || this.window != $window) { + return; + } + } + ,__onLimeWindowClose: function($window) { + if(this.window == $window) { + this.window = null; + } + this.__primaryTouch = null; + var event = null; + event = new openfl_events_Event("deactivate"); + this.__broadcastEvent(event); + } + ,__onLimeWindowCreate: function($window) { + if(this.window == null || this.window != $window) { + return; + } + if($window.context != null) { + this.__createRenderer(); + } + } + ,__onLimeWindowDeactivate: function($window) { + if(this.window == null || this.window != $window) { + return; + } + } + ,__onLimeWindowDropFile: function($window,file) { + } + ,__onLimeWindowEnter: function($window) { + } + ,__onLimeWindowExpose: function($window) { + if(this.window == null || this.window != $window) { + return; + } + this.__renderDirty = true; + } + ,__onLimeWindowFocusIn: function($window) { + if(this.window == null || this.window != $window) { + return; + } + this.__renderDirty = true; + var event = null; + event = new openfl_events_Event("activate"); + this.__broadcastEvent(event); + this.set_focus(this.__cacheFocus); + } + ,__onLimeWindowFocusOut: function($window) { + if(this.window == null || this.window != $window) { + return; + } + this.__primaryTouch = null; + var event = null; + event = new openfl_events_Event("deactivate"); + this.__broadcastEvent(event); + var currentFocus = this.get_focus(); + this.set_focus(null); + this.__cacheFocus = currentFocus; + openfl_events_MouseEvent.__altKey = false; + openfl_events_MouseEvent.__commandKey = false; + openfl_events_MouseEvent.__ctrlKey = false; + openfl_events_MouseEvent.__shiftKey = false; + } + ,__onLimeWindowFullscreen: function($window) { + if(this.window == null || this.window != $window) { + return; + } + this.__resize(); + if(!this.__wasFullscreen) { + this.__wasFullscreen = true; + if(this.__displayState == 2) { + this.__displayState = 1; + } + this.__dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,true,true)); + } + } + ,__onLimeWindowLeave: function($window) { + if(this.window == null || this.window != $window || openfl_events_MouseEvent.__buttonDown) { + return; + } + this.__dispatchPendingMouseEvent(); + var event = null; + event = new openfl_events_Event("mouseLeave"); + this.__dispatchEvent(event); + } + ,__onLimeWindowMinimize: function($window) { + if(this.window == null || this.window != $window) { + return; + } + } + ,__onLimeWindowMove: function($window,x,y) { + } + ,__onLimeWindowResize: function($window,width,height) { + if(this.window == null || this.window != $window) { + return; + } + this.__resize(); + if(this.__wasFullscreen && !$window.__fullscreen) { + this.__wasFullscreen = false; + this.__displayState = 2; + this.__dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,false,true)); + } + } + ,__onLimeWindowRestore: function($window) { + if(this.window == null || this.window != $window) { + return; + } + if(this.__wasFullscreen && !$window.__fullscreen) { + this.__wasFullscreen = false; + this.__displayState = 2; + this.__dispatchEvent(new openfl_events_FullScreenEvent("fullScreen",false,false,false,true)); + } + } + ,__onMouse: function(type,x,y,button) { + if(button > 2) { + return; + } + var targetPoint = openfl_geom_Point.__pool.get(); + targetPoint.setTo(x,y); + var _this = this.__displayMatrix; + var norm = _this.a * _this.d - _this.b * _this.c; + if(norm == 0) { + targetPoint.x = -_this.tx; + targetPoint.y = -_this.ty; + } else { + var px = 1.0 / norm * (_this.c * (_this.ty - targetPoint.y) + _this.d * (targetPoint.x - _this.tx)); + targetPoint.y = 1.0 / norm * (_this.a * (targetPoint.y - _this.ty) + _this.b * (_this.tx - targetPoint.x)); + targetPoint.x = px; + } + this.__mouseX = targetPoint.x; + this.__mouseY = targetPoint.y; + var stack = []; + var target = null; + if(this.__hitTest(this.__mouseX,this.__mouseY,true,stack,true,this)) { + target = stack[stack.length - 1]; + } else { + target = this; + stack = [this]; + } + if(target == null) { + target = this; + } + var clickType = null; + var supportsClickCount = false; + switch(type) { + case "middleMouseDown": + this.__mouseDownMiddle = target; + supportsClickCount = true; + break; + case "middleMouseUp": + if(this.__mouseDownMiddle == target) { + clickType = "middleClick"; + } + this.__mouseDownMiddle = null; + supportsClickCount = true; + break; + case "mouseDown": + if(this.get_focus() != null) { + if(this.get_focus() != target) { + var focusEvent = new openfl_events_FocusEvent("mouseFocusChange",true,true,target,false,0); + this.get_focus().dispatchEvent(focusEvent); + if(!focusEvent.isDefaultPrevented()) { + if(target.__allowMouseFocus()) { + this.set_focus(target); + } else { + this.set_focus(null); + } + } + } + } else if(target.__allowMouseFocus()) { + this.set_focus(target); + } else { + this.set_focus(null); + } + this.__mouseDownLeft = target; + if(this.__lastClickTarget != target) { + this.__lastClickTarget = null; + this.__lastClickTime = 0; + } + openfl_events_MouseEvent.__buttonDown = true; + supportsClickCount = true; + break; + case "mouseUp": + if(this.__mouseDownLeft != null) { + openfl_events_MouseEvent.__buttonDown = false; + if(this.__mouseDownLeft == target) { + clickType = "click"; + } else { + var event = null; + event = openfl_events_MouseEvent.__create("releaseOutside",1,0,this.__mouseX,this.__mouseY,new openfl_geom_Point(this.__mouseX,this.__mouseY),this); + this.__mouseDownLeft.dispatchEvent(event); + } + this.__mouseDownLeft = null; + } + supportsClickCount = true; + break; + case "rightMouseDown": + this.__mouseDownRight = target; + supportsClickCount = true; + break; + case "rightMouseUp": + if(this.__mouseDownRight == target) { + clickType = "rightClick"; + } + this.__mouseDownRight = null; + supportsClickCount = true; + break; + default: + } + var localPoint = openfl_geom_Point.__pool.get(); + var event = null; + var clickCount = supportsClickCount ? this.window.clickCount : 0; + event = openfl_events_MouseEvent.__create(type,button,clickCount,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,localPoint),target); + this.__dispatchStack(event,stack); + if(event.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + if(clickType != null) { + event = openfl_events_MouseEvent.__create(clickType,button,0,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,localPoint),target); + this.__dispatchStack(event,stack); + if(event.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + if(type == "mouseUp") { + if(target.doubleClickEnabled) { + var currentTime = openfl_Lib.getTimer(); + if(currentTime - this.__lastClickTime < 500 && target == this.__lastClickTarget) { + event = openfl_events_MouseEvent.__create("doubleClick",button,0,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,localPoint),target); + this.__dispatchStack(event,stack); + if(event.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + this.__lastClickTime = 0; + this.__lastClickTarget = null; + } else { + this.__lastClickTarget = target; + this.__lastClickTime = currentTime; + } + } else { + this.__lastClickTarget = null; + this.__lastClickTime = 0; + } + } + } + if(openfl_ui_Mouse.__cursor == "auto" && !openfl_ui_Mouse.__hidden) { + var cursor = null; + if(this.__mouseDownLeft != null) { + cursor = this.__mouseDownLeft.__getCursor(); + } else { + var _g = 0; + while(_g < stack.length) { + var target1 = stack[_g]; + ++_g; + cursor = target1.__getCursor(); + if(cursor != null && this.window != null) { + this.window.set_cursor(openfl_ui_MouseCursor.toLimeCursor(cursor)); + break; + } + } + } + if(cursor == null && this.window != null) { + this.window.set_cursor(lime_ui_MouseCursor.ARROW); + } + } + var event; + if(target != this.__mouseOverTarget) { + if(this.__mouseOverTarget != null) { + event = openfl_events_MouseEvent.__create("mouseOut",button,0,this.__mouseX,this.__mouseY,this.__mouseOverTarget.__globalToLocal(targetPoint,localPoint),this.__mouseOverTarget); + this.__dispatchStack(event,this.__mouseOutStack); + if(event.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + } + } + var item; + var i = 0; + while(i < this.__rollOutStack.length) { + item = this.__rollOutStack[i]; + if(stack.indexOf(item) == -1) { + HxOverrides.remove(this.__rollOutStack,item); + event = openfl_events_MouseEvent.__create("rollOut",button,0,this.__mouseX,this.__mouseY,this.__mouseOverTarget.__globalToLocal(targetPoint,localPoint),item); + event.bubbles = false; + this.__dispatchTarget(item,event); + if(event.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + } else { + ++i; + } + } + var _g = 0; + while(_g < stack.length) { + var item = stack[_g]; + ++_g; + if(this.__rollOutStack.indexOf(item) == -1 && this.__mouseOverTarget != null) { + if(item.hasEventListener("rollOver")) { + event = openfl_events_MouseEvent.__create("rollOver",button,0,this.__mouseX,this.__mouseY,this.__mouseOverTarget.__globalToLocal(targetPoint,localPoint),item); + event.bubbles = false; + this.__dispatchTarget(item,event); + if(event.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + } + if(item.hasEventListener("rollOut") || item.hasEventListener("rollOver")) { + this.__rollOutStack.push(item); + } + } + } + if(target != this.__mouseOverTarget) { + if(target != null) { + event = openfl_events_MouseEvent.__create("mouseOver",button,0,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,localPoint),target); + this.__dispatchStack(event,stack); + if(event.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + } + this.__mouseOverTarget = target; + this.__mouseOutStack = stack; + } + if(this.__dragObject != null) { + this.__drag(targetPoint); + var dropTarget = null; + if(this.__mouseOverTarget == this.__dragObject) { + var cacheMouseEnabled = this.__dragObject.mouseEnabled; + var cacheMouseChildren = this.__dragObject.mouseChildren; + this.__dragObject.mouseEnabled = false; + this.__dragObject.mouseChildren = false; + var stack = []; + if(this.__hitTest(this.__mouseX,this.__mouseY,true,stack,true,this)) { + dropTarget = stack[stack.length - 1]; + } + this.__dragObject.mouseEnabled = cacheMouseEnabled; + this.__dragObject.mouseChildren = cacheMouseChildren; + } else if(this.__mouseOverTarget != this) { + dropTarget = this.__mouseOverTarget; + } + this.__dragObject.dropTarget = dropTarget; + } + openfl_geom_Point.__pool.release(targetPoint); + openfl_geom_Point.__pool.release(localPoint); + } + ,__onMouseWheel: function(deltaX,deltaY,deltaMode) { + var x = this.__mouseX; + var y = this.__mouseY; + var stack = []; + var target = null; + if(this.__hitTest(this.__mouseX,this.__mouseY,true,stack,true,this)) { + target = stack[stack.length - 1]; + } else { + target = this; + stack = [this]; + } + if(target == null) { + target = this; + } + var targetPoint = openfl_geom_Point.__pool.get(); + targetPoint.setTo(x,y); + var _this = this.__displayMatrix; + var norm = _this.a * _this.d - _this.b * _this.c; + if(norm == 0) { + targetPoint.x = -_this.tx; + targetPoint.y = -_this.ty; + } else { + var px = 1.0 / norm * (_this.c * (_this.ty - targetPoint.y) + _this.d * (targetPoint.x - _this.tx)); + targetPoint.y = 1.0 / norm * (_this.a * (targetPoint.y - _this.ty) + _this.b * (_this.tx - targetPoint.x)); + targetPoint.x = px; + } + var delta = deltaY | 0; + var event = openfl_events_MouseEvent.__create("mouseWheel",0,0,this.__mouseX,this.__mouseY,target.__globalToLocal(targetPoint,targetPoint),target,delta); + event.cancelable = true; + this.__dispatchStack(event,stack); + if(event.isDefaultPrevented()) { + this.window.onMouseWheel.cancel(); + } + if(event.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + openfl_geom_Point.__pool.release(targetPoint); + } + ,__onTouch: function(type,touch,isPrimaryTouchPoint) { + var targetPoint = openfl_geom_Point.__pool.get(); + targetPoint.setTo(Math.round(touch.x * this.window.__width * this.window.__scale),Math.round(touch.y * this.window.__height * this.window.__scale)); + var _this = this.__displayMatrix; + var norm = _this.a * _this.d - _this.b * _this.c; + if(norm == 0) { + targetPoint.x = -_this.tx; + targetPoint.y = -_this.ty; + } else { + var px = 1.0 / norm * (_this.c * (_this.ty - targetPoint.y) + _this.d * (targetPoint.x - _this.tx)); + targetPoint.y = 1.0 / norm * (_this.a * (targetPoint.y - _this.ty) + _this.b * (_this.tx - targetPoint.x)); + targetPoint.x = px; + } + var touchX = targetPoint.x; + var touchY = targetPoint.y; + var stack = []; + var target = null; + if(this.__hitTest(touchX,touchY,false,stack,true,this)) { + target = stack[stack.length - 1]; + } else { + target = this; + stack = [this]; + } + if(target == null) { + target = this; + } + var touchId = touch.id; + var touchData = null; + if(this.__touchData.h.hasOwnProperty(touchId)) { + touchData = this.__touchData.h[touchId]; + } else { + touchData = openfl_utils__$internal_TouchData.__pool.get(); + touchData.reset(); + touchData.touch = touch; + this.__touchData.h[touchId] = touchData; + } + var touchType = null; + var releaseTouchData = false; + switch(type) { + case "touchBegin": + touchData.touchDownTarget = target; + break; + case "touchEnd": + if(touchData.touchDownTarget == target) { + touchType = "touchTap"; + } + touchData.touchDownTarget = null; + releaseTouchData = true; + break; + default: + } + var localPoint = openfl_geom_Point.__pool.get(); + var touchEvent = openfl_events_TouchEvent.__create(type,null,touchX,touchY,target.__globalToLocal(targetPoint,localPoint),target); + touchEvent.touchPointID = touchId; + touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint; + touchEvent.pressure = touch.pressure; + this.__dispatchStack(touchEvent,stack); + if(touchEvent.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + if(touchType != null) { + touchEvent = openfl_events_TouchEvent.__create(touchType,null,touchX,touchY,target.__globalToLocal(targetPoint,localPoint),target); + touchEvent.touchPointID = touchId; + touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint; + touchEvent.pressure = touch.pressure; + this.__dispatchStack(touchEvent,stack); + if(touchEvent.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + } + var touchOverTarget = touchData.touchOverTarget; + if(target != touchOverTarget && touchOverTarget != null) { + touchEvent = openfl_events_TouchEvent.__create("touchOut",null,touchX,touchY,touchOverTarget.__globalToLocal(targetPoint,localPoint),touchOverTarget); + touchEvent.touchPointID = touchId; + touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint; + touchEvent.pressure = touch.pressure; + this.__dispatchTarget(touchOverTarget,touchEvent); + if(touchEvent.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + } + var touchOutStack = touchData.rollOutStack; + var item; + var i = 0; + while(i < touchOutStack.length) { + item = touchOutStack[i]; + if(stack.indexOf(item) == -1) { + HxOverrides.remove(touchOutStack,item); + touchEvent = openfl_events_TouchEvent.__create("touchRollOut",null,touchX,touchY,touchOverTarget.__globalToLocal(targetPoint,localPoint),touchOverTarget); + touchEvent.touchPointID = touchId; + touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint; + touchEvent.bubbles = false; + touchEvent.pressure = touch.pressure; + this.__dispatchTarget(item,touchEvent); + if(touchEvent.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + } else { + ++i; + } + } + var _g = 0; + while(_g < stack.length) { + var item = stack[_g]; + ++_g; + if(touchOutStack.indexOf(item) == -1) { + if(item.hasEventListener("touchRollOver")) { + touchEvent = openfl_events_TouchEvent.__create("touchRollOver",null,touchX,touchY,touchOverTarget.__globalToLocal(targetPoint,localPoint),item); + touchEvent.touchPointID = touchId; + touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint; + touchEvent.bubbles = false; + touchEvent.pressure = touch.pressure; + this.__dispatchTarget(item,touchEvent); + if(touchEvent.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + } + if(item.hasEventListener("touchRollOut")) { + touchOutStack.push(item); + } + } + } + if(target != touchOverTarget) { + if(target != null) { + touchEvent = openfl_events_TouchEvent.__create("touchOver",null,touchX,touchY,target.__globalToLocal(targetPoint,localPoint),target); + touchEvent.touchPointID = touchId; + touchEvent.isPrimaryTouchPoint = isPrimaryTouchPoint; + touchEvent.bubbles = true; + touchEvent.pressure = touch.pressure; + this.__dispatchTarget(target,touchEvent); + if(touchEvent.__updateAfterEventFlag) { + this.__renderAfterEvent(); + } + } + touchData.touchOverTarget = target; + } + openfl_geom_Point.__pool.release(targetPoint); + openfl_geom_Point.__pool.release(localPoint); + if(releaseTouchData) { + this.__touchData.remove(touchId); + touchData.reset(); + openfl_utils__$internal_TouchData.__pool.release(touchData); + } + } + ,__registerLimeModule: function(application) { + application.onCreateWindow.add($bind(this,this.__onLimeCreateWindow)); + application.onUpdate.add($bind(this,this.__onLimeUpdate)); + application.onExit.add($bind(this,this.__onLimeModuleExit),false,0); + var gamepad = lime_ui_Gamepad.devices.iterator(); + while(gamepad.hasNext()) { + var gamepad1 = gamepad.next(); + this.__onLimeGamepadConnect(gamepad1); + } + lime_ui_Gamepad.onConnect.add($bind(this,this.__onLimeGamepadConnect)); + lime_ui_Touch.onStart.add($bind(this,this.__onLimeTouchStart)); + lime_ui_Touch.onMove.add($bind(this,this.__onLimeTouchMove)); + lime_ui_Touch.onEnd.add($bind(this,this.__onLimeTouchEnd)); + lime_ui_Touch.onCancel.add($bind(this,this.__onLimeTouchCancel)); + } + ,__resize: function() { + var cacheWidth = this.stageWidth; + var cacheHeight = this.stageHeight; + var windowWidth = this.window.__width * this.window.__scale | 0; + var windowHeight = this.window.__height * this.window.__scale | 0; + this.__displayMatrix.identity(); + if(this.get_fullScreenSourceRect() != null && this.window.__fullscreen) { + this.stageWidth = this.get_fullScreenSourceRect().width | 0; + this.stageHeight = this.get_fullScreenSourceRect().height | 0; + var displayScaleX = windowWidth / this.stageWidth; + var displayScaleY = windowHeight / this.stageHeight; + this.__displayMatrix.translate(-this.get_fullScreenSourceRect().x,-this.get_fullScreenSourceRect().y); + this.__displayMatrix.scale(displayScaleX,displayScaleY); + this.__displayRect.setTo(this.get_fullScreenSourceRect().get_left(),this.get_fullScreenSourceRect().get_right(),this.get_fullScreenSourceRect().get_top(),this.get_fullScreenSourceRect().get_bottom()); + } else if(this.__logicalWidth == 0 || this.__logicalHeight == 0 || this.get_scaleMode() == 2 || windowWidth == 0 || windowHeight == 0) { + this.stageWidth = Math.round(windowWidth / this.window.__scale); + this.stageHeight = Math.round(windowHeight / this.window.__scale); + this.__displayMatrix.scale(this.window.__scale,this.window.__scale); + this.__displayRect.setTo(0,0,this.stageWidth,this.stageHeight); + } else { + this.stageWidth = this.__logicalWidth; + this.stageHeight = this.__logicalHeight; + switch(this.get_scaleMode()) { + case 0: + var displayScaleX = windowWidth / this.stageWidth; + var displayScaleY = windowHeight / this.stageHeight; + this.__displayMatrix.scale(displayScaleX,displayScaleY); + this.__displayRect.setTo(0,0,this.stageWidth,this.stageHeight); + break; + case 1: + var scaleX = windowWidth / this.stageWidth; + var scaleY = windowHeight / this.stageHeight; + var scale = Math.max(scaleX,scaleY); + var scaledWidth = this.stageWidth * scale; + var scaledHeight = this.stageHeight * scale; + var visibleWidth = this.stageWidth - Math.round((scaledWidth - windowWidth) / scale); + var visibleHeight = this.stageHeight - Math.round((scaledHeight - windowHeight) / scale); + var visibleX = Math.round((this.stageWidth - visibleWidth) / 2); + var visibleY = Math.round((this.stageHeight - visibleHeight) / 2); + this.__displayMatrix.translate(-visibleX,-visibleY); + this.__displayMatrix.scale(scale,scale); + this.__displayRect.setTo(visibleX,visibleY,visibleWidth,visibleHeight); + break; + default: + var scaleX = windowWidth / this.stageWidth; + var scaleY = windowHeight / this.stageHeight; + var scale = Math.min(scaleX,scaleY); + var scaledWidth = this.stageWidth * scale; + var scaledHeight = this.stageHeight * scale; + var visibleWidth = this.stageWidth - Math.round((scaledWidth - windowWidth) / scale); + var visibleHeight = this.stageHeight - Math.round((scaledHeight - windowHeight) / scale); + var visibleX = Math.round((this.stageWidth - visibleWidth) / 2); + var visibleY = Math.round((this.stageHeight - visibleHeight) / 2); + this.__displayMatrix.translate(-visibleX,-visibleY); + this.__displayMatrix.scale(scale,scale); + this.__displayRect.setTo(visibleX,visibleY,visibleWidth,visibleHeight); + } + } + if(this.context3D != null) { + this.context3D.configureBackBuffer(this.stageWidth,this.stageHeight,0,true,true,true); + } + var stage3D = this.stage3Ds.iterator(); + while(stage3D.hasNext()) { + var stage3D1 = stage3D.next(); + stage3D1.__resize(windowWidth,windowHeight); + } + if(this.__renderer != null) { + this.__renderer.__resize(windowWidth,windowHeight); + } + this.__renderDirty = true; + if(this.stageWidth != cacheWidth || this.stageHeight != cacheHeight) { + this.__setTransformDirty(); + var event = null; + event = new openfl_events_Event("resize"); + this.__dispatchEvent(event); + } + } + ,__setLogicalSize: function(width,height) { + this.__logicalWidth = width; + this.__logicalHeight = height; + this.__resize(); + } + ,__startDrag: function(sprite,lockCenter,bounds) { + if(bounds == null) { + this.__dragBounds = null; + } else { + this.__dragBounds = new openfl_geom_Rectangle(); + var right = bounds.get_right(); + var bottom = bounds.get_bottom(); + this.__dragBounds.x = right < bounds.x ? right : bounds.x; + this.__dragBounds.y = bottom < bounds.y ? bottom : bounds.y; + this.__dragBounds.width = Math.abs(bounds.width); + this.__dragBounds.height = Math.abs(bounds.height); + } + this.__dragObject = sprite; + if(this.__dragObject != null) { + if(lockCenter) { + this.__dragOffsetX = 0; + this.__dragOffsetY = 0; + } else { + var mouse = openfl_geom_Point.__pool.get(); + mouse.setTo(this.get_mouseX(),this.get_mouseY()); + var parent = this.__dragObject.parent; + if(parent != null) { + var _this = parent.__getWorldTransform(); + var norm = _this.a * _this.d - _this.b * _this.c; + if(norm == 0) { + mouse.x = -_this.tx; + mouse.y = -_this.ty; + } else { + var px = 1.0 / norm * (_this.c * (_this.ty - mouse.y) + _this.d * (mouse.x - _this.tx)); + mouse.y = 1.0 / norm * (_this.a * (mouse.y - _this.ty) + _this.b * (_this.tx - mouse.x)); + mouse.x = px; + } + } + this.__dragOffsetX = this.__dragObject.get_x() - mouse.x; + this.__dragOffsetY = this.__dragObject.get_y() - mouse.y; + openfl_geom_Point.__pool.release(mouse); + } + } + } + ,__stopDrag: function(sprite) { + this.__dragBounds = null; + this.__dragObject = null; + } + ,__unregisterLimeModule: function(application) { + application.onCreateWindow.remove($bind(this,this.__onLimeCreateWindow)); + application.onUpdate.remove($bind(this,this.__onLimeUpdate)); + application.onExit.remove($bind(this,this.__onLimeModuleExit)); + lime_ui_Gamepad.onConnect.remove($bind(this,this.__onLimeGamepadConnect)); + lime_ui_Touch.onStart.remove($bind(this,this.__onLimeTouchStart)); + lime_ui_Touch.onMove.remove($bind(this,this.__onLimeTouchMove)); + lime_ui_Touch.onEnd.remove($bind(this,this.__onLimeTouchEnd)); + lime_ui_Touch.onCancel.remove($bind(this,this.__onLimeTouchCancel)); + } + ,__update: function(transformOnly,updateChildren) { + if(transformOnly) { + if(this.__transformDirty) { + openfl_display_DisplayObjectContainer.prototype.__update.call(this,true,updateChildren); + if(updateChildren) { + this.__transformDirty = false; + } + } + } else if(this.__transformDirty || this.__renderDirty) { + openfl_display_DisplayObjectContainer.prototype.__update.call(this,false,updateChildren); + if(updateChildren) { + if(openfl_display_DisplayObject.__supportDOM) { + this.__wasDirty = true; + } + } + } else if(!this.__renderDirty && this.__wasDirty) { + openfl_display_DisplayObjectContainer.prototype.__update.call(this,false,updateChildren); + if(updateChildren) { + this.__wasDirty = false; + } + } + } + ,get_color: function() { + return this.__color; + } + ,set_color: function(value) { + if(value == null) { + this.__transparent = true; + value = 0; + } else { + this.__transparent = false; + } + if(this.__color != value) { + var r = (value & 16711680) >>> 16; + var g = (value & 65280) >>> 8; + var b = value & 255; + this.__colorSplit[0] = r / 255; + this.__colorSplit[1] = g / 255; + this.__colorSplit[2] = b / 255; + this.__colorString = "#" + StringTools.hex(value & 16777215,6); + this.__renderDirty = true; + this.__color = -16777216 | value & 16777215; + } + return value; + } + ,get_contentsScaleFactor: function() { + return this.__contentsScaleFactor; + } + ,get_displayState: function() { + return this.__displayState; + } + ,set_displayState: function(value) { + if(this.window != null) { + if(value == 2) { + if(this.window.__fullscreen) { + this.window.set_fullscreen(false); + } + } else if(!this.window.__fullscreen) { + this.window.set_fullscreen(true); + } + } + return this.__displayState = value; + } + ,get_focus: function() { + return this.__focus; + } + ,set_focus: function(value) { + if(value != this.__focus || value == null && this.__cacheFocus != null) { + var oldFocus = this.__focus; + this.__focus = value; + this.__cacheFocus = value; + if(oldFocus != null) { + var event = new openfl_events_FocusEvent("focusOut",true,false,value,false,0); + var stack = []; + oldFocus.__getInteractive(stack); + stack.reverse(); + this.__dispatchStack(event,stack); + } + if(value != null) { + var event = new openfl_events_FocusEvent("focusIn",true,false,oldFocus,false,0); + var stack = []; + value.__getInteractive(stack); + stack.reverse(); + this.__dispatchStack(event,stack); + } + } + return value; + } + ,get_frameRate: function() { + if(this.window != null) { + return this.window.__backend.getFrameRate(); + } + return 0; + } + ,set_frameRate: function(value) { + if(this.window != null) { + return this.window.__backend.setFrameRate(value); + } + return value; + } + ,get_fullScreenHeight: function() { + return Math.ceil(this.window.get_display().currentMode.height * this.window.__scale); + } + ,get_fullScreenSourceRect: function() { + if(this.__fullScreenSourceRect == null) { + return null; + } else { + return this.__fullScreenSourceRect.clone(); + } + } + ,set_fullScreenSourceRect: function(value) { + if(value == null) { + if(this.__fullScreenSourceRect != null) { + this.__fullScreenSourceRect = null; + this.__resize(); + } + } else if(!value.equals(this.__fullScreenSourceRect)) { + this.__fullScreenSourceRect = value.clone(); + this.__resize(); + } + return value; + } + ,get_fullScreenWidth: function() { + return Math.ceil(this.window.get_display().currentMode.width * this.window.__scale); + } + ,set_height: function(value) { + return this.get_height(); + } + ,get_mouseX: function() { + return this.__mouseX; + } + ,get_mouseY: function() { + return this.__mouseY; + } + ,get_quality: function() { + return this.__quality; + } + ,set_quality: function(value) { + this.__quality = value; + if(this.__renderer != null) { + var tmp = this.get_quality(); + this.__renderer.__allowSmoothing = tmp != 2; + } + return value; + } + ,set_rotation: function(value) { + return 0; + } + ,get_scaleMode: function() { + return this.__scaleMode; + } + ,set_scaleMode: function(value) { + if(value != this.__scaleMode) { + this.__scaleMode = value; + this.__resize(); + } + return value; + } + ,set_scaleX: function(value) { + return 0; + } + ,set_scaleY: function(value) { + return 0; + } + ,get_tabEnabled: function() { + return false; + } + ,set_tabEnabled: function(value) { + throw new openfl_errors_IllegalOperationError("Error: The Stage class does not implement this property or method."); + } + ,get_tabIndex: function() { + return -1; + } + ,set_tabIndex: function(value) { + throw new openfl_errors_IllegalOperationError("Error: The Stage class does not implement this property or method."); + } + ,set_transform: function(value) { + return this.get_transform(); + } + ,set_width: function(value) { + return this.get_width(); + } + ,set_x: function(value) { + return 0; + } + ,set_y: function(value) { + return 0; + } + ,__class__: openfl_display_Stage + ,__properties__: $extend(openfl_display_DisplayObjectContainer.prototype.__properties__,{set_scaleMode:"set_scaleMode",get_scaleMode:"get_scaleMode",set_quality:"set_quality",get_quality:"get_quality",get_fullScreenWidth:"get_fullScreenWidth",set_fullScreenSourceRect:"set_fullScreenSourceRect",get_fullScreenSourceRect:"get_fullScreenSourceRect",get_fullScreenHeight:"get_fullScreenHeight",set_frameRate:"set_frameRate",get_frameRate:"get_frameRate",set_focus:"set_focus",get_focus:"get_focus",set_displayState:"set_displayState",get_displayState:"get_displayState",get_contentsScaleFactor:"get_contentsScaleFactor",set_color:"set_color",get_color:"get_color"}) +}); +var openfl_display_Stage3D = function(stage) { + openfl_events_EventDispatcher.call(this); + this.__stage = stage; + this.__height = 0; + this.__projectionTransform = new openfl_geom_Matrix3D(); + this.__renderTransform = new openfl_geom_Matrix3D(); + this.__width = 0; + this.__x = 0; + this.__y = 0; + this.visible = true; + if(stage.stageWidth > 0 && stage.stageHeight > 0) { + this.__resize(stage.stageWidth,stage.stageHeight); + } +}; +$hxClasses["openfl.display.Stage3D"] = openfl_display_Stage3D; +openfl_display_Stage3D.__name__ = "openfl.display.Stage3D"; +openfl_display_Stage3D.__super__ = openfl_events_EventDispatcher; +openfl_display_Stage3D.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + requestContext3D: function(context3DRenderMode,profile) { + if(profile == null) { + profile = 0; + } + if(context3DRenderMode == null) { + context3DRenderMode = 0; + } + if(this.__contextLost) { + this.__contextRequested = true; + return; + } + if(this.context3D != null) { + this.__contextRequested = true; + haxe_Timer.delay($bind(this,this.__dispatchCreate),1); + } else if(!this.__contextRequested) { + this.__contextRequested = true; + haxe_Timer.delay($bind(this,this.__createContext),1); + } + } + ,requestContext3DMatchingProfiles: function(profiles) { + this.requestContext3D(); + } + ,__createContext: function() { + var stage = this.__stage; + var renderer = stage.__renderer; + if(renderer.__type == "cairo" || renderer.__type == "canvas") { + this.__dispatchError(); + return; + } + if(renderer.__type == "opengl") { + this.context3D = new openfl_display3D_Context3D(stage,stage.context3D.__contextState,this); + this.__dispatchCreate(); + } else if(renderer.__type == "dom") { + if(stage.context3D == null) { + this.__canvas = window.document.createElement("canvas"); + this.__canvas.width = stage.stageWidth; + this.__canvas.height = stage.stageHeight; + var $window = stage.window; + var attributes = stage.window.context.attributes; + var transparentBackground = Object.prototype.hasOwnProperty.call(attributes,"background") && attributes.background == null; + var colorDepth = Object.prototype.hasOwnProperty.call(attributes,"colorDepth") ? attributes.colorDepth : 32; + var options = Object.prototype.hasOwnProperty.call(attributes,"antialiasing") && attributes.antialiasing > 0; + var options1 = { alpha : transparentBackground || colorDepth > 16, antialias : options, depth : true, premultipliedAlpha : true, stencil : true, preserveDrawingBuffer : false}; + this.__webgl = js_html__$CanvasElement_CanvasUtil.getContextWebGL(this.__canvas,options1); + if(this.__webgl != null) { + if(lime_graphics_opengl_GL.context == null) { + lime_graphics_opengl_GL.context = this.__webgl; + lime_graphics_opengl_GL.type = "webgl"; + lime_graphics_opengl_GL.version = 1; + } + stage.context3D = new openfl_display3D_Context3D(stage); + stage.context3D.configureBackBuffer(stage.window.__width,stage.window.__height,0,true,true,true); + stage.context3D.present(); + var renderer1 = renderer; + renderer1.element.appendChild(this.__canvas); + this.__style = this.__canvas.style; + this.__style.setProperty("position","absolute",null); + this.__style.setProperty("top","0",null); + this.__style.setProperty("left","0",null); + this.__style.setProperty(renderer1.__transformOriginProperty,"0 0 0",null); + this.__style.setProperty("z-index","-1",null); + } + if(stage.context3D != null) { + this.context3D = new openfl_display3D_Context3D(stage,stage.context3D.__contextState,this); + } + this.__dispatchCreate(); + } else { + this.__dispatchError(); + } + } + } + ,__dispatchError: function() { + this.__contextRequested = false; + this.dispatchEvent(new openfl_events_ErrorEvent("error",false,false,"Context3D not available")); + } + ,__dispatchCreate: function() { + if(this.__contextRequested) { + this.__contextRequested = false; + this.dispatchEvent(new openfl_events_Event("context3DCreate")); + } + } + ,__lostContext: function() { + this.__contextLost = true; + if(this.context3D != null) { + this.context3D.__dispose(); + this.__contextRequested = true; + } + } + ,__resize: function(width,height) { + if(width != this.__width || height != this.__height) { + if(this.__canvas != null) { + this.__canvas.width = width; + this.__canvas.height = height; + } + this.__projectionTransform.copyRawDataFrom(openfl_Vector.toFloatVector(null,null,null,[2.0 / (width > 0 ? width : 1),0.0,0.0,0.0,0.0,-2.0 / (height > 0 ? height : 1),0.0,0.0,0.0,0.0,-0.001,0.0,-1.0,1.0,0.0,1.0])); + var pixelRatio = this.__stage.window.__scale; + this.__renderTransform.identity(); + this.__renderTransform.appendTranslation(this.__x * pixelRatio,this.__y * pixelRatio,0); + this.__renderTransform.append(this.__projectionTransform); + this.__width = width; + this.__height = height; + } + } + ,__restoreContext: function() { + this.__contextLost = false; + this.__createContext(); + } + ,get_x: function() { + return this.__x; + } + ,set_x: function(value) { + if(this.__x == value) { + return value; + } + this.__x = value; + var pixelRatio = this.__stage.window.__scale; + this.__renderTransform.identity(); + this.__renderTransform.appendTranslation(this.__x * pixelRatio,this.__y * pixelRatio,0); + this.__renderTransform.append(this.__projectionTransform); + return value; + } + ,get_y: function() { + return this.__y; + } + ,set_y: function(value) { + if(this.__y == value) { + return value; + } + this.__y = value; + var pixelRatio = this.__stage.window.__scale; + this.__renderTransform.identity(); + this.__renderTransform.appendTranslation(this.__x * pixelRatio,this.__y * pixelRatio,0); + this.__renderTransform.append(this.__projectionTransform); + return value; + } + ,__class__: openfl_display_Stage3D + ,__properties__: {set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x"} +}); +var openfl_display_StageAlign = {}; +openfl_display_StageAlign.fromString = function(value) { + switch(value) { + case "bottom": + return 0; + case "bottomLeft": + return 1; + case "bottomRight": + return 2; + case "left": + return 3; + case "right": + return 4; + case "top": + return 5; + case "topLeft": + return 6; + case "topRight": + return 7; + default: + return null; + } +}; +openfl_display_StageAlign.toString = function(this1) { + switch(this1) { + case 0: + return "bottom"; + case 1: + return "bottomLeft"; + case 2: + return "bottomRight"; + case 3: + return "left"; + case 4: + return "right"; + case 5: + return "top"; + case 6: + return "topLeft"; + case 7: + return "topRight"; + default: + return null; + } +}; +var openfl_display_StageDisplayState = {}; +openfl_display_StageDisplayState.fromString = function(value) { + switch(value) { + case "fullScreen": + return 0; + case "fullScreenInteractive": + return 1; + case "normal": + return 2; + default: + return null; + } +}; +openfl_display_StageDisplayState.toString = function(this1) { + switch(this1) { + case 0: + return "fullScreen"; + case 1: + return "fullScreenInteractive"; + case 2: + return "normal"; + default: + return null; + } +}; +var openfl_display_StageQuality = {}; +openfl_display_StageQuality.fromString = function(value) { + switch(value) { + case "best": + return 0; + case "high": + return 1; + case "low": + return 2; + case "medium": + return 3; + default: + return null; + } +}; +openfl_display_StageQuality.toString = function(this1) { + switch(this1) { + case 0: + return "best"; + case 1: + return "high"; + case 2: + return "low"; + case 3: + return "medium"; + default: + return null; + } +}; +var openfl_display_StageScaleMode = {}; +openfl_display_StageScaleMode.fromString = function(value) { + switch(value) { + case "exactFit": + return 0; + case "noBorder": + return 1; + case "noScale": + return 2; + case "showAll": + return 3; + default: + return null; + } +}; +openfl_display_StageScaleMode.toString = function(this1) { + switch(this1) { + case 0: + return "exactFit"; + case 1: + return "noBorder"; + case 2: + return "noScale"; + case 3: + return "showAll"; + default: + return null; + } +}; +var openfl_display_Tile = function(id,x,y,scaleX,scaleY,rotation,originX,originY) { + if(originY == null) { + originY = 0; + } + if(originX == null) { + originX = 0; + } + if(rotation == null) { + rotation = 0; + } + if(scaleY == null) { + scaleY = 1; + } + if(scaleX == null) { + scaleX = 1; + } + if(y == null) { + y = 0; + } + if(x == null) { + x = 0; + } + if(id == null) { + id = 0; + } + this.__id = id; + this.__matrix = new openfl_geom_Matrix(); + if(x != 0) { + this.set_x(x); + } + if(y != 0) { + this.set_y(y); + } + if(scaleX != 1) { + this.set_scaleX(scaleX); + } + if(scaleY != 1) { + this.set_scaleY(scaleY); + } + if(rotation != 0) { + this.set_rotation(rotation); + } + this.__dirty = true; + this.__length = 0; + this.__originX = originX; + this.__originY = originY; + this.__alpha = 1; + this.__blendMode = null; + this.__visible = true; +}; +$hxClasses["openfl.display.Tile"] = openfl_display_Tile; +openfl_display_Tile.__name__ = "openfl.display.Tile"; +openfl_display_Tile.prototype = { + clone: function() { + var tile = new openfl_display_Tile(this.__id); + tile.__alpha = this.__alpha; + tile.__blendMode = this.__blendMode; + tile.__originX = this.__originX; + tile.__originY = this.__originY; + if(this.__rect != null) { + tile.__rect = this.__rect.clone(); + } + tile.set_matrix(this.__matrix.clone()); + tile.__shader = this.__shader; + tile.set_tileset(this.__tileset); + if(this.__colorTransform != null) { + tile.__colorTransform = this.__colorTransform.__clone(); + } + return tile; + } + ,getBounds: function(targetCoordinateSpace) { + var result = new openfl_geom_Rectangle(); + this.__findTileRect(result); + var matrix = openfl_geom_Matrix.__pool.get(); + if(targetCoordinateSpace != null && targetCoordinateSpace != this) { + matrix.copyFrom(this.__getWorldTransform()); + var targetMatrix = openfl_geom_Matrix.__pool.get(); + targetMatrix.copyFrom(targetCoordinateSpace.__getWorldTransform()); + targetMatrix.invert(); + matrix.concat(targetMatrix); + openfl_geom_Matrix.__pool.release(targetMatrix); + } else { + matrix.identity(); + } + this.__getBounds(result,matrix); + openfl_geom_Matrix.__pool.release(matrix); + return result; + } + ,__getBounds: function(result,matrix) { + result.__transform(result,matrix); + } + ,hitTestTile: function(obj) { + if(obj != null && obj.parent != null && this.parent != null) { + var currentBounds = this.getBounds(this); + var targetBounds = obj.getBounds(this); + return currentBounds.intersects(targetBounds); + } + return false; + } + ,invalidate: function() { + this.__setRenderDirty(); + } + ,__findTileRect: function(result) { + if(this.get_tileset() == null) { + if(this.parent != null) { + var parentTileset = this.parent.__findTileset(); + if(parentTileset == null) { + result.setTo(0,0,0,0); + } else { + var _g = parentTileset.getRect(this.get_id()); + if(_g == null) { + result.setTo(0,0,0,0); + } else { + var not_null = _g; + result.copyFrom(not_null); + } + } + } else { + result.setTo(0,0,0,0); + } + } else { + result.copyFrom(this.get_tileset().getRect(this.get_id())); + } + result.x = 0; + result.y = 0; + } + ,__findTileset: function() { + if(this.get_tileset() != null) { + return this.get_tileset(); + } + if(((this.parent) instanceof openfl_display_Tilemap)) { + return this.parent.get_tileset(); + } + if(this.parent == null) { + return null; + } + return this.parent.__findTileset(); + } + ,__getWorldTransform: function() { + var retval = this.get_matrix().clone(); + if(this.parent != null) { + retval.concat(this.parent.__getWorldTransform()); + } + return retval; + } + ,__setRenderDirty: function() { + if(!this.__dirty) { + this.__dirty = true; + if(this.parent != null) { + this.parent.__setRenderDirty(); + } + } + } + ,get_alpha: function() { + return this.__alpha; + } + ,set_alpha: function(value) { + if(value != this.__alpha) { + this.__alpha = value; + this.__setRenderDirty(); + } + return value; + } + ,get_blendMode: function() { + return this.__blendMode; + } + ,set_blendMode: function(value) { + if(value != this.__blendMode) { + this.__blendMode = value; + this.__setRenderDirty(); + } + return value; + } + ,get_colorTransform: function() { + return this.__colorTransform; + } + ,set_colorTransform: function(value) { + if(value != this.__colorTransform) { + this.__colorTransform = value; + this.__setRenderDirty(); + } + return value; + } + ,get_height: function() { + var result = openfl_geom_Rectangle.__pool.get(); + this.__findTileRect(result); + this.__getBounds(result,this.get_matrix()); + var h = result.height; + openfl_geom_Rectangle.__pool.release(result); + return h; + } + ,set_height: function(value) { + var result = openfl_geom_Rectangle.__pool.get(); + this.__findTileRect(result); + if(result.height != 0) { + this.set_scaleY(value / result.height); + } + openfl_geom_Rectangle.__pool.release(result); + return value; + } + ,get_id: function() { + return this.__id; + } + ,set_id: function(value) { + if(value != this.__id) { + this.__id = value; + this.__setRenderDirty(); + } + return value; + } + ,get_matrix: function() { + return this.__matrix; + } + ,set_matrix: function(value) { + if(value != this.__matrix) { + this.__rotation = null; + this.__scaleX = null; + this.__scaleY = null; + this.__matrix = value; + this.__setRenderDirty(); + } + return value; + } + ,get_originX: function() { + return this.__originX; + } + ,set_originX: function(value) { + if(value != this.__originX) { + this.__originX = value; + this.__setRenderDirty(); + } + return value; + } + ,get_originY: function() { + return this.__originY; + } + ,set_originY: function(value) { + if(value != this.__originY) { + this.__originY = value; + this.__setRenderDirty(); + } + return value; + } + ,get_rect: function() { + return this.__rect; + } + ,set_rect: function(value) { + if(value != this.__rect) { + this.__rect = value; + this.__setRenderDirty(); + } + return value; + } + ,get_rotation: function() { + if(this.__rotation == null) { + if(this.__matrix.b == 0 && this.__matrix.c == 0) { + this.__rotation = 0; + this.__rotationSine = 0; + this.__rotationCosine = 1; + } else { + var radians = Math.atan2(this.__matrix.d,this.__matrix.c) - Math.PI / 2; + this.__rotation = radians * (180 / Math.PI); + this.__rotationSine = Math.sin(radians); + this.__rotationCosine = Math.cos(radians); + } + } + return this.__rotation; + } + ,set_rotation: function(value) { + if(value != this.__rotation) { + this.__rotation = value; + var radians = value * (Math.PI / 180); + this.__rotationSine = Math.sin(radians); + this.__rotationCosine = Math.cos(radians); + var __scaleX = this.get_scaleX(); + var __scaleY = this.get_scaleY(); + this.__matrix.a = this.__rotationCosine * __scaleX; + this.__matrix.b = this.__rotationSine * __scaleX; + this.__matrix.c = -this.__rotationSine * __scaleY; + this.__matrix.d = this.__rotationCosine * __scaleY; + this.__setRenderDirty(); + } + return value; + } + ,get_scaleX: function() { + if(this.__scaleX == null) { + if(this.get_matrix().b == 0) { + this.__scaleX = this.__matrix.a; + } else { + this.__scaleX = Math.sqrt(this.__matrix.a * this.__matrix.a + this.__matrix.b * this.__matrix.b); + } + } + return this.__scaleX; + } + ,set_scaleX: function(value) { + if(value != this.__scaleX) { + this.__scaleX = value; + if(this.__matrix.b == 0) { + this.__matrix.a = value; + } else { + var rotation = this.get_rotation(); + var a = this.__rotationCosine * value; + var b = this.__rotationSine * value; + this.__matrix.a = a; + this.__matrix.b = b; + } + this.__setRenderDirty(); + } + return value; + } + ,get_scaleY: function() { + if(this.__scaleY == null) { + if(this.__matrix.c == 0) { + this.__scaleY = this.get_matrix().d; + } else { + this.__scaleY = Math.sqrt(this.__matrix.c * this.__matrix.c + this.__matrix.d * this.__matrix.d); + } + } + return this.__scaleY; + } + ,set_scaleY: function(value) { + if(value != this.__scaleY) { + this.__scaleY = value; + if(this.__matrix.c == 0) { + this.__matrix.d = value; + } else { + var rotation = this.get_rotation(); + var c = -this.__rotationSine * value; + var d = this.__rotationCosine * value; + this.__matrix.c = c; + this.__matrix.d = d; + } + this.__setRenderDirty(); + } + return value; + } + ,get_shader: function() { + return this.__shader; + } + ,set_shader: function(value) { + if(value != this.__shader) { + this.__shader = value; + this.__setRenderDirty(); + } + return value; + } + ,get_tileset: function() { + return this.__tileset; + } + ,set_tileset: function(value) { + if(value != this.__tileset) { + this.__tileset = value; + this.__setRenderDirty(); + } + return value; + } + ,get_visible: function() { + return this.__visible; + } + ,set_visible: function(value) { + if(value != this.__visible) { + this.__visible = value; + this.__setRenderDirty(); + } + return value; + } + ,get_width: function() { + var result = openfl_geom_Rectangle.__pool.get(); + this.__findTileRect(result); + this.__getBounds(result,this.get_matrix()); + var w = result.width; + openfl_geom_Rectangle.__pool.release(result); + return w; + } + ,set_width: function(value) { + var result = openfl_geom_Rectangle.__pool.get(); + this.__findTileRect(result); + if(result.width != 0) { + this.set_scaleX(value / result.width); + } + openfl_geom_Rectangle.__pool.release(result); + return value; + } + ,get_x: function() { + return this.__matrix.tx; + } + ,set_x: function(value) { + if(value != this.__matrix.tx) { + this.__matrix.tx = value; + this.__setRenderDirty(); + } + return value; + } + ,get_y: function() { + return this.__matrix.ty; + } + ,set_y: function(value) { + if(value != this.__matrix.ty) { + this.__matrix.ty = value; + this.__setRenderDirty(); + } + return value; + } + ,__class__: openfl_display_Tile + ,__properties__: {set_y:"set_y",get_y:"get_y",set_x:"set_x",get_x:"get_x",set_width:"set_width",get_width:"get_width",set_visible:"set_visible",get_visible:"get_visible",set_tileset:"set_tileset",get_tileset:"get_tileset",set_shader:"set_shader",get_shader:"get_shader",set_scaleY:"set_scaleY",get_scaleY:"get_scaleY",set_scaleX:"set_scaleX",get_scaleX:"get_scaleX",set_rotation:"set_rotation",get_rotation:"get_rotation",set_rect:"set_rect",get_rect:"get_rect",set_originY:"set_originY",get_originY:"get_originY",set_originX:"set_originX",get_originX:"get_originX",set_matrix:"set_matrix",get_matrix:"get_matrix",set_id:"set_id",get_id:"get_id",set_height:"set_height",get_height:"get_height",set_colorTransform:"set_colorTransform",get_colorTransform:"get_colorTransform",set_blendMode:"set_blendMode",get_blendMode:"get_blendMode",set_alpha:"set_alpha",get_alpha:"get_alpha"} +}; +var openfl_display_TileContainer = function(x,y,scaleX,scaleY,rotation,originX,originY) { + if(originY == null) { + originY = 0; + } + if(originX == null) { + originX = 0; + } + if(rotation == null) { + rotation = 0; + } + if(scaleY == null) { + scaleY = 1; + } + if(scaleX == null) { + scaleX = 1; + } + if(y == null) { + y = 0; + } + if(x == null) { + x = 0; + } + openfl_display_Tile.call(this,-1,x,y,scaleX,scaleY,rotation,originX,originY); + this.__tiles = []; + this.__length = 0; +}; +$hxClasses["openfl.display.TileContainer"] = openfl_display_TileContainer; +openfl_display_TileContainer.__name__ = "openfl.display.TileContainer"; +openfl_display_TileContainer.__interfaces__ = [openfl_display_ITileContainer]; +openfl_display_TileContainer.__super__ = openfl_display_Tile; +openfl_display_TileContainer.prototype = $extend(openfl_display_Tile.prototype,{ + addTile: function(tile) { + if(tile == null) { + return null; + } + if(tile.parent == this) { + HxOverrides.remove(this.__tiles,tile); + this.__length--; + } + this.__tiles[this.get_numTiles()] = tile; + tile.parent = this; + this.__length++; + this.__setRenderDirty(); + return tile; + } + ,addTileAt: function(tile,index) { + if(tile == null) { + return null; + } + if(tile.parent == this) { + HxOverrides.remove(this.__tiles,tile); + this.__length--; + } + this.__tiles.splice(index,0,tile); + tile.parent = this; + this.__length++; + this.__setRenderDirty(); + return tile; + } + ,addTiles: function(tiles) { + var _g = 0; + while(_g < tiles.length) { + var tile = tiles[_g]; + ++_g; + this.addTile(tile); + } + return tiles; + } + ,clone: function() { + var group = new openfl_display_TileContainer(); + var _g = 0; + var _g1 = this.__tiles; + while(_g < _g1.length) { + var tile = _g1[_g]; + ++_g; + group.addTile(tile.clone()); + } + return group; + } + ,contains: function(tile) { + return this.__tiles.indexOf(tile) > -1; + } + ,getBounds: function(targetCoordinateSpace) { + var result = new openfl_geom_Rectangle(); + var rect = null; + var _g = 0; + var _g1 = this.__tiles; + while(_g < _g1.length) { + var tile = _g1[_g]; + ++_g; + rect = tile.getBounds(targetCoordinateSpace); + result.__expand(rect.x,rect.y,rect.width,rect.height); + } + return result; + } + ,getTileAt: function(index) { + if(index >= 0 && index < this.get_numTiles()) { + return this.__tiles[index]; + } + return null; + } + ,getTileIndex: function(tile) { + var _g = 0; + var _g1 = this.__tiles.length; + while(_g < _g1) { + var i = _g++; + if(this.__tiles[i] == tile) { + return i; + } + } + return -1; + } + ,removeTile: function(tile) { + if(tile != null && tile.parent == this) { + tile.parent = null; + HxOverrides.remove(this.__tiles,tile); + this.__length--; + this.__setRenderDirty(); + } + return tile; + } + ,removeTileAt: function(index) { + if(index >= 0 && index < this.get_numTiles()) { + return this.removeTile(this.__tiles[index]); + } + return null; + } + ,removeTiles: function(beginIndex,endIndex) { + if(endIndex == null) { + endIndex = 2147483647; + } + if(beginIndex == null) { + beginIndex = 0; + } + if(beginIndex < 0) { + beginIndex = 0; + } + if(endIndex > this.__tiles.length - 1) { + endIndex = this.__tiles.length - 1; + } + var removed = this.__tiles.splice(beginIndex,endIndex - beginIndex + 1); + var _g = 0; + while(_g < removed.length) { + var tile = removed[_g]; + ++_g; + tile.parent = null; + } + this.__length = this.__tiles.length; + this.__setRenderDirty(); + } + ,setTileIndex: function(tile,index) { + if(index >= 0 && index <= this.get_numTiles() && tile.parent == this) { + HxOverrides.remove(this.__tiles,tile); + this.__tiles.splice(index,0,tile); + this.__setRenderDirty(); + } + } + ,sortTiles: function(compareFunction) { + this.__tiles.sort(compareFunction); + this.__setRenderDirty(); + } + ,swapTiles: function(tile1,tile2) { + if(tile1.parent == this && tile2.parent == this) { + var index1 = this.__tiles.indexOf(tile1); + var index2 = this.__tiles.indexOf(tile2); + this.__tiles[index1] = tile2; + this.__tiles[index2] = tile1; + this.__setRenderDirty(); + } + } + ,swapTilesAt: function(index1,index2) { + var swap = this.__tiles[index1]; + this.__tiles[index1] = this.__tiles[index2]; + this.__tiles[index2] = swap; + swap = null; + this.__setRenderDirty(); + } + ,get_numTiles: function() { + return this.__length; + } + ,get_height: function() { + var result = openfl_geom_Rectangle.__pool.get(); + var rect = null; + var _g = 0; + var _g1 = this.__tiles; + while(_g < _g1.length) { + var tile = _g1[_g]; + ++_g; + rect = tile.getBounds(this); + result.__expand(rect.x,rect.y,rect.width,rect.height); + } + this.__getBounds(result,this.get_matrix()); + var h = result.height; + openfl_geom_Rectangle.__pool.release(result); + return h; + } + ,set_height: function(value) { + var result = openfl_geom_Rectangle.__pool.get(); + var rect = null; + var _g = 0; + var _g1 = this.__tiles; + while(_g < _g1.length) { + var tile = _g1[_g]; + ++_g; + rect = tile.getBounds(this); + result.__expand(rect.x,rect.y,rect.width,rect.height); + } + if(result.height != 0) { + this.set_scaleY(value / result.height); + } + openfl_geom_Rectangle.__pool.release(result); + return value; + } + ,get_width: function() { + var result = openfl_geom_Rectangle.__pool.get(); + var rect = null; + var _g = 0; + var _g1 = this.__tiles; + while(_g < _g1.length) { + var tile = _g1[_g]; + ++_g; + rect = tile.getBounds(this); + result.__expand(rect.x,rect.y,rect.width,rect.height); + } + this.__getBounds(result,this.get_matrix()); + var w = result.width; + openfl_geom_Rectangle.__pool.release(result); + return w; + } + ,set_width: function(value) { + var result = openfl_geom_Rectangle.__pool.get(); + var rect = null; + var _g = 0; + var _g1 = this.__tiles; + while(_g < _g1.length) { + var tile = _g1[_g]; + ++_g; + rect = tile.getBounds(this); + result.__expand(rect.x,rect.y,rect.width,rect.height); + } + if(result.width != 0) { + this.set_scaleX(value / result.width); + } + openfl_geom_Rectangle.__pool.release(result); + return value; + } + ,__class__: openfl_display_TileContainer + ,__properties__: $extend(openfl_display_Tile.prototype.__properties__,{get_numTiles:"get_numTiles"}) +}); +var openfl_display_Tilemap = function(width,height,tileset,smoothing) { + if(smoothing == null) { + smoothing = true; + } + openfl_display_DisplayObject.call(this); + this.__drawableType = 9; + this.__tileset = tileset; + this.smoothing = smoothing; + this.tileAlphaEnabled = true; + this.tileBlendModeEnabled = true; + this.tileColorTransformEnabled = true; + this.__group = new openfl_display_TileContainer(); + this.__group.set_tileset(tileset); + this.__width = width; + this.__height = height; +}; +$hxClasses["openfl.display.Tilemap"] = openfl_display_Tilemap; +openfl_display_Tilemap.__name__ = "openfl.display.Tilemap"; +openfl_display_Tilemap.__interfaces__ = [openfl_display_ITileContainer]; +openfl_display_Tilemap.__super__ = openfl_display_DisplayObject; +openfl_display_Tilemap.prototype = $extend(openfl_display_DisplayObject.prototype,{ + addTile: function(tile) { + return this.__group.addTile(tile); + } + ,addTileAt: function(tile,index) { + return this.__group.addTileAt(tile,index); + } + ,addTiles: function(tiles) { + return this.__group.addTiles(tiles); + } + ,contains: function(tile) { + return this.__group.contains(tile); + } + ,getTileAt: function(index) { + return this.__group.getTileAt(index); + } + ,getTileIndex: function(tile) { + return this.__group.getTileIndex(tile); + } + ,getTiles: function() { + return this.__group.clone(); + } + ,removeTile: function(tile) { + return this.__group.removeTile(tile); + } + ,removeTileAt: function(index) { + return this.__group.removeTileAt(index); + } + ,removeTiles: function(beginIndex,endIndex) { + if(endIndex == null) { + endIndex = 2147483647; + } + if(beginIndex == null) { + beginIndex = 0; + } + this.__group.removeTiles(beginIndex,endIndex); + } + ,setTileIndex: function(tile,index) { + this.__group.setTileIndex(tile,index); + } + ,setTiles: function(group) { + var _g = 0; + var _g1 = this.__group.__tiles; + while(_g < _g1.length) { + var tile = _g1[_g]; + ++_g; + this.removeTile(tile); + } + var _g = 0; + var _g1 = group.__tiles; + while(_g < _g1.length) { + var tile = _g1[_g]; + ++_g; + this.addTile(tile); + } + } + ,sortTiles: function(compareFunction) { + this.__group.sortTiles(compareFunction); + } + ,swapTiles: function(tile1,tile2) { + this.__group.swapTiles(tile1,tile2); + } + ,swapTilesAt: function(index1,index2) { + this.__group.swapTilesAt(index1,index2); + } + ,__enterFrame: function(deltaTime) { + if(this.__group.__dirty) { + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + } + ,__getBounds: function(rect,matrix) { + var bounds = openfl_geom_Rectangle.__pool.get(); + bounds.setTo(0,0,this.__width,this.__height); + bounds.__transform(bounds,matrix); + rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height); + openfl_geom_Rectangle.__pool.release(bounds); + } + ,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { + if(!hitObject.get_visible() || this.__isMask) { + return false; + } + if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) { + return false; + } + this.__getRenderTransform(); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx)); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x)); + if(px > 0 && py > 0 && px <= this.__width && py <= this.__height) { + if(stack != null && !interactiveOnly) { + stack.push(hitObject); + } + return true; + } + return false; + } + ,__renderFlash: function() { + } + ,get_height: function() { + return this.__height * Math.abs(this.get_scaleY()); + } + ,set_height: function(value) { + this.__height = value | 0; + return this.__height * Math.abs(this.get_scaleY()); + } + ,get_numTiles: function() { + return this.__group.__length; + } + ,get_tileset: function() { + return this.__tileset; + } + ,set_tileset: function(value) { + if(value != this.__tileset) { + this.__tileset = value; + this.__group.set_tileset(value); + this.__group.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return value; + } + ,get_width: function() { + return this.__width * Math.abs(this.__scaleX); + } + ,set_width: function(value) { + this.__width = value | 0; + return this.__width * Math.abs(this.__scaleX); + } + ,__class__: openfl_display_Tilemap + ,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{set_tileset:"set_tileset",get_tileset:"get_tileset",get_numTiles:"get_numTiles"}) +}); +var openfl_display_Tileset = function(bitmapData,rects) { + this.__bitmapData = bitmapData; + this.rectData = openfl_Vector.toFloatVector(null); + this.__data = []; + if(rects != null) { + var _g = 0; + while(_g < rects.length) { + var rect = rects[_g]; + ++_g; + this.addRect(rect); + } + } +}; +$hxClasses["openfl.display.Tileset"] = openfl_display_Tileset; +openfl_display_Tileset.__name__ = "openfl.display.Tileset"; +openfl_display_Tileset.prototype = { + addRect: function(rect) { + if(rect == null) { + return -1; + } + this.rectData.push(rect.x); + this.rectData.push(rect.y); + this.rectData.push(rect.width); + this.rectData.push(rect.height); + var tileData = new openfl_display_TileData(rect); + tileData.__update(this.__bitmapData); + this.__data.push(tileData); + return this.__data.length - 1; + } + ,clone: function() { + var tileset = new openfl_display_Tileset(this.__bitmapData,null); + var rect = openfl_geom_Rectangle.__pool.get(); + var _g = 0; + var _g1 = this.__data; + while(_g < _g1.length) { + var tileData = _g1[_g]; + ++_g; + rect.setTo(tileData.x,tileData.y,tileData.width,tileData.height); + tileset.addRect(rect); + } + openfl_geom_Rectangle.__pool.release(rect); + return tileset; + } + ,hasRect: function(rect) { + var _g = 0; + var _g1 = this.__data; + while(_g < _g1.length) { + var tileData = _g1[_g]; + ++_g; + if(rect.x == tileData.x && rect.y == tileData.y && rect.width == tileData.width && rect.height == tileData.height) { + return true; + } + } + return false; + } + ,getRect: function(id) { + if(id < this.__data.length && id >= 0) { + return new openfl_geom_Rectangle(this.__data[id].x,this.__data[id].y,this.__data[id].width,this.__data[id].height); + } + return null; + } + ,getRectID: function(rect) { + var tileData; + var _g = 0; + var _g1 = this.__data.length; + while(_g < _g1) { + var i = _g++; + tileData = this.__data[i]; + if(rect.x == tileData.x && rect.y == tileData.y && rect.width == tileData.width && rect.height == tileData.height) { + return i; + } + } + return null; + } + ,get_bitmapData: function() { + return this.__bitmapData; + } + ,set_bitmapData: function(value) { + this.__bitmapData = value; + var _g = 0; + var _g1 = this.__data; + while(_g < _g1.length) { + var data = _g1[_g]; + ++_g; + data.__update(this.__bitmapData); + } + return value; + } + ,get_numRects: function() { + return this.__data.length; + } + ,__class__: openfl_display_Tileset + ,__properties__: {get_numRects:"get_numRects",set_bitmapData:"set_bitmapData",get_bitmapData:"get_bitmapData"} +}; +var openfl_display_TileData = function(rect) { + if(rect != null) { + this.x = rect.x | 0; + this.y = rect.y | 0; + this.width = rect.width | 0; + this.height = rect.height | 0; + } +}; +$hxClasses["openfl.display.TileData"] = openfl_display_TileData; +openfl_display_TileData.__name__ = "openfl.display.TileData"; +openfl_display_TileData.prototype = { + __update: function(bitmapData) { + if(bitmapData != null) { + var bitmapWidth = bitmapData.width; + var bitmapHeight = bitmapData.height; + this.__uvX = this.x / bitmapWidth; + this.__uvY = this.y / bitmapHeight; + this.__uvWidth = (this.x + this.width) / bitmapWidth; + this.__uvHeight = (this.y + this.height) / bitmapHeight; + } + } + ,__class__: openfl_display_TileData +}; +var openfl_display_Timeline = function() { + this.__framesLoaded = 1; + this.__totalFrames = 1; + this.__currentLabels = []; + this.__currentFrame = 1; + this.__lastFrameScriptEval = -1; + this.__lastFrameUpdate = -1; +}; +$hxClasses["openfl.display.Timeline"] = openfl_display_Timeline; +openfl_display_Timeline.__name__ = "openfl.display.Timeline"; +openfl_display_Timeline.prototype = { + attachMovieClip: function(movieClip) { + } + ,enterFrame: function(frame) { + } + ,initializeSprite: function(sprite) { + } + ,__addFrameScript: function(index,method) { + if(index < 0) { + return; + } + var frame = index + 1; + if(method != null) { + if(this.__frameScripts == null) { + this.__frameScripts = new haxe_ds_IntMap(); + } + this.__frameScripts.h[frame] = function(scope) { + method(); + }; + } else if(this.__frameScripts != null) { + this.__frameScripts.remove(frame); + } + } + ,__attachMovieClip: function(movieClip) { + this.__scope = movieClip; + this.__totalFrames = 0; + this.__framesLoaded = 0; + if(this.scenes != null && this.scenes.length > 0) { + var _g = 0; + var _g1 = this.scenes; + while(_g < _g1.length) { + var scene = _g1[_g]; + ++_g; + this.__totalFrames += scene.numFrames; + this.__framesLoaded += scene.numFrames; + if(scene.labels != null) { + this.__currentLabels = this.__currentLabels.concat(scene.labels); + } + } + this.__currentScene = this.scenes[0]; + } + if(this.scripts != null && this.scripts.length > 0) { + this.__frameScripts = new haxe_ds_IntMap(); + var _g = 0; + var _g1 = this.scripts; + while(_g < _g1.length) { + var script = _g1[_g]; + ++_g; + if(this.__frameScripts.h.hasOwnProperty(script.frame)) { + var existing = [this.__frameScripts.h[script.frame]]; + var append = [script.script]; + this.__frameScripts.h[script.frame] = (function(append,existing) { + return function(clip) { + existing[0](clip); + append[0](clip); + }; + })(append,existing); + } else { + this.__frameScripts.h[script.frame] = script.script; + } + } + } + this.attachMovieClip(movieClip); + } + ,__enterFrame: function(deltaTime) { + if(this.__isPlaying) { + var nextFrame = this.__getNextFrame(deltaTime); + if(this.__lastFrameScriptEval == nextFrame) { + return; + } + if(this.__frameScripts != null) { + if(nextFrame < this.__currentFrame) { + if(!this.__evaluateFrameScripts(this.__totalFrames)) { + return; + } + this.__currentFrame = 1; + } + if(!this.__evaluateFrameScripts(nextFrame)) { + return; + } + } else { + this.__currentFrame = nextFrame; + } + } + this.__updateSymbol(this.__currentFrame); + } + ,__evaluateFrameScripts: function(advanceToFrame) { + if(this.__frameScripts == null) { + return true; + } + var _g = this.__currentFrame; + var _g1 = advanceToFrame + 1; + while(_g < _g1) { + var frame = _g++; + if(frame == this.__lastFrameScriptEval) { + continue; + } + this.__lastFrameScriptEval = frame; + this.__currentFrame = frame; + if(this.__frameScripts.h.hasOwnProperty(frame)) { + this.__updateSymbol(frame); + var script = this.__frameScripts.h[frame]; + script(this.__scope); + if(this.__currentFrame != frame) { + return false; + } + } + if(!this.__isPlaying) { + return false; + } + } + return true; + } + ,__getNextFrame: function(deltaTime) { + var nextFrame = 0; + if(this.frameRate != null) { + this.__timeElapsed += deltaTime; + nextFrame = this.__currentFrame + Math.floor(this.__timeElapsed / this.__frameTime); + if(nextFrame < 1) { + nextFrame = 1; + } + if(nextFrame > this.__totalFrames) { + nextFrame = Math.floor((nextFrame - 1) % this.__totalFrames) + 1; + } + this.__timeElapsed %= this.__frameTime; + } else { + nextFrame = this.__currentFrame + 1; + if(nextFrame > this.__totalFrames) { + nextFrame = 1; + } + } + return nextFrame; + } + ,__goto: function(frame) { + if(frame < 1) { + frame = 1; + } else if(frame > this.__totalFrames) { + frame = this.__totalFrames; + } + this.__lastFrameScriptEval = -1; + this.__currentFrame = frame; + this.__updateSymbol(this.__currentFrame); + this.__evaluateFrameScripts(this.__currentFrame); + } + ,__gotoAndPlay: function(frame,scene) { + this.__play(); + this.__goto(this.__resolveFrameReference(frame)); + } + ,__gotoAndStop: function(frame,scene) { + this.__stop(); + this.__goto(this.__resolveFrameReference(frame)); + } + ,__nextFrame: function() { + this.__stop(); + this.__goto(this.__currentFrame + 1); + } + ,__nextScene: function() { + } + ,__play: function() { + if(this.__isPlaying || this.__totalFrames < 2) { + return; + } + this.__isPlaying = true; + if(this.frameRate != null) { + this.__frameTime = 1000 / this.frameRate | 0; + this.__timeElapsed = 0; + } + } + ,__prevFrame: function() { + this.__stop(); + this.__goto(this.__currentFrame - 1); + } + ,__prevScene: function() { + } + ,__stop: function() { + this.__isPlaying = false; + } + ,__resolveFrameReference: function(frame) { + if(typeof(frame) == "number" && ((frame | 0) === frame)) { + return frame; + } else if(typeof(frame) == "string") { + var label = frame; + var _g = 0; + var _g1 = this.__currentLabels; + while(_g < _g1.length) { + var frameLabel = _g1[_g]; + ++_g; + if(frameLabel.name == label) { + return frameLabel.frame; + } + } + throw new openfl_errors_ArgumentError("Error #2109: Frame label " + label + " not found in scene."); + } else { + throw haxe_Exception.thrown("Invalid type for frame " + frame.__name__); + } + } + ,__updateFrameLabel: function() { + this.__currentLabel = null; + this.__currentFrameLabel = null; + var _g = 0; + var _g1 = this.__currentLabels; + while(_g < _g1.length) { + var label = _g1[_g]; + ++_g; + if(label.frame < this.__currentFrame) { + this.__currentLabel = label.name; + } else if(label.frame == this.__currentFrame) { + this.__currentLabel = label.name; + this.__currentFrameLabel = label.name; + } else { + break; + } + } + } + ,__updateSymbol: function(targetFrame) { + if(this.__currentFrame != this.__lastFrameUpdate) { + this.__updateFrameLabel(); + this.enterFrame(targetFrame); + this.__lastFrameUpdate = this.__currentFrame; + } + } + ,__class__: openfl_display_Timeline +}; +var openfl_display_TriangleCulling = {}; +openfl_display_TriangleCulling.fromString = function(value) { + switch(value) { + case "negative": + return 0; + case "none": + return 1; + case "positive": + return 2; + default: + return null; + } +}; +openfl_display_TriangleCulling.toString = function(this1) { + switch(this1) { + case 0: + return "negative"; + case 1: + return "none"; + case 2: + return "positive"; + default: + return null; + } +}; +var openfl_display_Window = function(application,attributes) { + lime_ui_Window.call(this,application,attributes); + this.stage = new openfl_display_Stage(this,Object.prototype.hasOwnProperty.call(attributes.context,"background") ? attributes.context.background : 16777215); + if(Object.prototype.hasOwnProperty.call(attributes,"parameters")) { + try { + this.stage.get_loaderInfo().parameters = attributes.parameters; + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + } + } + this.stage.__setLogicalSize(attributes.width,attributes.height); + if(Object.prototype.hasOwnProperty.call(attributes,"resizable") && !attributes.resizable) { + this.stage.set_scaleMode(3); + } + application.addModule(this.stage); +}; +$hxClasses["openfl.display.Window"] = openfl_display_Window; +openfl_display_Window.__name__ = "openfl.display.Window"; +openfl_display_Window.__super__ = lime_ui_Window; +openfl_display_Window.prototype = $extend(lime_ui_Window.prototype,{ + close: function() { + lime_ui_Window.prototype.close.call(this); + if(this.onClose.canceled) { + return; + } + if(this.stage == null) { + return; + } + this.application.removeModule(this.stage); + this.stage = null; + } + ,__class__: openfl_display_Window +}); +var openfl_display__$internal_AbstractNoise = function(seed,octaves,channels,grayScale,falloff,stitch,stitch_threshold) { + if(stitch_threshold == null) { + stitch_threshold = 0.05; + } + if(stitch == null) { + stitch = false; + } + this.stitch = stitch; + this.stitch_threshold = stitch_threshold; + this.octaves = octaves; + this.channels = channels; + this.grayscale = grayScale; + this.calculateOctaves(falloff); +}; +$hxClasses["openfl.display._internal.AbstractNoise"] = openfl_display__$internal_AbstractNoise; +openfl_display__$internal_AbstractNoise.__name__ = "openfl.display._internal.AbstractNoise"; +openfl_display__$internal_AbstractNoise.prototype = { + fill: function(bitmap,_scale_x,_scale_y,_scale_z) { + } + ,stitching: function(bitmap,color,px,py,stitch_w,stitch_h,width,height) { + var r = color >> 16 & 255; + var g = color >> 8 & 255; + var b = color & 255; + if(width - stitch_w < px) { + var dest = bitmap.getPixel32(width - px,py); + var dest_r = dest >> 16 & 255; + var dest_g = dest >> 8 & 255; + var dest_b = dest & 255; + var u = (width - px) / stitch_w; + var uu = u * u; + r = this.mixI(dest_r,r,u); + g = this.mixI(dest_g,g,u); + b = this.mixI(dest_b,b,u); + } + if(height - stitch_h < py) { + var dest = bitmap.getPixel32(px,height - py); + var dest_r = dest >> 16 & 255; + var dest_g = dest >> 8 & 255; + var dest_b = dest & 255; + var u = (height - py) / stitch_h; + var uu = u * u; + r = this.mixI(dest_r,r,u); + g = this.mixI(dest_g,g,u); + b = this.mixI(dest_b,b,u); + } + return -16777216 | r << 16 | g << 8 | b; + } + ,color: function(r_noise,g_noise,b_noise) { + var color_r = 0; + var color_g = 0; + var color_b = 0; + if(null != r_noise) { + color_r = this.noiseToColor(r_noise); + } + if(null != g_noise) { + color_g = this.noiseToColor(g_noise); + } + if(null != b_noise) { + color_b = this.noiseToColor(b_noise); + } + return -16777216 | color_r << 16 | color_g << 8 | color_b; + } + ,noiseToColor: function(noise) { + return (noise * this.persistence_max + 1.0) * 128 | 0; + } + ,fade: function(t) { + return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); + } + ,mixI: function(x,y,t) { + return (1.0 - t) * x + t * y | 0; + } + ,mix: function(x,y,t) { + return (1.0 - t) * x + t * y; + } + ,fastfloor: function(x) { + if(x > 0) { + return x | 0; + } else { + return x - 1 | 0; + } + } + ,dot2d: function(grad,x,y) { + return grad[0] * x + grad[1] * y; + } + ,dot: function(grad,x,y,z) { + return grad[0] * x + grad[1] * y + grad[2] * z; + } + ,calculateOctaves: function(fPersistence) { + var fFreq; + var fPers; + this.octaves_frequencies = []; + this.octaves_persistences = []; + this.persistence_max = 0; + var _g = 0; + var _g1 = this.octaves; + while(_g < _g1) { + var i = _g++; + fFreq = Math.pow(2.0,i); + fPers = Math.pow(fPersistence,i); + this.persistence_max += fPers; + this.octaves_frequencies.push(fFreq); + this.octaves_persistences.push(fPers); + } + this.persistence_max = 1.0 / this.persistence_max; + } + ,__class__: openfl_display__$internal_AbstractNoise +}; +var openfl_display__$internal_CairoBitmap = function() { }; +$hxClasses["openfl.display._internal.CairoBitmap"] = openfl_display__$internal_CairoBitmap; +openfl_display__$internal_CairoBitmap.__name__ = "openfl.display._internal.CairoBitmap"; +openfl_display__$internal_CairoBitmap.render = function(bitmap,renderer) { + if(!bitmap.__renderable) { + return; + } + var alpha = renderer.__getAlpha(bitmap.__worldAlpha); + if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid) { + var cairo = renderer.cairo; + renderer.__setBlendMode(bitmap.__worldBlendMode); + renderer.__pushMaskObject(bitmap); + renderer.applyMatrix(bitmap.__renderTransform,cairo); + var surface = bitmap.__bitmapData.getSurface(); + if(surface != null) { + var pattern = lime_graphics_cairo_CairoPattern.createForSurface(surface); + lime_graphics_cairo_CairoPattern.set_filter(pattern,renderer.__allowSmoothing && bitmap.smoothing ? 1 : 3); + cairo.set_source(pattern); + if(alpha == 1) { + cairo.paint(); + } else { + cairo.paintWithAlpha(alpha); + } + } + renderer.__popMaskObject(bitmap); + renderer.__setBlendMode(10); + } +}; +openfl_display__$internal_CairoBitmap.renderDrawable = function(bitmap,renderer) { +}; +openfl_display__$internal_CairoBitmap.renderDrawableMask = function(bitmap,renderer) { + renderer.cairo.rectangle(0,0,bitmap.get_width(),bitmap.get_height()); +}; +var openfl_display__$internal_CairoBitmapData = function() { }; +$hxClasses["openfl.display._internal.CairoBitmapData"] = openfl_display__$internal_CairoBitmapData; +openfl_display__$internal_CairoBitmapData.__name__ = "openfl.display._internal.CairoBitmapData"; +openfl_display__$internal_CairoBitmapData.renderDrawable = function(bitmapData,renderer) { +}; +openfl_display__$internal_CairoBitmapData.renderDrawableMask = function(tilemap,renderer) { +}; +var openfl_display__$internal_CairoDisplayObject = function() { }; +$hxClasses["openfl.display._internal.CairoDisplayObject"] = openfl_display__$internal_CairoDisplayObject; +openfl_display__$internal_CairoDisplayObject.__name__ = "openfl.display._internal.CairoDisplayObject"; +openfl_display__$internal_CairoDisplayObject.render = function(displayObject,renderer) { +}; +openfl_display__$internal_CairoDisplayObject.renderDrawable = function(displayObject,renderer) { +}; +openfl_display__$internal_CairoDisplayObject.renderDrawableMask = function(displayObject,renderer) { +}; +var openfl_display__$internal_CairoDisplayObjectContainer = function() { }; +$hxClasses["openfl.display._internal.CairoDisplayObjectContainer"] = openfl_display__$internal_CairoDisplayObjectContainer; +openfl_display__$internal_CairoDisplayObjectContainer.__name__ = "openfl.display._internal.CairoDisplayObjectContainer"; +openfl_display__$internal_CairoDisplayObjectContainer.renderDrawable = function(displayObjectContainer,renderer) { +}; +openfl_display__$internal_CairoDisplayObjectContainer.renderDrawableMask = function(displayObjectContainer,renderer) { +}; +var openfl_display__$internal_CairoGraphics = function() { }; +$hxClasses["openfl.display._internal.CairoGraphics"] = openfl_display__$internal_CairoGraphics; +openfl_display__$internal_CairoGraphics.__name__ = "openfl.display._internal.CairoGraphics"; +openfl_display__$internal_CairoGraphics.hitTest = function(graphics,x,y) { + return false; +}; +openfl_display__$internal_CairoGraphics.render = function(graphics,renderer) { +}; +openfl_display__$internal_CairoGraphics.renderMask = function(graphics,renderer) { +}; +var openfl_display__$internal_CairoShape = function() { }; +$hxClasses["openfl.display._internal.CairoShape"] = openfl_display__$internal_CairoShape; +openfl_display__$internal_CairoShape.__name__ = "openfl.display._internal.CairoShape"; +openfl_display__$internal_CairoShape.render = function(shape,renderer) { +}; +openfl_display__$internal_CairoShape.renderDrawable = function(shape,renderer) { +}; +openfl_display__$internal_CairoShape.renderDrawableMask = function(shape,renderer) { +}; +var openfl_display__$internal_CairoSimpleButton = function() { }; +$hxClasses["openfl.display._internal.CairoSimpleButton"] = openfl_display__$internal_CairoSimpleButton; +openfl_display__$internal_CairoSimpleButton.__name__ = "openfl.display._internal.CairoSimpleButton"; +openfl_display__$internal_CairoSimpleButton.renderDrawable = function(simpleButton,renderer) { + if(!simpleButton.__renderable || simpleButton.__worldAlpha <= 0 || simpleButton.__currentState == null) { + return; + } + renderer.__pushMaskObject(simpleButton); + renderer.__renderDrawable(simpleButton.__currentState); + renderer.__popMaskObject(simpleButton); + renderer.__renderEvent(simpleButton); +}; +openfl_display__$internal_CairoSimpleButton.renderDrawableMask = function(simpleButton,renderer) { + renderer.__renderDrawableMask(simpleButton.__currentState); +}; +var openfl_display__$internal_CairoTextField = function() { }; +$hxClasses["openfl.display._internal.CairoTextField"] = openfl_display__$internal_CairoTextField; +openfl_display__$internal_CairoTextField.__name__ = "openfl.display._internal.CairoTextField"; +openfl_display__$internal_CairoTextField.render = function(textField,renderer,transform) { +}; +openfl_display__$internal_CairoTextField.renderDrawable = function(textField,renderer) { +}; +openfl_display__$internal_CairoTextField.renderDrawableMask = function(textField,renderer) { +}; +var openfl_display__$internal_CairoTilemap = function() { }; +$hxClasses["openfl.display._internal.CairoTilemap"] = openfl_display__$internal_CairoTilemap; +openfl_display__$internal_CairoTilemap.__name__ = "openfl.display._internal.CairoTilemap"; +openfl_display__$internal_CairoTilemap.render = function(tilemap,renderer) { + if(!tilemap.__renderable || tilemap.__group.__tiles.length == 0) { + return; + } + var alpha = renderer.__getAlpha(tilemap.__worldAlpha); + if(alpha <= 0) { + return; + } + renderer.__setBlendMode(tilemap.__worldBlendMode); + renderer.__pushMaskObject(tilemap); + var rect = openfl_geom_Rectangle.__pool.get(); + rect.setTo(0,0,tilemap.__width,tilemap.__height); + renderer.__pushMaskRect(rect,tilemap.__renderTransform); + openfl_display__$internal_CairoTilemap.renderTileContainer(tilemap.__group,renderer,tilemap.__renderTransform,tilemap.__tileset,renderer.__allowSmoothing && tilemap.smoothing,tilemap.tileAlphaEnabled,alpha,tilemap.tileBlendModeEnabled,tilemap.__worldBlendMode,null,null,null,rect,lime_math_Matrix3._new()); + renderer.__popMaskRect(); + renderer.__popMaskObject(tilemap); + openfl_geom_Rectangle.__pool.release(rect); +}; +openfl_display__$internal_CairoTilemap.renderTileContainer = function(group,renderer,parentTransform,defaultTileset,smooth,alphaEnabled,worldAlpha,blendModeEnabled,defaultBlendMode,cacheBitmapData,surface,pattern,rect,matrix) { + var cairo = renderer.cairo; + var tileTransform = openfl_geom_Matrix.__pool.get(); + var tiles = group.__tiles; + var tileset; + var alpha; + var visible; + var blendMode = null; + var id; + var tileData; + var tileRect; + var bitmapData; + var _g = 0; + while(_g < tiles.length) { + var tile = tiles[_g]; + ++_g; + tileTransform.setTo(1,0,0,1,-tile.get_originX(),-tile.get_originY()); + tileTransform.concat(tile.get_matrix()); + tileTransform.concat(parentTransform); + tileset = tile.get_tileset() != null ? tile.get_tileset() : defaultTileset; + alpha = tile.get_alpha() * worldAlpha; + visible = tile.get_visible(); + if(!visible || alpha <= 0) { + continue; + } + if(!alphaEnabled) { + alpha = 1; + } + if(blendModeEnabled) { + blendMode = tile.__blendMode != null ? tile.__blendMode : defaultBlendMode; + } + if(tile.__length > 0) { + openfl_display__$internal_CairoTilemap.renderTileContainer(tile,renderer,tileTransform,tileset,smooth,alphaEnabled,alpha,blendModeEnabled,blendMode,cacheBitmapData,surface,pattern,rect,matrix); + } else { + if(tileset == null) { + continue; + } + id = tile.get_id(); + if(id == -1) { + tileRect = tile.__rect; + if(tileRect == null || tileRect.width <= 0 || tileRect.height <= 0) { + continue; + } + } else { + tileData = tileset.__data[id]; + if(tileData == null) { + continue; + } + rect.setTo(tileData.x,tileData.y,tileData.width,tileData.height); + tileRect = rect; + } + bitmapData = tileset.__bitmapData; + if(bitmapData == null || bitmapData.image == null) { + continue; + } + if(bitmapData != cacheBitmapData) { + surface = bitmapData.getSurface(); + pattern = lime_graphics_cairo_CairoPattern.createForSurface(surface); + lime_graphics_cairo_CairoPattern.set_filter(pattern,smooth ? 1 : 3); + cairo.set_source(pattern); + cacheBitmapData = bitmapData; + } + if(blendModeEnabled) { + renderer.__setBlendMode(blendMode); + } + renderer.applyMatrix(tileTransform,cairo); + matrix[6] = tileRect.x; + matrix[7] = tileRect.y; + lime_graphics_cairo_CairoPattern.set_matrix(pattern,matrix); + cairo.set_source(pattern); + cairo.save(); + cairo.newPath(); + cairo.rectangle(0,0,tileRect.width,tileRect.height); + cairo.clip(); + if(alpha == 1) { + cairo.paint(); + } else { + cairo.paintWithAlpha(alpha); + } + cairo.restore(); + } + } + openfl_geom_Matrix.__pool.release(tileTransform); +}; +openfl_display__$internal_CairoTilemap.renderDrawable = function(tilemap,renderer) { +}; +openfl_display__$internal_CairoTilemap.renderDrawableMask = function(tilemap,renderer) { +}; +var openfl_display__$internal_CanvasBitmap = function() { }; +$hxClasses["openfl.display._internal.CanvasBitmap"] = openfl_display__$internal_CanvasBitmap; +openfl_display__$internal_CanvasBitmap.__name__ = "openfl.display._internal.CanvasBitmap"; +openfl_display__$internal_CanvasBitmap.render = function(bitmap,renderer) { + if(!bitmap.__renderable) { + return; + } + var alpha = renderer.__getAlpha(bitmap.__worldAlpha); + if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) { + var context = renderer.context; + renderer.__setBlendMode(bitmap.__worldBlendMode); + renderer.__pushMaskObject(bitmap,false); + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image); + context.globalAlpha = alpha; + var scrollRect = bitmap.__scrollRect; + renderer.setTransform(bitmap.__renderTransform,context); + if(!renderer.__allowSmoothing || !bitmap.smoothing) { + context.imageSmoothingEnabled = false; + } + if(scrollRect == null) { + context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height); + } else { + context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height); + } + if(!renderer.__allowSmoothing || !bitmap.smoothing) { + context.imageSmoothingEnabled = true; + } + renderer.__popMaskObject(bitmap,false); + } +}; +openfl_display__$internal_CanvasBitmap.renderDrawable = function(bitmap,renderer) { + renderer.__updateCacheBitmap(bitmap,false); + if(bitmap.__bitmapData != null && bitmap.__bitmapData.image != null) { + bitmap.__imageVersion = bitmap.__bitmapData.image.version; + } + if(bitmap.__cacheBitmap != null && !bitmap.__isCacheBitmapRender) { + var bitmap1 = bitmap.__cacheBitmap; + if(bitmap1.__renderable) { + var alpha = renderer.__getAlpha(bitmap1.__worldAlpha); + if(alpha > 0 && bitmap1.__bitmapData != null && bitmap1.__bitmapData.__isValid && bitmap1.__bitmapData.readable) { + var context = renderer.context; + renderer.__setBlendMode(bitmap1.__worldBlendMode); + renderer.__pushMaskObject(bitmap1,false); + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap1.__bitmapData.image); + context.globalAlpha = alpha; + var scrollRect = bitmap1.__scrollRect; + renderer.setTransform(bitmap1.__renderTransform,context); + if(!renderer.__allowSmoothing || !bitmap1.smoothing) { + context.imageSmoothingEnabled = false; + } + if(scrollRect == null) { + context.drawImage(bitmap1.__bitmapData.image.get_src(),0,0,bitmap1.__bitmapData.image.width,bitmap1.__bitmapData.image.height); + } else { + context.drawImage(bitmap1.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height); + } + if(!renderer.__allowSmoothing || !bitmap1.smoothing) { + context.imageSmoothingEnabled = true; + } + renderer.__popMaskObject(bitmap1,false); + } + } + } else { + if(!(bitmap.opaqueBackground == null && bitmap.__graphics == null)) { + if(bitmap.__renderable) { + var alpha = renderer.__getAlpha(bitmap.__worldAlpha); + if(!(alpha <= 0)) { + if(bitmap.opaqueBackground != null && !bitmap.__isCacheBitmapRender && bitmap.get_width() > 0 && bitmap.get_height() > 0) { + renderer.__setBlendMode(bitmap.__worldBlendMode); + renderer.__pushMaskObject(bitmap); + var context = renderer.context; + renderer.setTransform(bitmap.__renderTransform,context); + var color = bitmap.opaqueBackground; + context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")"; + context.fillRect(0,0,bitmap.get_width(),bitmap.get_height()); + renderer.__popMaskObject(bitmap); + } + if(bitmap.__graphics != null) { + if(bitmap.__renderable) { + var alpha = renderer.__getAlpha(bitmap.__worldAlpha); + if(!(alpha <= 0)) { + var graphics = bitmap.__graphics; + if(graphics != null) { + openfl_display__$internal_CanvasGraphics.render(graphics,renderer); + var width = graphics.__width; + var height = graphics.__height; + var canvas = graphics.__canvas; + if(canvas != null && graphics.__visible && width >= 1 && height >= 1) { + var transform = graphics.__worldTransform; + var context = renderer.context; + var scrollRect = bitmap.__scrollRect; + var scale9Grid = bitmap.__worldScale9Grid; + if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) { + renderer.__setBlendMode(bitmap.__worldBlendMode); + renderer.__pushMaskObject(bitmap); + context.globalAlpha = alpha; + if(scale9Grid != null && transform.b == 0 && transform.c == 0) { + var pixelRatio = renderer.__pixelRatio; + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.translate(transform.tx,transform.ty); + renderer.setTransform(matrix,context); + openfl_geom_Matrix.__pool.release(matrix); + var bounds = graphics.__bounds; + var scaleX = graphics.__renderTransform.a / graphics.__bitmapScale; + var scaleY = graphics.__renderTransform.d / graphics.__bitmapScale; + var renderScaleX = scaleX * transform.a; + var renderScaleY = scaleY * transform.d; + var left = Math.max(1,Math.round(scale9Grid.x * scaleX)); + var top = Math.round(scale9Grid.y * scaleY); + var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX)); + var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY); + var centerWidth = Math.round(scale9Grid.width * scaleX); + var centerHeight = Math.round(scale9Grid.height * scaleY); + var renderLeft = Math.round(left / pixelRatio); + var renderTop = Math.round(top / pixelRatio); + var renderRight = Math.round(right / pixelRatio); + var renderBottom = Math.round(bottom / pixelRatio); + var renderCenterWidth = bounds.width * renderScaleX - renderLeft - renderRight; + var renderCenterHeight = bounds.height * renderScaleY - renderTop - renderBottom; + renderer.applySmoothing(context,false); + if(centerWidth != 0 && centerHeight != 0) { + context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop); + context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop); + context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop); + context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight); + context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight); + context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom); + context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom); + context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom); + } else if(centerWidth == 0 && centerHeight != 0) { + var renderWidth = renderLeft + renderCenterWidth + renderRight; + context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop); + context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom); + } else if(centerHeight == 0 && centerWidth != 0) { + var renderHeight = renderTop + renderCenterHeight + renderBottom; + context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight); + context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight); + context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight); + } + } else { + renderer.setTransform(transform,context); + context.drawImage(canvas,0,0,width,height); + } + renderer.__popMaskObject(bitmap); + } + } + } + } + } + } + } + } + } + if(bitmap.__renderable) { + var alpha = renderer.__getAlpha(bitmap.__worldAlpha); + if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) { + var context = renderer.context; + renderer.__setBlendMode(bitmap.__worldBlendMode); + renderer.__pushMaskObject(bitmap,false); + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image); + context.globalAlpha = alpha; + var scrollRect = bitmap.__scrollRect; + renderer.setTransform(bitmap.__renderTransform,context); + if(!renderer.__allowSmoothing || !bitmap.smoothing) { + context.imageSmoothingEnabled = false; + } + if(scrollRect == null) { + context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height); + } else { + context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height); + } + if(!renderer.__allowSmoothing || !bitmap.smoothing) { + context.imageSmoothingEnabled = true; + } + renderer.__popMaskObject(bitmap,false); + } + } + } + renderer.__renderEvent(bitmap); +}; +openfl_display__$internal_CanvasBitmap.renderDrawableMask = function(bitmap,renderer) { + renderer.context.rect(0,0,bitmap.get_width(),bitmap.get_height()); +}; +var openfl_display__$internal_CanvasBitmapData = function() { }; +$hxClasses["openfl.display._internal.CanvasBitmapData"] = openfl_display__$internal_CanvasBitmapData; +openfl_display__$internal_CanvasBitmapData.__name__ = "openfl.display._internal.CanvasBitmapData"; +openfl_display__$internal_CanvasBitmapData.renderDrawable = function(bitmapData,renderer) { + if(!bitmapData.readable) { + return; + } + var image = bitmapData.image; + if(image.type == lime_graphics_ImageType.DATA) { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(image); + } + var context = renderer.context; + context.globalAlpha = 1; + renderer.setTransform(bitmapData.__renderTransform,context); + context.drawImage(image.get_src(),0,0,image.width,image.height); +}; +openfl_display__$internal_CanvasBitmapData.renderDrawableMask = function(bitmapData,renderer) { +}; +var openfl_display__$internal_CanvasDisplayObject = function() { }; +$hxClasses["openfl.display._internal.CanvasDisplayObject"] = openfl_display__$internal_CanvasDisplayObject; +openfl_display__$internal_CanvasDisplayObject.__name__ = "openfl.display._internal.CanvasDisplayObject"; +openfl_display__$internal_CanvasDisplayObject.render = function(displayObject,renderer) { + if(displayObject.opaqueBackground == null && displayObject.__graphics == null) { + return; + } + if(!displayObject.__renderable) { + return; + } + var alpha = renderer.__getAlpha(displayObject.__worldAlpha); + if(alpha <= 0) { + return; + } + if(displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0) { + renderer.__setBlendMode(displayObject.__worldBlendMode); + renderer.__pushMaskObject(displayObject); + var context = renderer.context; + renderer.setTransform(displayObject.__renderTransform,context); + var color = displayObject.opaqueBackground; + context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")"; + context.fillRect(0,0,displayObject.get_width(),displayObject.get_height()); + renderer.__popMaskObject(displayObject); + } + if(displayObject.__graphics != null) { + if(displayObject.__renderable) { + var alpha = renderer.__getAlpha(displayObject.__worldAlpha); + if(!(alpha <= 0)) { + var graphics = displayObject.__graphics; + if(graphics != null) { + openfl_display__$internal_CanvasGraphics.render(graphics,renderer); + var width = graphics.__width; + var height = graphics.__height; + var canvas = graphics.__canvas; + if(canvas != null && graphics.__visible && width >= 1 && height >= 1) { + var transform = graphics.__worldTransform; + var context = renderer.context; + var scrollRect = displayObject.__scrollRect; + var scale9Grid = displayObject.__worldScale9Grid; + if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) { + renderer.__setBlendMode(displayObject.__worldBlendMode); + renderer.__pushMaskObject(displayObject); + context.globalAlpha = alpha; + if(scale9Grid != null && transform.b == 0 && transform.c == 0) { + var pixelRatio = renderer.__pixelRatio; + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.translate(transform.tx,transform.ty); + renderer.setTransform(matrix,context); + openfl_geom_Matrix.__pool.release(matrix); + var bounds = graphics.__bounds; + var scaleX = graphics.__renderTransform.a / graphics.__bitmapScale; + var scaleY = graphics.__renderTransform.d / graphics.__bitmapScale; + var renderScaleX = scaleX * transform.a; + var renderScaleY = scaleY * transform.d; + var left = Math.max(1,Math.round(scale9Grid.x * scaleX)); + var top = Math.round(scale9Grid.y * scaleY); + var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX)); + var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY); + var centerWidth = Math.round(scale9Grid.width * scaleX); + var centerHeight = Math.round(scale9Grid.height * scaleY); + var renderLeft = Math.round(left / pixelRatio); + var renderTop = Math.round(top / pixelRatio); + var renderRight = Math.round(right / pixelRatio); + var renderBottom = Math.round(bottom / pixelRatio); + var renderCenterWidth = bounds.width * renderScaleX - renderLeft - renderRight; + var renderCenterHeight = bounds.height * renderScaleY - renderTop - renderBottom; + renderer.applySmoothing(context,false); + if(centerWidth != 0 && centerHeight != 0) { + context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop); + context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop); + context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop); + context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight); + context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight); + context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom); + context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom); + context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom); + } else if(centerWidth == 0 && centerHeight != 0) { + var renderWidth = renderLeft + renderCenterWidth + renderRight; + context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop); + context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom); + } else if(centerHeight == 0 && centerWidth != 0) { + var renderHeight = renderTop + renderCenterHeight + renderBottom; + context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight); + context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight); + context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight); + } + } else { + renderer.setTransform(transform,context); + context.drawImage(canvas,0,0,width,height); + } + renderer.__popMaskObject(displayObject); + } + } + } + } + } + } +}; +openfl_display__$internal_CanvasDisplayObject.renderDrawable = function(displayObject,renderer) { + if(displayObject.get_mask() == null || displayObject.get_mask().get_width() > 0 && displayObject.get_mask().get_height() > 0) { + renderer.__updateCacheBitmap(displayObject,false); + if(displayObject.__cacheBitmap != null && !displayObject.__isCacheBitmapRender) { + var bitmap = displayObject.__cacheBitmap; + if(bitmap.__renderable) { + var alpha = renderer.__getAlpha(bitmap.__worldAlpha); + if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) { + var context = renderer.context; + renderer.__setBlendMode(bitmap.__worldBlendMode); + renderer.__pushMaskObject(bitmap,false); + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image); + context.globalAlpha = alpha; + var scrollRect = bitmap.__scrollRect; + renderer.setTransform(bitmap.__renderTransform,context); + if(!renderer.__allowSmoothing || !bitmap.smoothing) { + context.imageSmoothingEnabled = false; + } + if(scrollRect == null) { + context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height); + } else { + context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height); + } + if(!renderer.__allowSmoothing || !bitmap.smoothing) { + context.imageSmoothingEnabled = true; + } + renderer.__popMaskObject(bitmap,false); + } + } + } else if(!(displayObject.opaqueBackground == null && displayObject.__graphics == null)) { + if(displayObject.__renderable) { + var alpha = renderer.__getAlpha(displayObject.__worldAlpha); + if(!(alpha <= 0)) { + if(displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0) { + renderer.__setBlendMode(displayObject.__worldBlendMode); + renderer.__pushMaskObject(displayObject); + var context = renderer.context; + renderer.setTransform(displayObject.__renderTransform,context); + var color = displayObject.opaqueBackground; + context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")"; + context.fillRect(0,0,displayObject.get_width(),displayObject.get_height()); + renderer.__popMaskObject(displayObject); + } + if(displayObject.__graphics != null) { + if(displayObject.__renderable) { + var alpha = renderer.__getAlpha(displayObject.__worldAlpha); + if(!(alpha <= 0)) { + var graphics = displayObject.__graphics; + if(graphics != null) { + openfl_display__$internal_CanvasGraphics.render(graphics,renderer); + var width = graphics.__width; + var height = graphics.__height; + var canvas = graphics.__canvas; + if(canvas != null && graphics.__visible && width >= 1 && height >= 1) { + var transform = graphics.__worldTransform; + var context = renderer.context; + var scrollRect = displayObject.__scrollRect; + var scale9Grid = displayObject.__worldScale9Grid; + if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) { + renderer.__setBlendMode(displayObject.__worldBlendMode); + renderer.__pushMaskObject(displayObject); + context.globalAlpha = alpha; + if(scale9Grid != null && transform.b == 0 && transform.c == 0) { + var pixelRatio = renderer.__pixelRatio; + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.translate(transform.tx,transform.ty); + renderer.setTransform(matrix,context); + openfl_geom_Matrix.__pool.release(matrix); + var bounds = graphics.__bounds; + var scaleX = graphics.__renderTransform.a / graphics.__bitmapScale; + var scaleY = graphics.__renderTransform.d / graphics.__bitmapScale; + var renderScaleX = scaleX * transform.a; + var renderScaleY = scaleY * transform.d; + var left = Math.max(1,Math.round(scale9Grid.x * scaleX)); + var top = Math.round(scale9Grid.y * scaleY); + var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX)); + var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY); + var centerWidth = Math.round(scale9Grid.width * scaleX); + var centerHeight = Math.round(scale9Grid.height * scaleY); + var renderLeft = Math.round(left / pixelRatio); + var renderTop = Math.round(top / pixelRatio); + var renderRight = Math.round(right / pixelRatio); + var renderBottom = Math.round(bottom / pixelRatio); + var renderCenterWidth = bounds.width * renderScaleX - renderLeft - renderRight; + var renderCenterHeight = bounds.height * renderScaleY - renderTop - renderBottom; + renderer.applySmoothing(context,false); + if(centerWidth != 0 && centerHeight != 0) { + context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop); + context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop); + context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop); + context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight); + context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight); + context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom); + context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom); + context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom); + } else if(centerWidth == 0 && centerHeight != 0) { + var renderWidth = renderLeft + renderCenterWidth + renderRight; + context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop); + context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom); + } else if(centerHeight == 0 && centerWidth != 0) { + var renderHeight = renderTop + renderCenterHeight + renderBottom; + context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight); + context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight); + context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight); + } + } else { + renderer.setTransform(transform,context); + context.drawImage(canvas,0,0,width,height); + } + renderer.__popMaskObject(displayObject); + } + } + } + } + } + } + } + } + } + } + renderer.__renderEvent(displayObject); +}; +openfl_display__$internal_CanvasDisplayObject.renderDrawableMask = function(displayObject,renderer) { + if(displayObject.__graphics != null) { + openfl_display__$internal_CanvasGraphics.renderMask(displayObject.__graphics,renderer); + } +}; +var openfl_display__$internal_CanvasDisplayObjectContainer = function() { }; +$hxClasses["openfl.display._internal.CanvasDisplayObjectContainer"] = openfl_display__$internal_CanvasDisplayObjectContainer; +openfl_display__$internal_CanvasDisplayObjectContainer.__name__ = "openfl.display._internal.CanvasDisplayObjectContainer"; +openfl_display__$internal_CanvasDisplayObjectContainer.renderDrawable = function(displayObjectContainer,renderer) { + var orphan = displayObjectContainer.__removedChildren.iterator(); + while(orphan.hasNext()) { + var orphan1 = orphan.next(); + if(orphan1.stage == null) { + orphan1.__cleanup(); + } + } + displayObjectContainer.__removedChildren.set_length(0); + if(!displayObjectContainer.__renderable || displayObjectContainer.__worldAlpha <= 0 || displayObjectContainer.get_mask() != null && (displayObjectContainer.get_mask().get_width() <= 0 || displayObjectContainer.get_mask().get_height() <= 0)) { + return; + } + openfl_display__$internal_CanvasDisplayObject.renderDrawable(displayObjectContainer,renderer); + if(displayObjectContainer.__cacheBitmap != null && !displayObjectContainer.__isCacheBitmapRender) { + return; + } + renderer.__pushMaskObject(displayObjectContainer); + if(renderer.__stage != null) { + var _g = 0; + var _g1 = displayObjectContainer.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + renderer.__renderDrawable(child); + child.__renderDirty = false; + } + displayObjectContainer.__renderDirty = false; + } else { + var _g = 0; + var _g1 = displayObjectContainer.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + renderer.__renderDrawable(child); + } + } + renderer.__popMaskObject(displayObjectContainer); +}; +openfl_display__$internal_CanvasDisplayObjectContainer.renderDrawableMask = function(displayObjectContainer,renderer) { + var orphan = displayObjectContainer.__removedChildren.iterator(); + while(orphan.hasNext()) { + var orphan1 = orphan.next(); + if(orphan1.stage == null) { + orphan1.__cleanup(); + } + } + displayObjectContainer.__removedChildren.set_length(0); + if(displayObjectContainer.__graphics != null) { + openfl_display__$internal_CanvasGraphics.renderMask(displayObjectContainer.__graphics,renderer); + } + var _g = 0; + var _g1 = displayObjectContainer.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + renderer.__renderDrawableMask(child); + } +}; +var openfl_display__$internal_DrawCommandBuffer = function() { + if(openfl_display__$internal_DrawCommandBuffer.empty == null) { + this.types = []; + this.b = []; + this.i = []; + this.f = []; + this.o = []; + this.ff = []; + this.ii = []; + this.copyOnWrite = true; + } else { + this.clear(); + } +}; +$hxClasses["openfl.display._internal.DrawCommandBuffer"] = openfl_display__$internal_DrawCommandBuffer; +openfl_display__$internal_DrawCommandBuffer.__name__ = "openfl.display._internal.DrawCommandBuffer"; +openfl_display__$internal_DrawCommandBuffer.prototype = { + append: function(other) { + if(this.get_length() == 0) { + this.types = other.types; + this.b = other.b; + this.i = other.i; + this.f = other.f; + this.o = other.o; + this.ff = other.ff; + this.ii = other.ii; + this.copyOnWrite = other.copyOnWrite = true; + return other; + } + var data = new openfl_display__$internal_DrawCommandReader(other); + var _g = 0; + var _g1 = other.types; + while(_g < _g1.length) { + var type = _g1[_g]; + ++_g; + switch(type._hx_index) { + case 0: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL; + var c = data; + this.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]); + break; + case 1: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL; + var c1 = data; + this.beginFill(c1.buffer.i[c1.iPos],c1.buffer.f[c1.fPos]); + break; + case 2: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL; + var c2 = data; + this.beginGradientFill(c2.buffer.o[c2.oPos],c2.buffer.ii[c2.iiPos],c2.buffer.ff[c2.ffPos],c2.buffer.ii[c2.iiPos + 1],c2.buffer.o[c2.oPos + 1],c2.buffer.o[c2.oPos + 2],c2.buffer.o[c2.oPos + 3],c2.buffer.f[c2.fPos]); + break; + case 3: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL; + var c3 = data; + this.beginShaderFill(c3.buffer.o[c3.oPos]); + break; + case 4: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO; + var c4 = data; + this.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]); + break; + case 5: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO; + var c5 = data; + this.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]); + break; + case 6: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE; + var c6 = data; + this.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]); + break; + case 7: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE; + var c7 = data; + this.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]); + break; + case 8: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS; + var c8 = data; + this.drawQuads(c8.buffer.o[c8.oPos],c8.buffer.o[c8.oPos + 1],c8.buffer.o[c8.oPos + 2]); + break; + case 9: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT; + var c9 = data; + this.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]); + break; + case 10: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT; + var c10 = data; + this.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]); + break; + case 12: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES; + var c11 = data; + this.drawTriangles(c11.buffer.o[c11.oPos],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3]); + break; + case 13: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.END_FILL; + var c12 = data; + this.endFill(); + break; + case 14: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE; + var c13 = data; + this.lineBitmapStyle(c13.buffer.o[c13.oPos],c13.buffer.o[c13.oPos + 1],c13.buffer.b[c13.bPos],c13.buffer.b[c13.bPos + 1]); + break; + case 15: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE; + var c14 = data; + this.lineGradientStyle(c14.buffer.o[c14.oPos],c14.buffer.ii[c14.iiPos],c14.buffer.ff[c14.ffPos],c14.buffer.ii[c14.iiPos + 1],c14.buffer.o[c14.oPos + 1],c14.buffer.o[c14.oPos + 2],c14.buffer.o[c14.oPos + 3],c14.buffer.f[c14.fPos]); + break; + case 16: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE; + var c15 = data; + this.lineStyle(c15.buffer.o[c15.oPos],c15.buffer.i[c15.iPos],c15.buffer.f[c15.fPos],c15.buffer.b[c15.bPos],c15.buffer.o[c15.oPos + 1],c15.buffer.o[c15.oPos + 2],c15.buffer.o[c15.oPos + 3],c15.buffer.f[c15.fPos + 1]); + break; + case 17: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_TO; + var c16 = data; + this.lineTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]); + break; + case 18: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO; + var c17 = data; + this.moveTo(c17.buffer.f[c17.fPos],c17.buffer.f[c17.fPos + 1]); + break; + case 20: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_MATRIX; + var c18 = data; + this.overrideMatrix(c18.buffer.o[c18.oPos]); + break; + case 21: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD; + var c19 = data; + this.windingEvenOdd(); + break; + case 22: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO; + var c20 = data; + this.windingNonZero(); + break; + default: + } + } + data.destroy(); + return other; + } + ,beginBitmapFill: function(bitmap,matrix,repeat,smooth) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL); + this.o.push(bitmap); + this.o.push(matrix); + this.b.push(repeat); + this.b.push(smooth); + } + ,beginFill: function(color,alpha) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.BEGIN_FILL); + this.i.push(color); + this.f.push(alpha); + } + ,beginGradientFill: function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL); + this.o.push(type); + this.ii.push(colors); + this.ff.push(alphas); + this.ii.push(ratios); + this.o.push(matrix); + this.o.push(spreadMethod); + this.o.push(interpolationMethod); + this.f.push(focalPointRatio); + } + ,beginShaderFill: function(shaderBuffer) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL); + this.o.push(shaderBuffer); + } + ,clear: function() { + this.types = openfl_display__$internal_DrawCommandBuffer.empty.types; + this.b = openfl_display__$internal_DrawCommandBuffer.empty.b; + this.i = openfl_display__$internal_DrawCommandBuffer.empty.i; + this.f = openfl_display__$internal_DrawCommandBuffer.empty.f; + this.o = openfl_display__$internal_DrawCommandBuffer.empty.o; + this.ff = openfl_display__$internal_DrawCommandBuffer.empty.ff; + this.ii = openfl_display__$internal_DrawCommandBuffer.empty.ii; + this.copyOnWrite = true; + } + ,copy: function() { + var copy = new openfl_display__$internal_DrawCommandBuffer(); + copy.append(this); + return copy; + } + ,cubicCurveTo: function(controlX1,controlY1,controlX2,controlY2,anchorX,anchorY) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO); + this.f.push(controlX1); + this.f.push(controlY1); + this.f.push(controlX2); + this.f.push(controlY2); + this.f.push(anchorX); + this.f.push(anchorY); + } + ,curveTo: function(controlX,controlY,anchorX,anchorY) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.CURVE_TO); + this.f.push(controlX); + this.f.push(controlY); + this.f.push(anchorX); + this.f.push(anchorY); + } + ,destroy: function() { + this.clear(); + this.types = null; + this.b = null; + this.i = null; + this.f = null; + this.o = null; + this.ff = null; + this.ii = null; + } + ,drawCircle: function(x,y,radius) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.DRAW_CIRCLE); + this.f.push(x); + this.f.push(y); + this.f.push(radius); + } + ,drawEllipse: function(x,y,width,height) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE); + this.f.push(x); + this.f.push(y); + this.f.push(width); + this.f.push(height); + } + ,drawQuads: function(rects,indices,transforms) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.DRAW_QUADS); + this.o.push(rects); + this.o.push(indices); + this.o.push(transforms); + } + ,drawRect: function(x,y,width,height) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.DRAW_RECT); + this.f.push(x); + this.f.push(y); + this.f.push(width); + this.f.push(height); + } + ,drawRoundRect: function(x,y,width,height,ellipseWidth,ellipseHeight) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT); + this.f.push(x); + this.f.push(y); + this.f.push(width); + this.f.push(height); + this.f.push(ellipseWidth); + this.o.push(ellipseHeight); + } + ,drawTriangles: function(vertices,indices,uvtData,culling) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES); + this.o.push(vertices); + this.o.push(indices); + this.o.push(uvtData); + this.o.push(culling); + } + ,endFill: function() { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.END_FILL); + } + ,lineBitmapStyle: function(bitmap,matrix,repeat,smooth) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE); + this.o.push(bitmap); + this.o.push(matrix); + this.b.push(repeat); + this.b.push(smooth); + } + ,lineGradientStyle: function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE); + this.o.push(type); + this.ii.push(colors); + this.ff.push(alphas); + this.ii.push(ratios); + this.o.push(matrix); + this.o.push(spreadMethod); + this.o.push(interpolationMethod); + this.f.push(focalPointRatio); + } + ,lineStyle: function(thickness,color,alpha,pixelHinting,scaleMode,caps,joints,miterLimit) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.LINE_STYLE); + this.o.push(thickness); + this.i.push(color); + this.f.push(alpha); + this.b.push(pixelHinting); + this.o.push(scaleMode); + this.o.push(caps); + this.o.push(joints); + this.f.push(miterLimit); + } + ,lineTo: function(x,y) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.LINE_TO); + this.f.push(x); + this.f.push(y); + } + ,moveTo: function(x,y) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.MOVE_TO); + this.f.push(x); + this.f.push(y); + } + ,prepareWrite: function() { + if(this.copyOnWrite) { + this.types = this.types.slice(); + this.b = this.b.slice(); + this.i = this.i.slice(); + this.f = this.f.slice(); + this.o = this.o.slice(); + this.ff = this.ff.slice(); + this.ii = this.ii.slice(); + this.copyOnWrite = false; + } + } + ,overrideBlendMode: function(blendMode) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE); + this.o.push(blendMode); + } + ,overrideMatrix: function(matrix) { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.OVERRIDE_MATRIX); + this.o.push(matrix); + } + ,windingEvenOdd: function() { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD); + } + ,windingNonZero: function() { + this.prepareWrite(); + this.types.push(openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO); + } + ,get_length: function() { + return this.types.length; + } + ,__class__: openfl_display__$internal_DrawCommandBuffer + ,__properties__: {get_length:"get_length"} +}; +var openfl_display__$internal_CanvasGraphics = function() { }; +$hxClasses["openfl.display._internal.CanvasGraphics"] = openfl_display__$internal_CanvasGraphics; +openfl_display__$internal_CanvasGraphics.__name__ = "openfl.display._internal.CanvasGraphics"; +openfl_display__$internal_CanvasGraphics.closePath = function(strokeBefore) { + if(strokeBefore == null) { + strokeBefore = false; + } + if(openfl_display__$internal_CanvasGraphics.context.strokeStyle == null) { + return; + } + if(!strokeBefore) { + openfl_display__$internal_CanvasGraphics.context.closePath(); + } + openfl_display__$internal_CanvasGraphics.context.stroke(); + if(strokeBefore) { + openfl_display__$internal_CanvasGraphics.context.closePath(); + } + openfl_display__$internal_CanvasGraphics.context.beginPath(); +}; +openfl_display__$internal_CanvasGraphics.createBitmapFill = function(bitmap,bitmapRepeat,smooth) { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.image); + openfl_display__$internal_CanvasGraphics.setSmoothing(smooth); + return openfl_display__$internal_CanvasGraphics.context.createPattern(bitmap.image.get_src(),bitmapRepeat ? "repeat" : "no-repeat"); +}; +openfl_display__$internal_CanvasGraphics.createGradientPattern = function(type,colors,alphas,ratios,matrix,spreadMethod,interpolationMethod,focalPointRatio) { + var gradientFill = null; + var point = null; + var point2 = null; + var releaseMatrix = false; + var ratio = 0.0; + if(matrix == null) { + matrix = openfl_geom_Matrix.__pool.get(); + matrix.identity(); + releaseMatrix = true; + } + switch(type) { + case 0: + if(spreadMethod == 0) { + gradientFill = openfl_display__$internal_CanvasGraphics.context.createLinearGradient(-819.2,0,819.2,0); + openfl_display__$internal_CanvasGraphics.pendingMatrix = matrix.clone(); + openfl_display__$internal_CanvasGraphics.inversePendingMatrix = matrix.clone(); + openfl_display__$internal_CanvasGraphics.inversePendingMatrix.invert(); + var _g = 0; + var _g1 = colors.length; + while(_g < _g1) { + var i = _g++; + ratio = ratios[i] / 255; + if(ratio < 0) { + ratio = 0; + } else if(ratio > 1) { + ratio = 1; + } + gradientFill.addColorStop(ratio,openfl_display__$internal_CanvasGraphics.getRGBA(colors[i],alphas[i])); + } + if(point != null) { + openfl_geom_Point.__pool.release(point); + } + if(point2 != null) { + openfl_geom_Point.__pool.release(point2); + } + if(releaseMatrix) { + openfl_geom_Matrix.__pool.release(matrix); + } + return gradientFill; + } + var gradientScale = spreadMethod == 0 ? 1.0 : 25.0; + var dx = 0.5 * (gradientScale - 1.0) * 1638.4; + var canvas = window.document.createElement("canvas"); + var context2 = canvas.getContext("2d"); + var dimensions = openfl_display__$internal_CanvasGraphics.getDimensions(matrix); + canvas.width = openfl_display__$internal_CanvasGraphics.context.canvas.width; + canvas.height = openfl_display__$internal_CanvasGraphics.context.canvas.height; + gradientFill = openfl_display__$internal_CanvasGraphics.context.createLinearGradient(-819.2 - dx,0,819.2 + dx,0); + if(spreadMethod == 1) { + var t = 0; + var step = 0.04; + var a; + while(t < 1) { + var _g = 0; + var _g1 = colors.length; + while(_g < _g1) { + var i = _g++; + ratio = ratios[i] / 255; + ratio = t + ratio * step; + if(ratio < 0) { + ratio = 0; + } else if(ratio > 1) { + ratio = 1; + } + gradientFill.addColorStop(ratio,openfl_display__$internal_CanvasGraphics.getRGBA(colors[i],alphas[i])); + } + t += step; + a = colors.length - 1; + while(a >= 0) { + ratio = ratios[a] / 255; + ratio = t + (1.0 - ratio) * step; + if(ratio < 0) { + ratio = 0; + } else if(ratio > 1) { + ratio = 1; + } + gradientFill.addColorStop(ratio,openfl_display__$internal_CanvasGraphics.getRGBA(colors[a],alphas[a])); + --a; + } + t += step; + } + } else if(spreadMethod == 2) { + var t = 0; + var step = 0.04; + var a; + while(t < 1) { + var _g = 0; + var _g1 = colors.length; + while(_g < _g1) { + var i = _g++; + ratio = ratios[i] / 255; + ratio = t + ratio * step; + if(ratio < 0) { + ratio = 0; + } else if(ratio > 1) { + ratio = 0.999; + } + gradientFill.addColorStop(ratio,openfl_display__$internal_CanvasGraphics.getRGBA(colors[i],alphas[i])); + } + ratio = t + 0.001; + if(ratio < 0) { + ratio = 0; + } else if(ratio > 1) { + ratio = 1; + } + gradientFill.addColorStop(ratio - 0.001,openfl_display__$internal_CanvasGraphics.getRGBA(colors[colors.length - 1],alphas[alphas.length - 1])); + gradientFill.addColorStop(ratio,openfl_display__$internal_CanvasGraphics.getRGBA(colors[0],alphas[0])); + t += step; + } + } + openfl_display__$internal_CanvasGraphics.pendingMatrix = new openfl_geom_Matrix(); + openfl_display__$internal_CanvasGraphics.pendingMatrix.tx = matrix.tx - dimensions.width / 2; + openfl_display__$internal_CanvasGraphics.pendingMatrix.ty = matrix.ty - dimensions.height / 2; + openfl_display__$internal_CanvasGraphics.inversePendingMatrix = openfl_display__$internal_CanvasGraphics.pendingMatrix.clone(); + openfl_display__$internal_CanvasGraphics.inversePendingMatrix.invert(); + var path = new Path2D(); + path.rect(0,0,canvas.width,canvas.height); + path.closePath(); + var gradientMatrix = new DOMMatrix([matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty]); + var inverseMatrix = gradientMatrix.inverse(); + var untransformedPath = new Path2D(); + untransformedPath.addPath(path,inverseMatrix); + context2.fillStyle = gradientFill; + context2.setTransform(gradientMatrix); + context2.fill(untransformedPath); + return openfl_display__$internal_CanvasGraphics.context.createPattern(canvas,"no-repeat"); + case 1: + var radius = 819.2; + if(focalPointRatio > 1.0) { + focalPointRatio = 1.0; + } else if(focalPointRatio < -1.0) { + focalPointRatio = -1.0; + } + gradientFill = openfl_display__$internal_CanvasGraphics.context.createRadialGradient(radius * focalPointRatio,0,0,0,0,radius); + openfl_display__$internal_CanvasGraphics.pendingMatrix = matrix.clone(); + openfl_display__$internal_CanvasGraphics.inversePendingMatrix = matrix.clone(); + openfl_display__$internal_CanvasGraphics.inversePendingMatrix.invert(); + var _g = 0; + var _g1 = colors.length; + while(_g < _g1) { + var i = _g++; + ratio = ratios[i] / 255; + if(ratio < 0) { + ratio = 0; + } else if(ratio > 1) { + ratio = 1; + } + gradientFill.addColorStop(ratio,openfl_display__$internal_CanvasGraphics.getRGBA(colors[i],alphas[i])); + } + if(point != null) { + openfl_geom_Point.__pool.release(point); + } + if(point2 != null) { + openfl_geom_Point.__pool.release(point2); + } + if(releaseMatrix) { + openfl_geom_Matrix.__pool.release(matrix); + } + return gradientFill; + } +}; +openfl_display__$internal_CanvasGraphics.getRGBA = function(color,alpha) { + var r = (color & 16711680) >>> 16; + var g = (color & 65280) >>> 8; + var b = color & 255; + return "rgba(" + (r == null ? "null" : Std.string(UInt.toFloat(r))) + ", " + (g == null ? "null" : Std.string(UInt.toFloat(g))) + ", " + (b == null ? "null" : Std.string(UInt.toFloat(b))) + ", " + alpha + ")"; +}; +openfl_display__$internal_CanvasGraphics.getDimensions = function(matrix) { + var angle = Math.atan2(matrix.c,matrix.a); + var cos = Math.cos(angle); + var w = matrix.a / cos * 1638.4; + var h = matrix.d / cos * 1638.4; + if(w == 0 && h == 0) { + h = 819.2; + w = h; + } + return { width : w, height : h}; +}; +openfl_display__$internal_CanvasGraphics.createTempPatternCanvas = function(bitmap,repeat,width,height) { + var canvas = window.document.createElement("canvas"); + var context = canvas.getContext("2d"); + canvas.width = width; + canvas.height = height; + var tmp = bitmap.image.get_src(); + context.fillStyle = context.createPattern(tmp,repeat ? "repeat" : "no-repeat"); + context.beginPath(); + context.moveTo(0,0); + context.lineTo(0,height); + context.lineTo(width,height); + context.lineTo(width,0); + context.lineTo(0,0); + context.closePath(); + if(!openfl_display__$internal_CanvasGraphics.hitTesting) { + context.fill(openfl_display__$internal_CanvasGraphics.windingRule); + } + return canvas; +}; +openfl_display__$internal_CanvasGraphics.drawRoundRect = function(x,y,width,height,ellipseWidth,ellipseHeight) { + if(ellipseHeight == null) { + ellipseHeight = ellipseWidth; + } + ellipseWidth *= 0.5; + ellipseHeight *= 0.5; + if(ellipseWidth > width / 2) { + ellipseWidth = width / 2; + } + if(ellipseHeight > height / 2) { + ellipseHeight = height / 2; + } + var xe = x + width; + var ye = y + height; + var cx1 = -ellipseWidth + ellipseWidth * 0.70710678118654752440084436210485; + var cx2 = -ellipseWidth + ellipseWidth * 0.4142135623730950488016887242097; + var cy1 = -ellipseHeight + ellipseHeight * 0.70710678118654752440084436210485; + var cy2 = -ellipseHeight + ellipseHeight * 0.4142135623730950488016887242097; + openfl_display__$internal_CanvasGraphics.context.moveTo(xe,ye - ellipseHeight); + openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(xe,ye + cy2,xe + cx1,ye + cy1); + openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(xe + cx2,ye,xe - ellipseWidth,ye); + openfl_display__$internal_CanvasGraphics.context.lineTo(x + ellipseWidth,ye); + openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(x - cx2,ye,x - cx1,ye + cy1); + openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(x,ye + cy2,x,ye - ellipseHeight); + openfl_display__$internal_CanvasGraphics.context.lineTo(x,y + ellipseHeight); + openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(x,y - cy2,x - cx1,y - cy1); + openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(x - cx2,y,x + ellipseWidth,y); + openfl_display__$internal_CanvasGraphics.context.lineTo(xe - ellipseWidth,y); + openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(xe + cx2,y,xe + cx1,y - cy1); + openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(xe,y - cy2,xe,y + ellipseHeight); + openfl_display__$internal_CanvasGraphics.context.lineTo(xe,ye - ellipseHeight); +}; +openfl_display__$internal_CanvasGraphics.endFill = function() { + openfl_display__$internal_CanvasGraphics.context.beginPath(); + openfl_display__$internal_CanvasGraphics.playCommands(openfl_display__$internal_CanvasGraphics.fillCommands,false); + openfl_display__$internal_CanvasGraphics.fillCommands.clear(); +}; +openfl_display__$internal_CanvasGraphics.endStroke = function() { + openfl_display__$internal_CanvasGraphics.context.beginPath(); + openfl_display__$internal_CanvasGraphics.playCommands(openfl_display__$internal_CanvasGraphics.strokeCommands,true); + openfl_display__$internal_CanvasGraphics.context.closePath(); + openfl_display__$internal_CanvasGraphics.strokeCommands.clear(); +}; +openfl_display__$internal_CanvasGraphics.hitTest = function(graphics,x,y) { + openfl_display__$internal_CanvasGraphics.bounds = graphics.__bounds; + openfl_display__$internal_CanvasGraphics.graphics = graphics; + if(graphics.__commands.get_length() == 0 || openfl_display__$internal_CanvasGraphics.bounds == null || openfl_display__$internal_CanvasGraphics.bounds.width <= 0 || openfl_display__$internal_CanvasGraphics.bounds.height <= 0) { + openfl_display__$internal_CanvasGraphics.graphics = null; + return false; + } else { + openfl_display__$internal_CanvasGraphics.hitTesting = true; + var transform = graphics.__renderTransform; + var px = x * transform.a + y * transform.c + transform.tx; + var py = x * transform.b + y * transform.d + transform.ty; + x = px; + y = py; + x -= openfl_display__$internal_CanvasGraphics.bounds.x * transform.a + openfl_display__$internal_CanvasGraphics.bounds.y * transform.c + transform.tx; + y -= openfl_display__$internal_CanvasGraphics.bounds.x * transform.b + openfl_display__$internal_CanvasGraphics.bounds.y * transform.d + transform.ty; + var cacheCanvas = graphics.__canvas; + var cacheContext = graphics.__context; + graphics.__canvas = openfl_display__$internal_CanvasGraphics.hitTestCanvas; + graphics.__context = openfl_display__$internal_CanvasGraphics.hitTestContext; + openfl_display__$internal_CanvasGraphics.context = graphics.__context; + openfl_display__$internal_CanvasGraphics.context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty); + openfl_display__$internal_CanvasGraphics.fillCommands.clear(); + openfl_display__$internal_CanvasGraphics.strokeCommands.clear(); + openfl_display__$internal_CanvasGraphics.hasFill = false; + openfl_display__$internal_CanvasGraphics.hasStroke = false; + openfl_display__$internal_CanvasGraphics.bitmapFill = null; + openfl_display__$internal_CanvasGraphics.bitmapRepeat = false; + openfl_display__$internal_CanvasGraphics.windingRule = "evenodd"; + var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands); + var _g = 0; + var _g1 = graphics.__commands.types; + while(_g < _g1.length) { + var type = _g1[_g]; + ++_g; + switch(type._hx_index) { + case 0:case 1:case 2:case 3: + openfl_display__$internal_CanvasGraphics.endFill(); + if(openfl_display__$internal_CanvasGraphics.hasFill && openfl_display__$internal_CanvasGraphics.context.isPointInPath(x,y,openfl_display__$internal_CanvasGraphics.windingRule)) { + data.destroy(); + graphics.__canvas = cacheCanvas; + graphics.__context = cacheContext; + openfl_display__$internal_CanvasGraphics.graphics = null; + return true; + } + openfl_display__$internal_CanvasGraphics.endStroke(); + if(openfl_display__$internal_CanvasGraphics.hasStroke && openfl_display__$internal_CanvasGraphics.context.isPointInStroke(x,y)) { + data.destroy(); + graphics.__canvas = cacheCanvas; + graphics.__context = cacheContext; + openfl_display__$internal_CanvasGraphics.graphics = null; + return true; + } + if(type == openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL) { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL; + var c = data; + openfl_display__$internal_CanvasGraphics.fillCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]); + openfl_display__$internal_CanvasGraphics.strokeCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]); + } else if(type == openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL) { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL; + var c1 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]); + openfl_display__$internal_CanvasGraphics.strokeCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]); + } else if(type == openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL) { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL; + var c2 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.beginShaderFill(c2.buffer.o[c2.oPos]); + openfl_display__$internal_CanvasGraphics.strokeCommands.beginShaderFill(c2.buffer.o[c2.oPos]); + } else { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL; + var c3 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.beginFill(c3.buffer.i[c3.iPos],1); + openfl_display__$internal_CanvasGraphics.strokeCommands.beginFill(c3.buffer.i[c3.iPos],1); + } + break; + case 4: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO; + var c4 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]); + openfl_display__$internal_CanvasGraphics.strokeCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]); + break; + case 5: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO; + var c5 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]); + openfl_display__$internal_CanvasGraphics.strokeCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]); + break; + case 6: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE; + var c6 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]); + openfl_display__$internal_CanvasGraphics.strokeCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]); + break; + case 7: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE; + var c7 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]); + openfl_display__$internal_CanvasGraphics.strokeCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]); + break; + case 9: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT; + var c8 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.drawRect(c8.buffer.f[c8.fPos],c8.buffer.f[c8.fPos + 1],c8.buffer.f[c8.fPos + 2],c8.buffer.f[c8.fPos + 3]); + openfl_display__$internal_CanvasGraphics.strokeCommands.drawRect(c8.buffer.f[c8.fPos],c8.buffer.f[c8.fPos + 1],c8.buffer.f[c8.fPos + 2],c8.buffer.f[c8.fPos + 3]); + break; + case 10: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT; + var c9 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.drawRoundRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3],c9.buffer.f[c9.fPos + 4],c9.buffer.o[c9.oPos]); + openfl_display__$internal_CanvasGraphics.strokeCommands.drawRoundRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3],c9.buffer.f[c9.fPos + 4],c9.buffer.o[c9.oPos]); + break; + case 13: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.END_FILL; + var this1 = data; + openfl_display__$internal_CanvasGraphics.endFill(); + if(openfl_display__$internal_CanvasGraphics.hasFill && openfl_display__$internal_CanvasGraphics.context.isPointInPath(x,y,openfl_display__$internal_CanvasGraphics.windingRule)) { + data.destroy(); + graphics.__canvas = cacheCanvas; + graphics.__context = cacheContext; + openfl_display__$internal_CanvasGraphics.graphics = null; + return true; + } + openfl_display__$internal_CanvasGraphics.endStroke(); + if(openfl_display__$internal_CanvasGraphics.hasStroke && openfl_display__$internal_CanvasGraphics.context.isPointInStroke(x,y)) { + data.destroy(); + graphics.__canvas = cacheCanvas; + graphics.__context = cacheContext; + openfl_display__$internal_CanvasGraphics.graphics = null; + return true; + } + openfl_display__$internal_CanvasGraphics.hasFill = false; + openfl_display__$internal_CanvasGraphics.bitmapFill = null; + break; + case 14: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE; + var c10 = data; + openfl_display__$internal_CanvasGraphics.strokeCommands.lineBitmapStyle(c10.buffer.o[c10.oPos],c10.buffer.o[c10.oPos + 1],c10.buffer.b[c10.bPos],c10.buffer.b[c10.bPos + 1]); + break; + case 15: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE; + var c11 = data; + openfl_display__$internal_CanvasGraphics.strokeCommands.lineGradientStyle(c11.buffer.o[c11.oPos],c11.buffer.ii[c11.iiPos],c11.buffer.ff[c11.ffPos],c11.buffer.ii[c11.iiPos + 1],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3],c11.buffer.f[c11.fPos]); + break; + case 16: + openfl_display__$internal_CanvasGraphics.endStroke(); + if(openfl_display__$internal_CanvasGraphics.hasStroke && openfl_display__$internal_CanvasGraphics.context.isPointInStroke(x,y)) { + data.destroy(); + graphics.__canvas = cacheCanvas; + graphics.__context = cacheContext; + openfl_display__$internal_CanvasGraphics.graphics = null; + return true; + } + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE; + var c12 = data; + openfl_display__$internal_CanvasGraphics.strokeCommands.lineStyle(c12.buffer.o[c12.oPos],c12.buffer.i[c12.iPos],1,c12.buffer.b[c12.bPos],c12.buffer.o[c12.oPos + 1],c12.buffer.o[c12.oPos + 2],c12.buffer.o[c12.oPos + 3],c12.buffer.f[c12.fPos + 1]); + break; + case 17: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_TO; + var c13 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.lineTo(c13.buffer.f[c13.fPos],c13.buffer.f[c13.fPos + 1]); + openfl_display__$internal_CanvasGraphics.strokeCommands.lineTo(c13.buffer.f[c13.fPos],c13.buffer.f[c13.fPos + 1]); + break; + case 18: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO; + var c14 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.moveTo(c14.buffer.f[c14.fPos],c14.buffer.f[c14.fPos + 1]); + openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(c14.buffer.f[c14.fPos],c14.buffer.f[c14.fPos + 1]); + break; + case 21: + openfl_display__$internal_CanvasGraphics.windingRule = "evenodd"; + break; + case 22: + openfl_display__$internal_CanvasGraphics.windingRule = "nonzero"; + break; + default: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + } + } + var hitTest = false; + if(openfl_display__$internal_CanvasGraphics.fillCommands.get_length() > 0) { + openfl_display__$internal_CanvasGraphics.endFill(); + } + if(openfl_display__$internal_CanvasGraphics.hasFill && openfl_display__$internal_CanvasGraphics.context.isPointInPath(x,y,openfl_display__$internal_CanvasGraphics.windingRule)) { + hitTest = true; + } + if(openfl_display__$internal_CanvasGraphics.strokeCommands.get_length() > 0) { + openfl_display__$internal_CanvasGraphics.endStroke(); + } + if(openfl_display__$internal_CanvasGraphics.hasStroke && openfl_display__$internal_CanvasGraphics.context.isPointInStroke(x,y)) { + hitTest = true; + } + data.destroy(); + graphics.__canvas = cacheCanvas; + graphics.__context = cacheContext; + openfl_display__$internal_CanvasGraphics.graphics = null; + return hitTest; + } +}; +openfl_display__$internal_CanvasGraphics.isCCW = function(x1,y1,x2,y2,x3,y3) { + return (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1) < 0; +}; +openfl_display__$internal_CanvasGraphics.normalizeUVT = function(uvt,skipT) { + if(skipT == null) { + skipT = false; + } + var max = -Infinity; + var tmp = -Infinity; + var len = uvt.get_length(); + var _g = 1; + var _g1 = len + 1; + while(_g < _g1) { + var t = _g++; + if(skipT && t % 3 == 0) { + continue; + } + tmp = uvt.get(t - 1); + if(max < tmp) { + max = tmp; + } + } + if(!skipT) { + return { max : max, uvt : uvt}; + } + var result = openfl_Vector.toFloatVector(null); + var _g = 1; + var _g1 = len + 1; + while(_g < _g1) { + var t = _g++; + if(skipT && t % 3 == 0) { + continue; + } + result.push(uvt.get(t - 1)); + } + return { max : max, uvt : result}; +}; +openfl_display__$internal_CanvasGraphics.playCommands = function(commands,stroke) { + if(stroke == null) { + stroke = false; + } + openfl_display__$internal_CanvasGraphics.bounds = openfl_display__$internal_CanvasGraphics.graphics.__bounds; + var offsetX = openfl_display__$internal_CanvasGraphics.bounds.x; + var offsetY = openfl_display__$internal_CanvasGraphics.bounds.y; + var positionX = 0.0; + var positionY = 0.0; + var closeGap = false; + var startX = 0.0; + var startY = 0.0; + var setStart = false; + openfl_display__$internal_CanvasGraphics.windingRule = "evenodd"; + openfl_display__$internal_CanvasGraphics.setSmoothing(true); + var hasPath = false; + var data = new openfl_display__$internal_DrawCommandReader(commands); + var x; + var y; + var width; + var height; + var kappa = 0.5522848; + var ox; + var oy; + var xe; + var ye; + var xm; + var ym; + var r; + var g; + var b; + var optimizationUsed; + var canOptimizeMatrix; + var st; + var sr; + var sb; + var sl; + var stl = null; + var sbr = null; + var _g = 0; + var _g1 = commands.types; + _hx_loop1: while(_g < _g1.length) { + var type = _g1[_g]; + ++_g; + switch(type._hx_index) { + case 0: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL; + var c = data; + openfl_display__$internal_CanvasGraphics.bitmapFill = c.buffer.o[c.oPos]; + if(c.buffer.o[c.oPos].readable) { + openfl_display__$internal_CanvasGraphics.context.fillStyle = openfl_display__$internal_CanvasGraphics.createBitmapFill(c.buffer.o[c.oPos],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]); + } else { + var tmp = StringTools.hex(0,6); + openfl_display__$internal_CanvasGraphics.context.fillStyle = "#" + tmp; + } + openfl_display__$internal_CanvasGraphics.hasFill = true; + if(c.buffer.o[c.oPos + 1] != null) { + openfl_display__$internal_CanvasGraphics.pendingMatrix = c.buffer.o[c.oPos + 1]; + openfl_display__$internal_CanvasGraphics.inversePendingMatrix = c.buffer.o[c.oPos + 1].clone(); + openfl_display__$internal_CanvasGraphics.inversePendingMatrix.invert(); + } else { + openfl_display__$internal_CanvasGraphics.pendingMatrix = null; + openfl_display__$internal_CanvasGraphics.inversePendingMatrix = null; + } + break; + case 1: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL; + var c1 = data; + if(c1.buffer.f[c1.fPos] < 0.005) { + openfl_display__$internal_CanvasGraphics.hasFill = false; + } else { + if(c1.buffer.f[c1.fPos] == 1) { + var tmp1 = StringTools.hex(c1.buffer.i[c1.iPos] & 16777215,6); + openfl_display__$internal_CanvasGraphics.context.fillStyle = "#" + tmp1; + } else { + r = (c1.buffer.i[c1.iPos] & 16711680) >>> 16; + g = (c1.buffer.i[c1.iPos] & 65280) >>> 8; + b = c1.buffer.i[c1.iPos] & 255; + openfl_display__$internal_CanvasGraphics.context.fillStyle = "rgba(" + r + ", " + g + ", " + b + ", " + c1.buffer.f[c1.fPos] + ")"; + } + openfl_display__$internal_CanvasGraphics.bitmapFill = null; + openfl_display__$internal_CanvasGraphics.setSmoothing(true); + openfl_display__$internal_CanvasGraphics.hasFill = true; + } + break; + case 2: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL; + var c2 = data; + openfl_display__$internal_CanvasGraphics.context.fillStyle = openfl_display__$internal_CanvasGraphics.createGradientPattern(c2.buffer.o[c2.oPos],c2.buffer.ii[c2.iiPos],c2.buffer.ff[c2.ffPos],c2.buffer.ii[c2.iiPos + 1],c2.buffer.o[c2.oPos + 1],c2.buffer.o[c2.oPos + 2],c2.buffer.o[c2.oPos + 3],c2.buffer.f[c2.fPos]); + openfl_display__$internal_CanvasGraphics.bitmapFill = null; + openfl_display__$internal_CanvasGraphics.setSmoothing(true); + openfl_display__$internal_CanvasGraphics.hasFill = true; + break; + case 3: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL; + var c3 = data; + var shaderBuffer = c3.buffer.o[c3.oPos]; + if(shaderBuffer.inputCount > 0) { + openfl_display__$internal_CanvasGraphics.bitmapFill = shaderBuffer.inputs[0]; + if(openfl_display__$internal_CanvasGraphics.bitmapFill.readable) { + openfl_display__$internal_CanvasGraphics.context.fillStyle = openfl_display__$internal_CanvasGraphics.createBitmapFill(openfl_display__$internal_CanvasGraphics.bitmapFill,shaderBuffer.inputWrap[0] != 0,shaderBuffer.inputFilter[0] != 5); + } else { + var tmp2 = StringTools.hex(0,6); + openfl_display__$internal_CanvasGraphics.context.fillStyle = "#" + tmp2; + } + openfl_display__$internal_CanvasGraphics.hasFill = true; + openfl_display__$internal_CanvasGraphics.pendingMatrix = null; + openfl_display__$internal_CanvasGraphics.inversePendingMatrix = null; + } + break; + case 4: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO; + var c4 = data; + hasPath = true; + openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(c4.buffer.f[c4.fPos] - offsetX,c4.buffer.f[c4.fPos + 1] - offsetY,c4.buffer.f[c4.fPos + 2] - offsetX,c4.buffer.f[c4.fPos + 3] - offsetY,c4.buffer.f[c4.fPos + 4] - offsetX,c4.buffer.f[c4.fPos + 5] - offsetY); + positionX = c4.buffer.f[c4.fPos + 4]; + positionY = c4.buffer.f[c4.fPos + 5]; + break; + case 5: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO; + var c5 = data; + hasPath = true; + openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(c5.buffer.f[c5.fPos] - offsetX,c5.buffer.f[c5.fPos + 1] - offsetY,c5.buffer.f[c5.fPos + 2] - offsetX,c5.buffer.f[c5.fPos + 3] - offsetY); + positionX = c5.buffer.f[c5.fPos + 2]; + positionY = c5.buffer.f[c5.fPos + 3]; + break; + case 6: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE; + var c6 = data; + hasPath = true; + openfl_display__$internal_CanvasGraphics.context.moveTo(c6.buffer.f[c6.fPos] - offsetX + c6.buffer.f[c6.fPos + 2],c6.buffer.f[c6.fPos + 1] - offsetY); + openfl_display__$internal_CanvasGraphics.context.arc(c6.buffer.f[c6.fPos] - offsetX,c6.buffer.f[c6.fPos + 1] - offsetY,c6.buffer.f[c6.fPos + 2],0,Math.PI * 2,true); + break; + case 7: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE; + var c7 = data; + hasPath = true; + x = c7.buffer.f[c7.fPos]; + y = c7.buffer.f[c7.fPos + 1]; + width = c7.buffer.f[c7.fPos + 2]; + height = c7.buffer.f[c7.fPos + 3]; + x -= offsetX; + y -= offsetY; + ox = width / 2 * kappa; + oy = height / 2 * kappa; + xe = x + width; + ye = y + height; + xm = x + width / 2; + ym = y + height / 2; + openfl_display__$internal_CanvasGraphics.context.moveTo(x,ym); + openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(x,ym - oy,xm - ox,y,xm,y); + openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm + ox,y,xe,ym - oy,xe,ym); + openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xe,ym + oy,xm + ox,ye,xm,ye); + openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm - ox,ye,x,ym + oy,x,ym); + break; + case 8: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS; + var c8 = data; + var rects = c8.buffer.o[c8.oPos]; + var indices = c8.buffer.o[c8.oPos + 1]; + var transforms = c8.buffer.o[c8.oPos + 2]; + var hasIndices = indices != null; + var transformABCD = false; + var transformXY = false; + var length = hasIndices ? indices.get_length() : Math.floor(rects.get_length() / 4); + if(length == 0) { + return; + } + if(transforms != null) { + if(transforms.get_length() >= length * 6) { + transformABCD = true; + transformXY = true; + } else if(transforms.get_length() >= length * 4) { + transformABCD = true; + } else if(transforms.get_length() >= length * 2) { + transformXY = true; + } + } + var tileRect = openfl_geom_Rectangle.__pool.get(); + var tileTransform = openfl_geom_Matrix.__pool.get(); + var transform = openfl_display__$internal_CanvasGraphics.graphics.__renderTransform; + var alpha = openfl_display__$internal_CanvasGraphics.worldAlpha; + var ri; + var ti; + openfl_display__$internal_CanvasGraphics.context.save(); + var _g2 = 0; + var _g3 = length; + while(_g2 < _g3) { + var i = _g2++; + ri = hasIndices ? indices.get(i) * 4 : i * 4; + if(ri < 0) { + continue; + } + tileRect.setTo(rects.get(ri),rects.get(ri + 1),rects.get(ri + 2),rects.get(ri + 3)); + if(tileRect.width <= 0 || tileRect.height <= 0) { + continue; + } + if(transformABCD && transformXY) { + ti = i * 6; + tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),transforms.get(ti + 4),transforms.get(ti + 5)); + } else if(transformABCD) { + ti = i * 4; + tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),tileRect.x,tileRect.y); + } else if(transformXY) { + ti = i * 2; + tileTransform.tx = transforms.get(ti); + tileTransform.ty = transforms.get(ti + 1); + } else { + tileTransform.tx = tileRect.x; + tileTransform.ty = tileRect.y; + } + tileTransform.tx += positionX - offsetX; + tileTransform.ty += positionY - offsetY; + tileTransform.concat(transform); + openfl_display__$internal_CanvasGraphics.context.setTransform(tileTransform.a,tileTransform.b,tileTransform.c,tileTransform.d,tileTransform.tx,tileTransform.ty); + if(openfl_display__$internal_CanvasGraphics.bitmapFill != null && openfl_display__$internal_CanvasGraphics.bitmapFill.readable) { + openfl_display__$internal_CanvasGraphics.context.drawImage(openfl_display__$internal_CanvasGraphics.bitmapFill.image.get_src(),tileRect.x,tileRect.y,tileRect.width,tileRect.height,0,0,tileRect.width,tileRect.height); + } else { + openfl_display__$internal_CanvasGraphics.context.fillRect(0,0,tileRect.width,tileRect.height); + } + } + openfl_geom_Rectangle.__pool.release(tileRect); + openfl_geom_Matrix.__pool.release(tileTransform); + openfl_display__$internal_CanvasGraphics.context.restore(); + break; + case 9: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT; + var c9 = data; + optimizationUsed = false; + if(openfl_display__$internal_CanvasGraphics.bitmapFill != null && openfl_display__$internal_CanvasGraphics.bitmapFill.readable && !openfl_display__$internal_CanvasGraphics.hitTesting) { + st = 0; + sr = 0; + sb = 0; + sl = 0; + canOptimizeMatrix = true; + if(openfl_display__$internal_CanvasGraphics.pendingMatrix != null) { + if(openfl_display__$internal_CanvasGraphics.pendingMatrix.b != 0 || openfl_display__$internal_CanvasGraphics.pendingMatrix.c != 0) { + canOptimizeMatrix = false; + } else { + if(stl == null) { + stl = openfl_geom_Point.__pool.get(); + } + if(sbr == null) { + sbr = openfl_geom_Point.__pool.get(); + } + stl.setTo(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1]); + var _this = openfl_display__$internal_CanvasGraphics.inversePendingMatrix; + var px = stl.x; + var py = stl.y; + stl.x = px * _this.a + py * _this.c + _this.tx; + stl.y = px * _this.b + py * _this.d + _this.ty; + sbr.setTo(c9.buffer.f[c9.fPos] + c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 1] + c9.buffer.f[c9.fPos + 3]); + var _this1 = openfl_display__$internal_CanvasGraphics.inversePendingMatrix; + var px1 = sbr.x; + var py1 = sbr.y; + sbr.x = px1 * _this1.a + py1 * _this1.c + _this1.tx; + sbr.y = px1 * _this1.b + py1 * _this1.d + _this1.ty; + st = stl.y; + sl = stl.x; + sb = sbr.y; + sr = sbr.x; + } + } else { + st = c9.buffer.f[c9.fPos + 1]; + sl = c9.buffer.f[c9.fPos]; + sb = c9.buffer.f[c9.fPos + 1] + c9.buffer.f[c9.fPos + 3]; + sr = c9.buffer.f[c9.fPos] + c9.buffer.f[c9.fPos + 2]; + } + if(canOptimizeMatrix && st >= 0 && sl >= 0 && sr <= openfl_display__$internal_CanvasGraphics.bitmapFill.width && sb <= openfl_display__$internal_CanvasGraphics.bitmapFill.height) { + optimizationUsed = true; + if(!openfl_display__$internal_CanvasGraphics.hitTesting) { + openfl_display__$internal_CanvasGraphics.context.drawImage(openfl_display__$internal_CanvasGraphics.bitmapFill.image.get_src(),sl,st,sr - sl,sb - st,c9.buffer.f[c9.fPos] - offsetX,c9.buffer.f[c9.fPos + 1] - offsetY,c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]); + } + } + } + if(!optimizationUsed) { + hasPath = true; + openfl_display__$internal_CanvasGraphics.context.rect(c9.buffer.f[c9.fPos] - offsetX,c9.buffer.f[c9.fPos + 1] - offsetY,c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]); + } + break; + case 10: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT; + var c10 = data; + hasPath = true; + openfl_display__$internal_CanvasGraphics.drawRoundRect(c10.buffer.f[c10.fPos] - offsetX,c10.buffer.f[c10.fPos + 1] - offsetY,c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]); + break; + case 12: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES; + var c11 = data; + var v = c11.buffer.o[c11.oPos]; + var ind = c11.buffer.o[c11.oPos + 1]; + var uvt = c11.buffer.o[c11.oPos + 2]; + var pattern = null; + var colorFill = openfl_display__$internal_CanvasGraphics.bitmapFill == null; + if(colorFill && uvt != null) { + break _hx_loop1; + } + if(!colorFill) { + if(uvt == null) { + uvt = openfl_Vector.toFloatVector(null); + var _g4 = 0; + var _g5 = v.get_length() / 2 | 0; + while(_g4 < _g5) { + var i1 = _g4++; + uvt.push(v.get(i1 * 2) - offsetX / openfl_display__$internal_CanvasGraphics.bitmapFill.width); + uvt.push(v.get(i1 * 2 + 1) - offsetY / openfl_display__$internal_CanvasGraphics.bitmapFill.height); + } + } + var skipT = uvt.get_length() != v.get_length(); + var normalizedUVT = openfl_display__$internal_CanvasGraphics.normalizeUVT(uvt,skipT); + var maxUVT = normalizedUVT.max; + uvt = normalizedUVT.uvt; + if(maxUVT > 1) { + pattern = openfl_display__$internal_CanvasGraphics.createTempPatternCanvas(openfl_display__$internal_CanvasGraphics.bitmapFill,openfl_display__$internal_CanvasGraphics.bitmapRepeat,openfl_display__$internal_CanvasGraphics.bounds.width | 0,openfl_display__$internal_CanvasGraphics.bounds.height | 0); + } else { + pattern = openfl_display__$internal_CanvasGraphics.createTempPatternCanvas(openfl_display__$internal_CanvasGraphics.bitmapFill,openfl_display__$internal_CanvasGraphics.bitmapRepeat,openfl_display__$internal_CanvasGraphics.bitmapFill.width,openfl_display__$internal_CanvasGraphics.bitmapFill.height); + } + } + var i2 = 0; + var l = ind.get_length(); + var a_; + var b_; + var c_; + var iax; + var iay; + var ibx; + var iby; + var icx; + var icy; + var x1; + var y1; + var x2; + var y2; + var x3; + var y3; + var uvx1; + var uvy1; + var uvx2; + var uvy2; + var uvx3; + var uvy3; + var denom; + var t1; + var t2; + var t3; + var t4; + var dx; + var dy; + while(i2 < l) { + a_ = i2; + b_ = i2 + 1; + c_ = i2 + 2; + iax = ind.get(a_) * 2; + iay = ind.get(a_) * 2 + 1; + ibx = ind.get(b_) * 2; + iby = ind.get(b_) * 2 + 1; + icx = ind.get(c_) * 2; + icy = ind.get(c_) * 2 + 1; + x1 = v.get(iax) - offsetX; + y1 = v.get(iay) - offsetY; + x2 = v.get(ibx) - offsetX; + y2 = v.get(iby) - offsetY; + x3 = v.get(icx) - offsetX; + y3 = v.get(icy) - offsetY; + switch(c11.buffer.o[c11.oPos + 3]) { + case 0: + if((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1) < 0) { + i2 += 3; + continue; + } + break; + case 2: + if(!((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1) < 0)) { + i2 += 3; + continue; + } + break; + default: + } + if(colorFill) { + openfl_display__$internal_CanvasGraphics.context.beginPath(); + openfl_display__$internal_CanvasGraphics.context.moveTo(x1,y1); + openfl_display__$internal_CanvasGraphics.context.lineTo(x2,y2); + openfl_display__$internal_CanvasGraphics.context.lineTo(x3,y3); + openfl_display__$internal_CanvasGraphics.context.closePath(); + if(!openfl_display__$internal_CanvasGraphics.hitTesting) { + openfl_display__$internal_CanvasGraphics.context.fill(openfl_display__$internal_CanvasGraphics.windingRule); + } + i2 += 3; + continue; + } + uvx1 = uvt.get(iax) * pattern.width; + uvx2 = uvt.get(ibx) * pattern.width; + uvx3 = uvt.get(icx) * pattern.width; + uvy1 = uvt.get(iay) * pattern.height; + uvy2 = uvt.get(iby) * pattern.height; + uvy3 = uvt.get(icy) * pattern.height; + denom = uvx1 * (uvy3 - uvy2) - uvx2 * uvy3 + uvx3 * uvy2 + (uvx2 - uvx3) * uvy1; + if(denom == 0) { + i2 += 3; + openfl_display__$internal_CanvasGraphics.context.restore(); + continue; + } + openfl_display__$internal_CanvasGraphics.context.save(); + openfl_display__$internal_CanvasGraphics.context.beginPath(); + openfl_display__$internal_CanvasGraphics.context.moveTo(x1,y1); + openfl_display__$internal_CanvasGraphics.context.lineTo(x2,y2); + openfl_display__$internal_CanvasGraphics.context.lineTo(x3,y3); + openfl_display__$internal_CanvasGraphics.context.closePath(); + openfl_display__$internal_CanvasGraphics.context.clip(); + t1 = -(uvy1 * (x3 - x2) - uvy2 * x3 + uvy3 * x2 + (uvy2 - uvy3) * x1) / denom; + t2 = (uvy2 * y3 + uvy1 * (y2 - y3) - uvy3 * y2 + (uvy3 - uvy2) * y1) / denom; + t3 = (uvx1 * (x3 - x2) - uvx2 * x3 + uvx3 * x2 + (uvx2 - uvx3) * x1) / denom; + t4 = -(uvx2 * y3 + uvx1 * (y2 - y3) - uvx3 * y2 + (uvx3 - uvx2) * y1) / denom; + dx = (uvx1 * (uvy3 * x2 - uvy2 * x3) + uvy1 * (uvx2 * x3 - uvx3 * x2) + (uvx3 * uvy2 - uvx2 * uvy3) * x1) / denom; + dy = (uvx1 * (uvy3 * y2 - uvy2 * y3) + uvy1 * (uvx2 * y3 - uvx3 * y2) + (uvx3 * uvy2 - uvx2 * uvy3) * y1) / denom; + openfl_display__$internal_CanvasGraphics.context.transform(t1,t2,t3,t4,dx,dy); + openfl_display__$internal_CanvasGraphics.context.drawImage(pattern,0,0,pattern.width,pattern.height); + openfl_display__$internal_CanvasGraphics.context.restore(); + i2 += 3; + } + break; + case 14: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE; + var c12 = data; + if(stroke && openfl_display__$internal_CanvasGraphics.hasStroke) { + openfl_display__$internal_CanvasGraphics.closePath(true); + } + openfl_display__$internal_CanvasGraphics.context.moveTo(positionX - offsetX,positionY - offsetY); + if(c12.buffer.o[c12.oPos].readable) { + openfl_display__$internal_CanvasGraphics.context.strokeStyle = openfl_display__$internal_CanvasGraphics.createBitmapFill(c12.buffer.o[c12.oPos],c12.buffer.b[c12.bPos],c12.buffer.b[c12.bPos + 1]); + } else { + var tmp3 = StringTools.hex(0,6); + openfl_display__$internal_CanvasGraphics.context.strokeStyle = "#" + tmp3; + } + openfl_display__$internal_CanvasGraphics.hasStroke = true; + break; + case 15: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE; + var c13 = data; + if(stroke && openfl_display__$internal_CanvasGraphics.hasStroke) { + openfl_display__$internal_CanvasGraphics.closePath(true); + } + openfl_display__$internal_CanvasGraphics.context.moveTo(positionX - offsetX,positionY - offsetY); + openfl_display__$internal_CanvasGraphics.context.strokeStyle = openfl_display__$internal_CanvasGraphics.createGradientPattern(c13.buffer.o[c13.oPos],c13.buffer.ii[c13.iiPos],c13.buffer.ff[c13.ffPos],c13.buffer.ii[c13.iiPos + 1],c13.buffer.o[c13.oPos + 1],c13.buffer.o[c13.oPos + 2],c13.buffer.o[c13.oPos + 3],c13.buffer.f[c13.fPos]); + openfl_display__$internal_CanvasGraphics.setSmoothing(true); + openfl_display__$internal_CanvasGraphics.hasStroke = true; + break; + case 16: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE; + var c14 = data; + if(stroke && openfl_display__$internal_CanvasGraphics.hasStroke) { + openfl_display__$internal_CanvasGraphics.closePath(true); + } + openfl_display__$internal_CanvasGraphics.context.moveTo(positionX - offsetX,positionY - offsetY); + if(c14.buffer.o[c14.oPos] == null) { + openfl_display__$internal_CanvasGraphics.hasStroke = false; + } else { + openfl_display__$internal_CanvasGraphics.context.lineWidth = c14.buffer.o[c14.oPos] > 0 ? c14.buffer.o[c14.oPos] : 1; + var tmp4 = c14.buffer.o[c14.oPos + 3] == null ? "round" : (c14.buffer.o[c14.oPos + 3] == null ? "null" : openfl_display_JointStyle.toString(c14.buffer.o[c14.oPos + 3])).toLowerCase(); + openfl_display__$internal_CanvasGraphics.context.lineJoin = tmp4; + var tmp5 = c14.buffer.o[c14.oPos + 2] == null ? "round" : c14.buffer.o[c14.oPos + 2] == 0 ? "butt" : (c14.buffer.o[c14.oPos + 2] == null ? "null" : openfl_display_CapsStyle.toString(c14.buffer.o[c14.oPos + 2])).toLowerCase(); + openfl_display__$internal_CanvasGraphics.context.lineCap = tmp5; + openfl_display__$internal_CanvasGraphics.context.miterLimit = c14.buffer.f[c14.fPos + 1]; + if(c14.buffer.f[c14.fPos] == 1) { + var tmp6 = StringTools.hex(c14.buffer.i[c14.iPos] & 16777215,6); + openfl_display__$internal_CanvasGraphics.context.strokeStyle = "#" + tmp6; + } else { + r = (c14.buffer.i[c14.iPos] & 16711680) >>> 16; + g = (c14.buffer.i[c14.iPos] & 65280) >>> 8; + b = c14.buffer.i[c14.iPos] & 255; + openfl_display__$internal_CanvasGraphics.context.strokeStyle = "rgba(" + r + ", " + g + ", " + b + ", " + c14.buffer.f[c14.fPos] + ")"; + } + openfl_display__$internal_CanvasGraphics.setSmoothing(true); + openfl_display__$internal_CanvasGraphics.hasStroke = true; + } + break; + case 17: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_TO; + var c15 = data; + hasPath = true; + openfl_display__$internal_CanvasGraphics.context.lineTo(c15.buffer.f[c15.fPos] - offsetX,c15.buffer.f[c15.fPos + 1] - offsetY); + positionX = c15.buffer.f[c15.fPos]; + positionY = c15.buffer.f[c15.fPos + 1]; + if(positionX == startX && positionY == startY) { + closeGap = true; + } + break; + case 18: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO; + var c16 = data; + openfl_display__$internal_CanvasGraphics.context.moveTo(c16.buffer.f[c16.fPos] - offsetX,c16.buffer.f[c16.fPos + 1] - offsetY); + positionX = c16.buffer.f[c16.fPos]; + positionY = c16.buffer.f[c16.fPos + 1]; + if(setStart && c16.buffer.f[c16.fPos] != startX && c16.buffer.f[c16.fPos + 1] != startY) { + closeGap = true; + } + startX = c16.buffer.f[c16.fPos]; + startY = c16.buffer.f[c16.fPos + 1]; + setStart = true; + break; + case 21: + openfl_display__$internal_CanvasGraphics.windingRule = "evenodd"; + break; + case 22: + openfl_display__$internal_CanvasGraphics.windingRule = "nonzero"; + break; + default: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + } + } + if(stl != null) { + openfl_geom_Point.__pool.release(stl); + } + if(sbr != null) { + openfl_geom_Point.__pool.release(sbr); + } + data.destroy(); + if(hasPath) { + if(stroke && openfl_display__$internal_CanvasGraphics.hasStroke) { + if(openfl_display__$internal_CanvasGraphics.hasFill) { + if(positionX != startX || positionY != startY) { + openfl_display__$internal_CanvasGraphics.context.lineTo(startX - offsetX,startY - offsetY); + closeGap = true; + } + if(closeGap) { + openfl_display__$internal_CanvasGraphics.closePath(true); + } + } else if(closeGap && positionX == startX && positionY == startY) { + openfl_display__$internal_CanvasGraphics.closePath(true); + } + if(!openfl_display__$internal_CanvasGraphics.hitTesting) { + openfl_display__$internal_CanvasGraphics.context.stroke(); + } + } + if(!stroke) { + if(openfl_display__$internal_CanvasGraphics.hasFill || openfl_display__$internal_CanvasGraphics.bitmapFill != null) { + openfl_display__$internal_CanvasGraphics.context.translate(-openfl_display__$internal_CanvasGraphics.bounds.x,-openfl_display__$internal_CanvasGraphics.bounds.y); + if(openfl_display__$internal_CanvasGraphics.pendingMatrix != null) { + openfl_display__$internal_CanvasGraphics.context.transform(openfl_display__$internal_CanvasGraphics.pendingMatrix.a,openfl_display__$internal_CanvasGraphics.pendingMatrix.b,openfl_display__$internal_CanvasGraphics.pendingMatrix.c,openfl_display__$internal_CanvasGraphics.pendingMatrix.d,openfl_display__$internal_CanvasGraphics.pendingMatrix.tx,openfl_display__$internal_CanvasGraphics.pendingMatrix.ty); + if(!openfl_display__$internal_CanvasGraphics.hitTesting) { + openfl_display__$internal_CanvasGraphics.context.fill(openfl_display__$internal_CanvasGraphics.windingRule); + } + openfl_display__$internal_CanvasGraphics.context.transform(openfl_display__$internal_CanvasGraphics.inversePendingMatrix.a,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.b,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.c,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.d,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.tx,openfl_display__$internal_CanvasGraphics.inversePendingMatrix.ty); + } else if(!openfl_display__$internal_CanvasGraphics.hitTesting) { + openfl_display__$internal_CanvasGraphics.context.fill(openfl_display__$internal_CanvasGraphics.windingRule); + } + openfl_display__$internal_CanvasGraphics.context.translate(openfl_display__$internal_CanvasGraphics.bounds.x,openfl_display__$internal_CanvasGraphics.bounds.y); + openfl_display__$internal_CanvasGraphics.context.closePath(); + } + } + } +}; +openfl_display__$internal_CanvasGraphics.render = function(graphics,renderer) { + var pixelRatio = renderer.__pixelRatio; + graphics.__update(renderer.__worldTransform,pixelRatio); + if(graphics.__softwareDirty) { + openfl_display__$internal_CanvasGraphics.hitTesting = false; + openfl_display__$internal_CanvasGraphics.graphics = graphics; + openfl_display__$internal_CanvasGraphics.allowSmoothing = renderer.__allowSmoothing; + openfl_display__$internal_CanvasGraphics.worldAlpha = renderer.__getAlpha(graphics.__owner.__worldAlpha); + openfl_display__$internal_CanvasGraphics.bounds = graphics.__bounds; + var width = graphics.__width; + var height = graphics.__height; + if(!graphics.__visible || graphics.__commands.get_length() == 0 || openfl_display__$internal_CanvasGraphics.bounds == null || width < 1 || height < 1) { + graphics.__canvas = null; + graphics.__context = null; + graphics.__bitmap = null; + } else { + if(graphics.__canvas == null) { + graphics.__canvas = window.document.createElement("canvas"); + graphics.__context = graphics.__canvas.getContext("2d"); + } + openfl_display__$internal_CanvasGraphics.context = graphics.__context; + var transform = graphics.__renderTransform; + var canvas = graphics.__canvas; + var scale = renderer.__pixelRatio; + var scaledWidth = width * scale | 0; + var scaledHeight = height * scale | 0; + renderer.__setBlendModeContext(openfl_display__$internal_CanvasGraphics.context,10); + if(renderer.__isDOM) { + if(canvas.width == scaledWidth && canvas.height == scaledHeight) { + openfl_display__$internal_CanvasGraphics.context.clearRect(0,0,scaledWidth,scaledHeight); + } else { + canvas.width = scaledWidth; + canvas.height = scaledHeight; + canvas.style.width = width + "px"; + canvas.style.height = height + "px"; + } + var transform1 = graphics.__renderTransform; + openfl_display__$internal_CanvasGraphics.context.setTransform(transform1.a * scale,transform1.b * scale,transform1.c * scale,transform1.d * scale,transform1.tx * scale,transform1.ty * scale); + } else { + if(canvas.width == scaledWidth && canvas.height == scaledHeight) { + openfl_display__$internal_CanvasGraphics.context.closePath(); + openfl_display__$internal_CanvasGraphics.context.setTransform(1,0,0,1,0,0); + openfl_display__$internal_CanvasGraphics.context.clearRect(0,0,scaledWidth,scaledHeight); + } else { + canvas.width = width; + canvas.height = height; + } + openfl_display__$internal_CanvasGraphics.context.setTransform(transform.a,transform.b,transform.c,transform.d,transform.tx,transform.ty); + } + openfl_display__$internal_CanvasGraphics.fillCommands.clear(); + openfl_display__$internal_CanvasGraphics.strokeCommands.clear(); + openfl_display__$internal_CanvasGraphics.hasFill = false; + openfl_display__$internal_CanvasGraphics.hasStroke = false; + openfl_display__$internal_CanvasGraphics.bitmapFill = null; + openfl_display__$internal_CanvasGraphics.bitmapRepeat = false; + var hasLineStyle = false; + var initStrokeX = 0.0; + var initStrokeY = 0.0; + openfl_display__$internal_CanvasGraphics.windingRule = "evenodd"; + var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands); + var _g = 0; + var _g1 = graphics.__commands.types; + while(_g < _g1.length) { + var type = _g1[_g]; + ++_g; + switch(type._hx_index) { + case 0:case 1:case 2:case 3: + openfl_display__$internal_CanvasGraphics.endFill(); + openfl_display__$internal_CanvasGraphics.endStroke(); + if(type == openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL) { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL; + var c = data; + openfl_display__$internal_CanvasGraphics.fillCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]); + openfl_display__$internal_CanvasGraphics.strokeCommands.beginBitmapFill(c.buffer.o[c.oPos],c.buffer.o[c.oPos + 1],c.buffer.b[c.bPos],c.buffer.b[c.bPos + 1]); + } else if(type == openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL) { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL; + var c1 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]); + openfl_display__$internal_CanvasGraphics.strokeCommands.beginGradientFill(c1.buffer.o[c1.oPos],c1.buffer.ii[c1.iiPos],c1.buffer.ff[c1.ffPos],c1.buffer.ii[c1.iiPos + 1],c1.buffer.o[c1.oPos + 1],c1.buffer.o[c1.oPos + 2],c1.buffer.o[c1.oPos + 3],c1.buffer.f[c1.fPos]); + } else if(type == openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL) { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL; + var c2 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.beginShaderFill(c2.buffer.o[c2.oPos]); + openfl_display__$internal_CanvasGraphics.strokeCommands.beginShaderFill(c2.buffer.o[c2.oPos]); + } else { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL; + var c3 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.beginFill(c3.buffer.i[c3.iPos],c3.buffer.f[c3.fPos]); + openfl_display__$internal_CanvasGraphics.strokeCommands.beginFill(c3.buffer.i[c3.iPos],c3.buffer.f[c3.fPos]); + } + break; + case 4: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO; + var c4 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]); + if(hasLineStyle) { + openfl_display__$internal_CanvasGraphics.strokeCommands.cubicCurveTo(c4.buffer.f[c4.fPos],c4.buffer.f[c4.fPos + 1],c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3],c4.buffer.f[c4.fPos + 4],c4.buffer.f[c4.fPos + 5]); + } else { + initStrokeX = c4.buffer.f[c4.fPos + 4]; + initStrokeY = c4.buffer.f[c4.fPos + 5]; + } + break; + case 5: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO; + var c5 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]); + if(hasLineStyle) { + openfl_display__$internal_CanvasGraphics.strokeCommands.curveTo(c5.buffer.f[c5.fPos],c5.buffer.f[c5.fPos + 1],c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3]); + } else { + initStrokeX = c5.buffer.f[c5.fPos + 2]; + initStrokeY = c5.buffer.f[c5.fPos + 3]; + } + break; + case 6: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE; + var c6 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]); + if(hasLineStyle) { + openfl_display__$internal_CanvasGraphics.strokeCommands.drawCircle(c6.buffer.f[c6.fPos],c6.buffer.f[c6.fPos + 1],c6.buffer.f[c6.fPos + 2]); + } + break; + case 7: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE; + var c7 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]); + if(hasLineStyle) { + openfl_display__$internal_CanvasGraphics.strokeCommands.drawEllipse(c7.buffer.f[c7.fPos],c7.buffer.f[c7.fPos + 1],c7.buffer.f[c7.fPos + 2],c7.buffer.f[c7.fPos + 3]); + } + break; + case 8: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS; + var c8 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.drawQuads(c8.buffer.o[c8.oPos],c8.buffer.o[c8.oPos + 1],c8.buffer.o[c8.oPos + 2]); + break; + case 9: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT; + var c9 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]); + if(hasLineStyle) { + openfl_display__$internal_CanvasGraphics.strokeCommands.drawRect(c9.buffer.f[c9.fPos],c9.buffer.f[c9.fPos + 1],c9.buffer.f[c9.fPos + 2],c9.buffer.f[c9.fPos + 3]); + } + break; + case 10: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT; + var c10 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]); + if(hasLineStyle) { + openfl_display__$internal_CanvasGraphics.strokeCommands.drawRoundRect(c10.buffer.f[c10.fPos],c10.buffer.f[c10.fPos + 1],c10.buffer.f[c10.fPos + 2],c10.buffer.f[c10.fPos + 3],c10.buffer.f[c10.fPos + 4],c10.buffer.o[c10.oPos]); + } + break; + case 12: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES; + var c11 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.drawTriangles(c11.buffer.o[c11.oPos],c11.buffer.o[c11.oPos + 1],c11.buffer.o[c11.oPos + 2],c11.buffer.o[c11.oPos + 3]); + break; + case 13: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.END_FILL; + var this1 = data; + openfl_display__$internal_CanvasGraphics.endFill(); + openfl_display__$internal_CanvasGraphics.endStroke(); + openfl_display__$internal_CanvasGraphics.hasFill = false; + openfl_display__$internal_CanvasGraphics.bitmapFill = null; + initStrokeX = 0; + initStrokeY = 0; + break; + case 14: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE; + var c12 = data; + if(!hasLineStyle && (initStrokeX != 0 || initStrokeY != 0)) { + openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY); + initStrokeX = 0; + initStrokeY = 0; + } + hasLineStyle = true; + openfl_display__$internal_CanvasGraphics.strokeCommands.lineBitmapStyle(c12.buffer.o[c12.oPos],c12.buffer.o[c12.oPos + 1],c12.buffer.b[c12.bPos],c12.buffer.b[c12.bPos + 1]); + break; + case 15: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE; + var c13 = data; + if(!hasLineStyle && (initStrokeX != 0 || initStrokeY != 0)) { + openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY); + initStrokeX = 0; + initStrokeY = 0; + } + hasLineStyle = true; + openfl_display__$internal_CanvasGraphics.strokeCommands.lineGradientStyle(c13.buffer.o[c13.oPos],c13.buffer.ii[c13.iiPos],c13.buffer.ff[c13.ffPos],c13.buffer.ii[c13.iiPos + 1],c13.buffer.o[c13.oPos + 1],c13.buffer.o[c13.oPos + 2],c13.buffer.o[c13.oPos + 3],c13.buffer.f[c13.fPos]); + break; + case 16: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE; + var c14 = data; + if(!hasLineStyle && c14.buffer.o[c14.oPos] != null) { + if(initStrokeX != 0 || initStrokeY != 0) { + openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(initStrokeX,initStrokeY); + initStrokeX = 0; + initStrokeY = 0; + } + } + hasLineStyle = c14.buffer.o[c14.oPos] != null; + openfl_display__$internal_CanvasGraphics.strokeCommands.lineStyle(c14.buffer.o[c14.oPos],c14.buffer.i[c14.iPos],c14.buffer.f[c14.fPos],c14.buffer.b[c14.bPos],c14.buffer.o[c14.oPos + 1],c14.buffer.o[c14.oPos + 2],c14.buffer.o[c14.oPos + 3],c14.buffer.f[c14.fPos + 1]); + break; + case 17: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_TO; + var c15 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.lineTo(c15.buffer.f[c15.fPos],c15.buffer.f[c15.fPos + 1]); + if(hasLineStyle) { + openfl_display__$internal_CanvasGraphics.strokeCommands.lineTo(c15.buffer.f[c15.fPos],c15.buffer.f[c15.fPos + 1]); + } else { + initStrokeX = c15.buffer.f[c15.fPos]; + initStrokeY = c15.buffer.f[c15.fPos + 1]; + } + break; + case 18: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO; + var c16 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.moveTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]); + if(hasLineStyle) { + openfl_display__$internal_CanvasGraphics.strokeCommands.moveTo(c16.buffer.f[c16.fPos],c16.buffer.f[c16.fPos + 1]); + } else { + initStrokeX = c16.buffer.f[c16.fPos]; + initStrokeY = c16.buffer.f[c16.fPos + 1]; + } + break; + case 19: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE; + var c17 = data; + renderer.__setBlendModeContext(openfl_display__$internal_CanvasGraphics.context,c17.buffer.o[c17.oPos]); + break; + case 21: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD; + var this2 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.windingEvenOdd(); + openfl_display__$internal_CanvasGraphics.windingRule = "evenodd"; + break; + case 22: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO; + var this3 = data; + openfl_display__$internal_CanvasGraphics.fillCommands.windingNonZero(); + openfl_display__$internal_CanvasGraphics.windingRule = "nonzero"; + break; + default: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + } + } + if(openfl_display__$internal_CanvasGraphics.fillCommands.get_length() > 0) { + openfl_display__$internal_CanvasGraphics.endFill(); + } + if(openfl_display__$internal_CanvasGraphics.strokeCommands.get_length() > 0) { + openfl_display__$internal_CanvasGraphics.endStroke(); + } + data.destroy(); + graphics.__bitmap = openfl_display_BitmapData.fromCanvas(graphics.__canvas); + } + graphics.__softwareDirty = false; + graphics.set___dirty(false); + openfl_display__$internal_CanvasGraphics.graphics = null; + } +}; +openfl_display__$internal_CanvasGraphics.renderMask = function(graphics,renderer) { + if(graphics.__commands.get_length() != 0) { + openfl_display__$internal_CanvasGraphics.context = renderer.context; + var positionX = 0.0; + var positionY = 0.0; + var offsetX = 0; + var offsetY = 0; + var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands); + var x; + var y; + var width; + var height; + var kappa = 0.5522848; + var ox; + var oy; + var xe; + var ye; + var xm; + var ym; + var _g = 0; + var _g1 = graphics.__commands.types; + while(_g < _g1.length) { + var type = _g1[_g]; + ++_g; + switch(type._hx_index) { + case 4: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO; + var c = data; + openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(c.buffer.f[c.fPos] - offsetX,c.buffer.f[c.fPos + 1] - offsetY,c.buffer.f[c.fPos + 2] - offsetX,c.buffer.f[c.fPos + 3] - offsetY,c.buffer.f[c.fPos + 4] - offsetX,c.buffer.f[c.fPos + 5] - offsetY); + positionX = c.buffer.f[c.fPos + 4]; + positionY = c.buffer.f[c.fPos + 5]; + break; + case 5: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.CURVE_TO; + var c1 = data; + openfl_display__$internal_CanvasGraphics.context.quadraticCurveTo(c1.buffer.f[c1.fPos] - offsetX,c1.buffer.f[c1.fPos + 1] - offsetY,c1.buffer.f[c1.fPos + 2] - offsetX,c1.buffer.f[c1.fPos + 3] - offsetY); + positionX = c1.buffer.f[c1.fPos + 2]; + positionY = c1.buffer.f[c1.fPos + 3]; + break; + case 6: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE; + var c2 = data; + openfl_display__$internal_CanvasGraphics.context.arc(c2.buffer.f[c2.fPos] - offsetX,c2.buffer.f[c2.fPos + 1] - offsetY,c2.buffer.f[c2.fPos + 2],0,Math.PI * 2,true); + break; + case 7: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE; + var c3 = data; + x = c3.buffer.f[c3.fPos]; + y = c3.buffer.f[c3.fPos + 1]; + width = c3.buffer.f[c3.fPos + 2]; + height = c3.buffer.f[c3.fPos + 3]; + x -= offsetX; + y -= offsetY; + ox = width / 2 * kappa; + oy = height / 2 * kappa; + xe = x + width; + ye = y + height; + xm = x + width / 2; + ym = y + height / 2; + openfl_display__$internal_CanvasGraphics.context.moveTo(x,ym); + openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(x,ym - oy,xm - ox,y,xm,y); + openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm + ox,y,xe,ym - oy,xe,ym); + openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xe,ym + oy,xm + ox,ye,xm,ye); + openfl_display__$internal_CanvasGraphics.context.bezierCurveTo(xm - ox,ye,x,ym + oy,x,ym); + break; + case 9: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT; + var c4 = data; + openfl_display__$internal_CanvasGraphics.context.beginPath(); + openfl_display__$internal_CanvasGraphics.context.rect(c4.buffer.f[c4.fPos] - offsetX,c4.buffer.f[c4.fPos + 1] - offsetY,c4.buffer.f[c4.fPos + 2],c4.buffer.f[c4.fPos + 3]); + openfl_display__$internal_CanvasGraphics.context.closePath(); + break; + case 10: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT; + var c5 = data; + openfl_display__$internal_CanvasGraphics.drawRoundRect(c5.buffer.f[c5.fPos] - offsetX,c5.buffer.f[c5.fPos + 1] - offsetY,c5.buffer.f[c5.fPos + 2],c5.buffer.f[c5.fPos + 3],c5.buffer.f[c5.fPos + 4],c5.buffer.o[c5.oPos]); + break; + case 17: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.LINE_TO; + var c6 = data; + openfl_display__$internal_CanvasGraphics.context.lineTo(c6.buffer.f[c6.fPos] - offsetX,c6.buffer.f[c6.fPos + 1] - offsetY); + positionX = c6.buffer.f[c6.fPos]; + positionY = c6.buffer.f[c6.fPos + 1]; + break; + case 18: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO; + var c7 = data; + openfl_display__$internal_CanvasGraphics.context.moveTo(c7.buffer.f[c7.fPos] - offsetX,c7.buffer.f[c7.fPos + 1] - offsetY); + positionX = c7.buffer.f[c7.fPos]; + positionY = c7.buffer.f[c7.fPos + 1]; + break; + default: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + } + } + data.destroy(); + } +}; +openfl_display__$internal_CanvasGraphics.setSmoothing = function(smooth) { + if(!openfl_display__$internal_CanvasGraphics.allowSmoothing) { + smooth = false; + } + if(openfl_display__$internal_CanvasGraphics.context.imageSmoothingEnabled != smooth) { + openfl_display__$internal_CanvasGraphics.context.imageSmoothingEnabled = smooth; + } +}; +var openfl_display__$internal_CanvasShape = function() { }; +$hxClasses["openfl.display._internal.CanvasShape"] = openfl_display__$internal_CanvasShape; +openfl_display__$internal_CanvasShape.__name__ = "openfl.display._internal.CanvasShape"; +openfl_display__$internal_CanvasShape.render = function(shape,renderer) { + if(!shape.__renderable) { + return; + } + var alpha = renderer.__getAlpha(shape.__worldAlpha); + if(alpha <= 0) { + return; + } + var graphics = shape.__graphics; + if(graphics != null) { + openfl_display__$internal_CanvasGraphics.render(graphics,renderer); + var width = graphics.__width; + var height = graphics.__height; + var canvas = graphics.__canvas; + if(canvas != null && graphics.__visible && width >= 1 && height >= 1) { + var transform = graphics.__worldTransform; + var context = renderer.context; + var scrollRect = shape.__scrollRect; + var scale9Grid = shape.__worldScale9Grid; + if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) { + renderer.__setBlendMode(shape.__worldBlendMode); + renderer.__pushMaskObject(shape); + context.globalAlpha = alpha; + if(scale9Grid != null && transform.b == 0 && transform.c == 0) { + var pixelRatio = renderer.__pixelRatio; + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.translate(transform.tx,transform.ty); + renderer.setTransform(matrix,context); + openfl_geom_Matrix.__pool.release(matrix); + var bounds = graphics.__bounds; + var scaleX = graphics.__renderTransform.a / graphics.__bitmapScale; + var scaleY = graphics.__renderTransform.d / graphics.__bitmapScale; + var renderScaleX = scaleX * transform.a; + var renderScaleY = scaleY * transform.d; + var left = Math.max(1,Math.round(scale9Grid.x * scaleX)); + var top = Math.round(scale9Grid.y * scaleY); + var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX)); + var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY); + var centerWidth = Math.round(scale9Grid.width * scaleX); + var centerHeight = Math.round(scale9Grid.height * scaleY); + var renderLeft = Math.round(left / pixelRatio); + var renderTop = Math.round(top / pixelRatio); + var renderRight = Math.round(right / pixelRatio); + var renderBottom = Math.round(bottom / pixelRatio); + var renderCenterWidth = bounds.width * renderScaleX - renderLeft - renderRight; + var renderCenterHeight = bounds.height * renderScaleY - renderTop - renderBottom; + renderer.applySmoothing(context,false); + if(centerWidth != 0 && centerHeight != 0) { + context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop); + context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop); + context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop); + context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight); + context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight); + context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom); + context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom); + context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom); + } else if(centerWidth == 0 && centerHeight != 0) { + var renderWidth = renderLeft + renderCenterWidth + renderRight; + context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop); + context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom); + } else if(centerHeight == 0 && centerWidth != 0) { + var renderHeight = renderTop + renderCenterHeight + renderBottom; + context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight); + context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight); + context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight); + } + } else { + renderer.setTransform(transform,context); + context.drawImage(canvas,0,0,width,height); + } + renderer.__popMaskObject(shape); + } + } + } +}; +var openfl_display__$internal_CanvasSimpleButton = function() { }; +$hxClasses["openfl.display._internal.CanvasSimpleButton"] = openfl_display__$internal_CanvasSimpleButton; +openfl_display__$internal_CanvasSimpleButton.__name__ = "openfl.display._internal.CanvasSimpleButton"; +openfl_display__$internal_CanvasSimpleButton.renderDrawable = function(simpleButton,renderer) { + if(!simpleButton.__renderable || simpleButton.__worldAlpha <= 0 || simpleButton.__currentState == null) { + return; + } + renderer.__pushMaskObject(simpleButton); + renderer.__renderDrawable(simpleButton.__currentState); + renderer.__popMaskObject(simpleButton); + renderer.__renderEvent(simpleButton); +}; +openfl_display__$internal_CanvasSimpleButton.renderDrawableMask = function(simpleButton,renderer) { + renderer.__renderDrawableMask(simpleButton.__currentState); +}; +var openfl_display__$internal_CanvasTextField = function() { }; +$hxClasses["openfl.display._internal.CanvasTextField"] = openfl_display__$internal_CanvasTextField; +openfl_display__$internal_CanvasTextField.__name__ = "openfl.display._internal.CanvasTextField"; +openfl_display__$internal_CanvasTextField.render = function(textField,renderer,transform) { + var textEngine = textField.__textEngine; + var useTextBounds = !(textEngine.background || textEngine.border); + var bounds = useTextBounds ? textEngine.textBounds : textEngine.bounds; + var graphics = textField.__graphics; + var cursorOffsetX = 0.0; + if(textField.__dirty) { + textField.__updateLayout(); + if(graphics.__bounds == null) { + graphics.__bounds = new openfl_geom_Rectangle(); + } + if(textField.get_text().length == 0) { + var boundsWidth = textEngine.bounds.width - 4; + var align = textField.get_defaultTextFormat().align; + cursorOffsetX = align == 3 ? 0 : align == 4 ? boundsWidth : boundsWidth / 2; + switch(align) { + case 0: + cursorOffsetX += textField.get_defaultTextFormat().leftMargin / 2; + cursorOffsetX -= textField.get_defaultTextFormat().rightMargin / 2; + cursorOffsetX += textField.get_defaultTextFormat().indent / 2; + cursorOffsetX += textField.get_defaultTextFormat().blockIndent / 2; + break; + case 1: + break; + case 2: + cursorOffsetX += textField.get_defaultTextFormat().leftMargin; + cursorOffsetX += textField.get_defaultTextFormat().indent; + cursorOffsetX += textField.get_defaultTextFormat().blockIndent; + break; + case 3: + cursorOffsetX += textField.get_defaultTextFormat().leftMargin; + cursorOffsetX += textField.get_defaultTextFormat().indent; + cursorOffsetX += textField.get_defaultTextFormat().blockIndent; + break; + case 4: + cursorOffsetX -= textField.get_defaultTextFormat().rightMargin; + break; + case 5: + break; + } + if(useTextBounds) { + bounds.y = textEngine.bounds.y; + bounds.x = cursorOffsetX; + } + } + graphics.__bounds.copyFrom(bounds); + } + var pixelRatio = renderer.__pixelRatio; + graphics.__update(renderer.__worldTransform,pixelRatio); + if(textField.__dirty || graphics.__softwareDirty) { + var width = Math.round(graphics.__width * pixelRatio); + var height = Math.round(graphics.__height * pixelRatio); + if((textEngine.text == null || textEngine.text == "") && !textEngine.background && !textEngine.border && !textEngine.__hasFocus && (textEngine.type != 1 || !textEngine.selectable) || (textEngine.width <= 0 || textEngine.height <= 0) && textEngine.autoSize != 2) { + textField.__graphics.__canvas = null; + textField.__graphics.__context = null; + textField.__graphics.__bitmap = null; + textField.__graphics.__softwareDirty = false; + textField.__graphics.set___dirty(false); + textField.__dirty = false; + } else { + if(textField.__graphics.__canvas == null) { + textField.__graphics.__canvas = window.document.createElement("canvas"); + textField.__graphics.__context = textField.__graphics.__canvas.getContext("2d"); + } + openfl_display__$internal_CanvasTextField.context = graphics.__context; + graphics.__canvas.width = width; + graphics.__canvas.height = height; + if(renderer.__isDOM) { + graphics.__canvas.style.width = Math.round(width / pixelRatio) + "px"; + graphics.__canvas.style.height = Math.round(height / pixelRatio) + "px"; + } + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.scale(pixelRatio,pixelRatio); + matrix.concat(graphics.__renderTransform); + openfl_display__$internal_CanvasTextField.context.setTransform(matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty); + openfl_geom_Matrix.__pool.release(matrix); + if(openfl_display__$internal_CanvasTextField.clearRect == null) { + openfl_display__$internal_CanvasTextField.clearRect = (typeof navigator !== 'undefined' && typeof navigator['isCocoonJS'] !== 'undefined'); + } + if(openfl_display__$internal_CanvasTextField.clearRect) { + openfl_display__$internal_CanvasTextField.context.clearRect(0,0,graphics.__canvas.width,graphics.__canvas.height); + } + if(textEngine.text != null && textEngine.text != "" || textEngine.__hasFocus) { + var text = textEngine.text; + if(!renderer.__allowSmoothing || textEngine.antiAliasType == 0 && textEngine.sharpness == 400) { + graphics.__context.imageSmoothingEnabled = false; + } else { + graphics.__context.imageSmoothingEnabled = true; + } + if(textEngine.border || textEngine.background) { + openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1); + if(textEngine.background) { + var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.fill(); + } + if(textEngine.border) { + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + var tmp = StringTools.hex(textEngine.borderColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.stroke(); + } + } + openfl_display__$internal_CanvasTextField.context.textBaseline = "alphabetic"; + openfl_display__$internal_CanvasTextField.context.textAlign = "start"; + var scrollX = -textField.get_scrollH(); + var scrollY = 0.0; + var _g = 0; + var _g1 = textField.get_scrollV() - 1; + while(_g < _g1) { + var i = _g++; + scrollY -= textEngine.lineHeights.get(i); + } + var advance; + var group = textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(group1.lineIndex < textField.get_scrollV() - 1) { + continue; + } + if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) { + break; + } + var color = "#" + StringTools.hex(group1.format.color & 16777215,6); + openfl_display__$internal_CanvasTextField.context.font = openfl_text__$internal_TextEngine.getFont(group1.format); + openfl_display__$internal_CanvasTextField.context.fillStyle = color; + openfl_display__$internal_CanvasTextField.context.fillText(text.substring(group1.startIndex,group1.endIndex),group1.offsetX + scrollX - bounds.x,group1.offsetY + group1.ascent + scrollY - bounds.y); + if(textField.__caretIndex > -1 && textEngine.selectable) { + if(textField.__selectionIndex == textField.__caretIndex) { + if(textField.__showCursor && group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex) { + advance = 0.0; + var _g = 0; + var _g1 = textField.__caretIndex - group1.startIndex; + while(_g < _g1) { + var i = _g++; + if(group1.positions.length <= i) { + break; + } + advance += group1.positions[i]; + } + var scrollY1 = 0.0; + var _g2 = textField.get_scrollV(); + var _g3 = group1.lineIndex + 1; + while(_g2 < _g3) { + var i1 = _g2++; + scrollY1 += textEngine.lineHeights.get(i1 - 1); + } + openfl_display__$internal_CanvasTextField.context.beginPath(); + var tmp = StringTools.hex(group1.format.color & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.moveTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + 2 - bounds.y); + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + openfl_display__$internal_CanvasTextField.context.lineTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1 - bounds.y); + openfl_display__$internal_CanvasTextField.context.stroke(); + openfl_display__$internal_CanvasTextField.context.closePath(); + } + } else if(group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex || group1.startIndex <= textField.__selectionIndex && group1.endIndex >= textField.__selectionIndex || group1.startIndex > textField.__caretIndex && group1.endIndex < textField.__selectionIndex || group1.startIndex > textField.__selectionIndex && group1.endIndex < textField.__caretIndex) { + var selectionStart = Math.min(textField.__selectionIndex,textField.__caretIndex) | 0; + var selectionEnd = Math.max(textField.__selectionIndex,textField.__caretIndex) | 0; + if(group1.startIndex > selectionStart) { + selectionStart = group1.startIndex; + } + if(group1.endIndex < selectionEnd) { + selectionEnd = group1.endIndex; + } + var end; + var start = textField.getCharBoundaries(selectionStart); + if(selectionEnd >= group1.endIndex) { + end = textField.getCharBoundaries(group1.endIndex - 1); + if(end != null) { + end.x += end.width + 2; + } + } else { + end = textField.getCharBoundaries(selectionEnd); + } + if(start != null && end != null) { + openfl_display__$internal_CanvasTextField.context.fillStyle = "#000000"; + openfl_display__$internal_CanvasTextField.context.fillRect(start.x + scrollX - bounds.x,start.y + scrollY,end.x - start.x,group1.height); + openfl_display__$internal_CanvasTextField.context.fillStyle = "#FFFFFF"; + openfl_display__$internal_CanvasTextField.context.fillText(text.substring(selectionStart,selectionEnd),scrollX + start.x - bounds.x,group1.offsetY + group1.ascent + scrollY); + } + } + } + if(group1.format.underline) { + openfl_display__$internal_CanvasTextField.context.beginPath(); + openfl_display__$internal_CanvasTextField.context.strokeStyle = color; + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + var descent = Math.floor(group1.ascent * 0.185); + var x = group1.offsetX + scrollX - bounds.x; + var y = Math.ceil(group1.offsetY + scrollY + group1.ascent - bounds.y) + descent + 0.5; + openfl_display__$internal_CanvasTextField.context.moveTo(x,y); + openfl_display__$internal_CanvasTextField.context.lineTo(x + group1.width,y); + openfl_display__$internal_CanvasTextField.context.stroke(); + openfl_display__$internal_CanvasTextField.context.closePath(); + } + } + } else { + if(textEngine.border || textEngine.background) { + if(textEngine.border) { + openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1); + } else { + openfl_display__$internal_CanvasTextField.context.rect(0,0,bounds.width,bounds.height); + } + if(textEngine.background) { + var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.fill(); + } + if(textEngine.border) { + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + openfl_display__$internal_CanvasTextField.context.lineCap = "square"; + var tmp = StringTools.hex(textEngine.borderColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.stroke(); + } + } + if(textField.__caretIndex > -1 && textEngine.selectable && textField.__showCursor) { + var scrollX = -textField.get_scrollH() + (useTextBounds ? 0 : cursorOffsetX); + var scrollY = 0.0; + var _g = 0; + var _g1 = textField.get_scrollV() - 1; + while(_g < _g1) { + var i = _g++; + scrollY += textEngine.lineHeights.get(i); + } + openfl_display__$internal_CanvasTextField.context.beginPath(); + var tmp = StringTools.hex(textField.get_defaultTextFormat().color & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.moveTo(scrollX + 2.5,scrollY + 2.5); + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + openfl_display__$internal_CanvasTextField.context.lineTo(scrollX + 2.5,scrollY + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1); + openfl_display__$internal_CanvasTextField.context.stroke(); + openfl_display__$internal_CanvasTextField.context.closePath(); + } + } + graphics.__bitmap = openfl_display_BitmapData.fromCanvas(textField.__graphics.__canvas); + graphics.__bitmapScale = pixelRatio; + graphics.__visible = true; + textField.__dirty = false; + graphics.__softwareDirty = false; + graphics.set___dirty(false); + } + } +}; +openfl_display__$internal_CanvasTextField.renderDrawable = function(textField,renderer) { + if(renderer.__isDOM && !textField.__renderedOnCanvasWhileOnDOM) { + textField.__renderedOnCanvasWhileOnDOM = true; + if(textField.get_type() == 1) { + textField.replaceText(0,textField.__text.length,textField.__text); + } + if(textField.__isHTML) { + textField.__updateText(openfl_text__$internal_HTMLParser.parse(textField.__text,textField.get_multiline(),textField.__styleSheet,textField.__textFormat,textField.__textEngine.textFormatRanges)); + } + textField.__dirty = true; + textField.__layoutDirty = true; + if(!textField.__renderDirty) { + textField.__renderDirty = true; + textField.__setParentRenderDirty(); + } + } + if(textField.get_mask() == null || textField.get_mask().get_width() > 0 && textField.get_mask().get_height() > 0) { + renderer.__updateCacheBitmap(textField,textField.__dirty); + if(textField.__cacheBitmap != null && !textField.__isCacheBitmapRender) { + var bitmap = textField.__cacheBitmap; + if(bitmap.__renderable) { + var alpha = renderer.__getAlpha(bitmap.__worldAlpha); + if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) { + var context = renderer.context; + renderer.__setBlendMode(bitmap.__worldBlendMode); + renderer.__pushMaskObject(bitmap,false); + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image); + context.globalAlpha = alpha; + var scrollRect = bitmap.__scrollRect; + renderer.setTransform(bitmap.__renderTransform,context); + if(!renderer.__allowSmoothing || !bitmap.smoothing) { + context.imageSmoothingEnabled = false; + } + if(scrollRect == null) { + context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height); + } else { + context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height); + } + if(!renderer.__allowSmoothing || !bitmap.smoothing) { + context.imageSmoothingEnabled = true; + } + renderer.__popMaskObject(bitmap,false); + } + } + } else { + var transform = textField.__worldTransform; + var textEngine = textField.__textEngine; + var useTextBounds = !(textEngine.background || textEngine.border); + var bounds = useTextBounds ? textEngine.textBounds : textEngine.bounds; + var graphics = textField.__graphics; + var cursorOffsetX = 0.0; + if(textField.__dirty) { + textField.__updateLayout(); + if(graphics.__bounds == null) { + graphics.__bounds = new openfl_geom_Rectangle(); + } + if(textField.get_text().length == 0) { + var boundsWidth = textEngine.bounds.width - 4; + var align = textField.get_defaultTextFormat().align; + cursorOffsetX = align == 3 ? 0 : align == 4 ? boundsWidth : boundsWidth / 2; + switch(align) { + case 0: + cursorOffsetX += textField.get_defaultTextFormat().leftMargin / 2; + cursorOffsetX -= textField.get_defaultTextFormat().rightMargin / 2; + cursorOffsetX += textField.get_defaultTextFormat().indent / 2; + cursorOffsetX += textField.get_defaultTextFormat().blockIndent / 2; + break; + case 1: + break; + case 2: + cursorOffsetX += textField.get_defaultTextFormat().leftMargin; + cursorOffsetX += textField.get_defaultTextFormat().indent; + cursorOffsetX += textField.get_defaultTextFormat().blockIndent; + break; + case 3: + cursorOffsetX += textField.get_defaultTextFormat().leftMargin; + cursorOffsetX += textField.get_defaultTextFormat().indent; + cursorOffsetX += textField.get_defaultTextFormat().blockIndent; + break; + case 4: + cursorOffsetX -= textField.get_defaultTextFormat().rightMargin; + break; + case 5: + break; + } + if(useTextBounds) { + bounds.y = textEngine.bounds.y; + bounds.x = cursorOffsetX; + } + } + graphics.__bounds.copyFrom(bounds); + } + var pixelRatio = renderer.__pixelRatio; + graphics.__update(renderer.__worldTransform,pixelRatio); + if(textField.__dirty || graphics.__softwareDirty) { + var width = Math.round(graphics.__width * pixelRatio); + var height = Math.round(graphics.__height * pixelRatio); + if((textEngine.text == null || textEngine.text == "") && !textEngine.background && !textEngine.border && !textEngine.__hasFocus && (textEngine.type != 1 || !textEngine.selectable) || (textEngine.width <= 0 || textEngine.height <= 0) && textEngine.autoSize != 2) { + textField.__graphics.__canvas = null; + textField.__graphics.__context = null; + textField.__graphics.__bitmap = null; + textField.__graphics.__softwareDirty = false; + textField.__graphics.set___dirty(false); + textField.__dirty = false; + } else { + if(textField.__graphics.__canvas == null) { + textField.__graphics.__canvas = window.document.createElement("canvas"); + textField.__graphics.__context = textField.__graphics.__canvas.getContext("2d"); + } + openfl_display__$internal_CanvasTextField.context = graphics.__context; + graphics.__canvas.width = width; + graphics.__canvas.height = height; + if(renderer.__isDOM) { + graphics.__canvas.style.width = Math.round(width / pixelRatio) + "px"; + graphics.__canvas.style.height = Math.round(height / pixelRatio) + "px"; + } + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.scale(pixelRatio,pixelRatio); + matrix.concat(graphics.__renderTransform); + openfl_display__$internal_CanvasTextField.context.setTransform(matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty); + openfl_geom_Matrix.__pool.release(matrix); + if(openfl_display__$internal_CanvasTextField.clearRect == null) { + openfl_display__$internal_CanvasTextField.clearRect = (typeof navigator !== 'undefined' && typeof navigator['isCocoonJS'] !== 'undefined'); + } + if(openfl_display__$internal_CanvasTextField.clearRect) { + openfl_display__$internal_CanvasTextField.context.clearRect(0,0,graphics.__canvas.width,graphics.__canvas.height); + } + if(textEngine.text != null && textEngine.text != "" || textEngine.__hasFocus) { + var text = textEngine.text; + if(!renderer.__allowSmoothing || textEngine.antiAliasType == 0 && textEngine.sharpness == 400) { + graphics.__context.imageSmoothingEnabled = false; + } else { + graphics.__context.imageSmoothingEnabled = true; + } + if(textEngine.border || textEngine.background) { + openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1); + if(textEngine.background) { + var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.fill(); + } + if(textEngine.border) { + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + var tmp = StringTools.hex(textEngine.borderColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.stroke(); + } + } + openfl_display__$internal_CanvasTextField.context.textBaseline = "alphabetic"; + openfl_display__$internal_CanvasTextField.context.textAlign = "start"; + var scrollX = -textField.get_scrollH(); + var scrollY = 0.0; + var _g = 0; + var _g1 = textField.get_scrollV() - 1; + while(_g < _g1) { + var i = _g++; + scrollY -= textEngine.lineHeights.get(i); + } + var advance; + var group = textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(group1.lineIndex < textField.get_scrollV() - 1) { + continue; + } + if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) { + break; + } + var color = "#" + StringTools.hex(group1.format.color & 16777215,6); + openfl_display__$internal_CanvasTextField.context.font = openfl_text__$internal_TextEngine.getFont(group1.format); + openfl_display__$internal_CanvasTextField.context.fillStyle = color; + openfl_display__$internal_CanvasTextField.context.fillText(text.substring(group1.startIndex,group1.endIndex),group1.offsetX + scrollX - bounds.x,group1.offsetY + group1.ascent + scrollY - bounds.y); + if(textField.__caretIndex > -1 && textEngine.selectable) { + if(textField.__selectionIndex == textField.__caretIndex) { + if(textField.__showCursor && group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex) { + advance = 0.0; + var _g = 0; + var _g1 = textField.__caretIndex - group1.startIndex; + while(_g < _g1) { + var i = _g++; + if(group1.positions.length <= i) { + break; + } + advance += group1.positions[i]; + } + var scrollY1 = 0.0; + var _g2 = textField.get_scrollV(); + var _g3 = group1.lineIndex + 1; + while(_g2 < _g3) { + var i1 = _g2++; + scrollY1 += textEngine.lineHeights.get(i1 - 1); + } + openfl_display__$internal_CanvasTextField.context.beginPath(); + var tmp = StringTools.hex(group1.format.color & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.moveTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + 2 - bounds.y); + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + openfl_display__$internal_CanvasTextField.context.lineTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1 - bounds.y); + openfl_display__$internal_CanvasTextField.context.stroke(); + openfl_display__$internal_CanvasTextField.context.closePath(); + } + } else if(group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex || group1.startIndex <= textField.__selectionIndex && group1.endIndex >= textField.__selectionIndex || group1.startIndex > textField.__caretIndex && group1.endIndex < textField.__selectionIndex || group1.startIndex > textField.__selectionIndex && group1.endIndex < textField.__caretIndex) { + var selectionStart = Math.min(textField.__selectionIndex,textField.__caretIndex) | 0; + var selectionEnd = Math.max(textField.__selectionIndex,textField.__caretIndex) | 0; + if(group1.startIndex > selectionStart) { + selectionStart = group1.startIndex; + } + if(group1.endIndex < selectionEnd) { + selectionEnd = group1.endIndex; + } + var end; + var start = textField.getCharBoundaries(selectionStart); + if(selectionEnd >= group1.endIndex) { + end = textField.getCharBoundaries(group1.endIndex - 1); + if(end != null) { + end.x += end.width + 2; + } + } else { + end = textField.getCharBoundaries(selectionEnd); + } + if(start != null && end != null) { + openfl_display__$internal_CanvasTextField.context.fillStyle = "#000000"; + openfl_display__$internal_CanvasTextField.context.fillRect(start.x + scrollX - bounds.x,start.y + scrollY,end.x - start.x,group1.height); + openfl_display__$internal_CanvasTextField.context.fillStyle = "#FFFFFF"; + openfl_display__$internal_CanvasTextField.context.fillText(text.substring(selectionStart,selectionEnd),scrollX + start.x - bounds.x,group1.offsetY + group1.ascent + scrollY); + } + } + } + if(group1.format.underline) { + openfl_display__$internal_CanvasTextField.context.beginPath(); + openfl_display__$internal_CanvasTextField.context.strokeStyle = color; + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + var descent = Math.floor(group1.ascent * 0.185); + var x = group1.offsetX + scrollX - bounds.x; + var y = Math.ceil(group1.offsetY + scrollY + group1.ascent - bounds.y) + descent + 0.5; + openfl_display__$internal_CanvasTextField.context.moveTo(x,y); + openfl_display__$internal_CanvasTextField.context.lineTo(x + group1.width,y); + openfl_display__$internal_CanvasTextField.context.stroke(); + openfl_display__$internal_CanvasTextField.context.closePath(); + } + } + } else { + if(textEngine.border || textEngine.background) { + if(textEngine.border) { + openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1); + } else { + openfl_display__$internal_CanvasTextField.context.rect(0,0,bounds.width,bounds.height); + } + if(textEngine.background) { + var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.fill(); + } + if(textEngine.border) { + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + openfl_display__$internal_CanvasTextField.context.lineCap = "square"; + var tmp = StringTools.hex(textEngine.borderColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.stroke(); + } + } + if(textField.__caretIndex > -1 && textEngine.selectable && textField.__showCursor) { + var scrollX = -textField.get_scrollH() + (useTextBounds ? 0 : cursorOffsetX); + var scrollY = 0.0; + var _g = 0; + var _g1 = textField.get_scrollV() - 1; + while(_g < _g1) { + var i = _g++; + scrollY += textEngine.lineHeights.get(i); + } + openfl_display__$internal_CanvasTextField.context.beginPath(); + var tmp = StringTools.hex(textField.get_defaultTextFormat().color & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.moveTo(scrollX + 2.5,scrollY + 2.5); + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + openfl_display__$internal_CanvasTextField.context.lineTo(scrollX + 2.5,scrollY + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1); + openfl_display__$internal_CanvasTextField.context.stroke(); + openfl_display__$internal_CanvasTextField.context.closePath(); + } + } + graphics.__bitmap = openfl_display_BitmapData.fromCanvas(textField.__graphics.__canvas); + graphics.__bitmapScale = pixelRatio; + graphics.__visible = true; + textField.__dirty = false; + graphics.__softwareDirty = false; + graphics.set___dirty(false); + } + } + var smoothingEnabled = false; + if(textField.__textEngine.antiAliasType == 0 && textField.__textEngine.gridFitType == 1) { + smoothingEnabled = renderer.context.imageSmoothingEnabled; + if(smoothingEnabled) { + renderer.context.imageSmoothingEnabled = false; + } + } + if(!(textField.opaqueBackground == null && textField.__graphics == null)) { + if(textField.__renderable) { + var alpha = renderer.__getAlpha(textField.__worldAlpha); + if(!(alpha <= 0)) { + if(textField.opaqueBackground != null && !textField.__isCacheBitmapRender && textField.get_width() > 0 && textField.get_height() > 0) { + renderer.__setBlendMode(textField.__worldBlendMode); + renderer.__pushMaskObject(textField); + var context = renderer.context; + renderer.setTransform(textField.__renderTransform,context); + var color = textField.opaqueBackground; + context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")"; + context.fillRect(0,0,textField.get_width(),textField.get_height()); + renderer.__popMaskObject(textField); + } + if(textField.__graphics != null) { + if(textField.__renderable) { + var alpha = renderer.__getAlpha(textField.__worldAlpha); + if(!(alpha <= 0)) { + var graphics = textField.__graphics; + if(graphics != null) { + openfl_display__$internal_CanvasGraphics.render(graphics,renderer); + var width = graphics.__width; + var height = graphics.__height; + var canvas = graphics.__canvas; + if(canvas != null && graphics.__visible && width >= 1 && height >= 1) { + var transform = graphics.__worldTransform; + var context = renderer.context; + var scrollRect = textField.__scrollRect; + var scale9Grid = textField.__worldScale9Grid; + if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) { + renderer.__setBlendMode(textField.__worldBlendMode); + renderer.__pushMaskObject(textField); + context.globalAlpha = alpha; + if(scale9Grid != null && transform.b == 0 && transform.c == 0) { + var pixelRatio = renderer.__pixelRatio; + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.translate(transform.tx,transform.ty); + renderer.setTransform(matrix,context); + openfl_geom_Matrix.__pool.release(matrix); + var bounds = graphics.__bounds; + var scaleX = graphics.__renderTransform.a / graphics.__bitmapScale; + var scaleY = graphics.__renderTransform.d / graphics.__bitmapScale; + var renderScaleX = scaleX * transform.a; + var renderScaleY = scaleY * transform.d; + var left = Math.max(1,Math.round(scale9Grid.x * scaleX)); + var top = Math.round(scale9Grid.y * scaleY); + var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX)); + var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY); + var centerWidth = Math.round(scale9Grid.width * scaleX); + var centerHeight = Math.round(scale9Grid.height * scaleY); + var renderLeft = Math.round(left / pixelRatio); + var renderTop = Math.round(top / pixelRatio); + var renderRight = Math.round(right / pixelRatio); + var renderBottom = Math.round(bottom / pixelRatio); + var renderCenterWidth = bounds.width * renderScaleX - renderLeft - renderRight; + var renderCenterHeight = bounds.height * renderScaleY - renderTop - renderBottom; + renderer.applySmoothing(context,false); + if(centerWidth != 0 && centerHeight != 0) { + context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop); + context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop); + context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop); + context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight); + context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight); + context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom); + context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom); + context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom); + } else if(centerWidth == 0 && centerHeight != 0) { + var renderWidth = renderLeft + renderCenterWidth + renderRight; + context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop); + context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom); + } else if(centerHeight == 0 && centerWidth != 0) { + var renderHeight = renderTop + renderCenterHeight + renderBottom; + context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight); + context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight); + context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight); + } + } else { + renderer.setTransform(transform,context); + context.drawImage(canvas,0,0,width,height); + } + renderer.__popMaskObject(textField); + } + } + } + } + } + } + } + } + } + if(smoothingEnabled) { + renderer.context.imageSmoothingEnabled = true; + } + } + } +}; +openfl_display__$internal_CanvasTextField.renderDrawableMask = function(textField,renderer) { + openfl_display__$internal_CanvasDisplayObject.renderDrawableMask(textField,renderer); +}; +var openfl_display__$internal_CanvasTilemap = function() { }; +$hxClasses["openfl.display._internal.CanvasTilemap"] = openfl_display__$internal_CanvasTilemap; +openfl_display__$internal_CanvasTilemap.__name__ = "openfl.display._internal.CanvasTilemap"; +openfl_display__$internal_CanvasTilemap.render = function(tilemap,renderer) { + if(!tilemap.__renderable || tilemap.__group.__tiles.length == 0) { + return; + } + var alpha = renderer.__getAlpha(tilemap.__worldAlpha); + if(alpha <= 0) { + return; + } + var context = renderer.context; + renderer.__setBlendMode(tilemap.__worldBlendMode); + renderer.__pushMaskObject(tilemap); + var rect = openfl_geom_Rectangle.__pool.get(); + rect.setTo(0,0,tilemap.__width,tilemap.__height); + renderer.__pushMaskRect(rect,tilemap.__renderTransform); + if(!renderer.__allowSmoothing || !tilemap.smoothing) { + context.imageSmoothingEnabled = false; + } + openfl_display__$internal_CanvasTilemap.renderTileContainer(tilemap.__group,renderer,tilemap.__renderTransform,tilemap.__tileset,renderer.__allowSmoothing && tilemap.smoothing,tilemap.tileAlphaEnabled,alpha,tilemap.tileBlendModeEnabled,tilemap.__worldBlendMode,null,null,rect); + if(!renderer.__allowSmoothing || !tilemap.smoothing) { + context.imageSmoothingEnabled = true; + } + renderer.__popMaskRect(); + renderer.__popMaskObject(tilemap); + openfl_geom_Rectangle.__pool.release(rect); +}; +openfl_display__$internal_CanvasTilemap.renderTileContainer = function(group,renderer,parentTransform,defaultTileset,smooth,alphaEnabled,worldAlpha,blendModeEnabled,defaultBlendMode,cacheBitmapData,source,rect) { + var context = renderer.context; + var roundPixels = renderer.__roundPixels; + var tileTransform = openfl_geom_Matrix.__pool.get(); + var tiles = group.__tiles; + var length = group.__length; + var tile; + var tileset; + var alpha; + var visible; + var blendMode = null; + var id; + var tileData; + var tileRect; + var bitmapData; + var _g = 0; + var _g1 = length; + while(_g < _g1) { + var i = _g++; + tile = tiles[i]; + tileTransform.setTo(1,0,0,1,-tile.get_originX(),-tile.get_originY()); + tileTransform.concat(tile.get_matrix()); + tileTransform.concat(parentTransform); + if(roundPixels) { + tileTransform.tx = Math.round(tileTransform.tx); + tileTransform.ty = Math.round(tileTransform.ty); + } + tileset = tile.get_tileset() != null ? tile.get_tileset() : defaultTileset; + alpha = tile.get_alpha() * worldAlpha; + visible = tile.get_visible(); + if(!visible || alpha <= 0) { + continue; + } + if(!alphaEnabled) { + alpha = 1; + } + if(blendModeEnabled) { + blendMode = tile.__blendMode != null ? tile.__blendMode : defaultBlendMode; + } + if(tile.__length > 0) { + openfl_display__$internal_CanvasTilemap.renderTileContainer(tile,renderer,tileTransform,tileset,smooth,alphaEnabled,alpha,blendModeEnabled,blendMode,cacheBitmapData,source,rect); + } else { + if(tileset == null) { + continue; + } + id = tile.get_id(); + if(id == -1) { + tileRect = tile.__rect; + if(tileRect == null || tileRect.width <= 0 || tileRect.height <= 0) { + continue; + } + } else { + tileData = tileset.__data[id]; + if(tileData == null) { + continue; + } + rect.setTo(tileData.x,tileData.y,tileData.width,tileData.height); + tileRect = rect; + } + bitmapData = tileset.__bitmapData; + if(bitmapData == null || bitmapData.image == null) { + continue; + } + if(bitmapData != cacheBitmapData) { + if(bitmapData.image.buffer.__srcImage == null) { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmapData.image); + } + source = bitmapData.image.get_src(); + cacheBitmapData = bitmapData; + } + context.globalAlpha = alpha; + if(blendModeEnabled) { + renderer.__setBlendMode(blendMode); + } + renderer.setTransform(tileTransform,context); + context.drawImage(source,tileRect.x,tileRect.y,tileRect.width,tileRect.height,0,0,tileRect.width,tileRect.height); + } + } + openfl_geom_Matrix.__pool.release(tileTransform); +}; +openfl_display__$internal_CanvasTilemap.renderDrawable = function(tilemap,renderer) { + renderer.__updateCacheBitmap(tilemap,false); + if(tilemap.__cacheBitmap != null && !tilemap.__isCacheBitmapRender) { + var bitmap = tilemap.__cacheBitmap; + if(bitmap.__renderable) { + var alpha = renderer.__getAlpha(bitmap.__worldAlpha); + if(alpha > 0 && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) { + var context = renderer.context; + renderer.__setBlendMode(bitmap.__worldBlendMode); + renderer.__pushMaskObject(bitmap,false); + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image); + context.globalAlpha = alpha; + var scrollRect = bitmap.__scrollRect; + renderer.setTransform(bitmap.__renderTransform,context); + if(!renderer.__allowSmoothing || !bitmap.smoothing) { + context.imageSmoothingEnabled = false; + } + if(scrollRect == null) { + context.drawImage(bitmap.__bitmapData.image.get_src(),0,0,bitmap.__bitmapData.image.width,bitmap.__bitmapData.image.height); + } else { + context.drawImage(bitmap.__bitmapData.image.get_src(),scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height); + } + if(!renderer.__allowSmoothing || !bitmap.smoothing) { + context.imageSmoothingEnabled = true; + } + renderer.__popMaskObject(bitmap,false); + } + } + } else { + if(!(tilemap.opaqueBackground == null && tilemap.__graphics == null)) { + if(tilemap.__renderable) { + var alpha = renderer.__getAlpha(tilemap.__worldAlpha); + if(!(alpha <= 0)) { + if(tilemap.opaqueBackground != null && !tilemap.__isCacheBitmapRender && tilemap.get_width() > 0 && tilemap.get_height() > 0) { + renderer.__setBlendMode(tilemap.__worldBlendMode); + renderer.__pushMaskObject(tilemap); + var context = renderer.context; + renderer.setTransform(tilemap.__renderTransform,context); + var color = tilemap.opaqueBackground; + context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")"; + context.fillRect(0,0,tilemap.get_width(),tilemap.get_height()); + renderer.__popMaskObject(tilemap); + } + if(tilemap.__graphics != null) { + if(tilemap.__renderable) { + var alpha = renderer.__getAlpha(tilemap.__worldAlpha); + if(!(alpha <= 0)) { + var graphics = tilemap.__graphics; + if(graphics != null) { + openfl_display__$internal_CanvasGraphics.render(graphics,renderer); + var width = graphics.__width; + var height = graphics.__height; + var canvas = graphics.__canvas; + if(canvas != null && graphics.__visible && width >= 1 && height >= 1) { + var transform = graphics.__worldTransform; + var context = renderer.context; + var scrollRect = tilemap.__scrollRect; + var scale9Grid = tilemap.__worldScale9Grid; + if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) { + renderer.__setBlendMode(tilemap.__worldBlendMode); + renderer.__pushMaskObject(tilemap); + context.globalAlpha = alpha; + if(scale9Grid != null && transform.b == 0 && transform.c == 0) { + var pixelRatio = renderer.__pixelRatio; + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.translate(transform.tx,transform.ty); + renderer.setTransform(matrix,context); + openfl_geom_Matrix.__pool.release(matrix); + var bounds = graphics.__bounds; + var scaleX = graphics.__renderTransform.a / graphics.__bitmapScale; + var scaleY = graphics.__renderTransform.d / graphics.__bitmapScale; + var renderScaleX = scaleX * transform.a; + var renderScaleY = scaleY * transform.d; + var left = Math.max(1,Math.round(scale9Grid.x * scaleX)); + var top = Math.round(scale9Grid.y * scaleY); + var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX)); + var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY); + var centerWidth = Math.round(scale9Grid.width * scaleX); + var centerHeight = Math.round(scale9Grid.height * scaleY); + var renderLeft = Math.round(left / pixelRatio); + var renderTop = Math.round(top / pixelRatio); + var renderRight = Math.round(right / pixelRatio); + var renderBottom = Math.round(bottom / pixelRatio); + var renderCenterWidth = bounds.width * renderScaleX - renderLeft - renderRight; + var renderCenterHeight = bounds.height * renderScaleY - renderTop - renderBottom; + renderer.applySmoothing(context,false); + if(centerWidth != 0 && centerHeight != 0) { + context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop); + context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop); + context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop); + context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight); + context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight); + context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom); + context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom); + context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom); + } else if(centerWidth == 0 && centerHeight != 0) { + var renderWidth = renderLeft + renderCenterWidth + renderRight; + context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop); + context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom); + } else if(centerHeight == 0 && centerWidth != 0) { + var renderHeight = renderTop + renderCenterHeight + renderBottom; + context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight); + context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight); + context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight); + } + } else { + renderer.setTransform(transform,context); + context.drawImage(canvas,0,0,width,height); + } + renderer.__popMaskObject(tilemap); + } + } + } + } + } + } + } + } + } + if(!(!tilemap.__renderable || tilemap.__group.__tiles.length == 0)) { + var alpha = renderer.__getAlpha(tilemap.__worldAlpha); + if(!(alpha <= 0)) { + var context = renderer.context; + renderer.__setBlendMode(tilemap.__worldBlendMode); + renderer.__pushMaskObject(tilemap); + var rect = openfl_geom_Rectangle.__pool.get(); + rect.setTo(0,0,tilemap.__width,tilemap.__height); + renderer.__pushMaskRect(rect,tilemap.__renderTransform); + if(!renderer.__allowSmoothing || !tilemap.smoothing) { + context.imageSmoothingEnabled = false; + } + openfl_display__$internal_CanvasTilemap.renderTileContainer(tilemap.__group,renderer,tilemap.__renderTransform,tilemap.__tileset,renderer.__allowSmoothing && tilemap.smoothing,tilemap.tileAlphaEnabled,alpha,tilemap.tileBlendModeEnabled,tilemap.__worldBlendMode,null,null,rect); + if(!renderer.__allowSmoothing || !tilemap.smoothing) { + context.imageSmoothingEnabled = true; + } + renderer.__popMaskRect(); + renderer.__popMaskObject(tilemap); + openfl_geom_Rectangle.__pool.release(rect); + } + } + } + renderer.__renderEvent(tilemap); +}; +openfl_display__$internal_CanvasTilemap.renderDrawableMask = function(tilemap,renderer) { +}; +var openfl_display__$internal_CanvasVideo = function() { }; +$hxClasses["openfl.display._internal.CanvasVideo"] = openfl_display__$internal_CanvasVideo; +openfl_display__$internal_CanvasVideo.__name__ = "openfl.display._internal.CanvasVideo"; +openfl_display__$internal_CanvasVideo.render = function(video,renderer) { + if(!video.__renderable || video.__stream == null) { + return; + } + var alpha = renderer.__getAlpha(video.__worldAlpha); + if(alpha <= 0) { + return; + } + var context = renderer.context; + if(video.__stream.__video != null) { + renderer.__setBlendMode(video.__worldBlendMode); + renderer.__pushMaskObject(video); + context.globalAlpha = alpha; + var scrollRect = video.__scrollRect; + var smoothing = video.smoothing; + renderer.setTransform(video.__worldTransform,context); + if(!smoothing) { + context.imageSmoothingEnabled = false; + } + if(scrollRect == null) { + context.drawImage(video.__stream.__video,0,0,video.get_width(),video.get_height()); + } else { + context.drawImage(video.__stream.__video,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height,scrollRect.x,scrollRect.y,scrollRect.width,scrollRect.height); + } + if(!smoothing) { + context.imageSmoothingEnabled = true; + } + renderer.__popMaskObject(video); + } +}; +openfl_display__$internal_CanvasVideo.renderDrawable = function(video,renderer) { + openfl_display__$internal_CanvasVideo.render(video,renderer); + renderer.__renderEvent(video); +}; +openfl_display__$internal_CanvasVideo.renderDrawableMask = function(video,renderer) { +}; +var openfl_display__$internal_Context3DBitmap = function() { }; +$hxClasses["openfl.display._internal.Context3DBitmap"] = openfl_display__$internal_Context3DBitmap; +openfl_display__$internal_Context3DBitmap.__name__ = "openfl.display._internal.Context3DBitmap"; +openfl_display__$internal_Context3DBitmap.render = function(bitmap,renderer) { + if(!bitmap.__renderable || bitmap.__worldAlpha <= 0) { + return; + } + if(bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid) { + var context = renderer.__context3D; + renderer.__setBlendMode(bitmap.__worldBlendMode); + renderer.__pushMaskObject(bitmap); + var shader = renderer.__initDisplayShader(bitmap.__worldShader); + renderer.setShader(shader); + renderer.applyBitmapData(bitmap.__bitmapData,renderer.__allowSmoothing && (bitmap.smoothing || renderer.__upscaled)); + renderer.applyMatrix(renderer.__getMatrix(bitmap.__renderTransform,bitmap.pixelSnapping)); + renderer.applyAlpha(bitmap.__worldAlpha); + renderer.applyColorTransform(bitmap.__worldColorTransform); + renderer.updateShader(); + var vertexBuffer = bitmap.__bitmapData.getVertexBuffer(context); + if(shader.__position != null) { + context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3); + } + if(shader.__textureCoord != null) { + context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2); + } + var indexBuffer = bitmap.__bitmapData.getIndexBuffer(context); + context.drawTriangles(indexBuffer); + renderer.__clearShader(); + renderer.__popMaskObject(bitmap); + } +}; +openfl_display__$internal_Context3DBitmap.renderDrawable = function(bitmap,renderer) { + renderer.__updateCacheBitmap(bitmap,false); + if(bitmap.__bitmapData != null && bitmap.__bitmapData.image != null) { + bitmap.__imageVersion = bitmap.__bitmapData.image.version; + } + if(bitmap.__cacheBitmap != null && !bitmap.__isCacheBitmapRender) { + openfl_display__$internal_Context3DBitmap.render(bitmap.__cacheBitmap,renderer); + } else { + if(!(bitmap.opaqueBackground == null && bitmap.__graphics == null)) { + if(!(!bitmap.__renderable || bitmap.__worldAlpha <= 0)) { + if(bitmap.opaqueBackground != null && !bitmap.__isCacheBitmapRender && bitmap.get_width() > 0 && bitmap.get_height() > 0) { + renderer.__setBlendMode(bitmap.__worldBlendMode); + renderer.__pushMaskObject(bitmap); + var context = renderer.__context3D; + var rect = openfl_geom_Rectangle.__pool.get(); + rect.setTo(0,0,bitmap.get_width(),bitmap.get_height()); + renderer.__pushMaskRect(rect,bitmap.__renderTransform); + var color = bitmap.opaqueBackground; + context.clear((color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1); + renderer.__popMaskRect(); + renderer.__popMaskObject(bitmap); + openfl_geom_Rectangle.__pool.release(rect); + } + if(bitmap.__graphics != null) { + openfl_display__$internal_Context3DShape.render(bitmap,renderer); + } + } + } + openfl_display__$internal_Context3DBitmap.render(bitmap,renderer); + } + renderer.__renderEvent(bitmap); +}; +openfl_display__$internal_Context3DBitmap.renderDrawableMask = function(bitmap,renderer) { + openfl_display__$internal_Context3DBitmap.renderMask(bitmap,renderer); +}; +openfl_display__$internal_Context3DBitmap.renderMask = function(bitmap,renderer) { + if(bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid) { + var context = renderer.__context3D; + var shader = renderer.__maskShader; + renderer.setShader(shader); + renderer.applyBitmapData(openfl_display__$internal_Context3DMaskShader.opaqueBitmapData,true); + renderer.applyMatrix(renderer.__getMatrix(bitmap.__renderTransform,bitmap.pixelSnapping)); + renderer.updateShader(); + var vertexBuffer = bitmap.__bitmapData.getVertexBuffer(context); + if(shader.__position != null) { + context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3); + } + if(shader.__textureCoord != null) { + context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2); + } + var indexBuffer = bitmap.__bitmapData.getIndexBuffer(context); + context.drawTriangles(indexBuffer); + renderer.__clearShader(); + } +}; +var openfl_display__$internal_Context3DBitmapData = function() { }; +$hxClasses["openfl.display._internal.Context3DBitmapData"] = openfl_display__$internal_Context3DBitmapData; +openfl_display__$internal_Context3DBitmapData.__name__ = "openfl.display._internal.Context3DBitmapData"; +openfl_display__$internal_Context3DBitmapData.renderDrawable = function(bitmapData,renderer) { + var context = renderer.__context3D; + var gl = context.gl; + renderer.__setBlendMode(10); + var shader = renderer.__defaultDisplayShader; + renderer.setShader(shader); + renderer.applyBitmapData(bitmapData,renderer.__upscaled); + renderer.applyMatrix(renderer.__getMatrix(bitmapData.__worldTransform,1)); + renderer.applyAlpha(bitmapData.__worldAlpha); + renderer.applyColorTransform(bitmapData.__worldColorTransform); + renderer.updateShader(); + var vertexBuffer = bitmapData.getVertexBuffer(context); + if(shader.__position != null) { + context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3); + } + if(shader.__textureCoord != null) { + context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2); + } + var indexBuffer = bitmapData.getIndexBuffer(context); + context.drawTriangles(indexBuffer); + renderer.__clearShader(); +}; +openfl_display__$internal_Context3DBitmapData.renderDrawableMask = function(bitmapData,renderer) { + var context = renderer.__context3D; + var gl = context.gl; + var shader = renderer.__maskShader; + renderer.setShader(shader); + renderer.applyBitmapData(bitmapData,renderer.__upscaled); + renderer.applyMatrix(renderer.__getMatrix(bitmapData.__worldTransform,1)); + renderer.updateShader(); + var vertexBuffer = bitmapData.getVertexBuffer(context); + if(shader.__position != null) { + context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3); + } + if(shader.__textureCoord != null) { + context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2); + } + var indexBuffer = bitmapData.getIndexBuffer(context); + context.drawTriangles(indexBuffer); + renderer.__clearShader(); +}; +var openfl_display__$internal_Context3DBuffer = function(context3D,elementType,elementCount,dataPerVertex) { + this.context3D = context3D; + this.elementType = elementType; + this.dataPerVertex = dataPerVertex; + this.indexCount = 0; + this.vertexCount = 0; + this.resize(elementCount); +}; +$hxClasses["openfl.display._internal.Context3DBuffer"] = openfl_display__$internal_Context3DBuffer; +openfl_display__$internal_Context3DBuffer.__name__ = "openfl.display._internal.Context3DBuffer"; +openfl_display__$internal_Context3DBuffer.prototype = { + drawElements: function(start,length) { + if(length == null) { + length = -1; + } + if(this.indexCount == 0 || this.vertexCount == 0) { + return; + } + if(this.elementType._hx_index == 0) { + if(length == -1) { + length = this.elementCount * 2; + } + if(start < 10922 && length - start < 10922) { + this.context3D.drawTriangles(this.indexBuffers[0],start,length * 2); + } else { + var end = start + length; + while(start < end) { + var arrayBufferIndex = Math.floor(start / 10922); + length = Math.min(end - start,10922) | 0; + if(length <= 0) { + break; + } + this.context3D.drawTriangles(this.indexBuffers[arrayBufferIndex],(start - arrayBufferIndex * 10922) * 3,length * 2); + start += length; + } + } + } + } + ,flushVertexBufferData: function() { + if(this.vertexBufferData.length > this.vertexCount) { + this.vertexCount = this.vertexBufferData.length; + this.vertexBuffer = this.context3D.createVertexBuffer(this.vertexCount,this.dataPerVertex,0); + } + this.vertexBuffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.vertexBufferData)); + } + ,resize: function(elementCount,dataPerVertex) { + if(dataPerVertex == null) { + dataPerVertex = -1; + } + this.elementCount = elementCount; + if(dataPerVertex == -1) { + dataPerVertex = this.dataPerVertex; + } + if(dataPerVertex != this.dataPerVertex) { + this.vertexBuffer = null; + this.vertexCount = 0; + this.dataPerVertex = dataPerVertex; + } + var numVertices = 0; + switch(this.elementType._hx_index) { + case 0: + numVertices = elementCount * 4; + break; + case 1: + numVertices = elementCount * 3; + break; + case 2: + numVertices = elementCount * 3; + break; + } + var vertexLength = numVertices * dataPerVertex; + if(this.vertexBufferData == null) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(vertexLength != null) { + this1 = new Float32Array(vertexLength); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Float32Array(buffer,0); + } else { + this1 = new Float32Array(buffer,0,len); + } + } else { + this1 = null; + } + this.vertexBufferData = this1; + } else if(vertexLength > this.vertexBufferData.length) { + var cacheBufferData = this.vertexBufferData; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(vertexLength != null) { + this1 = new Float32Array(vertexLength); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Float32Array(buffer,0); + } else { + this1 = new Float32Array(buffer,0,len); + } + } else { + this1 = null; + } + this.vertexBufferData = this1; + this.vertexBufferData.set(cacheBufferData); + } + } + ,__class__: openfl_display__$internal_Context3DBuffer +}; +var openfl_display__$internal_Context3DElementType = $hxEnums["openfl.display._internal.Context3DElementType"] = { __ename__:"openfl.display._internal.Context3DElementType",__constructs__:null + ,QUADS: {_hx_name:"QUADS",_hx_index:0,__enum__:"openfl.display._internal.Context3DElementType",toString:$estr} + ,TRIANGLES: {_hx_name:"TRIANGLES",_hx_index:1,__enum__:"openfl.display._internal.Context3DElementType",toString:$estr} + ,TRIANGLE_INDICES: {_hx_name:"TRIANGLE_INDICES",_hx_index:2,__enum__:"openfl.display._internal.Context3DElementType",toString:$estr} +}; +openfl_display__$internal_Context3DElementType.__constructs__ = [openfl_display__$internal_Context3DElementType.QUADS,openfl_display__$internal_Context3DElementType.TRIANGLES,openfl_display__$internal_Context3DElementType.TRIANGLE_INDICES]; +var openfl_display__$internal_Context3DDisplayObject = function() { }; +$hxClasses["openfl.display._internal.Context3DDisplayObject"] = openfl_display__$internal_Context3DDisplayObject; +openfl_display__$internal_Context3DDisplayObject.__name__ = "openfl.display._internal.Context3DDisplayObject"; +openfl_display__$internal_Context3DDisplayObject.render = function(displayObject,renderer) { + if(displayObject.opaqueBackground == null && displayObject.__graphics == null) { + return; + } + if(!displayObject.__renderable || displayObject.__worldAlpha <= 0) { + return; + } + if(displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0) { + renderer.__setBlendMode(displayObject.__worldBlendMode); + renderer.__pushMaskObject(displayObject); + var context = renderer.__context3D; + var rect = openfl_geom_Rectangle.__pool.get(); + rect.setTo(0,0,displayObject.get_width(),displayObject.get_height()); + renderer.__pushMaskRect(rect,displayObject.__renderTransform); + var color = displayObject.opaqueBackground; + context.clear((color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1); + renderer.__popMaskRect(); + renderer.__popMaskObject(displayObject); + openfl_geom_Rectangle.__pool.release(rect); + } + if(displayObject.__graphics != null) { + openfl_display__$internal_Context3DShape.render(displayObject,renderer); + } +}; +openfl_display__$internal_Context3DDisplayObject.renderDrawable = function(displayObject,renderer) { + renderer.__updateCacheBitmap(displayObject,false); + if(displayObject.__cacheBitmap != null && !displayObject.__isCacheBitmapRender) { + openfl_display__$internal_Context3DBitmap.render(displayObject.__cacheBitmap,renderer); + } else if(!(displayObject.opaqueBackground == null && displayObject.__graphics == null)) { + if(!(!displayObject.__renderable || displayObject.__worldAlpha <= 0)) { + if(displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0) { + renderer.__setBlendMode(displayObject.__worldBlendMode); + renderer.__pushMaskObject(displayObject); + var context = renderer.__context3D; + var rect = openfl_geom_Rectangle.__pool.get(); + rect.setTo(0,0,displayObject.get_width(),displayObject.get_height()); + renderer.__pushMaskRect(rect,displayObject.__renderTransform); + var color = displayObject.opaqueBackground; + context.clear((color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1); + renderer.__popMaskRect(); + renderer.__popMaskObject(displayObject); + openfl_geom_Rectangle.__pool.release(rect); + } + if(displayObject.__graphics != null) { + openfl_display__$internal_Context3DShape.render(displayObject,renderer); + } + } + } + renderer.__renderEvent(displayObject); +}; +openfl_display__$internal_Context3DDisplayObject.renderDrawableMask = function(displayObject,renderer) { + if(displayObject.__graphics != null) { + openfl_display__$internal_Context3DShape.renderMask(displayObject,renderer); + } +}; +openfl_display__$internal_Context3DDisplayObject.renderMask = function(displayObject,renderer) { + if(displayObject.opaqueBackground == null && displayObject.__graphics == null) { + return; + } + var tmp = displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0; + if(displayObject.__graphics != null) { + openfl_display__$internal_Context3DShape.renderMask(displayObject,renderer); + } +}; +var openfl_display__$internal_Context3DDisplayObjectContainer = function() { }; +$hxClasses["openfl.display._internal.Context3DDisplayObjectContainer"] = openfl_display__$internal_Context3DDisplayObjectContainer; +openfl_display__$internal_Context3DDisplayObjectContainer.__name__ = "openfl.display._internal.Context3DDisplayObjectContainer"; +openfl_display__$internal_Context3DDisplayObjectContainer.renderDrawable = function(displayObjectContainer,renderer) { + var orphan = displayObjectContainer.__removedChildren.iterator(); + while(orphan.hasNext()) { + var orphan1 = orphan.next(); + if(orphan1.stage == null) { + orphan1.__cleanup(); + } + } + displayObjectContainer.__removedChildren.set_length(0); + if(!displayObjectContainer.__renderable || displayObjectContainer.__worldAlpha <= 0) { + return; + } + openfl_display__$internal_Context3DDisplayObject.renderDrawable(displayObjectContainer,renderer); + if(displayObjectContainer.__cacheBitmap != null && !displayObjectContainer.__isCacheBitmapRender) { + return; + } + if(displayObjectContainer.__children.length > 0) { + renderer.__pushMaskObject(displayObjectContainer); + if(renderer.__stage != null) { + var _g = 0; + var _g1 = displayObjectContainer.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + renderer.__renderDrawable(child); + child.__renderDirty = false; + } + displayObjectContainer.__renderDirty = false; + } else { + var _g = 0; + var _g1 = displayObjectContainer.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + renderer.__renderDrawable(child); + } + } + } + if(displayObjectContainer.__children.length > 0) { + renderer.__popMaskObject(displayObjectContainer); + } +}; +openfl_display__$internal_Context3DDisplayObjectContainer.renderDrawableMask = function(displayObjectContainer,renderer) { + var orphan = displayObjectContainer.__removedChildren.iterator(); + while(orphan.hasNext()) { + var orphan1 = orphan.next(); + if(orphan1.stage == null) { + orphan1.__cleanup(); + } + } + displayObjectContainer.__removedChildren.set_length(0); + if(displayObjectContainer.__graphics != null) { + openfl_display__$internal_Context3DShape.renderMask(displayObjectContainer,renderer); + } + var _g = 0; + var _g1 = displayObjectContainer.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + renderer.__renderDrawableMask(child); + } +}; +var openfl_geom_Matrix = function(a,b,c,d,tx,ty) { + if(ty == null) { + ty = 0; + } + if(tx == null) { + tx = 0; + } + if(d == null) { + d = 1; + } + if(c == null) { + c = 0; + } + if(b == null) { + b = 0; + } + if(a == null) { + a = 1; + } + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.tx = tx; + this.ty = ty; +}; +$hxClasses["openfl.geom.Matrix"] = openfl_geom_Matrix; +openfl_geom_Matrix.__name__ = "openfl.geom.Matrix"; +openfl_geom_Matrix.prototype = { + clone: function() { + return new openfl_geom_Matrix(this.a,this.b,this.c,this.d,this.tx,this.ty); + } + ,concat: function(m) { + var a1 = this.a * m.a + this.b * m.c; + this.b = this.a * m.b + this.b * m.d; + this.a = a1; + var c1 = this.c * m.a + this.d * m.c; + this.d = this.c * m.b + this.d * m.d; + this.c = c1; + var tx1 = this.tx * m.a + this.ty * m.c + m.tx; + this.ty = this.tx * m.b + this.ty * m.d + m.ty; + this.tx = tx1; + } + ,copyColumnFrom: function(column,vector3D) { + if(column > 2) { + throw haxe_Exception.thrown("Column " + column + " out of bounds (2)"); + } else if(column == 0) { + this.a = vector3D.x; + this.b = vector3D.y; + } else if(column == 1) { + this.c = vector3D.x; + this.d = vector3D.y; + } else { + this.tx = vector3D.x; + this.ty = vector3D.y; + } + } + ,copyColumnTo: function(column,vector3D) { + if(column > 2) { + throw haxe_Exception.thrown("Column " + column + " out of bounds (2)"); + } else if(column == 0) { + vector3D.x = this.a; + vector3D.y = this.b; + vector3D.z = 0; + } else if(column == 1) { + vector3D.x = this.c; + vector3D.y = this.d; + vector3D.z = 0; + } else { + vector3D.x = this.tx; + vector3D.y = this.ty; + vector3D.z = 1; + } + } + ,copyFrom: function(sourceMatrix) { + this.a = sourceMatrix.a; + this.b = sourceMatrix.b; + this.c = sourceMatrix.c; + this.d = sourceMatrix.d; + this.tx = sourceMatrix.tx; + this.ty = sourceMatrix.ty; + } + ,copyRowFrom: function(row,vector3D) { + if(row > 2) { + throw haxe_Exception.thrown("Row " + row + " out of bounds (2)"); + } else if(row == 0) { + this.a = vector3D.x; + this.c = vector3D.y; + this.tx = vector3D.z; + } else if(row == 1) { + this.b = vector3D.x; + this.d = vector3D.y; + this.ty = vector3D.z; + } + } + ,copyRowTo: function(row,vector3D) { + if(row > 2) { + throw haxe_Exception.thrown("Row " + row + " out of bounds (2)"); + } else if(row == 0) { + vector3D.x = this.a; + vector3D.y = this.c; + vector3D.z = this.tx; + } else if(row == 1) { + vector3D.x = this.b; + vector3D.y = this.d; + vector3D.z = this.ty; + } else { + vector3D.setTo(0,0,1); + } + } + ,createBox: function(scaleX,scaleY,rotation,tx,ty) { + if(ty == null) { + ty = 0; + } + if(tx == null) { + tx = 0; + } + if(rotation == null) { + rotation = 0; + } + if(rotation != 0) { + var cos = Math.cos(rotation); + var sin = Math.sin(rotation); + this.a = cos * scaleX; + this.b = sin * scaleY; + this.c = -sin * scaleX; + this.d = cos * scaleY; + } else { + this.a = scaleX; + this.b = 0; + this.c = 0; + this.d = scaleY; + } + this.tx = tx; + this.ty = ty; + } + ,createGradientBox: function(width,height,rotation,tx,ty) { + if(ty == null) { + ty = 0; + } + if(tx == null) { + tx = 0; + } + if(rotation == null) { + rotation = 0; + } + this.a = width / 1638.4; + this.d = height / 1638.4; + if(rotation != 0) { + var cos = Math.cos(rotation); + var sin = Math.sin(rotation); + this.b = sin * this.d; + this.c = -sin * this.a; + this.a *= cos; + this.d *= cos; + } else { + this.b = 0; + this.c = 0; + } + this.tx = tx + width / 2; + this.ty = ty + height / 2; + } + ,deltaTransformPoint: function(point) { + return new openfl_geom_Point(point.x * this.a + point.y * this.c,point.x * this.b + point.y * this.d); + } + ,deltaTransformPointToOutput: function(point,output) { + if(output != null) { + output.setTo(point.x * this.a + point.y * this.c,point.x * this.b + point.y * this.d); + return output; + } + return new openfl_geom_Point(point.x * this.a + point.y * this.c,point.x * this.b + point.y * this.d); + } + ,equals: function(matrix) { + if(matrix != null && this.tx == matrix.tx && this.ty == matrix.ty && this.a == matrix.a && this.b == matrix.b && this.c == matrix.c) { + return this.d == matrix.d; + } else { + return false; + } + } + ,identity: function() { + this.a = 1; + this.b = 0; + this.c = 0; + this.d = 1; + this.tx = 0; + this.ty = 0; + } + ,invert: function() { + var norm = this.a * this.d - this.b * this.c; + if(norm == 0) { + this.a = this.b = this.c = this.d = 0; + this.tx = -this.tx; + this.ty = -this.ty; + } else { + norm = 1.0 / norm; + var a1 = this.d * norm; + this.d = this.a * norm; + this.a = a1; + this.b *= -norm; + this.c *= -norm; + var tx1 = -this.a * this.tx - this.c * this.ty; + this.ty = -this.b * this.tx - this.d * this.ty; + this.tx = tx1; + } + return this; + } + ,rotate: function(theta) { + var cos = Math.cos(theta); + var sin = Math.sin(theta); + var a1 = this.a * cos - this.b * sin; + this.b = this.a * sin + this.b * cos; + this.a = a1; + var c1 = this.c * cos - this.d * sin; + this.d = this.c * sin + this.d * cos; + this.c = c1; + var tx1 = this.tx * cos - this.ty * sin; + this.ty = this.tx * sin + this.ty * cos; + this.tx = tx1; + } + ,scale: function(sx,sy) { + this.a *= sx; + this.b *= sy; + this.c *= sx; + this.d *= sy; + this.tx *= sx; + this.ty *= sy; + } + ,setRotation: function(theta,scale) { + if(scale == null) { + scale = 1; + } + this.a = Math.cos(theta) * scale; + this.c = Math.sin(theta) * scale; + this.b = -this.c; + this.d = this.a; + } + ,setTo: function(a,b,c,d,tx,ty) { + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.tx = tx; + this.ty = ty; + } + ,to3DString: function(roundPixels) { + if(roundPixels == null) { + roundPixels = false; + } + if(roundPixels) { + return "matrix3d(" + this.a + ", " + this.b + ", 0, 0, " + this.c + ", " + this.d + ", 0, 0, 0, 0, 1, 0, " + (this.tx | 0) + ", " + (this.ty | 0) + ", 0, 1)"; + } else { + return "matrix3d(" + this.a + ", " + this.b + ", 0, 0, " + this.c + ", " + this.d + ", 0, 0, 0, 0, 1, 0, " + this.tx + ", " + this.ty + ", 0, 1)"; + } + } + ,toMozString: function() { + return "matrix(" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.tx + "px, " + this.ty + "px)"; + } + ,toString: function() { + return "matrix(" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.tx + ", " + this.ty + ")"; + } + ,transformPoint: function(pos) { + return new openfl_geom_Point(pos.x * this.a + pos.y * this.c + this.tx,pos.x * this.b + pos.y * this.d + this.ty); + } + ,transformPointToOutput: function(pos,output) { + if(output != null) { + output.setTo(pos.x * this.a + pos.y * this.c + this.tx,pos.x * this.b + pos.y * this.d + this.ty); + return output; + } + return new openfl_geom_Point(pos.x * this.a + pos.y * this.c + this.tx,pos.x * this.b + pos.y * this.d + this.ty); + } + ,translate: function(dx,dy) { + this.tx += dx; + this.ty += dy; + } + ,toArray: function(transpose) { + if(transpose == null) { + transpose = false; + } + if(this.__array == null) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__array = new Float32Array(9); + } + if(transpose) { + this.__array[0] = this.a; + this.__array[1] = this.b; + this.__array[2] = 0; + this.__array[3] = this.c; + this.__array[4] = this.d; + this.__array[5] = 0; + this.__array[6] = this.tx; + this.__array[7] = this.ty; + this.__array[8] = 1; + } else { + this.__array[0] = this.a; + this.__array[1] = this.c; + this.__array[2] = this.tx; + this.__array[3] = this.b; + this.__array[4] = this.d; + this.__array[5] = this.ty; + this.__array[6] = 0; + this.__array[7] = 0; + this.__array[8] = 1; + } + return this.__array; + } + ,__cleanValues: function() { + this.a = Math.round(this.a * 1000) / 1000; + this.b = Math.round(this.b * 1000) / 1000; + this.c = Math.round(this.c * 1000) / 1000; + this.d = Math.round(this.d * 1000) / 1000; + this.tx = Math.round(this.tx * 10) / 10; + this.ty = Math.round(this.ty * 10) / 10; + } + ,__toMatrix3: function() { + lime_math_Matrix3.setTo(openfl_geom_Matrix.__matrix3,this.a,this.b,this.c,this.d,this.tx,this.ty); + return openfl_geom_Matrix.__matrix3; + } + ,__transformInversePoint: function(point) { + var norm = this.a * this.d - this.b * this.c; + if(norm == 0) { + point.x = -this.tx; + point.y = -this.ty; + } else { + var px = 1.0 / norm * (this.c * (this.ty - point.y) + this.d * (point.x - this.tx)); + point.y = 1.0 / norm * (this.a * (point.y - this.ty) + this.b * (this.tx - point.x)); + point.x = px; + } + } + ,__transformInverseX: function(px,py) { + var norm = this.a * this.d - this.b * this.c; + if(norm == 0) { + return -this.tx; + } else { + return 1.0 / norm * (this.c * (this.ty - py) + this.d * (px - this.tx)); + } + } + ,__transformInverseY: function(px,py) { + var norm = this.a * this.d - this.b * this.c; + if(norm == 0) { + return -this.ty; + } else { + return 1.0 / norm * (this.a * (py - this.ty) + this.b * (this.tx - px)); + } + } + ,__transformPoint: function(point) { + var px = point.x; + var py = point.y; + point.x = px * this.a + py * this.c + this.tx; + point.y = px * this.b + py * this.d + this.ty; + } + ,__transformX: function(px,py) { + return px * this.a + py * this.c + this.tx; + } + ,__transformY: function(px,py) { + return px * this.b + py * this.d + this.ty; + } + ,__translateTransformed: function(px,py) { + this.tx = px * this.a + py * this.c + this.tx; + this.ty = px * this.b + py * this.d + this.ty; + } + ,__class__: openfl_geom_Matrix +}; +var openfl_geom_ColorTransform = function(redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier,redOffset,greenOffset,blueOffset,alphaOffset) { + if(alphaOffset == null) { + alphaOffset = 0; + } + if(blueOffset == null) { + blueOffset = 0; + } + if(greenOffset == null) { + greenOffset = 0; + } + if(redOffset == null) { + redOffset = 0; + } + if(alphaMultiplier == null) { + alphaMultiplier = 1; + } + if(blueMultiplier == null) { + blueMultiplier = 1; + } + if(greenMultiplier == null) { + greenMultiplier = 1; + } + if(redMultiplier == null) { + redMultiplier = 1; + } + this.redMultiplier = redMultiplier; + this.greenMultiplier = greenMultiplier; + this.blueMultiplier = blueMultiplier; + this.alphaMultiplier = alphaMultiplier; + this.redOffset = redOffset; + this.greenOffset = greenOffset; + this.blueOffset = blueOffset; + this.alphaOffset = alphaOffset; +}; +$hxClasses["openfl.geom.ColorTransform"] = openfl_geom_ColorTransform; +openfl_geom_ColorTransform.__name__ = "openfl.geom.ColorTransform"; +openfl_geom_ColorTransform.prototype = { + concat: function(second) { + this.redOffset = second.redOffset * this.redMultiplier + this.redOffset; + this.greenOffset = second.greenOffset * this.greenMultiplier + this.greenOffset; + this.blueOffset = second.blueOffset * this.blueMultiplier + this.blueOffset; + this.alphaOffset = second.alphaOffset * this.alphaMultiplier + this.alphaOffset; + this.redMultiplier *= second.redMultiplier; + this.greenMultiplier *= second.greenMultiplier; + this.blueMultiplier *= second.blueMultiplier; + this.alphaMultiplier *= second.alphaMultiplier; + } + ,toString: function() { + return "(redMultiplier=" + this.redMultiplier + ", greenMultiplier=" + this.greenMultiplier + ", blueMultiplier=" + this.blueMultiplier + ", alphaMultiplier=" + this.alphaMultiplier + ", redOffset=" + this.redOffset + ", greenOffset=" + this.greenOffset + ", blueOffset=" + this.blueOffset + ", alphaOffset=" + this.alphaOffset + ")"; + } + ,__clone: function() { + return new openfl_geom_ColorTransform(this.redMultiplier,this.greenMultiplier,this.blueMultiplier,this.alphaMultiplier,this.redOffset,this.greenOffset,this.blueOffset,this.alphaOffset); + } + ,__copyFrom: function(ct) { + this.redMultiplier = ct.redMultiplier; + this.greenMultiplier = ct.greenMultiplier; + this.blueMultiplier = ct.blueMultiplier; + this.alphaMultiplier = ct.alphaMultiplier; + this.redOffset = ct.redOffset; + this.greenOffset = ct.greenOffset; + this.blueOffset = ct.blueOffset; + this.alphaOffset = ct.alphaOffset; + } + ,__combine: function(ct) { + this.redMultiplier *= ct.redMultiplier; + this.greenMultiplier *= ct.greenMultiplier; + this.blueMultiplier *= ct.blueMultiplier; + this.alphaMultiplier *= ct.alphaMultiplier; + this.redOffset += ct.redOffset; + this.greenOffset += ct.greenOffset; + this.blueOffset += ct.blueOffset; + this.alphaOffset += ct.alphaOffset; + } + ,__identity: function() { + this.redMultiplier = 1; + this.greenMultiplier = 1; + this.blueMultiplier = 1; + this.alphaMultiplier = 1; + this.redOffset = 0; + this.greenOffset = 0; + this.blueOffset = 0; + this.alphaOffset = 0; + } + ,__invert: function() { + this.redMultiplier = this.redMultiplier != 0 ? 1 / this.redMultiplier : 1; + this.greenMultiplier = this.greenMultiplier != 0 ? 1 / this.greenMultiplier : 1; + this.blueMultiplier = this.blueMultiplier != 0 ? 1 / this.blueMultiplier : 1; + this.alphaMultiplier = this.alphaMultiplier != 0 ? 1 / this.alphaMultiplier : 1; + this.redOffset = -this.redOffset; + this.greenOffset = -this.greenOffset; + this.blueOffset = -this.blueOffset; + this.alphaOffset = -this.alphaOffset; + } + ,__equals: function(ct,ignoreAlphaMultiplier) { + if(ct != null && this.redMultiplier == ct.redMultiplier && this.greenMultiplier == ct.greenMultiplier && this.blueMultiplier == ct.blueMultiplier && (ignoreAlphaMultiplier || this.alphaMultiplier == ct.alphaMultiplier) && this.redOffset == ct.redOffset && this.greenOffset == ct.greenOffset && this.blueOffset == ct.blueOffset) { + return this.alphaOffset == ct.alphaOffset; + } else { + return false; + } + } + ,__isDefault: function(ignoreAlphaMultiplier) { + if(ignoreAlphaMultiplier) { + if(this.redMultiplier == 1 && this.greenMultiplier == 1 && this.blueMultiplier == 1 && this.redOffset == 0 && this.greenOffset == 0 && this.blueOffset == 0) { + return this.alphaOffset == 0; + } else { + return false; + } + } else if(this.redMultiplier == 1 && this.greenMultiplier == 1 && this.blueMultiplier == 1 && this.alphaMultiplier == 1 && this.redOffset == 0 && this.greenOffset == 0 && this.blueOffset == 0) { + return this.alphaOffset == 0; + } else { + return false; + } + } + ,__setArrays: function(colorMultipliers,colorOffsets) { + colorMultipliers[0] = this.redMultiplier; + colorMultipliers[1] = this.greenMultiplier; + colorMultipliers[2] = this.blueMultiplier; + colorMultipliers[3] = this.alphaMultiplier; + colorOffsets[0] = this.redOffset; + colorOffsets[1] = this.greenOffset; + colorOffsets[2] = this.blueOffset; + colorOffsets[3] = this.alphaOffset; + } + ,get_color: function() { + return (this.redOffset | 0) << 16 | (this.greenOffset | 0) << 8 | (this.blueOffset | 0); + } + ,set_color: function(value) { + this.redOffset = value >> 16 & 255; + this.greenOffset = value >> 8 & 255; + this.blueOffset = value & 255; + this.redMultiplier = 0; + this.greenMultiplier = 0; + this.blueMultiplier = 0; + return this.get_color(); + } + ,__toLimeColorMatrix: function() { + if(openfl_geom_ColorTransform.__limeColorMatrix == null) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + openfl_geom_ColorTransform.__limeColorMatrix = new Float32Array(20); + } + openfl_geom_ColorTransform.__limeColorMatrix[0] = this.redMultiplier; + openfl_geom_ColorTransform.__limeColorMatrix[4] = this.redOffset / 255; + openfl_geom_ColorTransform.__limeColorMatrix[6] = this.greenMultiplier; + openfl_geom_ColorTransform.__limeColorMatrix[9] = this.greenOffset / 255; + openfl_geom_ColorTransform.__limeColorMatrix[12] = this.blueMultiplier; + openfl_geom_ColorTransform.__limeColorMatrix[14] = this.blueOffset / 255; + openfl_geom_ColorTransform.__limeColorMatrix[18] = this.alphaMultiplier; + openfl_geom_ColorTransform.__limeColorMatrix[19] = this.alphaOffset / 255; + return openfl_geom_ColorTransform.__limeColorMatrix; + } + ,__class__: openfl_geom_ColorTransform + ,__properties__: {set_color:"set_color",get_color:"get_color"} +}; +var openfl_display__$internal_Context3DGraphics = function() { }; +$hxClasses["openfl.display._internal.Context3DGraphics"] = openfl_display__$internal_Context3DGraphics; +openfl_display__$internal_Context3DGraphics.__name__ = "openfl.display._internal.Context3DGraphics"; +openfl_display__$internal_Context3DGraphics.buildBuffer = function(graphics,renderer) { + var quadBufferPosition = 0; + var triangleIndexBufferPosition = 0; + var vertexBufferPosition = 0; + var vertexBufferPositionUVT = 0; + var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands); + var context = renderer.__context3D; + var tileRect = openfl_geom_Rectangle.__pool.get(); + var tileTransform = openfl_geom_Matrix.__pool.get(); + var bitmap = null; + var _g = 0; + var _g1 = graphics.__commands.types; + while(_g < _g1.length) { + var type = _g1[_g]; + ++_g; + switch(type._hx_index) { + case 0: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL; + var c = data; + bitmap = c.buffer.o[c.oPos]; + break; + case 1: + bitmap = null; + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + break; + case 3: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL; + var c1 = data; + var shaderBuffer = c1.buffer.o[c1.oPos]; + bitmap = null; + if(shaderBuffer != null) { + var _g2 = 0; + var _g3 = shaderBuffer.inputCount; + while(_g2 < _g3) { + var i = _g2++; + if(shaderBuffer.inputRefs[i].name == "bitmap") { + bitmap = shaderBuffer.inputs[i]; + break; + } + } + } + break; + case 8: + if(bitmap != null) { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS; + var c2 = data; + var rects = c2.buffer.o[c2.oPos]; + var indices = c2.buffer.o[c2.oPos + 1]; + var transforms = c2.buffer.o[c2.oPos + 2]; + var hasIndices = indices != null; + var transformABCD = false; + var transformXY = false; + var length = hasIndices ? indices.get_length() : Math.floor(rects.get_length() / 4); + if(length == 0) { + return; + } + if(transforms != null) { + if(transforms.get_length() >= length * 6) { + transformABCD = true; + transformXY = true; + } else if(transforms.get_length() >= length * 4) { + transformABCD = true; + } else if(transforms.get_length() >= length * 2) { + transformXY = true; + } + } + var dataPerVertex = 4; + var stride = dataPerVertex * 4; + if(graphics.__quadBuffer == null) { + graphics.__quadBuffer = new openfl_display__$internal_Context3DBuffer(context,openfl_display__$internal_Context3DElementType.QUADS,length,dataPerVertex); + } else { + graphics.__quadBuffer.resize(quadBufferPosition + length,dataPerVertex); + } + var vertexOffset; + var tileWidth; + var tileHeight; + var uvX; + var uvY; + var uvWidth; + var uvHeight; + var x; + var y; + var x2; + var y2; + var x3; + var y3; + var x4; + var y4; + var ri; + var ti; + var vertexBufferData = graphics.__quadBuffer.vertexBufferData; + var bitmapWidth = bitmap.width; + var bitmapHeight = bitmap.height; + var _g4 = 0; + var _g5 = length; + while(_g4 < _g5) { + var i1 = _g4++; + vertexOffset = (quadBufferPosition + i1) * stride; + ri = hasIndices ? indices.get(i1) * 4 : i1 * 4; + if(ri < 0) { + continue; + } + tileRect.setTo(rects.get(ri),rects.get(ri + 1),rects.get(ri + 2),rects.get(ri + 3)); + tileWidth = tileRect.width; + tileHeight = tileRect.height; + if(tileWidth <= 0 || tileHeight <= 0) { + continue; + } + if(transformABCD && transformXY) { + ti = i1 * 6; + tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),transforms.get(ti + 4),transforms.get(ti + 5)); + } else if(transformABCD) { + ti = i1 * 4; + tileTransform.setTo(transforms.get(ti),transforms.get(ti + 1),transforms.get(ti + 2),transforms.get(ti + 3),tileRect.x,tileRect.y); + } else if(transformXY) { + ti = i1 * 2; + tileTransform.tx = transforms.get(ti); + tileTransform.ty = transforms.get(ti + 1); + } else { + tileTransform.tx = tileRect.x; + tileTransform.ty = tileRect.y; + } + uvX = tileRect.x / bitmapWidth; + uvY = tileRect.y / bitmapHeight; + uvWidth = tileRect.get_right() / bitmapWidth; + uvHeight = tileRect.get_bottom() / bitmapHeight; + x = 0 * tileTransform.a + 0 * tileTransform.c + tileTransform.tx; + y = 0 * tileTransform.b + 0 * tileTransform.d + tileTransform.ty; + x2 = tileWidth * tileTransform.a + 0 * tileTransform.c + tileTransform.tx; + y2 = tileWidth * tileTransform.b + 0 * tileTransform.d + tileTransform.ty; + x3 = 0 * tileTransform.a + tileHeight * tileTransform.c + tileTransform.tx; + y3 = 0 * tileTransform.b + tileHeight * tileTransform.d + tileTransform.ty; + x4 = tileWidth * tileTransform.a + tileHeight * tileTransform.c + tileTransform.tx; + y4 = tileWidth * tileTransform.b + tileHeight * tileTransform.d + tileTransform.ty; + vertexBufferData[vertexOffset] = x; + vertexBufferData[vertexOffset + 1] = y; + vertexBufferData[vertexOffset + 2] = uvX; + vertexBufferData[vertexOffset + 3] = uvY; + vertexBufferData[vertexOffset + dataPerVertex] = x2; + vertexBufferData[vertexOffset + dataPerVertex + 1] = y2; + vertexBufferData[vertexOffset + dataPerVertex + 2] = uvWidth; + vertexBufferData[vertexOffset + dataPerVertex + 3] = uvY; + vertexBufferData[vertexOffset + dataPerVertex * 2] = x3; + vertexBufferData[vertexOffset + dataPerVertex * 2 + 1] = y3; + vertexBufferData[vertexOffset + dataPerVertex * 2 + 2] = uvX; + vertexBufferData[vertexOffset + dataPerVertex * 2 + 3] = uvHeight; + vertexBufferData[vertexOffset + dataPerVertex * 3] = x4; + vertexBufferData[vertexOffset + dataPerVertex * 3 + 1] = y4; + vertexBufferData[vertexOffset + dataPerVertex * 3 + 2] = uvWidth; + vertexBufferData[vertexOffset + dataPerVertex * 3 + 3] = uvHeight; + } + quadBufferPosition += length; + } + break; + case 12: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES; + var c3 = data; + var vertices = c3.buffer.o[c3.oPos]; + var indices1 = c3.buffer.o[c3.oPos + 1]; + var uvtData = c3.buffer.o[c3.oPos + 2]; + var culling = c3.buffer.o[c3.oPos + 3]; + var hasIndices1 = indices1 != null; + var numVertices = Math.floor(vertices.get_length() / 2); + var length1 = hasIndices1 ? indices1.get_length() : numVertices; + var hasUVData = uvtData != null; + var hasUVTData = hasUVData && uvtData.get_length() >= numVertices * 3; + var vertLength = hasUVTData ? 4 : 2; + var uvStride = hasUVTData ? 3 : 2; + var dataPerVertex1 = vertLength + 2; + var vertexOffset1 = hasUVTData ? vertexBufferPositionUVT : vertexBufferPosition; + openfl_display__$internal_Context3DGraphics.resizeVertexBuffer(graphics,hasUVTData,vertexOffset1 + length1 * dataPerVertex1); + var vertexBufferData1 = hasUVTData ? graphics.__vertexBufferDataUVT : graphics.__vertexBufferData; + var offset; + var vertOffset; + var uvOffset; + var t; + var _g6 = 0; + var _g7 = length1; + while(_g6 < _g7) { + var i2 = _g6++; + offset = vertexOffset1 + i2 * dataPerVertex1; + vertOffset = hasIndices1 ? indices1.get(i2) * 2 : i2 * 2; + uvOffset = hasIndices1 ? indices1.get(i2) * uvStride : i2 * uvStride; + if(hasUVTData) { + t = uvtData.get(uvOffset + 2); + vertexBufferData1[offset] = vertices.get(vertOffset) / t; + vertexBufferData1[offset + 1] = vertices.get(vertOffset + 1) / t; + vertexBufferData1[offset + 2] = 0; + vertexBufferData1[offset + 3] = 1 / t; + } else { + vertexBufferData1[offset] = vertices.get(vertOffset); + vertexBufferData1[offset + 1] = vertices.get(vertOffset + 1); + } + vertexBufferData1[offset + vertLength] = hasUVData ? uvtData.get(uvOffset) : 0; + vertexBufferData1[offset + vertLength + 1] = hasUVData ? uvtData.get(uvOffset + 1) : 0; + } + if(hasUVTData) { + vertexBufferPositionUVT += length1 * dataPerVertex1; + } else { + vertexBufferPosition += length1 * dataPerVertex1; + } + break; + case 13: + bitmap = null; + break; + default: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + } + } + if(quadBufferPosition > 0) { + graphics.__quadBuffer.flushVertexBufferData(); + } + if(triangleIndexBufferPosition > 0) { + var buffer = graphics.__triangleIndexBuffer; + if(buffer == null || triangleIndexBufferPosition > graphics.__triangleIndexBufferCount) { + buffer = context.createIndexBuffer(triangleIndexBufferPosition,0); + graphics.__triangleIndexBuffer = buffer; + graphics.__triangleIndexBufferCount = triangleIndexBufferPosition; + } + buffer.uploadFromTypedArray(graphics.__triangleIndexBufferData); + } + if(vertexBufferPosition > 0) { + var buffer = graphics.__vertexBuffer; + if(buffer == null || vertexBufferPosition > graphics.__vertexBufferCount) { + buffer = context.createVertexBuffer(vertexBufferPosition,4,0); + graphics.__vertexBuffer = buffer; + graphics.__vertexBufferCount = vertexBufferPosition; + } + buffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(graphics.__vertexBufferData)); + } + if(vertexBufferPositionUVT > 0) { + var buffer = graphics.__vertexBufferUVT; + if(buffer == null || vertexBufferPositionUVT > graphics.__vertexBufferCountUVT) { + buffer = context.createVertexBuffer(vertexBufferPositionUVT,6,0); + graphics.__vertexBufferUVT = buffer; + graphics.__vertexBufferCountUVT = vertexBufferPositionUVT; + } + buffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(graphics.__vertexBufferDataUVT)); + } + openfl_geom_Rectangle.__pool.release(tileRect); + openfl_geom_Matrix.__pool.release(tileTransform); +}; +openfl_display__$internal_Context3DGraphics.isCompatible = function(graphics) { + if(graphics.__owner.__worldScale9Grid != null) { + return false; + } + var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands); + var hasColorFill = false; + var hasBitmapFill = false; + var hasShaderFill = false; + var _g = 0; + var _g1 = graphics.__commands.types; + while(_g < _g1.length) { + var type = _g1[_g]; + ++_g; + switch(type._hx_index) { + case 0: + hasBitmapFill = true; + hasColorFill = false; + hasShaderFill = false; + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + break; + case 1: + hasBitmapFill = false; + hasColorFill = true; + hasShaderFill = false; + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + break; + case 3: + hasBitmapFill = false; + hasColorFill = false; + hasShaderFill = true; + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + break; + case 8: + if(hasBitmapFill || hasShaderFill) { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + } else { + data.destroy(); + return false; + } + break; + case 9: + if(hasColorFill) { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + } else { + data.destroy(); + return false; + } + break; + case 12: + if(hasBitmapFill || hasShaderFill) { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + } else { + data.destroy(); + return false; + } + break; + case 13: + hasBitmapFill = false; + hasColorFill = false; + hasShaderFill = false; + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + break; + case 18: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + break; + case 19: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + break; + default: + data.destroy(); + return false; + } + } + data.destroy(); + return true; +}; +openfl_display__$internal_Context3DGraphics.render = function(graphics,renderer) { + if(!graphics.__visible || graphics.__commands.get_length() == 0) { + return; + } + if(graphics.__bitmap != null && !graphics.__dirty || !openfl_display__$internal_Context3DGraphics.isCompatible(graphics)) { + renderer.__softwareRenderer.__pixelRatio = renderer.__pixelRatio; + var cacheTransform = renderer.__softwareRenderer.__worldTransform; + if(graphics.__owner.__drawableType == 7) { + renderer.__softwareRenderer.__worldTransform = openfl_geom_Matrix.__identity; + } else { + renderer.__softwareRenderer.__worldTransform = renderer.__worldTransform; + } + openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__softwareRenderer); + renderer.__softwareRenderer.__worldTransform = cacheTransform; + } else { + graphics.__bitmap = null; + var pixelRatio = renderer.__pixelRatio; + graphics.__update(renderer.__worldTransform,pixelRatio); + var bounds = graphics.__bounds; + var width = graphics.__width; + var height = graphics.__height; + if(bounds != null && width >= 1 && height >= 1) { + if(graphics.__hardwareDirty || graphics.__quadBuffer == null && graphics.__vertexBuffer == null && graphics.__vertexBufferUVT == null) { + openfl_display__$internal_Context3DGraphics.buildBuffer(graphics,renderer); + } + var data = new openfl_display__$internal_DrawCommandReader(graphics.__commands); + var context = renderer.__context3D; + var gl = context.gl; + var matrix = openfl_geom_Matrix.__pool.get(); + var shaderBuffer = null; + var bitmap = null; + var repeat = false; + var smooth = false; + var fill = null; + var positionX = 0.0; + var positionY = 0.0; + var quadBufferPosition = 0; + var shaderBufferOffset = 0; + var triangleIndexBufferPosition = 0; + var vertexBufferPosition = 0; + var vertexBufferPositionUVT = 0; + var _g = 0; + var _g1 = graphics.__commands.types; + while(_g < _g1.length) { + var type = _g1[_g]; + ++_g; + switch(type._hx_index) { + case 0: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL; + var c = data; + bitmap = c.buffer.o[c.oPos]; + repeat = c.buffer.b[c.bPos]; + smooth = c.buffer.b[c.bPos + 1]; + shaderBuffer = null; + fill = null; + break; + case 1: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL; + var c1 = data; + var color = c1.buffer.i[c1.iPos] | 0; + var alpha = c1.buffer.f[c1.fPos] * 255 | 0; + fill = color & 16777215 | alpha << 24; + shaderBuffer = null; + bitmap = null; + break; + case 3: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL; + var c2 = data; + shaderBuffer = c2.buffer.o[c2.oPos]; + shaderBufferOffset = 0; + if(shaderBuffer == null || shaderBuffer.shader == null || shaderBuffer.shader.__bitmap == null) { + bitmap = null; + } else { + bitmap = shaderBuffer.shader.__bitmap.input; + } + fill = null; + break; + case 8: + if(bitmap != null) { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS; + var c3 = data; + var rects = c3.buffer.o[c3.oPos]; + var indices = c3.buffer.o[c3.oPos + 1]; + var transforms = c3.buffer.o[c3.oPos + 2]; + var hasIndices = indices != null; + var length = hasIndices ? indices.get_length() : Math.floor(rects.get_length() / 4); + var uMatrix = renderer.__getMatrix(graphics.__owner.__renderTransform,1); + var shader; + if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) { + shader = renderer.__initShaderBuffer(shaderBuffer); + renderer.__setShaderBuffer(shaderBuffer); + renderer.applyMatrix(uMatrix); + renderer.applyBitmapData(bitmap,false,repeat); + renderer.applyAlpha(graphics.__owner.__worldAlpha); + renderer.applyColorTransform(graphics.__owner.__worldColorTransform); + } else { + shader = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null); + renderer.setShader(shader); + renderer.applyMatrix(uMatrix); + renderer.applyBitmapData(bitmap,smooth,repeat); + renderer.applyAlpha(graphics.__owner.__worldAlpha); + renderer.applyColorTransform(graphics.__owner.__worldColorTransform); + renderer.updateShader(); + } + var end = quadBufferPosition + length; + while(quadBufferPosition < end) { + length = Math.min(end - quadBufferPosition,context.__quadIndexBufferElements) | 0; + if(length <= 0) { + break; + } + if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) { + renderer.__updateShaderBuffer(shaderBufferOffset); + } + if(shader.__position != null) { + context.setVertexBufferAt(shader.__position.index,graphics.__quadBuffer.vertexBuffer,quadBufferPosition * 16,2); + } + if(shader.__textureCoord != null) { + context.setVertexBufferAt(shader.__textureCoord.index,graphics.__quadBuffer.vertexBuffer,quadBufferPosition * 16 + 2,2); + } + context.drawTriangles(context.__quadIndexBuffer,0,length * 2); + shaderBufferOffset += length * 4; + quadBufferPosition += length; + } + renderer.__clearShader(); + } + break; + case 9: + if(fill != null) { + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT; + var c4 = data; + var x = c4.buffer.f[c4.fPos]; + var y = c4.buffer.f[c4.fPos + 1]; + var width = c4.buffer.f[c4.fPos + 2]; + var height = c4.buffer.f[c4.fPos + 3]; + var color1 = fill; + openfl_display__$internal_Context3DGraphics.tempColorTransform.redOffset = color1 >>> 16 & 255; + openfl_display__$internal_Context3DGraphics.tempColorTransform.greenOffset = color1 >>> 8 & 255; + openfl_display__$internal_Context3DGraphics.tempColorTransform.blueOffset = color1 & 255; + openfl_display__$internal_Context3DGraphics.tempColorTransform.__combine(graphics.__owner.__worldColorTransform); + matrix.identity(); + matrix.scale(width,height); + matrix.tx = x; + matrix.ty = y; + matrix.concat(graphics.__owner.__renderTransform); + var shader1 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null); + renderer.setShader(shader1); + renderer.applyMatrix(renderer.__getMatrix(matrix,1)); + renderer.applyBitmapData(openfl_display__$internal_Context3DGraphics.blankBitmapData,true,repeat); + renderer.applyAlpha((color1 >>> 24 & 255) / 255 * graphics.__owner.__worldAlpha); + renderer.applyColorTransform(openfl_display__$internal_Context3DGraphics.tempColorTransform); + renderer.updateShader(); + var vertexBuffer = openfl_display__$internal_Context3DGraphics.blankBitmapData.getVertexBuffer(context); + if(shader1.__position != null) { + context.setVertexBufferAt(shader1.__position.index,vertexBuffer,0,3); + } + if(shader1.__textureCoord != null) { + context.setVertexBufferAt(shader1.__textureCoord.index,vertexBuffer,3,2); + } + var indexBuffer = openfl_display__$internal_Context3DGraphics.blankBitmapData.getIndexBuffer(context); + context.drawTriangles(indexBuffer); + shaderBufferOffset += 4; + renderer.__clearShader(); + } + break; + case 12: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES; + var c5 = data; + var vertices = c5.buffer.o[c5.oPos]; + var indices1 = c5.buffer.o[c5.oPos + 1]; + var uvtData = c5.buffer.o[c5.oPos + 2]; + var culling = c5.buffer.o[c5.oPos + 3]; + var hasIndices1 = indices1 != null; + var numVertices = Math.floor(vertices.get_length() / 2); + var length1 = hasIndices1 ? indices1.get_length() : numVertices; + var hasUVData = uvtData != null; + var hasUVTData = hasUVData && uvtData.get_length() >= numVertices * 3; + var vertLength = hasUVTData ? 4 : 2; + var uvStride = hasUVTData ? 3 : 2; + var dataPerVertex = vertLength + 2; + var vertexBuffer1 = hasUVTData ? graphics.__vertexBufferUVT : graphics.__vertexBuffer; + var bufferPosition = hasUVTData ? vertexBufferPositionUVT : vertexBufferPosition; + var uMatrix1 = renderer.__getMatrix(graphics.__owner.__renderTransform,1); + var shader2; + if(shaderBuffer != null && !openfl_display__$internal_Context3DGraphics.maskRender) { + shader2 = renderer.__initShaderBuffer(shaderBuffer); + renderer.__setShaderBuffer(shaderBuffer); + renderer.applyMatrix(uMatrix1); + renderer.applyBitmapData(bitmap,false,repeat); + renderer.applyAlpha(1); + renderer.applyColorTransform(null); + renderer.__updateShaderBuffer(shaderBufferOffset); + } else { + shader2 = openfl_display__$internal_Context3DGraphics.maskRender ? renderer.__maskShader : renderer.__initGraphicsShader(null); + renderer.setShader(shader2); + renderer.applyMatrix(uMatrix1); + renderer.applyBitmapData(bitmap,smooth,repeat); + renderer.applyAlpha(graphics.__owner.__worldAlpha); + renderer.applyColorTransform(graphics.__owner.__worldColorTransform); + renderer.updateShader(); + } + if(shader2.__position != null) { + context.setVertexBufferAt(shader2.__position.index,vertexBuffer1,bufferPosition,hasUVTData ? 4 : 2); + } + if(shader2.__textureCoord != null) { + context.setVertexBufferAt(shader2.__textureCoord.index,vertexBuffer1,bufferPosition + vertLength,2); + } + switch(culling) { + case 0: + context.setCulling(0); + break; + case 1: + context.setCulling(3); + break; + case 2: + context.setCulling(1); + break; + default: + } + context.__drawTriangles(0,length1); + shaderBufferOffset += length1; + if(hasUVTData) { + vertexBufferPositionUVT += dataPerVertex * length1; + } else { + vertexBufferPosition += dataPerVertex * length1; + } + switch(culling) { + case 1:case 2: + context.setCulling(0); + break; + default: + } + renderer.__clearShader(); + break; + case 13: + bitmap = null; + fill = null; + shaderBuffer = null; + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + context.setCulling(3); + break; + case 18: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.MOVE_TO; + var c6 = data; + positionX = c6.buffer.f[c6.fPos]; + positionY = c6.buffer.f[c6.fPos + 1]; + break; + case 19: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE; + var c7 = data; + renderer.__setBlendMode(c7.buffer.o[c7.oPos]); + break; + default: + switch(data.prev._hx_index) { + case 0: + data.oPos += 2; + data.bPos += 2; + break; + case 1: + data.iPos += 1; + data.fPos += 1; + break; + case 2: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 3: + data.oPos += 1; + break; + case 4: + data.fPos += 6; + break; + case 5: + data.fPos += 4; + break; + case 6: + data.fPos += 3; + break; + case 7: + data.fPos += 4; + break; + case 8: + data.oPos += 3; + break; + case 9: + data.fPos += 4; + break; + case 10: + data.fPos += 5; + data.oPos += 1; + break; + case 12: + data.oPos += 4; + break; + case 13: + break; + case 14: + data.oPos += 2; + data.bPos += 2; + break; + case 15: + data.oPos += 4; + data.iiPos += 2; + data.ffPos += 1; + data.fPos += 1; + break; + case 16: + data.oPos += 4; + data.iPos += 1; + data.fPos += 2; + data.bPos += 1; + break; + case 17: + data.fPos += 2; + break; + case 18: + data.fPos += 2; + break; + case 19: + data.oPos += 1; + break; + case 20: + data.oPos += 1; + break; + case 21:case 22: + break; + default: + } + data.prev = type; + } + } + openfl_geom_Matrix.__pool.release(matrix); + } + graphics.__hardwareDirty = false; + graphics.set___dirty(false); + } +}; +openfl_display__$internal_Context3DGraphics.renderMask = function(graphics,renderer) { + openfl_display__$internal_Context3DGraphics.maskRender = true; + openfl_display__$internal_Context3DGraphics.render(graphics,renderer); + openfl_display__$internal_Context3DGraphics.maskRender = false; +}; +openfl_display__$internal_Context3DGraphics.resizeIndexBuffer = function(graphics,isQuad,length) { + if(isQuad) { + return; + } + var buffer = isQuad ? null : graphics.__triangleIndexBufferData; + var position = 0; + var newBuffer = null; + if(buffer == null) { + var array = null; + var vector = null; + var view = null; + var buffer1 = null; + var len = null; + var this1; + if(length != null) { + this1 = new Uint16Array(length); + } else if(array != null) { + this1 = new Uint16Array(array); + } else if(vector != null) { + this1 = new Uint16Array(vector.__array); + } else if(view != null) { + this1 = new Uint16Array(view); + } else if(buffer1 != null) { + if(len == null) { + this1 = new Uint16Array(buffer1,0); + } else { + this1 = new Uint16Array(buffer1,0,len); + } + } else { + this1 = null; + } + newBuffer = this1; + } else if(length > buffer.length) { + var array = null; + var vector = null; + var view = null; + var buffer1 = null; + var len = null; + var this1; + if(length != null) { + this1 = new Uint16Array(length); + } else if(array != null) { + this1 = new Uint16Array(array); + } else if(vector != null) { + this1 = new Uint16Array(vector.__array); + } else if(view != null) { + this1 = new Uint16Array(view); + } else if(buffer1 != null) { + if(len == null) { + this1 = new Uint16Array(buffer1,0); + } else { + this1 = new Uint16Array(buffer1,0,len); + } + } else { + this1 = null; + } + newBuffer = this1; + newBuffer.set(buffer); + position = buffer.length; + } + if(newBuffer != null) { + if(!isQuad) { + graphics.__triangleIndexBufferData = newBuffer; + } + } +}; +openfl_display__$internal_Context3DGraphics.resizeVertexBuffer = function(graphics,hasUVTData,length) { + var buffer = hasUVTData ? graphics.__vertexBufferDataUVT : graphics.__vertexBufferData; + var newBuffer = null; + if(buffer == null) { + var array = null; + var vector = null; + var view = null; + var buffer1 = null; + var len = null; + var this1; + if(length != null) { + this1 = new Float32Array(length); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer1 != null) { + if(len == null) { + this1 = new Float32Array(buffer1,0); + } else { + this1 = new Float32Array(buffer1,0,len); + } + } else { + this1 = null; + } + newBuffer = this1; + } else if(length > buffer.length) { + var array = null; + var vector = null; + var view = null; + var buffer1 = null; + var len = null; + var this1; + if(length != null) { + this1 = new Float32Array(length); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer1 != null) { + if(len == null) { + this1 = new Float32Array(buffer1,0); + } else { + this1 = new Float32Array(buffer1,0,len); + } + } else { + this1 = null; + } + newBuffer = this1; + newBuffer.set(buffer); + } + if(newBuffer != null) { + if(hasUVTData) { + graphics.__vertexBufferDataUVT = newBuffer; + } else { + graphics.__vertexBufferData = newBuffer; + } + } +}; +var openfl_display__$internal_Context3DMaskShader = function() { + if(this.__glFragmentSource == null) { + this.__glFragmentSource = "varying vec2 openfl_TextureCoordv;\n\n\t\tuniform sampler2D openfl_Texture;\n\n\t\tvoid main(void) {\n\n\t\t\tvec4 color = texture2D (openfl_Texture, openfl_TextureCoordv);\n\n\t\t\tif (color.a == 0.0) {\n\n\t\t\t\tdiscard;\n\n\t\t\t} else {\n\n\t\t\t\tgl_FragColor = color;\n\n\t\t\t}\n\n\t\t}"; + } + if(this.__glVertexSource == null) { + this.__glVertexSource = "attribute vec4 openfl_Position;\n\t\tattribute vec2 openfl_TextureCoord;\n\t\tvarying vec2 openfl_TextureCoordv;\n\n\t\tuniform mat4 openfl_Matrix;\n\n\t\tvoid main(void) {\n\n\t\t\topenfl_TextureCoordv = openfl_TextureCoord;\n\n\t\t\tgl_Position = openfl_Matrix * openfl_Position;\n\n\t\t}"; + } + openfl_display_Shader.call(this); + this.__isGenerated = true; + this.__initGL(); +}; +$hxClasses["openfl.display._internal.Context3DMaskShader"] = openfl_display__$internal_Context3DMaskShader; +openfl_display__$internal_Context3DMaskShader.__name__ = "openfl.display._internal.Context3DMaskShader"; +openfl_display__$internal_Context3DMaskShader.__super__ = openfl_display_Shader; +openfl_display__$internal_Context3DMaskShader.prototype = $extend(openfl_display_Shader.prototype,{ + __class__: openfl_display__$internal_Context3DMaskShader +}); +var openfl_display__$internal_Context3DShape = function() { }; +$hxClasses["openfl.display._internal.Context3DShape"] = openfl_display__$internal_Context3DShape; +openfl_display__$internal_Context3DShape.__name__ = "openfl.display._internal.Context3DShape"; +openfl_display__$internal_Context3DShape.render = function(shape,renderer) { + if(!shape.__renderable || shape.__worldAlpha <= 0) { + return; + } + var graphics = shape.__graphics; + if(graphics != null) { + renderer.__setBlendMode(shape.__worldBlendMode); + renderer.__pushMaskObject(shape); + openfl_display__$internal_Context3DGraphics.render(graphics,renderer); + if(graphics.__bitmap != null && graphics.__visible) { + var context = renderer.__context3D; + var scale9Grid = shape.__worldScale9Grid; + var shader = renderer.__initDisplayShader(shape.__worldShader); + renderer.setShader(shader); + renderer.applyBitmapData(graphics.__bitmap,true); + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.scale(1 / graphics.__bitmapScale,1 / graphics.__bitmapScale); + matrix.concat(graphics.__worldTransform); + renderer.applyMatrix(renderer.__getMatrix(matrix,1)); + openfl_geom_Matrix.__pool.release(matrix); + renderer.applyAlpha(shape.__worldAlpha); + renderer.applyColorTransform(shape.__worldColorTransform); + renderer.updateShader(); + var vertexBuffer = graphics.__bitmap.getVertexBuffer(context); + if(shader.__position != null) { + context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3); + } + if(shader.__textureCoord != null) { + context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2); + } + var indexBuffer = graphics.__bitmap.getIndexBuffer(context); + context.drawTriangles(indexBuffer); + renderer.__clearShader(); + } + renderer.__popMaskObject(shape); + } +}; +openfl_display__$internal_Context3DShape.renderMask = function(shape,renderer) { + var graphics = shape.__graphics; + if(graphics != null) { + openfl_display__$internal_Context3DGraphics.renderMask(graphics,renderer); + if(graphics.__bitmap != null) { + var context = renderer.__context3D; + var shader = renderer.__maskShader; + renderer.setShader(shader); + renderer.applyBitmapData(graphics.__bitmap,true); + renderer.applyMatrix(renderer.__getMatrix(graphics.__worldTransform,1)); + renderer.updateShader(); + var vertexBuffer = graphics.__bitmap.getVertexBuffer(context); + if(shader.__position != null) { + context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3); + } + if(shader.__textureCoord != null) { + context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2); + } + var indexBuffer = graphics.__bitmap.getIndexBuffer(context); + context.drawTriangles(indexBuffer); + renderer.__clearShader(); + } + } +}; +var openfl_display__$internal_Context3DSimpleButton = function() { }; +$hxClasses["openfl.display._internal.Context3DSimpleButton"] = openfl_display__$internal_Context3DSimpleButton; +openfl_display__$internal_Context3DSimpleButton.__name__ = "openfl.display._internal.Context3DSimpleButton"; +openfl_display__$internal_Context3DSimpleButton.renderDrawable = function(simpleButton,renderer) { + if(!simpleButton.__renderable || simpleButton.__worldAlpha <= 0 || simpleButton.__currentState == null) { + return; + } + renderer.__pushMaskObject(simpleButton); + renderer.__renderDrawable(simpleButton.__currentState); + renderer.__popMaskObject(simpleButton); + renderer.__renderEvent(simpleButton); +}; +openfl_display__$internal_Context3DSimpleButton.renderDrawableMask = function(simpleButton,renderer) { + if(simpleButton.__currentState == null) { + return; + } + renderer.__renderDrawableMask(simpleButton.__currentState); +}; +var openfl_display__$internal_Context3DTextField = function() { }; +$hxClasses["openfl.display._internal.Context3DTextField"] = openfl_display__$internal_Context3DTextField; +openfl_display__$internal_Context3DTextField.__name__ = "openfl.display._internal.Context3DTextField"; +openfl_display__$internal_Context3DTextField.render = function(textField,renderer) { + renderer.__softwareRenderer.__pixelRatio = renderer.__pixelRatio; + var renderer1 = renderer.__softwareRenderer; + var transform = textField.__worldTransform; + var textEngine = textField.__textEngine; + var useTextBounds = !(textEngine.background || textEngine.border); + var bounds = useTextBounds ? textEngine.textBounds : textEngine.bounds; + var graphics = textField.__graphics; + var cursorOffsetX = 0.0; + if(textField.__dirty) { + textField.__updateLayout(); + if(graphics.__bounds == null) { + graphics.__bounds = new openfl_geom_Rectangle(); + } + if(textField.get_text().length == 0) { + var boundsWidth = textEngine.bounds.width - 4; + var align = textField.get_defaultTextFormat().align; + cursorOffsetX = align == 3 ? 0 : align == 4 ? boundsWidth : boundsWidth / 2; + switch(align) { + case 0: + cursorOffsetX += textField.get_defaultTextFormat().leftMargin / 2; + cursorOffsetX -= textField.get_defaultTextFormat().rightMargin / 2; + cursorOffsetX += textField.get_defaultTextFormat().indent / 2; + cursorOffsetX += textField.get_defaultTextFormat().blockIndent / 2; + break; + case 1: + break; + case 2: + cursorOffsetX += textField.get_defaultTextFormat().leftMargin; + cursorOffsetX += textField.get_defaultTextFormat().indent; + cursorOffsetX += textField.get_defaultTextFormat().blockIndent; + break; + case 3: + cursorOffsetX += textField.get_defaultTextFormat().leftMargin; + cursorOffsetX += textField.get_defaultTextFormat().indent; + cursorOffsetX += textField.get_defaultTextFormat().blockIndent; + break; + case 4: + cursorOffsetX -= textField.get_defaultTextFormat().rightMargin; + break; + case 5: + break; + } + if(useTextBounds) { + bounds.y = textEngine.bounds.y; + bounds.x = cursorOffsetX; + } + } + graphics.__bounds.copyFrom(bounds); + } + var pixelRatio = renderer1.__pixelRatio; + graphics.__update(renderer1.__worldTransform,pixelRatio); + if(textField.__dirty || graphics.__softwareDirty) { + var width = Math.round(graphics.__width * pixelRatio); + var height = Math.round(graphics.__height * pixelRatio); + if((textEngine.text == null || textEngine.text == "") && !textEngine.background && !textEngine.border && !textEngine.__hasFocus && (textEngine.type != 1 || !textEngine.selectable) || (textEngine.width <= 0 || textEngine.height <= 0) && textEngine.autoSize != 2) { + textField.__graphics.__canvas = null; + textField.__graphics.__context = null; + textField.__graphics.__bitmap = null; + textField.__graphics.__softwareDirty = false; + textField.__graphics.set___dirty(false); + textField.__dirty = false; + } else { + if(textField.__graphics.__canvas == null) { + textField.__graphics.__canvas = window.document.createElement("canvas"); + textField.__graphics.__context = textField.__graphics.__canvas.getContext("2d"); + } + openfl_display__$internal_CanvasTextField.context = graphics.__context; + graphics.__canvas.width = width; + graphics.__canvas.height = height; + if(renderer1.__isDOM) { + graphics.__canvas.style.width = Math.round(width / pixelRatio) + "px"; + graphics.__canvas.style.height = Math.round(height / pixelRatio) + "px"; + } + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.scale(pixelRatio,pixelRatio); + matrix.concat(graphics.__renderTransform); + openfl_display__$internal_CanvasTextField.context.setTransform(matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty); + openfl_geom_Matrix.__pool.release(matrix); + if(openfl_display__$internal_CanvasTextField.clearRect == null) { + openfl_display__$internal_CanvasTextField.clearRect = (typeof navigator !== 'undefined' && typeof navigator['isCocoonJS'] !== 'undefined'); + } + if(openfl_display__$internal_CanvasTextField.clearRect) { + openfl_display__$internal_CanvasTextField.context.clearRect(0,0,graphics.__canvas.width,graphics.__canvas.height); + } + if(textEngine.text != null && textEngine.text != "" || textEngine.__hasFocus) { + var text = textEngine.text; + if(!renderer1.__allowSmoothing || textEngine.antiAliasType == 0 && textEngine.sharpness == 400) { + graphics.__context.imageSmoothingEnabled = false; + } else { + graphics.__context.imageSmoothingEnabled = true; + } + if(textEngine.border || textEngine.background) { + openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1); + if(textEngine.background) { + var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.fill(); + } + if(textEngine.border) { + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + var tmp = StringTools.hex(textEngine.borderColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.stroke(); + } + } + openfl_display__$internal_CanvasTextField.context.textBaseline = "alphabetic"; + openfl_display__$internal_CanvasTextField.context.textAlign = "start"; + var scrollX = -textField.get_scrollH(); + var scrollY = 0.0; + var _g = 0; + var _g1 = textField.get_scrollV() - 1; + while(_g < _g1) { + var i = _g++; + scrollY -= textEngine.lineHeights.get(i); + } + var advance; + var group = textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(group1.lineIndex < textField.get_scrollV() - 1) { + continue; + } + if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) { + break; + } + var color = "#" + StringTools.hex(group1.format.color & 16777215,6); + openfl_display__$internal_CanvasTextField.context.font = openfl_text__$internal_TextEngine.getFont(group1.format); + openfl_display__$internal_CanvasTextField.context.fillStyle = color; + openfl_display__$internal_CanvasTextField.context.fillText(text.substring(group1.startIndex,group1.endIndex),group1.offsetX + scrollX - bounds.x,group1.offsetY + group1.ascent + scrollY - bounds.y); + if(textField.__caretIndex > -1 && textEngine.selectable) { + if(textField.__selectionIndex == textField.__caretIndex) { + if(textField.__showCursor && group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex) { + advance = 0.0; + var _g = 0; + var _g1 = textField.__caretIndex - group1.startIndex; + while(_g < _g1) { + var i = _g++; + if(group1.positions.length <= i) { + break; + } + advance += group1.positions[i]; + } + var scrollY1 = 0.0; + var _g2 = textField.get_scrollV(); + var _g3 = group1.lineIndex + 1; + while(_g2 < _g3) { + var i1 = _g2++; + scrollY1 += textEngine.lineHeights.get(i1 - 1); + } + openfl_display__$internal_CanvasTextField.context.beginPath(); + var tmp = StringTools.hex(group1.format.color & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.moveTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + 2 - bounds.y); + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + openfl_display__$internal_CanvasTextField.context.lineTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1 - bounds.y); + openfl_display__$internal_CanvasTextField.context.stroke(); + openfl_display__$internal_CanvasTextField.context.closePath(); + } + } else if(group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex || group1.startIndex <= textField.__selectionIndex && group1.endIndex >= textField.__selectionIndex || group1.startIndex > textField.__caretIndex && group1.endIndex < textField.__selectionIndex || group1.startIndex > textField.__selectionIndex && group1.endIndex < textField.__caretIndex) { + var selectionStart = Math.min(textField.__selectionIndex,textField.__caretIndex) | 0; + var selectionEnd = Math.max(textField.__selectionIndex,textField.__caretIndex) | 0; + if(group1.startIndex > selectionStart) { + selectionStart = group1.startIndex; + } + if(group1.endIndex < selectionEnd) { + selectionEnd = group1.endIndex; + } + var end; + var start = textField.getCharBoundaries(selectionStart); + if(selectionEnd >= group1.endIndex) { + end = textField.getCharBoundaries(group1.endIndex - 1); + if(end != null) { + end.x += end.width + 2; + } + } else { + end = textField.getCharBoundaries(selectionEnd); + } + if(start != null && end != null) { + openfl_display__$internal_CanvasTextField.context.fillStyle = "#000000"; + openfl_display__$internal_CanvasTextField.context.fillRect(start.x + scrollX - bounds.x,start.y + scrollY,end.x - start.x,group1.height); + openfl_display__$internal_CanvasTextField.context.fillStyle = "#FFFFFF"; + openfl_display__$internal_CanvasTextField.context.fillText(text.substring(selectionStart,selectionEnd),scrollX + start.x - bounds.x,group1.offsetY + group1.ascent + scrollY); + } + } + } + if(group1.format.underline) { + openfl_display__$internal_CanvasTextField.context.beginPath(); + openfl_display__$internal_CanvasTextField.context.strokeStyle = color; + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + var descent = Math.floor(group1.ascent * 0.185); + var x = group1.offsetX + scrollX - bounds.x; + var y = Math.ceil(group1.offsetY + scrollY + group1.ascent - bounds.y) + descent + 0.5; + openfl_display__$internal_CanvasTextField.context.moveTo(x,y); + openfl_display__$internal_CanvasTextField.context.lineTo(x + group1.width,y); + openfl_display__$internal_CanvasTextField.context.stroke(); + openfl_display__$internal_CanvasTextField.context.closePath(); + } + } + } else { + if(textEngine.border || textEngine.background) { + if(textEngine.border) { + openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1); + } else { + openfl_display__$internal_CanvasTextField.context.rect(0,0,bounds.width,bounds.height); + } + if(textEngine.background) { + var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.fill(); + } + if(textEngine.border) { + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + openfl_display__$internal_CanvasTextField.context.lineCap = "square"; + var tmp = StringTools.hex(textEngine.borderColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.stroke(); + } + } + if(textField.__caretIndex > -1 && textEngine.selectable && textField.__showCursor) { + var scrollX = -textField.get_scrollH() + (useTextBounds ? 0 : cursorOffsetX); + var scrollY = 0.0; + var _g = 0; + var _g1 = textField.get_scrollV() - 1; + while(_g < _g1) { + var i = _g++; + scrollY += textEngine.lineHeights.get(i); + } + openfl_display__$internal_CanvasTextField.context.beginPath(); + var tmp = StringTools.hex(textField.get_defaultTextFormat().color & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.moveTo(scrollX + 2.5,scrollY + 2.5); + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + openfl_display__$internal_CanvasTextField.context.lineTo(scrollX + 2.5,scrollY + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1); + openfl_display__$internal_CanvasTextField.context.stroke(); + openfl_display__$internal_CanvasTextField.context.closePath(); + } + } + graphics.__bitmap = openfl_display_BitmapData.fromCanvas(textField.__graphics.__canvas); + graphics.__bitmapScale = pixelRatio; + graphics.__visible = true; + textField.__dirty = false; + graphics.__softwareDirty = false; + graphics.set___dirty(false); + } + } + textField.__graphics.__hardwareDirty = false; +}; +openfl_display__$internal_Context3DTextField.renderDrawable = function(textField,renderer) { + renderer.__updateCacheBitmap(textField,false); + if(textField.__cacheBitmap != null && !textField.__isCacheBitmapRender) { + openfl_display__$internal_Context3DBitmap.render(textField.__cacheBitmap,renderer); + } else { + openfl_display__$internal_Context3DTextField.render(textField,renderer); + if(!(textField.opaqueBackground == null && textField.__graphics == null)) { + if(!(!textField.__renderable || textField.__worldAlpha <= 0)) { + if(textField.opaqueBackground != null && !textField.__isCacheBitmapRender && textField.get_width() > 0 && textField.get_height() > 0) { + renderer.__setBlendMode(textField.__worldBlendMode); + renderer.__pushMaskObject(textField); + var context = renderer.__context3D; + var rect = openfl_geom_Rectangle.__pool.get(); + rect.setTo(0,0,textField.get_width(),textField.get_height()); + renderer.__pushMaskRect(rect,textField.__renderTransform); + var color = textField.opaqueBackground; + context.clear((color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1); + renderer.__popMaskRect(); + renderer.__popMaskObject(textField); + openfl_geom_Rectangle.__pool.release(rect); + } + if(textField.__graphics != null) { + openfl_display__$internal_Context3DShape.render(textField,renderer); + } + } + } + } + renderer.__renderEvent(textField); +}; +openfl_display__$internal_Context3DTextField.renderDrawableMask = function(textField,renderer) { + openfl_display__$internal_Context3DTextField.renderMask(textField,renderer); + openfl_display__$internal_Context3DDisplayObject.renderDrawableMask(textField,renderer); +}; +openfl_display__$internal_Context3DTextField.renderMask = function(textField,renderer) { + var renderer1 = renderer.__softwareRenderer; + var transform = textField.__worldTransform; + var textEngine = textField.__textEngine; + var useTextBounds = !(textEngine.background || textEngine.border); + var bounds = useTextBounds ? textEngine.textBounds : textEngine.bounds; + var graphics = textField.__graphics; + var cursorOffsetX = 0.0; + if(textField.__dirty) { + textField.__updateLayout(); + if(graphics.__bounds == null) { + graphics.__bounds = new openfl_geom_Rectangle(); + } + if(textField.get_text().length == 0) { + var boundsWidth = textEngine.bounds.width - 4; + var align = textField.get_defaultTextFormat().align; + cursorOffsetX = align == 3 ? 0 : align == 4 ? boundsWidth : boundsWidth / 2; + switch(align) { + case 0: + cursorOffsetX += textField.get_defaultTextFormat().leftMargin / 2; + cursorOffsetX -= textField.get_defaultTextFormat().rightMargin / 2; + cursorOffsetX += textField.get_defaultTextFormat().indent / 2; + cursorOffsetX += textField.get_defaultTextFormat().blockIndent / 2; + break; + case 1: + break; + case 2: + cursorOffsetX += textField.get_defaultTextFormat().leftMargin; + cursorOffsetX += textField.get_defaultTextFormat().indent; + cursorOffsetX += textField.get_defaultTextFormat().blockIndent; + break; + case 3: + cursorOffsetX += textField.get_defaultTextFormat().leftMargin; + cursorOffsetX += textField.get_defaultTextFormat().indent; + cursorOffsetX += textField.get_defaultTextFormat().blockIndent; + break; + case 4: + cursorOffsetX -= textField.get_defaultTextFormat().rightMargin; + break; + case 5: + break; + } + if(useTextBounds) { + bounds.y = textEngine.bounds.y; + bounds.x = cursorOffsetX; + } + } + graphics.__bounds.copyFrom(bounds); + } + var pixelRatio = renderer1.__pixelRatio; + graphics.__update(renderer1.__worldTransform,pixelRatio); + if(textField.__dirty || graphics.__softwareDirty) { + var width = Math.round(graphics.__width * pixelRatio); + var height = Math.round(graphics.__height * pixelRatio); + if((textEngine.text == null || textEngine.text == "") && !textEngine.background && !textEngine.border && !textEngine.__hasFocus && (textEngine.type != 1 || !textEngine.selectable) || (textEngine.width <= 0 || textEngine.height <= 0) && textEngine.autoSize != 2) { + textField.__graphics.__canvas = null; + textField.__graphics.__context = null; + textField.__graphics.__bitmap = null; + textField.__graphics.__softwareDirty = false; + textField.__graphics.set___dirty(false); + textField.__dirty = false; + } else { + if(textField.__graphics.__canvas == null) { + textField.__graphics.__canvas = window.document.createElement("canvas"); + textField.__graphics.__context = textField.__graphics.__canvas.getContext("2d"); + } + openfl_display__$internal_CanvasTextField.context = graphics.__context; + graphics.__canvas.width = width; + graphics.__canvas.height = height; + if(renderer1.__isDOM) { + graphics.__canvas.style.width = Math.round(width / pixelRatio) + "px"; + graphics.__canvas.style.height = Math.round(height / pixelRatio) + "px"; + } + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.scale(pixelRatio,pixelRatio); + matrix.concat(graphics.__renderTransform); + openfl_display__$internal_CanvasTextField.context.setTransform(matrix.a,matrix.b,matrix.c,matrix.d,matrix.tx,matrix.ty); + openfl_geom_Matrix.__pool.release(matrix); + if(openfl_display__$internal_CanvasTextField.clearRect == null) { + openfl_display__$internal_CanvasTextField.clearRect = (typeof navigator !== 'undefined' && typeof navigator['isCocoonJS'] !== 'undefined'); + } + if(openfl_display__$internal_CanvasTextField.clearRect) { + openfl_display__$internal_CanvasTextField.context.clearRect(0,0,graphics.__canvas.width,graphics.__canvas.height); + } + if(textEngine.text != null && textEngine.text != "" || textEngine.__hasFocus) { + var text = textEngine.text; + if(!renderer1.__allowSmoothing || textEngine.antiAliasType == 0 && textEngine.sharpness == 400) { + graphics.__context.imageSmoothingEnabled = false; + } else { + graphics.__context.imageSmoothingEnabled = true; + } + if(textEngine.border || textEngine.background) { + openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1); + if(textEngine.background) { + var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.fill(); + } + if(textEngine.border) { + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + var tmp = StringTools.hex(textEngine.borderColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.stroke(); + } + } + openfl_display__$internal_CanvasTextField.context.textBaseline = "alphabetic"; + openfl_display__$internal_CanvasTextField.context.textAlign = "start"; + var scrollX = -textField.get_scrollH(); + var scrollY = 0.0; + var _g = 0; + var _g1 = textField.get_scrollV() - 1; + while(_g < _g1) { + var i = _g++; + scrollY -= textEngine.lineHeights.get(i); + } + var advance; + var group = textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(group1.lineIndex < textField.get_scrollV() - 1) { + continue; + } + if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) { + break; + } + var color = "#" + StringTools.hex(group1.format.color & 16777215,6); + openfl_display__$internal_CanvasTextField.context.font = openfl_text__$internal_TextEngine.getFont(group1.format); + openfl_display__$internal_CanvasTextField.context.fillStyle = color; + openfl_display__$internal_CanvasTextField.context.fillText(text.substring(group1.startIndex,group1.endIndex),group1.offsetX + scrollX - bounds.x,group1.offsetY + group1.ascent + scrollY - bounds.y); + if(textField.__caretIndex > -1 && textEngine.selectable) { + if(textField.__selectionIndex == textField.__caretIndex) { + if(textField.__showCursor && group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex) { + advance = 0.0; + var _g = 0; + var _g1 = textField.__caretIndex - group1.startIndex; + while(_g < _g1) { + var i = _g++; + if(group1.positions.length <= i) { + break; + } + advance += group1.positions[i]; + } + var scrollY1 = 0.0; + var _g2 = textField.get_scrollV(); + var _g3 = group1.lineIndex + 1; + while(_g2 < _g3) { + var i1 = _g2++; + scrollY1 += textEngine.lineHeights.get(i1 - 1); + } + openfl_display__$internal_CanvasTextField.context.beginPath(); + var tmp = StringTools.hex(group1.format.color & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.moveTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + 2 - bounds.y); + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + openfl_display__$internal_CanvasTextField.context.lineTo(group1.offsetX + advance - textField.get_scrollH() - bounds.x,scrollY1 + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1 - bounds.y); + openfl_display__$internal_CanvasTextField.context.stroke(); + openfl_display__$internal_CanvasTextField.context.closePath(); + } + } else if(group1.startIndex <= textField.__caretIndex && group1.endIndex >= textField.__caretIndex || group1.startIndex <= textField.__selectionIndex && group1.endIndex >= textField.__selectionIndex || group1.startIndex > textField.__caretIndex && group1.endIndex < textField.__selectionIndex || group1.startIndex > textField.__selectionIndex && group1.endIndex < textField.__caretIndex) { + var selectionStart = Math.min(textField.__selectionIndex,textField.__caretIndex) | 0; + var selectionEnd = Math.max(textField.__selectionIndex,textField.__caretIndex) | 0; + if(group1.startIndex > selectionStart) { + selectionStart = group1.startIndex; + } + if(group1.endIndex < selectionEnd) { + selectionEnd = group1.endIndex; + } + var end; + var start = textField.getCharBoundaries(selectionStart); + if(selectionEnd >= group1.endIndex) { + end = textField.getCharBoundaries(group1.endIndex - 1); + if(end != null) { + end.x += end.width + 2; + } + } else { + end = textField.getCharBoundaries(selectionEnd); + } + if(start != null && end != null) { + openfl_display__$internal_CanvasTextField.context.fillStyle = "#000000"; + openfl_display__$internal_CanvasTextField.context.fillRect(start.x + scrollX - bounds.x,start.y + scrollY,end.x - start.x,group1.height); + openfl_display__$internal_CanvasTextField.context.fillStyle = "#FFFFFF"; + openfl_display__$internal_CanvasTextField.context.fillText(text.substring(selectionStart,selectionEnd),scrollX + start.x - bounds.x,group1.offsetY + group1.ascent + scrollY); + } + } + } + if(group1.format.underline) { + openfl_display__$internal_CanvasTextField.context.beginPath(); + openfl_display__$internal_CanvasTextField.context.strokeStyle = color; + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + var descent = Math.floor(group1.ascent * 0.185); + var x = group1.offsetX + scrollX - bounds.x; + var y = Math.ceil(group1.offsetY + scrollY + group1.ascent - bounds.y) + descent + 0.5; + openfl_display__$internal_CanvasTextField.context.moveTo(x,y); + openfl_display__$internal_CanvasTextField.context.lineTo(x + group1.width,y); + openfl_display__$internal_CanvasTextField.context.stroke(); + openfl_display__$internal_CanvasTextField.context.closePath(); + } + } + } else { + if(textEngine.border || textEngine.background) { + if(textEngine.border) { + openfl_display__$internal_CanvasTextField.context.rect(0.5,0.5,bounds.width - 1,bounds.height - 1); + } else { + openfl_display__$internal_CanvasTextField.context.rect(0,0,bounds.width,bounds.height); + } + if(textEngine.background) { + var tmp = StringTools.hex(textEngine.backgroundColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.fillStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.fill(); + } + if(textEngine.border) { + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + openfl_display__$internal_CanvasTextField.context.lineCap = "square"; + var tmp = StringTools.hex(textEngine.borderColor & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.stroke(); + } + } + if(textField.__caretIndex > -1 && textEngine.selectable && textField.__showCursor) { + var scrollX = -textField.get_scrollH() + (useTextBounds ? 0 : cursorOffsetX); + var scrollY = 0.0; + var _g = 0; + var _g1 = textField.get_scrollV() - 1; + while(_g < _g1) { + var i = _g++; + scrollY += textEngine.lineHeights.get(i); + } + openfl_display__$internal_CanvasTextField.context.beginPath(); + var tmp = StringTools.hex(textField.get_defaultTextFormat().color & 16777215,6); + openfl_display__$internal_CanvasTextField.context.strokeStyle = "#" + tmp; + openfl_display__$internal_CanvasTextField.context.moveTo(scrollX + 2.5,scrollY + 2.5); + openfl_display__$internal_CanvasTextField.context.lineWidth = 1; + openfl_display__$internal_CanvasTextField.context.lineTo(scrollX + 2.5,scrollY + openfl_text__$internal_TextEngine.getFormatHeight(textField.get_defaultTextFormat()) - 1); + openfl_display__$internal_CanvasTextField.context.stroke(); + openfl_display__$internal_CanvasTextField.context.closePath(); + } + } + graphics.__bitmap = openfl_display_BitmapData.fromCanvas(textField.__graphics.__canvas); + graphics.__bitmapScale = pixelRatio; + graphics.__visible = true; + textField.__dirty = false; + graphics.__softwareDirty = false; + graphics.set___dirty(false); + } + } + textField.__graphics.__hardwareDirty = false; +}; +var openfl_display__$internal_Context3DTilemap = function() { }; +$hxClasses["openfl.display._internal.Context3DTilemap"] = openfl_display__$internal_Context3DTilemap; +openfl_display__$internal_Context3DTilemap.__name__ = "openfl.display._internal.Context3DTilemap"; +openfl_display__$internal_Context3DTilemap.buildBuffer = function(tilemap,renderer) { + if(!tilemap.__renderable || tilemap.__group.__tiles.length == 0 || tilemap.__worldAlpha <= 0) { + tilemap.__group.__dirty = false; + return; + } + openfl_display__$internal_Context3DTilemap.numTiles = 0; + openfl_display__$internal_Context3DTilemap.vertexBufferData = tilemap.__buffer != null ? tilemap.__buffer.vertexBufferData : null; + openfl_display__$internal_Context3DTilemap.vertexDataPosition = 0; + var rect = openfl_geom_Rectangle.__pool.get(); + var matrix = openfl_geom_Matrix.__pool.get(); + var parentTransform = openfl_geom_Matrix.__pool.get(); + openfl_display__$internal_Context3DTilemap.dataPerVertex = 4; + if(tilemap.tileAlphaEnabled) { + openfl_display__$internal_Context3DTilemap.dataPerVertex++; + } + if(tilemap.tileColorTransformEnabled) { + openfl_display__$internal_Context3DTilemap.dataPerVertex += 8; + } + openfl_display__$internal_Context3DTilemap.buildBufferTileContainer(tilemap,tilemap.__group,renderer,parentTransform,tilemap.__tileset,tilemap.tileAlphaEnabled,tilemap.__worldAlpha,tilemap.tileColorTransformEnabled,tilemap.__worldColorTransform,null,rect,matrix); + tilemap.__buffer.flushVertexBufferData(); + openfl_geom_Rectangle.__pool.release(rect); + openfl_geom_Matrix.__pool.release(matrix); + openfl_geom_Matrix.__pool.release(parentTransform); +}; +openfl_display__$internal_Context3DTilemap.buildBufferTileContainer = function(tilemap,group,renderer,parentTransform,defaultTileset,alphaEnabled,worldAlpha,colorTransformEnabled,defaultColorTransform,cacheBitmapData,rect,matrix,isTopLevel) { + if(isTopLevel == null) { + isTopLevel = true; + } + var tileTransform = openfl_geom_Matrix.__pool.get(); + var roundPixels = renderer.__roundPixels; + var tiles = group.__tiles; + var length = group.__length; + if(isTopLevel) { + openfl_display__$internal_Context3DTilemap.resizeBuffer(tilemap,openfl_display__$internal_Context3DTilemap.numTiles + openfl_display__$internal_Context3DTilemap.getRecursiveLength(group)); + } + var tileset; + var alpha; + var visible; + var colorTransform = null; + var id; + var tileData; + var tileRect; + var bitmapData; + var tileWidth; + var tileHeight; + var uvX; + var uvY; + var uvHeight; + var uvWidth; + var vertexOffset; + var x; + var y; + var x2; + var y2; + var x3; + var y3; + var x4; + var y4; + var alphaPosition = 4; + var ctPosition = alphaEnabled ? 5 : 4; + var _g = 0; + while(_g < tiles.length) { + var tile = tiles[_g]; + ++_g; + tileTransform.setTo(1,0,0,1,-tile.get_originX(),-tile.get_originY()); + tileTransform.concat(tile.get_matrix()); + tileTransform.concat(parentTransform); + if(roundPixels) { + tileTransform.tx = Math.round(tileTransform.tx); + tileTransform.ty = Math.round(tileTransform.ty); + } + tileset = tile.get_tileset() != null ? tile.get_tileset() : defaultTileset; + alpha = tile.get_alpha() * worldAlpha; + visible = tile.get_visible(); + tile.__dirty = false; + if(!visible || alpha <= 0) { + continue; + } + if(colorTransformEnabled) { + if(tile.get_colorTransform() != null) { + if(defaultColorTransform == null) { + colorTransform = tile.get_colorTransform(); + } else { + if(openfl_display__$internal_Context3DTilemap.cacheColorTransform == null) { + openfl_display__$internal_Context3DTilemap.cacheColorTransform = new openfl_geom_ColorTransform(); + } + colorTransform = openfl_display__$internal_Context3DTilemap.cacheColorTransform; + colorTransform.redMultiplier = defaultColorTransform.redMultiplier * tile.get_colorTransform().redMultiplier; + colorTransform.greenMultiplier = defaultColorTransform.greenMultiplier * tile.get_colorTransform().greenMultiplier; + colorTransform.blueMultiplier = defaultColorTransform.blueMultiplier * tile.get_colorTransform().blueMultiplier; + colorTransform.alphaMultiplier = defaultColorTransform.alphaMultiplier * tile.get_colorTransform().alphaMultiplier; + colorTransform.redOffset = defaultColorTransform.redOffset + tile.get_colorTransform().redOffset; + colorTransform.greenOffset = defaultColorTransform.greenOffset + tile.get_colorTransform().greenOffset; + colorTransform.blueOffset = defaultColorTransform.blueOffset + tile.get_colorTransform().blueOffset; + colorTransform.alphaOffset = defaultColorTransform.alphaOffset + tile.get_colorTransform().alphaOffset; + } + } else { + colorTransform = defaultColorTransform; + } + } + if(!alphaEnabled) { + alpha = 1; + } + if(tile.__length > 0) { + openfl_display__$internal_Context3DTilemap.buildBufferTileContainer(tilemap,tile,renderer,tileTransform,tileset,alphaEnabled,alpha,colorTransformEnabled,colorTransform,cacheBitmapData,rect,matrix,false); + } else { + if(tileset == null) { + continue; + } + id = tile.get_id(); + bitmapData = tileset.__bitmapData; + if(bitmapData == null) { + continue; + } + if(id == -1) { + tileRect = tile.__rect; + if(tileRect == null || tileRect.width <= 0 || tileRect.height <= 0) { + continue; + } + uvX = tileRect.x / bitmapData.width; + uvY = tileRect.y / bitmapData.height; + uvWidth = tileRect.get_right() / bitmapData.width; + uvHeight = tileRect.get_bottom() / bitmapData.height; + } else { + tileData = tileset.__data[id]; + if(tileData == null) { + continue; + } + rect.setTo(tileData.x,tileData.y,tileData.width,tileData.height); + tileRect = rect; + uvX = tileData.__uvX; + uvY = tileData.__uvY; + uvWidth = tileData.__uvWidth; + uvHeight = tileData.__uvHeight; + } + tileWidth = tileRect.width; + tileHeight = tileRect.height; + x = 0 * tileTransform.a + 0 * tileTransform.c + tileTransform.tx; + y = 0 * tileTransform.b + 0 * tileTransform.d + tileTransform.ty; + x2 = tileWidth * tileTransform.a + 0 * tileTransform.c + tileTransform.tx; + y2 = tileWidth * tileTransform.b + 0 * tileTransform.d + tileTransform.ty; + x3 = 0 * tileTransform.a + tileHeight * tileTransform.c + tileTransform.tx; + y3 = 0 * tileTransform.b + tileHeight * tileTransform.d + tileTransform.ty; + x4 = tileWidth * tileTransform.a + tileHeight * tileTransform.c + tileTransform.tx; + y4 = tileWidth * tileTransform.b + tileHeight * tileTransform.d + tileTransform.ty; + vertexOffset = openfl_display__$internal_Context3DTilemap.vertexDataPosition; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset] = x; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + 1] = y; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + 2] = uvX; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + 3] = uvY; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex] = x2; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex + 1] = y2; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex + 2] = uvWidth; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex + 3] = uvY; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 2] = x3; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 2 + 1] = y3; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 2 + 2] = uvX; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 2 + 3] = uvHeight; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 3] = x4; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 3 + 1] = y4; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 3 + 2] = uvWidth; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 3 + 3] = uvHeight; + if(alphaEnabled) { + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 0 + alphaPosition] = alpha; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex + alphaPosition] = alpha; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 2 + alphaPosition] = alpha; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * 3 + alphaPosition] = alpha; + } + if(colorTransformEnabled) { + if(colorTransform != null) { + var _g1 = 0; + while(_g1 < 4) { + var i = _g1++; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition] = colorTransform.redMultiplier; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 1] = colorTransform.greenMultiplier; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 2] = colorTransform.blueMultiplier; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 3] = colorTransform.alphaMultiplier; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 4] = colorTransform.redOffset; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 5] = colorTransform.greenOffset; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 6] = colorTransform.blueOffset; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i + ctPosition + 7] = colorTransform.alphaOffset; + } + } else { + var _g2 = 0; + while(_g2 < 4) { + var i1 = _g2++; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition] = 1; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 1] = 1; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 2] = 1; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 3] = 1; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 4] = 0; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 5] = 0; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 6] = 0; + openfl_display__$internal_Context3DTilemap.vertexBufferData[vertexOffset + openfl_display__$internal_Context3DTilemap.dataPerVertex * i1 + ctPosition + 7] = 0; + } + } + } + openfl_display__$internal_Context3DTilemap.vertexDataPosition += openfl_display__$internal_Context3DTilemap.dataPerVertex * 4; + } + } + group.__dirty = false; + openfl_geom_Matrix.__pool.release(tileTransform); +}; +openfl_display__$internal_Context3DTilemap.flush = function(tilemap,renderer,blendMode) { + if(openfl_display__$internal_Context3DTilemap.currentShader == null) { + openfl_display__$internal_Context3DTilemap.currentShader = renderer.__defaultDisplayShader; + } + if(openfl_display__$internal_Context3DTilemap.bufferPosition > openfl_display__$internal_Context3DTilemap.lastFlushedPosition && openfl_display__$internal_Context3DTilemap.currentBitmapData != null && openfl_display__$internal_Context3DTilemap.currentShader != null) { + var shader = renderer.__initDisplayShader(openfl_display__$internal_Context3DTilemap.currentShader); + renderer.setShader(shader); + renderer.applyBitmapData(openfl_display__$internal_Context3DTilemap.currentBitmapData,tilemap.smoothing); + renderer.applyMatrix(renderer.__getMatrix(tilemap.__renderTransform,1)); + if(tilemap.tileAlphaEnabled) { + renderer.useAlphaArray(); + } else { + renderer.applyAlpha(tilemap.__worldAlpha); + } + if(tilemap.tileBlendModeEnabled) { + renderer.__setBlendMode(blendMode); + } + if(tilemap.tileColorTransformEnabled) { + renderer.applyHasColorTransform(true); + renderer.useColorTransformArray(); + } else { + renderer.applyColorTransform(tilemap.__worldColorTransform); + } + renderer.updateShader(); + var vertexBuffer = tilemap.__buffer.vertexBuffer; + var vertexBufferPosition = openfl_display__$internal_Context3DTilemap.lastFlushedPosition * openfl_display__$internal_Context3DTilemap.dataPerVertex * 4; + var length = openfl_display__$internal_Context3DTilemap.bufferPosition - openfl_display__$internal_Context3DTilemap.lastFlushedPosition; + while(openfl_display__$internal_Context3DTilemap.lastFlushedPosition < openfl_display__$internal_Context3DTilemap.bufferPosition) { + length = Math.min(openfl_display__$internal_Context3DTilemap.bufferPosition - openfl_display__$internal_Context3DTilemap.lastFlushedPosition,openfl_display__$internal_Context3DTilemap.context.__quadIndexBufferElements) | 0; + if(length <= 0) { + break; + } + if(shader.__position != null) { + openfl_display__$internal_Context3DTilemap.context.setVertexBufferAt(shader.__position.index,vertexBuffer,vertexBufferPosition,2); + } + if(shader.__textureCoord != null) { + openfl_display__$internal_Context3DTilemap.context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,vertexBufferPosition + 2,2); + } + if(tilemap.tileAlphaEnabled) { + if(shader.__alpha != null) { + openfl_display__$internal_Context3DTilemap.context.setVertexBufferAt(shader.__alpha.index,vertexBuffer,vertexBufferPosition + 4,1); + } + } + if(tilemap.tileColorTransformEnabled) { + var position = tilemap.tileAlphaEnabled ? 5 : 4; + if(shader.__colorMultiplier != null) { + openfl_display__$internal_Context3DTilemap.context.setVertexBufferAt(shader.__colorMultiplier.index,vertexBuffer,vertexBufferPosition + position,4); + } + if(shader.__colorOffset != null) { + openfl_display__$internal_Context3DTilemap.context.setVertexBufferAt(shader.__colorOffset.index,vertexBuffer,vertexBufferPosition + position + 4,4); + } + } + openfl_display__$internal_Context3DTilemap.context.drawTriangles(openfl_display__$internal_Context3DTilemap.context.__quadIndexBuffer,0,length * 2); + openfl_display__$internal_Context3DTilemap.lastFlushedPosition += length; + } + renderer.__clearShader(); + } + openfl_display__$internal_Context3DTilemap.lastUsedBitmapData = openfl_display__$internal_Context3DTilemap.currentBitmapData; + openfl_display__$internal_Context3DTilemap.lastUsedShader = openfl_display__$internal_Context3DTilemap.currentShader; +}; +openfl_display__$internal_Context3DTilemap.getRecursiveLength = function(tileContainer) { + var tiles = tileContainer.__tiles; + var totalLength = 0; + var _g = 0; + while(_g < tiles.length) { + var tile = tiles[_g]; + ++_g; + if(tile.__length > 0) { + totalLength += openfl_display__$internal_Context3DTilemap.getRecursiveLength(tile); + } else { + ++totalLength; + } + } + return totalLength; +}; +openfl_display__$internal_Context3DTilemap.render = function(tilemap,renderer) { + if(!tilemap.__renderable || tilemap.__worldAlpha <= 0) { + return; + } + openfl_display__$internal_Context3DTilemap.context = renderer.__context3D; + openfl_display__$internal_Context3DTilemap.buildBuffer(tilemap,renderer); + if(openfl_display__$internal_Context3DTilemap.numTiles == 0) { + return; + } + openfl_display__$internal_Context3DTilemap.bufferPosition = 0; + openfl_display__$internal_Context3DTilemap.lastFlushedPosition = 0; + openfl_display__$internal_Context3DTilemap.lastUsedBitmapData = null; + openfl_display__$internal_Context3DTilemap.lastUsedShader = null; + openfl_display__$internal_Context3DTilemap.currentBitmapData = null; + openfl_display__$internal_Context3DTilemap.currentShader = null; + openfl_display__$internal_Context3DTilemap.currentBlendMode = tilemap.__worldBlendMode; + if(!tilemap.tileBlendModeEnabled) { + renderer.__setBlendMode(openfl_display__$internal_Context3DTilemap.currentBlendMode); + } + renderer.__pushMaskObject(tilemap); + var rect = openfl_geom_Rectangle.__pool.get(); + rect.setTo(0,0,tilemap.__width,tilemap.__height); + renderer.__pushMaskRect(rect,tilemap.__renderTransform); + openfl_display__$internal_Context3DTilemap.renderTileContainer(tilemap,renderer,tilemap.__group,tilemap.__worldShader,tilemap.__tileset,tilemap.__worldAlpha,tilemap.tileBlendModeEnabled,openfl_display__$internal_Context3DTilemap.currentBlendMode,null); + openfl_display__$internal_Context3DTilemap.flush(tilemap,renderer,openfl_display__$internal_Context3DTilemap.currentBlendMode); + renderer.__popMaskRect(); + renderer.__popMaskObject(tilemap); + openfl_geom_Rectangle.__pool.release(rect); +}; +openfl_display__$internal_Context3DTilemap.renderDrawable = function(tilemap,renderer) { + renderer.__updateCacheBitmap(tilemap,false); + if(tilemap.__cacheBitmap != null && !tilemap.__isCacheBitmapRender) { + openfl_display__$internal_Context3DBitmap.render(tilemap.__cacheBitmap,renderer); + } else { + if(!(tilemap.opaqueBackground == null && tilemap.__graphics == null)) { + if(!(!tilemap.__renderable || tilemap.__worldAlpha <= 0)) { + if(tilemap.opaqueBackground != null && !tilemap.__isCacheBitmapRender && tilemap.get_width() > 0 && tilemap.get_height() > 0) { + renderer.__setBlendMode(tilemap.__worldBlendMode); + renderer.__pushMaskObject(tilemap); + var context = renderer.__context3D; + var rect = openfl_geom_Rectangle.__pool.get(); + rect.setTo(0,0,tilemap.get_width(),tilemap.get_height()); + renderer.__pushMaskRect(rect,tilemap.__renderTransform); + var color = tilemap.opaqueBackground; + context.clear((color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,1,0,0,1); + renderer.__popMaskRect(); + renderer.__popMaskObject(tilemap); + openfl_geom_Rectangle.__pool.release(rect); + } + if(tilemap.__graphics != null) { + openfl_display__$internal_Context3DShape.render(tilemap,renderer); + } + } + } + openfl_display__$internal_Context3DTilemap.render(tilemap,renderer); + } + renderer.__renderEvent(tilemap); +}; +openfl_display__$internal_Context3DTilemap.renderDrawableMask = function(tilemap,renderer) { + if(!(tilemap.opaqueBackground == null && tilemap.__graphics == null)) { + var tmp = tilemap.opaqueBackground != null && !tilemap.__isCacheBitmapRender && tilemap.get_width() > 0 && tilemap.get_height() > 0; + if(tilemap.__graphics != null) { + openfl_display__$internal_Context3DShape.renderMask(tilemap,renderer); + } + } + openfl_display__$internal_Context3DTilemap.renderMask(tilemap,renderer); +}; +openfl_display__$internal_Context3DTilemap.renderTileContainer = function(tilemap,renderer,group,defaultShader,defaultTileset,worldAlpha,blendModeEnabled,defaultBlendMode,cacheBitmapData) { + var tiles = group.__tiles; + var tileset; + var alpha; + var visible; + var blendMode = null; + var id; + var tileData; + var tileRect; + var shader; + var bitmapData; + var _g = 0; + while(_g < tiles.length) { + var tile = tiles[_g]; + ++_g; + tileset = tile.get_tileset() != null ? tile.get_tileset() : defaultTileset; + alpha = tile.get_alpha() * worldAlpha; + visible = tile.get_visible(); + if(!visible || alpha <= 0) { + continue; + } + shader = tile.get_shader() != null ? tile.get_shader() : defaultShader; + if(blendModeEnabled) { + blendMode = tile.__blendMode != null ? tile.__blendMode : defaultBlendMode; + } + if(tile.__length > 0) { + openfl_display__$internal_Context3DTilemap.renderTileContainer(tilemap,renderer,tile,shader,tileset,alpha,blendModeEnabled,blendMode,cacheBitmapData); + } else { + if(tileset == null) { + continue; + } + id = tile.get_id(); + bitmapData = tileset.__bitmapData; + if(bitmapData == null) { + continue; + } + if(id == -1) { + tileRect = tile.__rect; + if(tileRect == null || tileRect.width <= 0 || tileRect.height <= 0) { + continue; + } + } else { + tileData = tileset.__data[id]; + if(tileData == null) { + continue; + } + } + var numBuffer = openfl_display__$internal_Context3DTilemap.bufferPosition - openfl_display__$internal_Context3DTilemap.lastFlushedPosition; + var forceFlush = numBuffer >= 16383; + if(forceFlush || shader != openfl_display__$internal_Context3DTilemap.currentShader || bitmapData != openfl_display__$internal_Context3DTilemap.currentBitmapData && openfl_display__$internal_Context3DTilemap.currentBitmapData != null || openfl_display__$internal_Context3DTilemap.currentBlendMode != blendMode) { + openfl_display__$internal_Context3DTilemap.flush(tilemap,renderer,openfl_display__$internal_Context3DTilemap.currentBlendMode); + } + openfl_display__$internal_Context3DTilemap.currentBitmapData = bitmapData; + openfl_display__$internal_Context3DTilemap.currentShader = shader; + openfl_display__$internal_Context3DTilemap.currentBlendMode = blendMode; + openfl_display__$internal_Context3DTilemap.bufferPosition++; + } + } +}; +openfl_display__$internal_Context3DTilemap.renderMask = function(tilemap,renderer) { +}; +openfl_display__$internal_Context3DTilemap.resizeBuffer = function(tilemap,count) { + openfl_display__$internal_Context3DTilemap.numTiles = count; + if(tilemap.__buffer == null) { + tilemap.__buffer = new openfl_display__$internal_Context3DBuffer(openfl_display__$internal_Context3DTilemap.context,openfl_display__$internal_Context3DElementType.QUADS,openfl_display__$internal_Context3DTilemap.numTiles,openfl_display__$internal_Context3DTilemap.dataPerVertex); + } else { + tilemap.__buffer.resize(openfl_display__$internal_Context3DTilemap.numTiles,openfl_display__$internal_Context3DTilemap.dataPerVertex); + } + openfl_display__$internal_Context3DTilemap.vertexBufferData = tilemap.__buffer.vertexBufferData; +}; +var openfl_display__$internal_Context3DVideo = function() { }; +$hxClasses["openfl.display._internal.Context3DVideo"] = openfl_display__$internal_Context3DVideo; +openfl_display__$internal_Context3DVideo.__name__ = "openfl.display._internal.Context3DVideo"; +openfl_display__$internal_Context3DVideo.render = function(video,renderer) { + if(!video.__renderable || video.__worldAlpha <= 0 || video.__stream == null) { + return; + } + if(video.__stream.__video != null) { + var context = renderer.__context3D; + var gl = context.gl; + var texture = video.__getTexture(context); + if(texture == null) { + return; + } + renderer.__setBlendMode(video.__worldBlendMode); + renderer.__pushMaskObject(video); + var shader = renderer.__initDisplayShader(video.__worldShader); + renderer.setShader(shader); + renderer.applyBitmapData(null,true,false); + renderer.applyMatrix(renderer.__getMatrix(video.__renderTransform,1)); + renderer.applyAlpha(video.__worldAlpha); + renderer.applyColorTransform(video.__worldColorTransform); + if(shader.__textureSize != null) { + openfl_display__$internal_Context3DVideo.__textureSizeValue[0] = video.__stream != null ? video.__stream.__video.videoWidth : 0; + openfl_display__$internal_Context3DVideo.__textureSizeValue[1] = video.__stream != null ? video.__stream.__video.videoHeight : 0; + shader.__textureSize.value = openfl_display__$internal_Context3DVideo.__textureSizeValue; + } + renderer.updateShader(); + context.setTextureAt(0,video.__getTexture(context)); + context.__flushGLTextures(); + gl.uniform1i(shader.__texture.index,0); + if(video.smoothing) { + gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR); + } else { + gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST); + } + var vertexBuffer = video.__getVertexBuffer(context); + if(shader.__position != null) { + context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3); + } + if(shader.__textureCoord != null) { + context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2); + } + var indexBuffer = video.__getIndexBuffer(context); + context.drawTriangles(indexBuffer); + renderer.__clearShader(); + renderer.__popMaskObject(video); + } +}; +openfl_display__$internal_Context3DVideo.renderDrawable = function(video,renderer) { + openfl_display__$internal_Context3DVideo.render(video,renderer); + renderer.__renderEvent(video); +}; +openfl_display__$internal_Context3DVideo.renderDrawableMask = function(video,renderer) { + openfl_display__$internal_Context3DVideo.renderMask(video,renderer); +}; +openfl_display__$internal_Context3DVideo.renderMask = function(video,renderer) { + if(video.__stream == null) { + return; + } + if(video.__stream.__video != null) { + var context = renderer.__context3D; + var gl = context.gl; + var shader = renderer.__maskShader; + renderer.setShader(shader); + renderer.applyBitmapData(openfl_display__$internal_Context3DMaskShader.opaqueBitmapData,true); + renderer.applyMatrix(renderer.__getMatrix(video.__renderTransform,1)); + renderer.updateShader(); + var vertexBuffer = video.__getVertexBuffer(context); + if(shader.__position != null) { + context.setVertexBufferAt(shader.__position.index,vertexBuffer,0,3); + } + if(shader.__textureCoord != null) { + context.setVertexBufferAt(shader.__textureCoord.index,vertexBuffer,3,2); + } + var indexBuffer = video.__getIndexBuffer(context); + context.drawTriangles(indexBuffer); + renderer.__clearShader(); + } +}; +var openfl_display__$internal_DOMBitmap = function() { }; +$hxClasses["openfl.display._internal.DOMBitmap"] = openfl_display__$internal_DOMBitmap; +openfl_display__$internal_DOMBitmap.__name__ = "openfl.display._internal.DOMBitmap"; +openfl_display__$internal_DOMBitmap.clear = function(bitmap,renderer) { + openfl_display__$internal_DOMDisplayObject.clear(bitmap,renderer); + if(bitmap.__image != null) { + renderer.element.removeChild(bitmap.__image); + bitmap.__image = null; + bitmap.__style = null; + } + if(bitmap.__canvas != null) { + renderer.element.removeChild(bitmap.__canvas); + bitmap.__canvas = null; + bitmap.__style = null; + } +}; +openfl_display__$internal_DOMBitmap.render = function(bitmap,renderer) { + if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) { + renderer.__pushMaskObject(bitmap); + if(bitmap.__bitmapData.image.buffer.__srcImage != null) { + var src = bitmap.__bitmapData.image.buffer.__srcImage.src; + if(StringTools.startsWith(src,"data:") || StringTools.startsWith(src,"blob:")) { + openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer); + } else { + openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer); + } + } else { + openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer); + } + renderer.__popMaskObject(bitmap); + } else { + openfl_display__$internal_DOMBitmap.clear(bitmap,renderer); + } +}; +openfl_display__$internal_DOMBitmap.renderCanvas = function(bitmap,renderer) { + if(bitmap.__image != null) { + renderer.element.removeChild(bitmap.__image); + bitmap.__image = null; + } + if(bitmap.__canvas == null) { + bitmap.__canvas = window.document.createElement("canvas"); + bitmap.__context = bitmap.__canvas.getContext("2d"); + bitmap.__imageVersion = -1; + if(!renderer.__allowSmoothing || !bitmap.smoothing) { + bitmap.__context.imageSmoothingEnabled = false; + } + renderer.__initializeElement(bitmap,bitmap.__canvas); + } + if(bitmap.__imageVersion != bitmap.__bitmapData.image.version) { + lime__$internal_graphics_ImageCanvasUtil.convertToCanvas(bitmap.__bitmapData.image); + bitmap.__canvas.width = bitmap.__bitmapData.width + 1; + bitmap.__canvas.width = bitmap.__bitmapData.width; + bitmap.__canvas.height = bitmap.__bitmapData.height; + bitmap.__context.drawImage(bitmap.__bitmapData.image.buffer.__srcCanvas,0,0); + bitmap.__imageVersion = bitmap.__bitmapData.image.version; + } + renderer.__updateClip(bitmap); + renderer.__applyStyle(bitmap,true,true,true); +}; +openfl_display__$internal_DOMBitmap.renderDrawable = function(bitmap,renderer) { + renderer.__updateCacheBitmap(bitmap,false); + if(bitmap.__cacheBitmap != null && !bitmap.__isCacheBitmapRender) { + renderer.__renderDrawableClear(bitmap); + bitmap.__cacheBitmap.stage = bitmap.stage; + var bitmap1 = bitmap.__cacheBitmap; + if(bitmap1.stage != null && bitmap1.__worldVisible && bitmap1.__renderable && bitmap1.__bitmapData != null && bitmap1.__bitmapData.__isValid && bitmap1.__bitmapData.readable) { + renderer.__pushMaskObject(bitmap1); + if(bitmap1.__bitmapData.image.buffer.__srcImage != null) { + var src = bitmap1.__bitmapData.image.buffer.__srcImage.src; + if(StringTools.startsWith(src,"data:") || StringTools.startsWith(src,"blob:")) { + openfl_display__$internal_DOMBitmap.renderCanvas(bitmap1,renderer); + } else { + openfl_display__$internal_DOMBitmap.renderImage(bitmap1,renderer); + } + } else { + openfl_display__$internal_DOMBitmap.renderCanvas(bitmap1,renderer); + } + renderer.__popMaskObject(bitmap1); + } else { + openfl_display__$internal_DOMBitmap.clear(bitmap1,renderer); + } + } else { + var tmp = bitmap.opaqueBackground != null && !bitmap.__isCacheBitmapRender && bitmap.get_width() > 0 && bitmap.get_height() > 0; + var graphics = bitmap.__graphics; + if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && graphics != null) { + openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__canvasRenderer); + if(graphics.__softwareDirty || bitmap.__worldAlphaChanged || bitmap.__canvas != graphics.__canvas) { + if(graphics.__canvas != null) { + if(bitmap.__canvas != graphics.__canvas) { + if(bitmap.__canvas != null) { + renderer.element.removeChild(bitmap.__canvas); + } + bitmap.__canvas = graphics.__canvas; + bitmap.__context = graphics.__context; + renderer.__initializeElement(bitmap,bitmap.__canvas); + } + } else { + openfl_display__$internal_DOMShape.clear(bitmap,renderer); + } + } + if(bitmap.__canvas != null) { + renderer.__pushMaskObject(bitmap); + var cacheTransform = bitmap.__renderTransform; + bitmap.__renderTransform = graphics.__worldTransform; + if(graphics.__transformDirty) { + graphics.__transformDirty = false; + bitmap.__renderTransformChanged = true; + } + renderer.__updateClip(bitmap); + renderer.__applyStyle(bitmap,true,true,true); + bitmap.__renderTransform = cacheTransform; + renderer.__popMaskObject(bitmap); + } + } else { + openfl_display__$internal_DOMShape.clear(bitmap,renderer); + } + if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) { + renderer.__pushMaskObject(bitmap); + if(bitmap.__bitmapData.image.buffer.__srcImage != null) { + var src = bitmap.__bitmapData.image.buffer.__srcImage.src; + if(StringTools.startsWith(src,"data:") || StringTools.startsWith(src,"blob:")) { + openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer); + } else { + openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer); + } + } else { + openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer); + } + renderer.__popMaskObject(bitmap); + } else { + openfl_display__$internal_DOMBitmap.clear(bitmap,renderer); + } + } + renderer.__renderEvent(bitmap); +}; +openfl_display__$internal_DOMBitmap.renderDrawableClear = function(bitmap,renderer) { + openfl_display__$internal_DOMBitmap.clear(bitmap,renderer); +}; +openfl_display__$internal_DOMBitmap.renderImage = function(bitmap,renderer) { + if(bitmap.__canvas != null) { + renderer.element.removeChild(bitmap.__canvas); + bitmap.__canvas = null; + } + if(bitmap.__image == null) { + bitmap.__image = window.document.createElement("img"); + bitmap.__image.crossOrigin = "Anonymous"; + bitmap.__image.src = bitmap.__bitmapData.image.buffer.__srcImage.src; + renderer.__initializeElement(bitmap,bitmap.__image); + } + renderer.__updateClip(bitmap); + renderer.__applyStyle(bitmap,true,true,true); +}; +var openfl_display__$internal_DOMDisplayObject = function() { }; +$hxClasses["openfl.display._internal.DOMDisplayObject"] = openfl_display__$internal_DOMDisplayObject; +openfl_display__$internal_DOMDisplayObject.__name__ = "openfl.display._internal.DOMDisplayObject"; +openfl_display__$internal_DOMDisplayObject.clear = function(displayObject,renderer) { + if(displayObject.__cacheBitmap != null) { + openfl_display__$internal_DOMBitmap.clear(displayObject.__cacheBitmap,renderer); + } + openfl_display__$internal_DOMShape.clear(displayObject,renderer); +}; +openfl_display__$internal_DOMDisplayObject.render = function(displayObject,renderer) { + var tmp = displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0; + var graphics = displayObject.__graphics; + if(displayObject.stage != null && displayObject.__worldVisible && displayObject.__renderable && graphics != null) { + openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__canvasRenderer); + if(graphics.__softwareDirty || displayObject.__worldAlphaChanged || displayObject.__canvas != graphics.__canvas) { + if(graphics.__canvas != null) { + if(displayObject.__canvas != graphics.__canvas) { + if(displayObject.__canvas != null) { + renderer.element.removeChild(displayObject.__canvas); + } + displayObject.__canvas = graphics.__canvas; + displayObject.__context = graphics.__context; + renderer.__initializeElement(displayObject,displayObject.__canvas); + } + } else { + openfl_display__$internal_DOMShape.clear(displayObject,renderer); + } + } + if(displayObject.__canvas != null) { + renderer.__pushMaskObject(displayObject); + var cacheTransform = displayObject.__renderTransform; + displayObject.__renderTransform = graphics.__worldTransform; + if(graphics.__transformDirty) { + graphics.__transformDirty = false; + displayObject.__renderTransformChanged = true; + } + renderer.__updateClip(displayObject); + renderer.__applyStyle(displayObject,true,true,true); + displayObject.__renderTransform = cacheTransform; + renderer.__popMaskObject(displayObject); + } + } else { + openfl_display__$internal_DOMShape.clear(displayObject,renderer); + } +}; +openfl_display__$internal_DOMDisplayObject.renderDrawable = function(displayObject,renderer) { + renderer.__updateCacheBitmap(displayObject,false); + if(displayObject.__cacheBitmap != null && !displayObject.__isCacheBitmapRender) { + renderer.__renderDrawableClear(displayObject); + displayObject.__cacheBitmap.stage = displayObject.stage; + var bitmap = displayObject.__cacheBitmap; + if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) { + renderer.__pushMaskObject(bitmap); + if(bitmap.__bitmapData.image.buffer.__srcImage != null) { + var src = bitmap.__bitmapData.image.buffer.__srcImage.src; + if(StringTools.startsWith(src,"data:") || StringTools.startsWith(src,"blob:")) { + openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer); + } else { + openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer); + } + } else { + openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer); + } + renderer.__popMaskObject(bitmap); + } else { + openfl_display__$internal_DOMBitmap.clear(bitmap,renderer); + } + } else { + var tmp = displayObject.opaqueBackground != null && !displayObject.__isCacheBitmapRender && displayObject.get_width() > 0 && displayObject.get_height() > 0; + var graphics = displayObject.__graphics; + if(displayObject.stage != null && displayObject.__worldVisible && displayObject.__renderable && graphics != null) { + openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__canvasRenderer); + if(graphics.__softwareDirty || displayObject.__worldAlphaChanged || displayObject.__canvas != graphics.__canvas) { + if(graphics.__canvas != null) { + if(displayObject.__canvas != graphics.__canvas) { + if(displayObject.__canvas != null) { + renderer.element.removeChild(displayObject.__canvas); + } + displayObject.__canvas = graphics.__canvas; + displayObject.__context = graphics.__context; + renderer.__initializeElement(displayObject,displayObject.__canvas); + } + } else { + openfl_display__$internal_DOMShape.clear(displayObject,renderer); + } + } + if(displayObject.__canvas != null) { + renderer.__pushMaskObject(displayObject); + var cacheTransform = displayObject.__renderTransform; + displayObject.__renderTransform = graphics.__worldTransform; + if(graphics.__transformDirty) { + graphics.__transformDirty = false; + displayObject.__renderTransformChanged = true; + } + renderer.__updateClip(displayObject); + renderer.__applyStyle(displayObject,true,true,true); + displayObject.__renderTransform = cacheTransform; + renderer.__popMaskObject(displayObject); + } + } else { + openfl_display__$internal_DOMShape.clear(displayObject,renderer); + } + } + renderer.__renderEvent(displayObject); +}; +openfl_display__$internal_DOMDisplayObject.renderDrawableClear = function(displayObject,renderer) { + openfl_display__$internal_DOMDisplayObject.clear(displayObject,renderer); +}; +var openfl_display__$internal_DOMDisplayObjectContainer = function() { }; +$hxClasses["openfl.display._internal.DOMDisplayObjectContainer"] = openfl_display__$internal_DOMDisplayObjectContainer; +openfl_display__$internal_DOMDisplayObjectContainer.__name__ = "openfl.display._internal.DOMDisplayObjectContainer"; +openfl_display__$internal_DOMDisplayObjectContainer.renderDrawable = function(displayObjectContainer,renderer) { + var orphan = displayObjectContainer.__removedChildren.iterator(); + while(orphan.hasNext()) { + var orphan1 = orphan.next(); + if(orphan1.stage == null) { + renderer.__renderDrawable(orphan1); + } + } + var orphan = displayObjectContainer.__removedChildren.iterator(); + while(orphan.hasNext()) { + var orphan1 = orphan.next(); + if(orphan1.stage == null) { + orphan1.__cleanup(); + } + } + displayObjectContainer.__removedChildren.set_length(0); + openfl_display__$internal_DOMDisplayObject.renderDrawable(displayObjectContainer,renderer); + if(displayObjectContainer.__cacheBitmap != null && !displayObjectContainer.__isCacheBitmapRender) { + var _g = 0; + var _g1 = displayObjectContainer.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + renderer.__renderDrawableClear(child); + } + openfl_display__$internal_DOMShape.clear(displayObjectContainer,renderer); + displayObjectContainer.__cacheBitmap.stage = displayObjectContainer.stage; + return; + } + renderer.__pushMaskObject(displayObjectContainer); + if(renderer.__stage != null) { + var _g = 0; + var _g1 = displayObjectContainer.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + renderer.__renderDrawable(child); + child.__renderDirty = false; + } + displayObjectContainer.__renderDirty = false; + } else { + var _g = 0; + var _g1 = displayObjectContainer.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + renderer.__renderDrawable(child); + } + } + renderer.__popMaskObject(displayObjectContainer); +}; +openfl_display__$internal_DOMDisplayObjectContainer.renderDrawableClear = function(displayObjectContainer,renderer) { + var orphan = displayObjectContainer.__removedChildren.iterator(); + while(orphan.hasNext()) { + var orphan1 = orphan.next(); + if(orphan1.stage == null) { + renderer.__renderDrawableClear(orphan1); + } + } + var orphan = displayObjectContainer.__removedChildren.iterator(); + while(orphan.hasNext()) { + var orphan1 = orphan.next(); + if(orphan1.stage == null) { + orphan1.__cleanup(); + } + } + displayObjectContainer.__removedChildren.set_length(0); + var _g = 0; + var _g1 = displayObjectContainer.__children; + while(_g < _g1.length) { + var child = _g1[_g]; + ++_g; + renderer.__renderDrawableClear(child); + } + openfl_display__$internal_DOMDisplayObject.clear(displayObjectContainer,renderer); +}; +var openfl_display__$internal_DOMShape = function() { }; +$hxClasses["openfl.display._internal.DOMShape"] = openfl_display__$internal_DOMShape; +openfl_display__$internal_DOMShape.__name__ = "openfl.display._internal.DOMShape"; +openfl_display__$internal_DOMShape.clear = function(shape,renderer) { + if(shape.__canvas != null) { + renderer.element.removeChild(shape.__canvas); + shape.__canvas = null; + shape.__style = null; + } +}; +openfl_display__$internal_DOMShape.render = function(shape,renderer) { + var graphics = shape.__graphics; + if(shape.stage != null && shape.__worldVisible && shape.__renderable && graphics != null) { + openfl_display__$internal_CanvasGraphics.render(graphics,renderer.__canvasRenderer); + if(graphics.__softwareDirty || shape.__worldAlphaChanged || shape.__canvas != graphics.__canvas) { + if(graphics.__canvas != null) { + if(shape.__canvas != graphics.__canvas) { + if(shape.__canvas != null) { + renderer.element.removeChild(shape.__canvas); + } + shape.__canvas = graphics.__canvas; + shape.__context = graphics.__context; + renderer.__initializeElement(shape,shape.__canvas); + } + } else { + openfl_display__$internal_DOMShape.clear(shape,renderer); + } + } + if(shape.__canvas != null) { + renderer.__pushMaskObject(shape); + var cacheTransform = shape.__renderTransform; + shape.__renderTransform = graphics.__worldTransform; + if(graphics.__transformDirty) { + graphics.__transformDirty = false; + shape.__renderTransformChanged = true; + } + renderer.__updateClip(shape); + renderer.__applyStyle(shape,true,true,true); + shape.__renderTransform = cacheTransform; + renderer.__popMaskObject(shape); + } + } else { + openfl_display__$internal_DOMShape.clear(shape,renderer); + } +}; +var openfl_display__$internal_DOMSimpleButton = function() { }; +$hxClasses["openfl.display._internal.DOMSimpleButton"] = openfl_display__$internal_DOMSimpleButton; +openfl_display__$internal_DOMSimpleButton.__name__ = "openfl.display._internal.DOMSimpleButton"; +openfl_display__$internal_DOMSimpleButton.renderDrawable = function(simpleButton,renderer) { + renderer.__pushMaskObject(simpleButton); + var previousState = simpleButton.__previousStates.iterator(); + while(previousState.hasNext()) { + var previousState1 = previousState.next(); + renderer.__renderDrawable(previousState1); + } + simpleButton.__previousStates.set_length(0); + if(simpleButton.__currentState != null) { + if(simpleButton.__currentState.stage != simpleButton.stage) { + simpleButton.__currentState.__setStageReference(simpleButton.stage); + } + renderer.__renderDrawable(simpleButton.__currentState); + } + renderer.__popMaskObject(simpleButton); + renderer.__renderEvent(simpleButton); +}; +openfl_display__$internal_DOMSimpleButton.renderDrawableClear = function(simpleButton,renderer) { + openfl_display__$internal_DOMDisplayObject.renderDrawableClear(simpleButton,renderer); +}; +var openfl_display__$internal_DOMTextField = function() { }; +$hxClasses["openfl.display._internal.DOMTextField"] = openfl_display__$internal_DOMTextField; +openfl_display__$internal_DOMTextField.__name__ = "openfl.display._internal.DOMTextField"; +openfl_display__$internal_DOMTextField.clear = function(textField,renderer) { + openfl_display__$internal_DOMDisplayObject.clear(textField,renderer); + if(textField.__div != null) { + renderer.element.removeChild(textField.__div); + textField.__div = null; + textField.__style = null; + } +}; +openfl_display__$internal_DOMTextField.measureText = function(textField) { + var textEngine = textField.__textEngine; + var div = textField.__div; + if(div == null) { + div = window.document.createElement("div"); + var _this_r = new RegExp("\n","g".split("u").join("")); + div.innerHTML = textEngine.text.replace(_this_r,"
"); + div.style.setProperty("font",openfl_text__$internal_TextEngine.getFont(textField.__textFormat),null); + div.style.setProperty("pointer-events","none",null); + div.style.position = "absolute"; + div.style.top = "110%"; + window.document.body.appendChild(div); + } + textEngine.__measuredWidth = div.clientWidth; + if(textField.__div == null) { + div.style.width = Std.string(textEngine.width - 4) + "px"; + } + textEngine.__measuredHeight = div.clientHeight; + if(textField.__div == null) { + window.document.body.removeChild(div); + } +}; +openfl_display__$internal_DOMTextField.render = function(textField,renderer) { + var textEngine = textField.__textEngine; + if(textField.stage != null && textField.__worldVisible && textField.__renderable) { + if(textField.__dirty || textField.__renderTransformChanged || textField.__div == null) { + if(textEngine.text != "" || textEngine.background || textEngine.border || textEngine.type == 1) { + textField.__updateLayout(); + if(textField.__div == null) { + textField.__div = window.document.createElement("div"); + renderer.__initializeElement(textField,textField.__div); + textField.__style.setProperty("outline","none",null); + textField.__div.addEventListener("input",function(event) { + event.preventDefault(); + if(textField.get_htmlText() != textField.__div.innerHTML) { + textField.set_htmlText(textField.__div.innerHTML); + var textField1 = textField.__displayAsPassword; + textField.__dirty = false; + textField.dispatchEvent(new openfl_events_TextEvent("textInput",false,false,textField.get_htmlText())); + } + },true); + } + if(!textEngine.wordWrap) { + textField.__style.setProperty("white-space","nowrap",null); + } else { + textField.__style.setProperty("word-wrap","break-word",null); + } + textField.__style.setProperty("overflow","hidden",null); + if(textEngine.selectable) { + textField.__style.setProperty("cursor","text",null); + textField.__style.setProperty("-webkit-user-select","text",null); + textField.__style.setProperty("-moz-user-select","text",null); + textField.__style.setProperty("-ms-user-select","text",null); + textField.__style.setProperty("-o-user-select","text",null); + } else { + textField.__style.setProperty("cursor","inherit",null); + } + var div = textField.__div; + div.contentEditable = textEngine.type == 1; + var style = textField.__style; + if(textEngine.background) { + style.setProperty("background-color","#" + StringTools.hex(textEngine.backgroundColor & 16777215,6),null); + } else { + style.removeProperty("background-color"); + } + var w = textEngine.width; + var h = textEngine.height; + var scale = 1; + var text = ""; + if(textField.__isHTML) { + textField.__updateText(openfl_text__$internal_HTMLParser.parse(textField.__text,textField.get_multiline(),textField.__styleSheet,textField.__textFormat,textField.__textEngine.textFormatRanges)); + } + var useTextBounds = !(textEngine.background || textEngine.border); + var bounds = useTextBounds ? textEngine.textBounds : textEngine.bounds; + var scrollX = -textField.get_scrollH(); + var scrollY = 0.0; + var group = textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(group1.lineIndex < textField.get_scrollV() - 1) { + continue; + } + if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) { + break; + } + text += "
"; + if(group1.format.url != null && group1.format.url != "") { + var anchorStyle = "text-decoration: underline; "; + if(group1.format.color != null) { + anchorStyle += "color: #" + StringTools.hex(group1.format.color & 16777215,6) + "; "; + } + text += ""; + } + if(!textField.__isHTML) { + text += StringTools.replace(StringTools.htmlEscape(textEngine.text.substring(group1.startIndex,group1.endIndex))," "," "); + } else { + text += StringTools.replace(textEngine.text.substring(group1.startIndex,group1.endIndex)," "," "); + } + if(group1.format.url != null && group1.format.url != "") { + text += ""; + } + text += "
"; + } + if(textEngine.border) { + style.setProperty("border","solid 1px #" + StringTools.hex(textEngine.borderColor & 16777215,6),null); + textField.__renderTransform.translate(-1,-1); + textField.__renderTransformChanged = true; + textField.__transformDirty = true; + } else if(style.border != "") { + style.removeProperty("border"); + textField.__renderTransformChanged = true; + } + style.setProperty("width",w + "px",null); + style.setProperty("height",h + "px",null); + textField.__div.innerHTML = text; + textField.__dirty = false; + } else if(textField.__div != null) { + renderer.element.removeChild(textField.__div); + textField.__div = null; + } + } + if(textField.__div != null) { + var old = renderer.__roundPixels; + renderer.__roundPixels = true; + renderer.__updateClip(textField); + renderer.__applyStyle(textField,true,true,true); + renderer.__roundPixels = old; + } + } else { + openfl_display__$internal_DOMTextField.clear(textField,renderer); + } +}; +openfl_display__$internal_DOMTextField.renderDrawable = function(textField,renderer) { + textField.__domRender = true; + renderer.__updateCacheBitmap(textField,textField.__forceCachedBitmapUpdate); + textField.__forceCachedBitmapUpdate = false; + textField.__domRender = false; + if(textField.__cacheBitmap != null && !textField.__isCacheBitmapRender) { + renderer.__renderDrawableClear(textField); + textField.__cacheBitmap.stage = textField.stage; + var bitmap = textField.__cacheBitmap; + if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) { + renderer.__pushMaskObject(bitmap); + if(bitmap.__bitmapData.image.buffer.__srcImage != null) { + var src = bitmap.__bitmapData.image.buffer.__srcImage.src; + if(StringTools.startsWith(src,"data:") || StringTools.startsWith(src,"blob:")) { + openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer); + } else { + openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer); + } + } else { + openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer); + } + renderer.__popMaskObject(bitmap); + } else { + openfl_display__$internal_DOMBitmap.clear(bitmap,renderer); + } + } else { + if(textField.__renderedOnCanvasWhileOnDOM) { + textField.__renderedOnCanvasWhileOnDOM = false; + if(textField.__isHTML && textField.__htmlText != null) { + textField.__updateText(textField.__htmlText); + textField.__dirty = true; + textField.__layoutDirty = true; + if(!textField.__renderDirty) { + textField.__renderDirty = true; + textField.__setParentRenderDirty(); + } + } + } + var textField1 = textField; + var textEngine = textField1.__textEngine; + if(textField1.stage != null && textField1.__worldVisible && textField1.__renderable) { + if(textField1.__dirty || textField1.__renderTransformChanged || textField1.__div == null) { + if(textEngine.text != "" || textEngine.background || textEngine.border || textEngine.type == 1) { + textField1.__updateLayout(); + if(textField1.__div == null) { + textField1.__div = window.document.createElement("div"); + renderer.__initializeElement(textField1,textField1.__div); + textField1.__style.setProperty("outline","none",null); + textField1.__div.addEventListener("input",function(event) { + event.preventDefault(); + if(textField1.get_htmlText() != textField1.__div.innerHTML) { + textField1.set_htmlText(textField1.__div.innerHTML); + var textField = textField1.__displayAsPassword; + textField1.__dirty = false; + textField1.dispatchEvent(new openfl_events_TextEvent("textInput",false,false,textField1.get_htmlText())); + } + },true); + } + if(!textEngine.wordWrap) { + textField1.__style.setProperty("white-space","nowrap",null); + } else { + textField1.__style.setProperty("word-wrap","break-word",null); + } + textField1.__style.setProperty("overflow","hidden",null); + if(textEngine.selectable) { + textField1.__style.setProperty("cursor","text",null); + textField1.__style.setProperty("-webkit-user-select","text",null); + textField1.__style.setProperty("-moz-user-select","text",null); + textField1.__style.setProperty("-ms-user-select","text",null); + textField1.__style.setProperty("-o-user-select","text",null); + } else { + textField1.__style.setProperty("cursor","inherit",null); + } + var div = textField1.__div; + div.contentEditable = textEngine.type == 1; + var style = textField1.__style; + if(textEngine.background) { + style.setProperty("background-color","#" + StringTools.hex(textEngine.backgroundColor & 16777215,6),null); + } else { + style.removeProperty("background-color"); + } + var w = textEngine.width; + var h = textEngine.height; + var scale = 1; + var text = ""; + if(textField1.__isHTML) { + textField1.__updateText(openfl_text__$internal_HTMLParser.parse(textField1.__text,textField1.get_multiline(),textField1.__styleSheet,textField1.__textFormat,textField1.__textEngine.textFormatRanges)); + } + var useTextBounds = !(textEngine.background || textEngine.border); + var bounds = useTextBounds ? textEngine.textBounds : textEngine.bounds; + var scrollX = -textField1.get_scrollH(); + var scrollY = 0.0; + var group = textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(group1.lineIndex < textField1.get_scrollV() - 1) { + continue; + } + if(group1.lineIndex > textEngine.get_bottomScrollV() - 1) { + break; + } + text += "
"; + if(group1.format.url != null && group1.format.url != "") { + var anchorStyle = "text-decoration: underline; "; + if(group1.format.color != null) { + anchorStyle += "color: #" + StringTools.hex(group1.format.color & 16777215,6) + "; "; + } + text += ""; + } + if(!textField1.__isHTML) { + text += StringTools.replace(StringTools.htmlEscape(textEngine.text.substring(group1.startIndex,group1.endIndex))," "," "); + } else { + text += StringTools.replace(textEngine.text.substring(group1.startIndex,group1.endIndex)," "," "); + } + if(group1.format.url != null && group1.format.url != "") { + text += ""; + } + text += "
"; + } + if(textEngine.border) { + style.setProperty("border","solid 1px #" + StringTools.hex(textEngine.borderColor & 16777215,6),null); + textField1.__renderTransform.translate(-1,-1); + textField1.__renderTransformChanged = true; + textField1.__transformDirty = true; + } else if(style.border != "") { + style.removeProperty("border"); + textField1.__renderTransformChanged = true; + } + style.setProperty("width",w + "px",null); + style.setProperty("height",h + "px",null); + textField1.__div.innerHTML = text; + textField1.__dirty = false; + } else if(textField1.__div != null) { + renderer.element.removeChild(textField1.__div); + textField1.__div = null; + } + } + if(textField1.__div != null) { + var old = renderer.__roundPixels; + renderer.__roundPixels = true; + renderer.__updateClip(textField1); + renderer.__applyStyle(textField1,true,true,true); + renderer.__roundPixels = old; + } + } else { + openfl_display__$internal_DOMTextField.clear(textField1,renderer); + } + } + renderer.__renderEvent(textField); +}; +openfl_display__$internal_DOMTextField.renderDrawableClear = function(textField,renderer) { + openfl_display__$internal_DOMTextField.clear(textField,renderer); +}; +openfl_display__$internal_DOMTextField.__getAttributeMatch = function(regex) { + if(regex.matched(2) != null) { + return regex.matched(2); + } else { + return regex.matched(3); + } +}; +var openfl_display__$internal_DOMTilemap = function() { }; +$hxClasses["openfl.display._internal.DOMTilemap"] = openfl_display__$internal_DOMTilemap; +openfl_display__$internal_DOMTilemap.__name__ = "openfl.display._internal.DOMTilemap"; +openfl_display__$internal_DOMTilemap.clear = function(tilemap,renderer) { + openfl_display__$internal_DOMDisplayObject.clear(tilemap,renderer); + if(tilemap.__canvas != null) { + renderer.element.removeChild(tilemap.__canvas); + tilemap.__canvas = null; + tilemap.__style = null; + } +}; +openfl_display__$internal_DOMTilemap.render = function(tilemap,renderer) { + if(tilemap.stage != null && tilemap.__worldVisible && tilemap.__renderable && tilemap.__group.__tiles.length > 0) { + if(tilemap.__canvas == null) { + tilemap.__canvas = window.document.createElement("canvas"); + tilemap.__context = tilemap.__canvas.getContext("2d"); + renderer.__initializeElement(tilemap,tilemap.__canvas); + } + tilemap.__canvas.width = tilemap.__width; + tilemap.__canvas.height = tilemap.__height; + renderer.__canvasRenderer.context = tilemap.__context; + var cacheRenderTransform = tilemap.__renderTransform; + tilemap.__renderTransform = openfl_geom_Matrix.__identity; + var renderer1 = renderer.__canvasRenderer; + if(!(tilemap.opaqueBackground == null && tilemap.__graphics == null)) { + if(tilemap.__renderable) { + var alpha = renderer1.__getAlpha(tilemap.__worldAlpha); + if(!(alpha <= 0)) { + if(tilemap.opaqueBackground != null && !tilemap.__isCacheBitmapRender && tilemap.get_width() > 0 && tilemap.get_height() > 0) { + renderer1.__setBlendMode(tilemap.__worldBlendMode); + renderer1.__pushMaskObject(tilemap); + var context = renderer1.context; + renderer1.setTransform(tilemap.__renderTransform,context); + var color = tilemap.opaqueBackground; + context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")"; + context.fillRect(0,0,tilemap.get_width(),tilemap.get_height()); + renderer1.__popMaskObject(tilemap); + } + if(tilemap.__graphics != null) { + if(tilemap.__renderable) { + var alpha = renderer1.__getAlpha(tilemap.__worldAlpha); + if(!(alpha <= 0)) { + var graphics = tilemap.__graphics; + if(graphics != null) { + openfl_display__$internal_CanvasGraphics.render(graphics,renderer1); + var width = graphics.__width; + var height = graphics.__height; + var canvas = graphics.__canvas; + if(canvas != null && graphics.__visible && width >= 1 && height >= 1) { + var transform = graphics.__worldTransform; + var context = renderer1.context; + var scrollRect = tilemap.__scrollRect; + var scale9Grid = tilemap.__worldScale9Grid; + if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) { + renderer1.__setBlendMode(tilemap.__worldBlendMode); + renderer1.__pushMaskObject(tilemap); + context.globalAlpha = alpha; + if(scale9Grid != null && transform.b == 0 && transform.c == 0) { + var pixelRatio = renderer1.__pixelRatio; + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.translate(transform.tx,transform.ty); + renderer1.setTransform(matrix,context); + openfl_geom_Matrix.__pool.release(matrix); + var bounds = graphics.__bounds; + var scaleX = graphics.__renderTransform.a / graphics.__bitmapScale; + var scaleY = graphics.__renderTransform.d / graphics.__bitmapScale; + var renderScaleX = scaleX * transform.a; + var renderScaleY = scaleY * transform.d; + var left = Math.max(1,Math.round(scale9Grid.x * scaleX)); + var top = Math.round(scale9Grid.y * scaleY); + var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX)); + var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY); + var centerWidth = Math.round(scale9Grid.width * scaleX); + var centerHeight = Math.round(scale9Grid.height * scaleY); + var renderLeft = Math.round(left / pixelRatio); + var renderTop = Math.round(top / pixelRatio); + var renderRight = Math.round(right / pixelRatio); + var renderBottom = Math.round(bottom / pixelRatio); + var renderCenterWidth = bounds.width * renderScaleX - renderLeft - renderRight; + var renderCenterHeight = bounds.height * renderScaleY - renderTop - renderBottom; + renderer1.applySmoothing(context,false); + if(centerWidth != 0 && centerHeight != 0) { + context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop); + context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop); + context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop); + context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight); + context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight); + context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom); + context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom); + context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom); + } else if(centerWidth == 0 && centerHeight != 0) { + var renderWidth = renderLeft + renderCenterWidth + renderRight; + context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop); + context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom); + } else if(centerHeight == 0 && centerWidth != 0) { + var renderHeight = renderTop + renderCenterHeight + renderBottom; + context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight); + context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight); + context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight); + } + } else { + renderer1.setTransform(transform,context); + context.drawImage(canvas,0,0,width,height); + } + renderer1.__popMaskObject(tilemap); + } + } + } + } + } + } + } + } + } + var renderer1 = renderer.__canvasRenderer; + if(!(!tilemap.__renderable || tilemap.__group.__tiles.length == 0)) { + var alpha = renderer1.__getAlpha(tilemap.__worldAlpha); + if(!(alpha <= 0)) { + var context = renderer1.context; + renderer1.__setBlendMode(tilemap.__worldBlendMode); + renderer1.__pushMaskObject(tilemap); + var rect = openfl_geom_Rectangle.__pool.get(); + rect.setTo(0,0,tilemap.__width,tilemap.__height); + renderer1.__pushMaskRect(rect,tilemap.__renderTransform); + if(!renderer1.__allowSmoothing || !tilemap.smoothing) { + context.imageSmoothingEnabled = false; + } + openfl_display__$internal_CanvasTilemap.renderTileContainer(tilemap.__group,renderer1,tilemap.__renderTransform,tilemap.__tileset,renderer1.__allowSmoothing && tilemap.smoothing,tilemap.tileAlphaEnabled,alpha,tilemap.tileBlendModeEnabled,tilemap.__worldBlendMode,null,null,rect); + if(!renderer1.__allowSmoothing || !tilemap.smoothing) { + context.imageSmoothingEnabled = true; + } + renderer1.__popMaskRect(); + renderer1.__popMaskObject(tilemap); + openfl_geom_Rectangle.__pool.release(rect); + } + } + tilemap.__renderTransform = cacheRenderTransform; + renderer.__canvasRenderer.context = null; + renderer.__updateClip(tilemap); + renderer.__applyStyle(tilemap,true,false,true); + } else { + openfl_display__$internal_DOMTilemap.clear(tilemap,renderer); + } +}; +openfl_display__$internal_DOMTilemap.renderDrawable = function(tilemap,renderer) { + renderer.__updateCacheBitmap(tilemap,false); + if(tilemap.__cacheBitmap != null && !tilemap.__isCacheBitmapRender) { + renderer.__renderDrawableClear(tilemap); + tilemap.__cacheBitmap.stage = tilemap.stage; + var bitmap = tilemap.__cacheBitmap; + if(bitmap.stage != null && bitmap.__worldVisible && bitmap.__renderable && bitmap.__bitmapData != null && bitmap.__bitmapData.__isValid && bitmap.__bitmapData.readable) { + renderer.__pushMaskObject(bitmap); + if(bitmap.__bitmapData.image.buffer.__srcImage != null) { + var src = bitmap.__bitmapData.image.buffer.__srcImage.src; + if(StringTools.startsWith(src,"data:") || StringTools.startsWith(src,"blob:")) { + openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer); + } else { + openfl_display__$internal_DOMBitmap.renderImage(bitmap,renderer); + } + } else { + openfl_display__$internal_DOMBitmap.renderCanvas(bitmap,renderer); + } + renderer.__popMaskObject(bitmap); + } else { + openfl_display__$internal_DOMBitmap.clear(bitmap,renderer); + } + } else if(tilemap.stage != null && tilemap.__worldVisible && tilemap.__renderable && tilemap.__group.__tiles.length > 0) { + if(tilemap.__canvas == null) { + tilemap.__canvas = window.document.createElement("canvas"); + tilemap.__context = tilemap.__canvas.getContext("2d"); + renderer.__initializeElement(tilemap,tilemap.__canvas); + } + tilemap.__canvas.width = tilemap.__width; + tilemap.__canvas.height = tilemap.__height; + renderer.__canvasRenderer.context = tilemap.__context; + var cacheRenderTransform = tilemap.__renderTransform; + tilemap.__renderTransform = openfl_geom_Matrix.__identity; + var renderer1 = renderer.__canvasRenderer; + if(!(tilemap.opaqueBackground == null && tilemap.__graphics == null)) { + if(tilemap.__renderable) { + var alpha = renderer1.__getAlpha(tilemap.__worldAlpha); + if(!(alpha <= 0)) { + if(tilemap.opaqueBackground != null && !tilemap.__isCacheBitmapRender && tilemap.get_width() > 0 && tilemap.get_height() > 0) { + renderer1.__setBlendMode(tilemap.__worldBlendMode); + renderer1.__pushMaskObject(tilemap); + var context = renderer1.context; + renderer1.setTransform(tilemap.__renderTransform,context); + var color = tilemap.opaqueBackground; + context.fillStyle = "rgb(" + (color >>> 16 & 255) + "," + (color >>> 8 & 255) + "," + (color & 255) + ")"; + context.fillRect(0,0,tilemap.get_width(),tilemap.get_height()); + renderer1.__popMaskObject(tilemap); + } + if(tilemap.__graphics != null) { + if(tilemap.__renderable) { + var alpha = renderer1.__getAlpha(tilemap.__worldAlpha); + if(!(alpha <= 0)) { + var graphics = tilemap.__graphics; + if(graphics != null) { + openfl_display__$internal_CanvasGraphics.render(graphics,renderer1); + var width = graphics.__width; + var height = graphics.__height; + var canvas = graphics.__canvas; + if(canvas != null && graphics.__visible && width >= 1 && height >= 1) { + var transform = graphics.__worldTransform; + var context = renderer1.context; + var scrollRect = tilemap.__scrollRect; + var scale9Grid = tilemap.__worldScale9Grid; + if(scrollRect == null || scrollRect.width > 0 && scrollRect.height > 0) { + renderer1.__setBlendMode(tilemap.__worldBlendMode); + renderer1.__pushMaskObject(tilemap); + context.globalAlpha = alpha; + if(scale9Grid != null && transform.b == 0 && transform.c == 0) { + var pixelRatio = renderer1.__pixelRatio; + var matrix = openfl_geom_Matrix.__pool.get(); + matrix.translate(transform.tx,transform.ty); + renderer1.setTransform(matrix,context); + openfl_geom_Matrix.__pool.release(matrix); + var bounds = graphics.__bounds; + var scaleX = graphics.__renderTransform.a / graphics.__bitmapScale; + var scaleY = graphics.__renderTransform.d / graphics.__bitmapScale; + var renderScaleX = scaleX * transform.a; + var renderScaleY = scaleY * transform.d; + var left = Math.max(1,Math.round(scale9Grid.x * scaleX)); + var top = Math.round(scale9Grid.y * scaleY); + var right = Math.max(1,Math.round((bounds.get_right() - scale9Grid.get_right()) * scaleX)); + var bottom = Math.round((bounds.get_bottom() - scale9Grid.get_bottom()) * scaleY); + var centerWidth = Math.round(scale9Grid.width * scaleX); + var centerHeight = Math.round(scale9Grid.height * scaleY); + var renderLeft = Math.round(left / pixelRatio); + var renderTop = Math.round(top / pixelRatio); + var renderRight = Math.round(right / pixelRatio); + var renderBottom = Math.round(bottom / pixelRatio); + var renderCenterWidth = bounds.width * renderScaleX - renderLeft - renderRight; + var renderCenterHeight = bounds.height * renderScaleY - renderTop - renderBottom; + renderer1.applySmoothing(context,false); + if(centerWidth != 0 && centerHeight != 0) { + context.drawImage(canvas,0,0,left,top,0,0,renderLeft,renderTop); + context.drawImage(canvas,left,0,centerWidth,top,renderLeft,0,renderCenterWidth,renderTop); + context.drawImage(canvas,left + centerWidth,0,right,top,renderLeft + renderCenterWidth,0,renderRight,renderTop); + context.drawImage(canvas,0,top,left,centerHeight,0,renderTop,renderLeft,renderCenterHeight); + context.drawImage(canvas,left,top,centerWidth,centerHeight,renderLeft,renderTop,renderCenterWidth,renderCenterHeight); + context.drawImage(canvas,left + centerWidth,top,right,centerHeight,renderLeft + renderCenterWidth,renderTop,renderRight,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,left,bottom,0,renderTop + renderCenterHeight,renderLeft,renderBottom); + context.drawImage(canvas,left,top + centerHeight,centerWidth,bottom,renderLeft,renderTop + renderCenterHeight,renderCenterWidth,renderBottom); + context.drawImage(canvas,left + centerWidth,top + centerHeight,right,bottom,renderLeft + renderCenterWidth,renderTop + renderCenterHeight,renderRight,renderBottom); + } else if(centerWidth == 0 && centerHeight != 0) { + var renderWidth = renderLeft + renderCenterWidth + renderRight; + context.drawImage(canvas,0,0,width,top,0,0,renderWidth,renderTop); + context.drawImage(canvas,0,top,width,centerHeight,0,renderTop,renderWidth,renderCenterHeight); + context.drawImage(canvas,0,top + centerHeight,width,bottom,0,renderTop + renderCenterHeight,renderWidth,renderBottom); + } else if(centerHeight == 0 && centerWidth != 0) { + var renderHeight = renderTop + renderCenterHeight + renderBottom; + context.drawImage(canvas,0,0,left,height,0,0,renderLeft,renderHeight); + context.drawImage(canvas,left,0,centerWidth,height,renderLeft,0,renderCenterWidth,renderHeight); + context.drawImage(canvas,left + centerWidth,0,right,height,renderLeft + renderCenterWidth,0,renderRight,renderHeight); + } + } else { + renderer1.setTransform(transform,context); + context.drawImage(canvas,0,0,width,height); + } + renderer1.__popMaskObject(tilemap); + } + } + } + } + } + } + } + } + } + var renderer1 = renderer.__canvasRenderer; + if(!(!tilemap.__renderable || tilemap.__group.__tiles.length == 0)) { + var alpha = renderer1.__getAlpha(tilemap.__worldAlpha); + if(!(alpha <= 0)) { + var context = renderer1.context; + renderer1.__setBlendMode(tilemap.__worldBlendMode); + renderer1.__pushMaskObject(tilemap); + var rect = openfl_geom_Rectangle.__pool.get(); + rect.setTo(0,0,tilemap.__width,tilemap.__height); + renderer1.__pushMaskRect(rect,tilemap.__renderTransform); + if(!renderer1.__allowSmoothing || !tilemap.smoothing) { + context.imageSmoothingEnabled = false; + } + openfl_display__$internal_CanvasTilemap.renderTileContainer(tilemap.__group,renderer1,tilemap.__renderTransform,tilemap.__tileset,renderer1.__allowSmoothing && tilemap.smoothing,tilemap.tileAlphaEnabled,alpha,tilemap.tileBlendModeEnabled,tilemap.__worldBlendMode,null,null,rect); + if(!renderer1.__allowSmoothing || !tilemap.smoothing) { + context.imageSmoothingEnabled = true; + } + renderer1.__popMaskRect(); + renderer1.__popMaskObject(tilemap); + openfl_geom_Rectangle.__pool.release(rect); + } + } + tilemap.__renderTransform = cacheRenderTransform; + renderer.__canvasRenderer.context = null; + renderer.__updateClip(tilemap); + renderer.__applyStyle(tilemap,true,false,true); + } else { + openfl_display__$internal_DOMTilemap.clear(tilemap,renderer); + } + renderer.__renderEvent(tilemap); +}; +openfl_display__$internal_DOMTilemap.renderDrawableClear = function(tilemap,renderer) { + openfl_display__$internal_DOMTilemap.clear(tilemap,renderer); +}; +var openfl_display__$internal_DOMVideo = function() { }; +$hxClasses["openfl.display._internal.DOMVideo"] = openfl_display__$internal_DOMVideo; +openfl_display__$internal_DOMVideo.__name__ = "openfl.display._internal.DOMVideo"; +openfl_display__$internal_DOMVideo.clear = function(video,renderer) { + openfl_display__$internal_DOMDisplayObject.clear(video,renderer); + if(video.__active) { + renderer.element.removeChild(video.__stream.__video); + video.__active = false; + } +}; +openfl_display__$internal_DOMVideo.render = function(video,renderer) { + if(video.stage != null && video.__stream != null && video.__worldVisible && video.__renderable) { + if(!video.__active) { + renderer.__initializeElement(video,video.__stream.__video); + video.__active = true; + video.__dirty = true; + } + if(video.__dirty) { + video.__stream.__video.width = video.__width | 0; + video.__stream.__video.height = video.__height | 0; + video.__dirty = false; + } + renderer.__updateClip(video); + renderer.__applyStyle(video,true,true,true); + } else { + openfl_display__$internal_DOMVideo.clear(video,renderer); + } +}; +openfl_display__$internal_DOMVideo.renderDrawable = function(video,renderer) { + openfl_display__$internal_DOMVideo.render(video,renderer); + renderer.__renderEvent(video); +}; +openfl_display__$internal_DOMVideo.renderDrawableClear = function(video,renderer) { + openfl_display__$internal_DOMDisplayObject.renderDrawableClear(video,renderer); +}; +var openfl_display__$internal_DrawCommandReader = function(buffer) { + this.buffer = buffer; + this.bPos = this.iPos = this.fPos = this.oPos = this.ffPos = this.iiPos = this.tsPos = 0; + this.prev = openfl_display__$internal_DrawCommandType.UNKNOWN; +}; +$hxClasses["openfl.display._internal.DrawCommandReader"] = openfl_display__$internal_DrawCommandReader; +openfl_display__$internal_DrawCommandReader.__name__ = "openfl.display._internal.DrawCommandReader"; +openfl_display__$internal_DrawCommandReader.prototype = { + advance: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + } + ,bool: function(index) { + return this.buffer.b[this.bPos + index]; + } + ,destroy: function() { + this.buffer = null; + this.reset(); + } + ,fArr: function(index) { + return this.buffer.ff[this.ffPos + index]; + } + ,float: function(index) { + return this.buffer.f[this.fPos + index]; + } + ,iArr: function(index) { + return this.buffer.ii[this.iiPos + index]; + } + ,int: function(index) { + return this.buffer.i[this.iPos + index]; + } + ,obj: function(index) { + return this.buffer.o[this.oPos + index]; + } + ,readBeginBitmapFill: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL; + return this; + } + ,readBeginFill: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.BEGIN_FILL; + return this; + } + ,readBeginGradientFill: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL; + return this; + } + ,readBeginShaderFill: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL; + return this; + } + ,readCubicCurveTo: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO; + return this; + } + ,readCurveTo: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.CURVE_TO; + return this; + } + ,readDrawCircle: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.DRAW_CIRCLE; + return this; + } + ,readDrawEllipse: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE; + return this; + } + ,readDrawQuads: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.DRAW_QUADS; + return this; + } + ,readDrawRect: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.DRAW_RECT; + return this; + } + ,readDrawRoundRect: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT; + return this; + } + ,readDrawTriangles: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES; + return this; + } + ,readEndFill: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.END_FILL; + return this; + } + ,readLineBitmapStyle: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE; + return this; + } + ,readLineGradientStyle: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE; + return this; + } + ,readLineStyle: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.LINE_STYLE; + return this; + } + ,readLineTo: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.LINE_TO; + return this; + } + ,readMoveTo: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.MOVE_TO; + return this; + } + ,readOverrideBlendMode: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE; + return this; + } + ,readOverrideMatrix: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.OVERRIDE_MATRIX; + return this; + } + ,readWindingEvenOdd: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD; + return this; + } + ,readWindingNonZero: function() { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO; + return this; + } + ,reset: function() { + this.bPos = this.iPos = this.fPos = this.oPos = this.ffPos = this.iiPos = this.tsPos = 0; + } + ,skip: function(type) { + switch(this.prev._hx_index) { + case 0: + this.oPos += 2; + this.bPos += 2; + break; + case 1: + this.iPos += 1; + this.fPos += 1; + break; + case 2: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 3: + this.oPos += 1; + break; + case 4: + this.fPos += 6; + break; + case 5: + this.fPos += 4; + break; + case 6: + this.fPos += 3; + break; + case 7: + this.fPos += 4; + break; + case 8: + this.oPos += 3; + break; + case 9: + this.fPos += 4; + break; + case 10: + this.fPos += 5; + this.oPos += 1; + break; + case 12: + this.oPos += 4; + break; + case 13: + break; + case 14: + this.oPos += 2; + this.bPos += 2; + break; + case 15: + this.oPos += 4; + this.iiPos += 2; + this.ffPos += 1; + this.fPos += 1; + break; + case 16: + this.oPos += 4; + this.iPos += 1; + this.fPos += 2; + this.bPos += 1; + break; + case 17: + this.fPos += 2; + break; + case 18: + this.fPos += 2; + break; + case 19: + this.oPos += 1; + break; + case 20: + this.oPos += 1; + break; + case 21:case 22: + break; + default: + } + this.prev = type; + } + ,__class__: openfl_display__$internal_DrawCommandReader +}; +var openfl_display__$internal_BeginBitmapFillView = {}; +openfl_display__$internal_BeginBitmapFillView.__properties__ = {get_smooth:"get_smooth",get_repeat:"get_repeat",get_matrix:"get_matrix",get_bitmap:"get_bitmap"}; +openfl_display__$internal_BeginBitmapFillView._new = function(d) { + return d; +}; +openfl_display__$internal_BeginBitmapFillView.get_bitmap = function(this1) { + return this1.buffer.o[this1.oPos]; +}; +openfl_display__$internal_BeginBitmapFillView.get_matrix = function(this1) { + return this1.buffer.o[this1.oPos + 1]; +}; +openfl_display__$internal_BeginBitmapFillView.get_repeat = function(this1) { + return this1.buffer.b[this1.bPos]; +}; +openfl_display__$internal_BeginBitmapFillView.get_smooth = function(this1) { + return this1.buffer.b[this1.bPos + 1]; +}; +var openfl_display__$internal_BeginFillView = {}; +openfl_display__$internal_BeginFillView.__properties__ = {get_alpha:"get_alpha",get_color:"get_color"}; +openfl_display__$internal_BeginFillView._new = function(d) { + return d; +}; +openfl_display__$internal_BeginFillView.get_color = function(this1) { + return this1.buffer.i[this1.iPos]; +}; +openfl_display__$internal_BeginFillView.get_alpha = function(this1) { + return this1.buffer.f[this1.fPos]; +}; +var openfl_display__$internal_BeginGradientFillView = {}; +openfl_display__$internal_BeginGradientFillView.__properties__ = {get_focalPointRatio:"get_focalPointRatio",get_interpolationMethod:"get_interpolationMethod",get_spreadMethod:"get_spreadMethod",get_matrix:"get_matrix",get_ratios:"get_ratios",get_alphas:"get_alphas",get_colors:"get_colors",get_type:"get_type"}; +openfl_display__$internal_BeginGradientFillView._new = function(d) { + return d; +}; +openfl_display__$internal_BeginGradientFillView.get_type = function(this1) { + return this1.buffer.o[this1.oPos]; +}; +openfl_display__$internal_BeginGradientFillView.get_colors = function(this1) { + return this1.buffer.ii[this1.iiPos]; +}; +openfl_display__$internal_BeginGradientFillView.get_alphas = function(this1) { + return this1.buffer.ff[this1.ffPos]; +}; +openfl_display__$internal_BeginGradientFillView.get_ratios = function(this1) { + return this1.buffer.ii[this1.iiPos + 1]; +}; +openfl_display__$internal_BeginGradientFillView.get_matrix = function(this1) { + return this1.buffer.o[this1.oPos + 1]; +}; +openfl_display__$internal_BeginGradientFillView.get_spreadMethod = function(this1) { + return this1.buffer.o[this1.oPos + 2]; +}; +openfl_display__$internal_BeginGradientFillView.get_interpolationMethod = function(this1) { + return this1.buffer.o[this1.oPos + 3]; +}; +openfl_display__$internal_BeginGradientFillView.get_focalPointRatio = function(this1) { + return this1.buffer.f[this1.fPos]; +}; +var openfl_display__$internal_BeginShaderFillView = {}; +openfl_display__$internal_BeginShaderFillView.__properties__ = {get_shaderBuffer:"get_shaderBuffer"}; +openfl_display__$internal_BeginShaderFillView._new = function(d) { + return d; +}; +openfl_display__$internal_BeginShaderFillView.get_shaderBuffer = function(this1) { + return this1.buffer.o[this1.oPos]; +}; +var openfl_display__$internal_CubicCurveToView = {}; +openfl_display__$internal_CubicCurveToView.__properties__ = {get_anchorY:"get_anchorY",get_anchorX:"get_anchorX",get_controlY2:"get_controlY2",get_controlX2:"get_controlX2",get_controlY1:"get_controlY1",get_controlX1:"get_controlX1"}; +openfl_display__$internal_CubicCurveToView._new = function(d) { + return d; +}; +openfl_display__$internal_CubicCurveToView.get_controlX1 = function(this1) { + return this1.buffer.f[this1.fPos]; +}; +openfl_display__$internal_CubicCurveToView.get_controlY1 = function(this1) { + return this1.buffer.f[this1.fPos + 1]; +}; +openfl_display__$internal_CubicCurveToView.get_controlX2 = function(this1) { + return this1.buffer.f[this1.fPos + 2]; +}; +openfl_display__$internal_CubicCurveToView.get_controlY2 = function(this1) { + return this1.buffer.f[this1.fPos + 3]; +}; +openfl_display__$internal_CubicCurveToView.get_anchorX = function(this1) { + return this1.buffer.f[this1.fPos + 4]; +}; +openfl_display__$internal_CubicCurveToView.get_anchorY = function(this1) { + return this1.buffer.f[this1.fPos + 5]; +}; +var openfl_display__$internal_CurveToView = {}; +openfl_display__$internal_CurveToView.__properties__ = {get_anchorY:"get_anchorY",get_anchorX:"get_anchorX",get_controlY:"get_controlY",get_controlX:"get_controlX"}; +openfl_display__$internal_CurveToView._new = function(d) { + return d; +}; +openfl_display__$internal_CurveToView.get_controlX = function(this1) { + return this1.buffer.f[this1.fPos]; +}; +openfl_display__$internal_CurveToView.get_controlY = function(this1) { + return this1.buffer.f[this1.fPos + 1]; +}; +openfl_display__$internal_CurveToView.get_anchorX = function(this1) { + return this1.buffer.f[this1.fPos + 2]; +}; +openfl_display__$internal_CurveToView.get_anchorY = function(this1) { + return this1.buffer.f[this1.fPos + 3]; +}; +var openfl_display__$internal_DrawCircleView = {}; +openfl_display__$internal_DrawCircleView.__properties__ = {get_radius:"get_radius",get_y:"get_y",get_x:"get_x"}; +openfl_display__$internal_DrawCircleView._new = function(d) { + return d; +}; +openfl_display__$internal_DrawCircleView.get_x = function(this1) { + return this1.buffer.f[this1.fPos]; +}; +openfl_display__$internal_DrawCircleView.get_y = function(this1) { + return this1.buffer.f[this1.fPos + 1]; +}; +openfl_display__$internal_DrawCircleView.get_radius = function(this1) { + return this1.buffer.f[this1.fPos + 2]; +}; +var openfl_display__$internal_DrawEllipseView = {}; +openfl_display__$internal_DrawEllipseView.__properties__ = {get_height:"get_height",get_width:"get_width",get_y:"get_y",get_x:"get_x"}; +openfl_display__$internal_DrawEllipseView._new = function(d) { + return d; +}; +openfl_display__$internal_DrawEllipseView.get_x = function(this1) { + return this1.buffer.f[this1.fPos]; +}; +openfl_display__$internal_DrawEllipseView.get_y = function(this1) { + return this1.buffer.f[this1.fPos + 1]; +}; +openfl_display__$internal_DrawEllipseView.get_width = function(this1) { + return this1.buffer.f[this1.fPos + 2]; +}; +openfl_display__$internal_DrawEllipseView.get_height = function(this1) { + return this1.buffer.f[this1.fPos + 3]; +}; +var openfl_display__$internal_DrawQuadsView = {}; +openfl_display__$internal_DrawQuadsView.__properties__ = {get_transforms:"get_transforms",get_indices:"get_indices",get_rects:"get_rects"}; +openfl_display__$internal_DrawQuadsView._new = function(d) { + return d; +}; +openfl_display__$internal_DrawQuadsView.get_rects = function(this1) { + return this1.buffer.o[this1.oPos]; +}; +openfl_display__$internal_DrawQuadsView.get_indices = function(this1) { + return this1.buffer.o[this1.oPos + 1]; +}; +openfl_display__$internal_DrawQuadsView.get_transforms = function(this1) { + return this1.buffer.o[this1.oPos + 2]; +}; +var openfl_display__$internal_DrawRectView = {}; +openfl_display__$internal_DrawRectView.__properties__ = {get_height:"get_height",get_width:"get_width",get_y:"get_y",get_x:"get_x"}; +openfl_display__$internal_DrawRectView._new = function(d) { + return d; +}; +openfl_display__$internal_DrawRectView.get_x = function(this1) { + return this1.buffer.f[this1.fPos]; +}; +openfl_display__$internal_DrawRectView.get_y = function(this1) { + return this1.buffer.f[this1.fPos + 1]; +}; +openfl_display__$internal_DrawRectView.get_width = function(this1) { + return this1.buffer.f[this1.fPos + 2]; +}; +openfl_display__$internal_DrawRectView.get_height = function(this1) { + return this1.buffer.f[this1.fPos + 3]; +}; +var openfl_display__$internal_DrawRoundRectView = {}; +openfl_display__$internal_DrawRoundRectView.__properties__ = {get_ellipseHeight:"get_ellipseHeight",get_ellipseWidth:"get_ellipseWidth",get_height:"get_height",get_width:"get_width",get_y:"get_y",get_x:"get_x"}; +openfl_display__$internal_DrawRoundRectView._new = function(d) { + return d; +}; +openfl_display__$internal_DrawRoundRectView.get_x = function(this1) { + return this1.buffer.f[this1.fPos]; +}; +openfl_display__$internal_DrawRoundRectView.get_y = function(this1) { + return this1.buffer.f[this1.fPos + 1]; +}; +openfl_display__$internal_DrawRoundRectView.get_width = function(this1) { + return this1.buffer.f[this1.fPos + 2]; +}; +openfl_display__$internal_DrawRoundRectView.get_height = function(this1) { + return this1.buffer.f[this1.fPos + 3]; +}; +openfl_display__$internal_DrawRoundRectView.get_ellipseWidth = function(this1) { + return this1.buffer.f[this1.fPos + 4]; +}; +openfl_display__$internal_DrawRoundRectView.get_ellipseHeight = function(this1) { + return this1.buffer.o[this1.oPos]; +}; +var openfl_display__$internal_DrawTrianglesView = {}; +openfl_display__$internal_DrawTrianglesView.__properties__ = {get_culling:"get_culling",get_uvtData:"get_uvtData",get_indices:"get_indices",get_vertices:"get_vertices"}; +openfl_display__$internal_DrawTrianglesView._new = function(d) { + return d; +}; +openfl_display__$internal_DrawTrianglesView.get_vertices = function(this1) { + return this1.buffer.o[this1.oPos]; +}; +openfl_display__$internal_DrawTrianglesView.get_indices = function(this1) { + return this1.buffer.o[this1.oPos + 1]; +}; +openfl_display__$internal_DrawTrianglesView.get_uvtData = function(this1) { + return this1.buffer.o[this1.oPos + 2]; +}; +openfl_display__$internal_DrawTrianglesView.get_culling = function(this1) { + return this1.buffer.o[this1.oPos + 3]; +}; +var openfl_display__$internal_EndFillView = {}; +openfl_display__$internal_EndFillView._new = function(d) { + return d; +}; +var openfl_display__$internal_LineBitmapStyleView = {}; +openfl_display__$internal_LineBitmapStyleView.__properties__ = {get_smooth:"get_smooth",get_repeat:"get_repeat",get_matrix:"get_matrix",get_bitmap:"get_bitmap"}; +openfl_display__$internal_LineBitmapStyleView._new = function(d) { + return d; +}; +openfl_display__$internal_LineBitmapStyleView.get_bitmap = function(this1) { + return this1.buffer.o[this1.oPos]; +}; +openfl_display__$internal_LineBitmapStyleView.get_matrix = function(this1) { + return this1.buffer.o[this1.oPos + 1]; +}; +openfl_display__$internal_LineBitmapStyleView.get_repeat = function(this1) { + return this1.buffer.b[this1.bPos]; +}; +openfl_display__$internal_LineBitmapStyleView.get_smooth = function(this1) { + return this1.buffer.b[this1.bPos + 1]; +}; +var openfl_display__$internal_LineGradientStyleView = {}; +openfl_display__$internal_LineGradientStyleView.__properties__ = {get_focalPointRatio:"get_focalPointRatio",get_interpolationMethod:"get_interpolationMethod",get_spreadMethod:"get_spreadMethod",get_matrix:"get_matrix",get_ratios:"get_ratios",get_alphas:"get_alphas",get_colors:"get_colors",get_type:"get_type"}; +openfl_display__$internal_LineGradientStyleView._new = function(d) { + return d; +}; +openfl_display__$internal_LineGradientStyleView.get_type = function(this1) { + return this1.buffer.o[this1.oPos]; +}; +openfl_display__$internal_LineGradientStyleView.get_colors = function(this1) { + return this1.buffer.ii[this1.iiPos]; +}; +openfl_display__$internal_LineGradientStyleView.get_alphas = function(this1) { + return this1.buffer.ff[this1.ffPos]; +}; +openfl_display__$internal_LineGradientStyleView.get_ratios = function(this1) { + return this1.buffer.ii[this1.iiPos + 1]; +}; +openfl_display__$internal_LineGradientStyleView.get_matrix = function(this1) { + return this1.buffer.o[this1.oPos + 1]; +}; +openfl_display__$internal_LineGradientStyleView.get_spreadMethod = function(this1) { + return this1.buffer.o[this1.oPos + 2]; +}; +openfl_display__$internal_LineGradientStyleView.get_interpolationMethod = function(this1) { + return this1.buffer.o[this1.oPos + 3]; +}; +openfl_display__$internal_LineGradientStyleView.get_focalPointRatio = function(this1) { + return this1.buffer.f[this1.fPos]; +}; +var openfl_display__$internal_LineStyleView = {}; +openfl_display__$internal_LineStyleView.__properties__ = {get_miterLimit:"get_miterLimit",get_joints:"get_joints",get_caps:"get_caps",get_scaleMode:"get_scaleMode",get_pixelHinting:"get_pixelHinting",get_alpha:"get_alpha",get_color:"get_color",get_thickness:"get_thickness"}; +openfl_display__$internal_LineStyleView._new = function(d) { + return d; +}; +openfl_display__$internal_LineStyleView.get_thickness = function(this1) { + return this1.buffer.o[this1.oPos]; +}; +openfl_display__$internal_LineStyleView.get_color = function(this1) { + return this1.buffer.i[this1.iPos]; +}; +openfl_display__$internal_LineStyleView.get_alpha = function(this1) { + return this1.buffer.f[this1.fPos]; +}; +openfl_display__$internal_LineStyleView.get_pixelHinting = function(this1) { + return this1.buffer.b[this1.bPos]; +}; +openfl_display__$internal_LineStyleView.get_scaleMode = function(this1) { + return this1.buffer.o[this1.oPos + 1]; +}; +openfl_display__$internal_LineStyleView.get_caps = function(this1) { + return this1.buffer.o[this1.oPos + 2]; +}; +openfl_display__$internal_LineStyleView.get_joints = function(this1) { + return this1.buffer.o[this1.oPos + 3]; +}; +openfl_display__$internal_LineStyleView.get_miterLimit = function(this1) { + return this1.buffer.f[this1.fPos + 1]; +}; +var openfl_display__$internal_LineToView = {}; +openfl_display__$internal_LineToView.__properties__ = {get_y:"get_y",get_x:"get_x"}; +openfl_display__$internal_LineToView._new = function(d) { + return d; +}; +openfl_display__$internal_LineToView.get_x = function(this1) { + return this1.buffer.f[this1.fPos]; +}; +openfl_display__$internal_LineToView.get_y = function(this1) { + return this1.buffer.f[this1.fPos + 1]; +}; +var openfl_display__$internal_MoveToView = {}; +openfl_display__$internal_MoveToView.__properties__ = {get_y:"get_y",get_x:"get_x"}; +openfl_display__$internal_MoveToView._new = function(d) { + return d; +}; +openfl_display__$internal_MoveToView.get_x = function(this1) { + return this1.buffer.f[this1.fPos]; +}; +openfl_display__$internal_MoveToView.get_y = function(this1) { + return this1.buffer.f[this1.fPos + 1]; +}; +var openfl_display__$internal_OverrideBlendModeView = {}; +openfl_display__$internal_OverrideBlendModeView.__properties__ = {get_blendMode:"get_blendMode"}; +openfl_display__$internal_OverrideBlendModeView._new = function(d) { + return d; +}; +openfl_display__$internal_OverrideBlendModeView.get_blendMode = function(this1) { + return this1.buffer.o[this1.oPos]; +}; +var openfl_display__$internal_OverrideMatrixView = {}; +openfl_display__$internal_OverrideMatrixView.__properties__ = {get_matrix:"get_matrix"}; +openfl_display__$internal_OverrideMatrixView._new = function(d) { + return d; +}; +openfl_display__$internal_OverrideMatrixView.get_matrix = function(this1) { + return this1.buffer.o[this1.oPos]; +}; +var openfl_display__$internal_WindingEvenOddView = {}; +openfl_display__$internal_WindingEvenOddView._new = function(d) { + return d; +}; +var openfl_display__$internal_WindingNonZeroView = {}; +openfl_display__$internal_WindingNonZeroView._new = function(d) { + return d; +}; +var openfl_display__$internal_DrawCommandType = $hxEnums["openfl.display._internal.DrawCommandType"] = { __ename__:"openfl.display._internal.DrawCommandType",__constructs__:null + ,BEGIN_BITMAP_FILL: {_hx_name:"BEGIN_BITMAP_FILL",_hx_index:0,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,BEGIN_FILL: {_hx_name:"BEGIN_FILL",_hx_index:1,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,BEGIN_GRADIENT_FILL: {_hx_name:"BEGIN_GRADIENT_FILL",_hx_index:2,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,BEGIN_SHADER_FILL: {_hx_name:"BEGIN_SHADER_FILL",_hx_index:3,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,CUBIC_CURVE_TO: {_hx_name:"CUBIC_CURVE_TO",_hx_index:4,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,CURVE_TO: {_hx_name:"CURVE_TO",_hx_index:5,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,DRAW_CIRCLE: {_hx_name:"DRAW_CIRCLE",_hx_index:6,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,DRAW_ELLIPSE: {_hx_name:"DRAW_ELLIPSE",_hx_index:7,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,DRAW_QUADS: {_hx_name:"DRAW_QUADS",_hx_index:8,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,DRAW_RECT: {_hx_name:"DRAW_RECT",_hx_index:9,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,DRAW_ROUND_RECT: {_hx_name:"DRAW_ROUND_RECT",_hx_index:10,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,DRAW_TILES: {_hx_name:"DRAW_TILES",_hx_index:11,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,DRAW_TRIANGLES: {_hx_name:"DRAW_TRIANGLES",_hx_index:12,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,END_FILL: {_hx_name:"END_FILL",_hx_index:13,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,LINE_BITMAP_STYLE: {_hx_name:"LINE_BITMAP_STYLE",_hx_index:14,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,LINE_GRADIENT_STYLE: {_hx_name:"LINE_GRADIENT_STYLE",_hx_index:15,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,LINE_STYLE: {_hx_name:"LINE_STYLE",_hx_index:16,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,LINE_TO: {_hx_name:"LINE_TO",_hx_index:17,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,MOVE_TO: {_hx_name:"MOVE_TO",_hx_index:18,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,OVERRIDE_BLEND_MODE: {_hx_name:"OVERRIDE_BLEND_MODE",_hx_index:19,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,OVERRIDE_MATRIX: {_hx_name:"OVERRIDE_MATRIX",_hx_index:20,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,WINDING_EVEN_ODD: {_hx_name:"WINDING_EVEN_ODD",_hx_index:21,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,WINDING_NON_ZERO: {_hx_name:"WINDING_NON_ZERO",_hx_index:22,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} + ,UNKNOWN: {_hx_name:"UNKNOWN",_hx_index:23,__enum__:"openfl.display._internal.DrawCommandType",toString:$estr} +}; +openfl_display__$internal_DrawCommandType.__constructs__ = [openfl_display__$internal_DrawCommandType.BEGIN_BITMAP_FILL,openfl_display__$internal_DrawCommandType.BEGIN_FILL,openfl_display__$internal_DrawCommandType.BEGIN_GRADIENT_FILL,openfl_display__$internal_DrawCommandType.BEGIN_SHADER_FILL,openfl_display__$internal_DrawCommandType.CUBIC_CURVE_TO,openfl_display__$internal_DrawCommandType.CURVE_TO,openfl_display__$internal_DrawCommandType.DRAW_CIRCLE,openfl_display__$internal_DrawCommandType.DRAW_ELLIPSE,openfl_display__$internal_DrawCommandType.DRAW_QUADS,openfl_display__$internal_DrawCommandType.DRAW_RECT,openfl_display__$internal_DrawCommandType.DRAW_ROUND_RECT,openfl_display__$internal_DrawCommandType.DRAW_TILES,openfl_display__$internal_DrawCommandType.DRAW_TRIANGLES,openfl_display__$internal_DrawCommandType.END_FILL,openfl_display__$internal_DrawCommandType.LINE_BITMAP_STYLE,openfl_display__$internal_DrawCommandType.LINE_GRADIENT_STYLE,openfl_display__$internal_DrawCommandType.LINE_STYLE,openfl_display__$internal_DrawCommandType.LINE_TO,openfl_display__$internal_DrawCommandType.MOVE_TO,openfl_display__$internal_DrawCommandType.OVERRIDE_BLEND_MODE,openfl_display__$internal_DrawCommandType.OVERRIDE_MATRIX,openfl_display__$internal_DrawCommandType.WINDING_EVEN_ODD,openfl_display__$internal_DrawCommandType.WINDING_NON_ZERO,openfl_display__$internal_DrawCommandType.UNKNOWN]; +var openfl_display__$internal_FlashRenderer = function() { }; +$hxClasses["openfl.display._internal.FlashRenderer"] = openfl_display__$internal_FlashRenderer; +openfl_display__$internal_FlashRenderer.__name__ = "openfl.display._internal.FlashRenderer"; +openfl_display__$internal_FlashRenderer.register = function(renderObject) { + if(openfl_display__$internal_FlashRenderer.instances == null) { + openfl_display__$internal_FlashRenderer.instances = openfl_utils_Dictionary.toObjectMap(null,true); + openfl_Lib.get_current().stage.addEventListener("enterFrame",openfl_display__$internal_FlashRenderer.render,false,-2147483648); + } + openfl_display__$internal_FlashRenderer.instances.set(renderObject,true); +}; +openfl_display__$internal_FlashRenderer.render = function(_) { + var instance = openfl_display__$internal_FlashRenderer.instances.keys(); + while(instance.hasNext()) { + var instance1 = instance.next(); + instance1.__renderFlash(); + } +}; +var openfl_display__$internal_IDisplayObject = function() { }; +$hxClasses["openfl.display._internal.IDisplayObject"] = openfl_display__$internal_IDisplayObject; +openfl_display__$internal_IDisplayObject.__name__ = "openfl.display._internal.IDisplayObject"; +openfl_display__$internal_IDisplayObject.__isInterface__ = true; +openfl_display__$internal_IDisplayObject.prototype = { + __class__: openfl_display__$internal_IDisplayObject +}; +var openfl_geom_Point = function(x,y) { + if(y == null) { + y = 0; + } + if(x == null) { + x = 0; + } + this.x = x; + this.y = y; +}; +$hxClasses["openfl.geom.Point"] = openfl_geom_Point; +openfl_geom_Point.__name__ = "openfl.geom.Point"; +openfl_geom_Point.distance = function(pt1,pt2) { + var dx = pt1.x - pt2.x; + var dy = pt1.y - pt2.y; + return Math.sqrt(dx * dx + dy * dy); +}; +openfl_geom_Point.interpolate = function(pt1,pt2,f) { + return new openfl_geom_Point(pt2.x + f * (pt1.x - pt2.x),pt2.y + f * (pt1.y - pt2.y)); +}; +openfl_geom_Point.interpolateToOutput = function(pt1,pt2,f,output) { + if(output != null) { + output.setTo(pt2.x + f * (pt1.x - pt2.x),pt2.y + f * (pt1.y - pt2.y)); + return output; + } + return new openfl_geom_Point(pt2.x + f * (pt1.x - pt2.x),pt2.y + f * (pt1.y - pt2.y)); +}; +openfl_geom_Point.polar = function(len,angle) { + return new openfl_geom_Point(len * Math.cos(angle),len * Math.sin(angle)); +}; +openfl_geom_Point.polarToOutput = function(len,angle,output) { + if(output != null) { + output.setTo(len * Math.cos(angle),len * Math.sin(angle)); + return output; + } + return new openfl_geom_Point(len * Math.cos(angle),len * Math.sin(angle)); +}; +openfl_geom_Point.prototype = { + add: function(v) { + return new openfl_geom_Point(v.x + this.x,v.y + this.y); + } + ,addToOutput: function(v,output) { + if(output != null) { + output.setTo(v.x + this.x,v.y + this.y); + return output; + } + return new openfl_geom_Point(v.x + this.x,v.y + this.y); + } + ,clone: function() { + return new openfl_geom_Point(this.x,this.y); + } + ,copyFrom: function(sourcePoint) { + this.x = sourcePoint.x; + this.y = sourcePoint.y; + } + ,equals: function(toCompare) { + if(toCompare != null && toCompare.x == this.x) { + return toCompare.y == this.y; + } else { + return false; + } + } + ,normalize: function(thickness) { + if(this.x == 0 && this.y == 0) { + return; + } else { + var norm = thickness / Math.sqrt(this.x * this.x + this.y * this.y); + this.x *= norm; + this.y *= norm; + } + } + ,offset: function(dx,dy) { + this.x += dx; + this.y += dy; + } + ,setTo: function(xa,ya) { + this.x = xa; + this.y = ya; + } + ,subtract: function(v) { + return new openfl_geom_Point(this.x - v.x,this.y - v.y); + } + ,subtractToOutput: function(v,output) { + if(output != null) { + output.setTo(this.x - v.x,this.y - v.y); + return output; + } + return new openfl_geom_Point(this.x - v.x,this.y - v.y); + } + ,toString: function() { + return "(x=" + this.x + ", y=" + this.y + ")"; + } + ,__toLimeVector2: function() { + if(openfl_geom_Point.__limeVector2 == null) { + openfl_geom_Point.__limeVector2 = new lime_math_Vector2(); + } + var _this = openfl_geom_Point.__limeVector2; + _this.x = this.x; + _this.y = this.y; + return openfl_geom_Point.__limeVector2; + } + ,get_length: function() { + return Math.sqrt(this.x * this.x + this.y * this.y); + } + ,__class__: openfl_geom_Point + ,__properties__: {get_length:"get_length"} +}; +var openfl_display__$internal_FlashTilemap = function() { }; +$hxClasses["openfl.display._internal.FlashTilemap"] = openfl_display__$internal_FlashTilemap; +openfl_display__$internal_FlashTilemap.__name__ = "openfl.display._internal.FlashTilemap"; +openfl_display__$internal_FlashTilemap.render = function(tilemap) { +}; +openfl_display__$internal_FlashTilemap.renderTileContainer = function(group,bitmapData,parentTransform,defaultTileset,smooth,alphaEnabled,worldAlpha,colorTransformEnabled,defaultColorTransform,blendModeEnabled,defaultBlendMode,cacheBitmapData) { +}; +var openfl_display__$internal_PerlinNoise = function(seed,octaves,channels,grayScale,falloff,stitch,stitch_threshold) { + if(stitch_threshold == null) { + stitch_threshold = 0.05; + } + if(stitch == null) { + stitch = false; + } + openfl_display__$internal_AbstractNoise.call(this,seed,octaves,channels,grayScale,falloff,stitch,stitch_threshold); + this.p_perm = []; + var _g = 0; + while(_g < 512) { + var i = _g++; + this.p_perm[i] = openfl_display__$internal_PerlinNoise.P[i & 255]; + } + this.base_factor = 0.03125; + this.setSeed(seed); +}; +$hxClasses["openfl.display._internal.PerlinNoise"] = openfl_display__$internal_PerlinNoise; +openfl_display__$internal_PerlinNoise.__name__ = "openfl.display._internal.PerlinNoise"; +openfl_display__$internal_PerlinNoise.__super__ = openfl_display__$internal_AbstractNoise; +openfl_display__$internal_PerlinNoise.prototype = $extend(openfl_display__$internal_AbstractNoise.prototype,{ + fill: function(bitmap,_scale_x,_scale_y,_scale_z) { + var width = bitmap.width; + var height = bitmap.height; + var octaves = this.octaves; + var octaves_frequencies = this.octaves_frequencies; + var octaves_persistences = this.octaves_persistences; + var isRed = (1 & this.channels) == 1; + var isGreen = (2 & this.channels) == 2; + var isBlue = (4 & this.channels) == 4; + var channels = 0; + if(isRed) { + ++channels; + } + if(isGreen) { + ++channels; + } + if(isBlue) { + ++channels; + } + var grayscale = this.grayscale; + var stitch_w = this.stitch_threshold * width | 0; + var stitch_h = this.stitch_threshold * height | 0; + var base_x = _scale_x * this.base_factor + this.x_offset; + _scale_y = _scale_y * this.base_factor + this.y_offset; + _scale_z = _scale_z * this.base_factor + this.z_offset; + var g_offset = 1.0; + var b_offset = 2.0; + var _g = 0; + var _g1 = height; + while(_g < _g1) { + var py = _g++; + _scale_x = base_x; + var _g2 = 0; + var _g3 = width; + while(_g2 < _g3) { + var px = _g2++; + var color1 = 0.0; + var color2 = 0.0; + var color3 = 0.0; + var _g4 = 0; + var _g5 = octaves; + while(_g4 < _g5) { + var i = _g4++; + var frequency = octaves_frequencies[i]; + var persistence = octaves_persistences[i]; + color1 += this.noise(_scale_x * frequency,_scale_y * frequency,_scale_z * frequency) * persistence; + if(!grayscale) { + if(1 < channels) { + color2 += this.noise((_scale_x + g_offset) * frequency,(_scale_y + g_offset) * frequency,_scale_z * frequency) * persistence; + } + if(2 < channels) { + color3 += this.noise((_scale_x + b_offset) * frequency,(_scale_y + b_offset) * frequency,_scale_z * frequency) * persistence; + } + } + } + var color = 0; + if(grayscale) { + color = this.color(color1,color1,color1); + } else if(isRed && isGreen && isBlue) { + color = this.color(color1,color2,color3); + } else if(isRed && isGreen) { + color = this.color(color1,color2,null); + } else if(isRed && isBlue) { + color = this.color(color1,null,color2); + } else if(isGreen && isBlue) { + color = this.color(null,color1,color2); + } else if(isRed) { + color = this.color(color1,null,null); + } else if(isGreen) { + color = this.color(null,color1,null); + } else if(isBlue) { + color = this.color(null,null,color1); + } + if(this.stitch) { + color = this.stitching(bitmap,color,px,py,stitch_w,stitch_h,width,height); + } + bitmap.setPixel32(px,py,color); + _scale_x += this.base_factor; + } + _scale_y += this.base_factor; + } + } + ,noise: function(x,y,z) { + var xf = x - x % 1; + var yf = y - y % 1; + var zf = z - z % 1; + x -= xf; + y -= yf; + z -= zf; + var X = (xf | 0) & 255; + var Y = (yf | 0) & 255; + var Z = (zf | 0) & 255; + var u = this.fade(x); + var v = this.fade(y); + var w = this.fade(z); + var A = this.p_perm[X] + Y; + var AA = this.p_perm[A] + Z; + var AB = this.p_perm[A + 1] + Z; + var B = this.p_perm[X + 1] + Y; + var BA = this.p_perm[B] + Z; + var BB = this.p_perm[B + 1] + Z; + var x1 = x - 1; + var y1 = y - 1; + var z1 = z - 1; + var hash = this.p_perm[BB + 1] & 15; + var g1 = ((hash & 1) == 0 ? hash < 8 ? x1 : y1 : hash < 8 ? -x1 : -y1) + ((hash & 2) == 0 ? hash < 4 ? y1 : hash == 12 ? x1 : z1 : hash < 4 ? -y1 : hash == 14 ? -x1 : -z1); + hash = this.p_perm[AB + 1] & 15; + var g2 = ((hash & 1) == 0 ? hash < 8 ? x : y1 : hash < 8 ? -x : -y1) + ((hash & 2) == 0 ? hash < 4 ? y1 : hash == 12 ? x : z1 : hash < 4 ? -y1 : hash == 14 ? -x : -z1); + hash = this.p_perm[BA + 1] & 15; + var g3 = ((hash & 1) == 0 ? hash < 8 ? x1 : y : hash < 8 ? -x1 : -y) + ((hash & 2) == 0 ? hash < 4 ? y : hash == 12 ? x1 : z1 : hash < 4 ? -y : hash == 14 ? -x1 : -z1); + hash = this.p_perm[AA + 1] & 15; + var g4 = ((hash & 1) == 0 ? hash < 8 ? x : y : hash < 8 ? -x : -y) + ((hash & 2) == 0 ? hash < 4 ? y : hash == 12 ? x : z1 : hash < 4 ? -y : hash == 14 ? -x : -z1); + hash = this.p_perm[BB] & 15; + var g5 = ((hash & 1) == 0 ? hash < 8 ? x1 : y1 : hash < 8 ? -x1 : -y1) + ((hash & 2) == 0 ? hash < 4 ? y1 : hash == 12 ? x1 : z : hash < 4 ? -y1 : hash == 14 ? -x1 : -z); + hash = this.p_perm[AB] & 15; + var g6 = ((hash & 1) == 0 ? hash < 8 ? x : y1 : hash < 8 ? -x : -y1) + ((hash & 2) == 0 ? hash < 4 ? y1 : hash == 12 ? x : z : hash < 4 ? -y1 : hash == 14 ? -x : -z); + hash = this.p_perm[BA] & 15; + var g7 = ((hash & 1) == 0 ? hash < 8 ? x1 : y : hash < 8 ? -x1 : -y) + ((hash & 2) == 0 ? hash < 4 ? y : hash == 12 ? x1 : z : hash < 4 ? -y : hash == 14 ? -x1 : -z); + hash = this.p_perm[AA] & 15; + var g8 = ((hash & 1) == 0 ? hash < 8 ? x : y : hash < 8 ? -x : -y) + ((hash & 2) == 0 ? hash < 4 ? y : hash == 12 ? x : z : hash < 4 ? -y : hash == 14 ? -x : -z); + g2 += u * (g1 - g2); + g4 += u * (g3 - g4); + g6 += u * (g5 - g6); + g8 += u * (g7 - g8); + g4 += v * (g2 - g4); + g8 += v * (g6 - g8); + return g8 + w * (g4 - g8); + } + ,setSeed: function(seed) { + seed = seed * 16807.0 % 2147483647 | 0; + this.x_offset = seed; + seed = seed * 16807.0 % 2147483647 | 0; + this.y_offset = seed; + seed = seed * 16807.0 % 2147483647 | 0; + this.z_offset = seed; + } + ,__class__: openfl_display__$internal_PerlinNoise +}); +var openfl_display__$internal_SamplerState = function(wrap,filter,mipfilter,lodBias,ignoreSampler,centroid,textureAlpha) { + if(textureAlpha == null) { + textureAlpha = false; + } + if(centroid == null) { + centroid = false; + } + if(ignoreSampler == null) { + ignoreSampler = false; + } + if(lodBias == null) { + lodBias = 0.0; + } + if(mipfilter == null) { + mipfilter = 2; + } + if(filter == null) { + filter = 5; + } + if(wrap == null) { + wrap = 0; + } + this.wrap = wrap; + this.filter = filter; + this.mipfilter = mipfilter; + this.lodBias = lodBias; + this.ignoreSampler = ignoreSampler; + this.centroid = centroid; + this.textureAlpha = textureAlpha; +}; +$hxClasses["openfl.display._internal.SamplerState"] = openfl_display__$internal_SamplerState; +openfl_display__$internal_SamplerState.__name__ = "openfl.display._internal.SamplerState"; +openfl_display__$internal_SamplerState.prototype = { + clone: function() { + var copy = new openfl_display__$internal_SamplerState(this.wrap,this.filter,this.mipfilter,this.lodBias,this.ignoreSampler,this.centroid,this.textureAlpha); + copy.mipmapGenerated = this.mipmapGenerated; + return copy; + } + ,copyFrom: function(other) { + if(other == null || other.ignoreSampler) { + return; + } + this.wrap = other.wrap; + this.filter = other.filter; + this.mipfilter = other.mipfilter; + this.lodBias = other.lodBias; + this.centroid = other.centroid; + this.textureAlpha = other.textureAlpha; + } + ,equals: function(other) { + if(other == null) { + return false; + } + if(this.wrap == other.wrap && this.filter == other.filter && this.mipfilter == other.mipfilter && this.lodBias == other.lodBias) { + return this.textureAlpha == other.textureAlpha; + } else { + return false; + } + } + ,__class__: openfl_display__$internal_SamplerState +}; +var openfl_display__$internal_ShaderBuffer = function() { + this.inputRefs = []; + this.inputFilter = []; + this.inputMipFilter = []; + this.inputs = []; + this.inputWrap = []; + this.overrideIntNames = []; + this.overrideIntValues = []; + this.overrideFloatNames = []; + this.overrideFloatValues = []; + this.overrideBoolNames = []; + this.overrideBoolValues = []; + this.paramLengths = []; + this.paramPositions = []; + this.paramRefs_Bool = []; + this.paramRefs_Float = []; + this.paramRefs_Int = []; + this.paramTypes = []; +}; +$hxClasses["openfl.display._internal.ShaderBuffer"] = openfl_display__$internal_ShaderBuffer; +openfl_display__$internal_ShaderBuffer.__name__ = "openfl.display._internal.ShaderBuffer"; +openfl_display__$internal_ShaderBuffer.prototype = { + addBoolOverride: function(name,values) { + this.overrideBoolNames[this.overrideBoolCount] = name; + this.overrideBoolValues[this.overrideBoolCount] = values; + this.overrideBoolCount++; + } + ,addFloatOverride: function(name,values) { + this.overrideFloatNames[this.overrideFloatCount] = name; + this.overrideFloatValues[this.overrideFloatCount] = values; + this.overrideFloatCount++; + } + ,addIntOverride: function(name,values) { + this.overrideIntNames[this.overrideIntCount] = name; + this.overrideIntValues[this.overrideIntCount] = values; + this.overrideIntCount++; + } + ,clearOverride: function() { + this.overrideIntCount = 0; + this.overrideFloatCount = 0; + this.overrideBoolCount = 0; + } + ,update: function(shader) { + this.inputCount = 0; + this.overrideIntCount = 0; + this.overrideFloatCount = 0; + this.overrideBoolCount = 0; + this.paramBoolCount = 0; + this.paramCount = 0; + this.paramDataLength = 0; + this.paramFloatCount = 0; + this.paramIntCount = 0; + this.shader = null; + if(shader == null) { + return; + } + shader.__init(); + this.inputCount = shader.__inputBitmapData.length; + var input; + var _g = 0; + var _g1 = this.inputCount; + while(_g < _g1) { + var i = _g++; + input = shader.__inputBitmapData[i]; + this.inputs[i] = input.input; + this.inputFilter[i] = input.filter; + this.inputMipFilter[i] = input.mipFilter; + this.inputRefs[i] = input; + this.inputWrap[i] = input.wrap; + } + var boolCount = shader.__paramBool.length; + var floatCount = shader.__paramFloat.length; + var intCount = shader.__paramInt.length; + this.paramCount = boolCount + floatCount + intCount; + this.paramBoolCount = boolCount; + this.paramFloatCount = floatCount; + this.paramIntCount = intCount; + var length = 0; + var p = 0; + var param; + var _g = 0; + var _g1 = boolCount; + while(_g < _g1) { + var i = _g++; + param = shader.__paramBool[i]; + this.paramPositions[p] = this.paramDataLength; + length = param.value != null ? param.value.length : 0; + this.paramLengths[p] = length; + this.paramDataLength += length; + this.paramTypes[p] = 0; + this.paramRefs_Bool[i] = param; + ++p; + } + var param; + var _g = 0; + var _g1 = floatCount; + while(_g < _g1) { + var i = _g++; + param = shader.__paramFloat[i]; + this.paramPositions[p] = this.paramDataLength; + length = param.value != null ? param.value.length : 0; + this.paramLengths[p] = length; + this.paramDataLength += length; + this.paramTypes[p] = 1; + this.paramRefs_Float[i] = param; + ++p; + } + var param; + var _g = 0; + var _g1 = intCount; + while(_g < _g1) { + var i = _g++; + param = shader.__paramInt[i]; + this.paramPositions[p] = this.paramDataLength; + length = param.value != null ? param.value.length : 0; + this.paramLengths[p] = length; + this.paramDataLength += length; + this.paramTypes[p] = 2; + this.paramRefs_Int[i] = param; + ++p; + } + if(this.paramDataLength > 0) { + if(this.paramData == null) { + var elements = this.paramDataLength; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Float32Array(elements); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Float32Array(buffer,0); + } else { + this1 = new Float32Array(buffer,0,len); + } + } else { + this1 = null; + } + this.paramData = this1; + } else if(this.paramDataLength > this.paramData.length) { + var elements = this.paramDataLength; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Float32Array(elements); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Float32Array(buffer,0); + } else { + this1 = new Float32Array(buffer,0,len); + } + } else { + this1 = null; + } + var data = this1; + data.set(this.paramData); + this.paramData = data; + } + } + var boolIndex = 0; + var floatIndex = 0; + var intIndex = 0; + var paramPosition = 0; + var boolParam; + var floatParam; + var intParam; + var length; + var _g = 0; + var _g1 = this.paramCount; + while(_g < _g1) { + var i = _g++; + length = this.paramLengths[i]; + if(i < boolCount) { + boolParam = this.paramRefs_Bool[boolIndex]; + ++boolIndex; + var _g2 = 0; + var _g3 = length; + while(_g2 < _g3) { + var j = _g2++; + this.paramData[paramPosition] = boolParam.value[j] ? 1 : 0; + ++paramPosition; + } + } else if(i < boolCount + floatCount) { + floatParam = this.paramRefs_Float[floatIndex]; + ++floatIndex; + var _g4 = 0; + var _g5 = length; + while(_g4 < _g5) { + var j1 = _g4++; + this.paramData[paramPosition] = floatParam.value[j1]; + ++paramPosition; + } + } else { + intParam = this.paramRefs_Int[intIndex]; + ++intIndex; + var _g6 = 0; + var _g7 = length; + while(_g6 < _g7) { + var j2 = _g6++; + this.paramData[paramPosition] = intParam.value[j2]; + ++paramPosition; + } + } + } + this.shader = shader; + } + ,__class__: openfl_display__$internal_ShaderBuffer +}; +var openfl_display3D_Context3D = function(stage,contextState,stage3D) { + this.profile = 3; + this.driverInfo = "OpenGL (Direct blitting)"; + this.backBufferWidth = 0; + this.backBufferHeight = 0; + openfl_events_EventDispatcher.call(this); + this.__stage = stage; + this.__contextState = contextState; + this.__stage3D = stage3D; + this.__context = stage.window.context; + this.gl = this.__context.webgl; + if(this.__contextState == null) { + this.__contextState = new openfl_display3D__$internal_Context3DState(); + } + this.__state = new openfl_display3D__$internal_Context3DState(); + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__vertexConstants = new Float32Array(512); + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__fragmentConstants = new Float32Array(512); + var elements = null; + var array = [1.0,1.0,1.0,1.0]; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Float32Array(elements); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Float32Array(buffer,0); + } else { + this1 = new Float32Array(buffer,0,len); + } + } else { + this1 = null; + } + this.__positionScale = this1; + this.__programs = new haxe_ds_StringMap(); + if(openfl_display3D_Context3D.__glMaxViewportDims == -1) { + openfl_display3D_Context3D.__glMaxViewportDims = this.gl.getParameter(this.gl.MAX_VIEWPORT_DIMS); + } + this.maxBackBufferWidth = openfl_display3D_Context3D.__glMaxViewportDims; + this.maxBackBufferHeight = openfl_display3D_Context3D.__glMaxViewportDims; + if(openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy == -1) { + var extension = this.gl.getExtension("EXT_texture_filter_anisotropic"); + if(extension == null || !Object.prototype.hasOwnProperty.call(extension,"MAX_TEXTURE_MAX_ANISOTROPY_EXT")) { + extension = this.gl.getExtension("MOZ_EXT_texture_filter_anisotropic"); + } + if(extension == null || !Object.prototype.hasOwnProperty.call(extension,"MAX_TEXTURE_MAX_ANISOTROPY_EXT")) { + extension = this.gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic"); + } + if(extension != null) { + openfl_display3D_Context3D.__glTextureMaxAnisotropy = extension.TEXTURE_MAX_ANISOTROPY_EXT; + openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy = this.gl.getParameter(extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT); + } else { + openfl_display3D_Context3D.__glTextureMaxAnisotropy = 0; + openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy = 0; + } + } + if(openfl_display3D_Context3D.__glDepthStencil == -1) { + openfl_display3D_Context3D.__glDepthStencil = this.gl.DEPTH_STENCIL; + } + if(openfl_display3D_Context3D.__glMemoryTotalAvailable == -1) { + var extension = this.gl.getExtension("NVX_gpu_memory_info"); + if(extension != null) { + openfl_display3D_Context3D.__glMemoryTotalAvailable = extension.GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX; + openfl_display3D_Context3D.__glMemoryCurrentAvailable = extension.GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX; + } + } + if(openfl_display3D_Context3D.__driverInfo == null) { + var vendor = this.gl.getParameter(this.gl.VENDOR); + var version = this.gl.getParameter(this.gl.VERSION); + var renderer = this.gl.getParameter(this.gl.RENDERER); + var glslVersion = this.gl.getParameter(this.gl.SHADING_LANGUAGE_VERSION); + openfl_display3D_Context3D.__driverInfo = "OpenGL Vendor=" + vendor + " Version=" + version + " Renderer=" + renderer + " GLSL=" + glslVersion; + } + this.driverInfo = openfl_display3D_Context3D.__driverInfo; + this.__quadIndexBufferElements = 16383; + this.__quadIndexBufferCount = this.__quadIndexBufferElements * 6; + var elements = this.__quadIndexBufferCount; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint16Array(elements); + } else if(array != null) { + this1 = new Uint16Array(array); + } else if(vector != null) { + this1 = new Uint16Array(vector.__array); + } else if(view != null) { + this1 = new Uint16Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint16Array(buffer,0); + } else { + this1 = new Uint16Array(buffer,0,len); + } + } else { + this1 = null; + } + var data = this1; + var index = 0; + var vertex = 0; + var _g = 0; + var _g1 = this.__quadIndexBufferElements; + while(_g < _g1) { + var i = _g++; + data[index] = vertex; + data[index + 1] = vertex + 1; + data[index + 2] = vertex + 2; + data[index + 3] = vertex + 2; + data[index + 4] = vertex + 1; + data[index + 5] = vertex + 3; + index = index + 6; + vertex = vertex + 4; + } + this.__quadIndexBuffer = this.createIndexBuffer(this.__quadIndexBufferCount); + this.__quadIndexBuffer.uploadFromTypedArray(data); +}; +$hxClasses["openfl.display3D.Context3D"] = openfl_display3D_Context3D; +openfl_display3D_Context3D.__name__ = "openfl.display3D.Context3D"; +openfl_display3D_Context3D.__super__ = openfl_events_EventDispatcher; +openfl_display3D_Context3D.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + clear: function(red,green,blue,alpha,depth,stencil,mask) { + if(mask == null) { + mask = 7; + } + if(stencil == null) { + stencil = 0; + } + if(depth == null) { + depth = 1; + } + if(alpha == null) { + alpha = 1; + } + if(blue == null) { + blue = 0; + } + if(green == null) { + green = 0; + } + if(red == null) { + red = 0; + } + this.__flushGLFramebuffer(); + this.__flushGLViewport(); + var clearMask = 0; + if((mask & 1) != 0) { + if(this.__state.renderToTexture == null) { + if(this.__stage.context3D == this && !this.__stage.__renderer.__cleared) { + this.__stage.__renderer.__cleared = true; + } + this.__cleared = true; + } + clearMask |= this.gl.COLOR_BUFFER_BIT; + if(this.__contextState.colorMaskRed != true || this.__contextState.colorMaskGreen != true || this.__contextState.colorMaskBlue != true || this.__contextState.colorMaskAlpha != true) { + this.gl.colorMask(true,true,true,true); + this.__contextState.colorMaskRed = true; + this.__contextState.colorMaskGreen = true; + this.__contextState.colorMaskBlue = true; + this.__contextState.colorMaskAlpha = true; + } + this.gl.clearColor(red,green,blue,alpha); + } + if((mask & 2) != 0) { + clearMask |= this.gl.DEPTH_BUFFER_BIT; + if(this.__contextState.depthMask != true) { + this.gl.depthMask(true); + this.__contextState.depthMask = true; + } + this.gl.clearDepth(depth); + } + if((mask & 4) != 0) { + clearMask |= this.gl.STENCIL_BUFFER_BIT; + if(this.__contextState.stencilWriteMask != 255) { + this.gl.stencilMask(255); + this.__contextState.stencilWriteMask = 255; + } + this.gl.clearStencil(stencil); + this.__contextState.stencilWriteMask = 255; + } + if(clearMask == 0) { + return; + } + this.__setGLScissorTest(false); + this.gl.clear(clearMask); + } + ,configureBackBuffer: function(width,height,antiAlias,enableDepthAndStencil,wantsBestResolution,wantsBestResolutionOnBrowserZoom) { + if(wantsBestResolutionOnBrowserZoom == null) { + wantsBestResolutionOnBrowserZoom = false; + } + if(wantsBestResolution == null) { + wantsBestResolution = false; + } + if(enableDepthAndStencil == null) { + enableDepthAndStencil = true; + } + if(wantsBestResolution) { + width = width * this.__stage.window.__scale | 0; + height = height * this.__stage.window.__scale | 0; + } + if(this.__stage3D == null) { + this.backBufferWidth = width; + this.backBufferHeight = height; + this.__backBufferAntiAlias = antiAlias; + this.__state.backBufferEnableDepthAndStencil = enableDepthAndStencil; + this.__backBufferWantsBestResolution = wantsBestResolution; + this.__backBufferWantsBestResolutionOnBrowserZoom = wantsBestResolutionOnBrowserZoom; + } else { + if(this.__backBufferTexture == null || this.backBufferWidth != width || this.backBufferHeight != height) { + if(this.__backBufferTexture != null) { + this.__backBufferTexture.dispose(); + } + if(this.__frontBufferTexture != null) { + this.__frontBufferTexture.dispose(); + } + this.__backBufferTexture = this.createRectangleTexture(width,height,1,true); + this.__frontBufferTexture = this.createRectangleTexture(width,height,1,true); + if(this.__stage3D.__vertexBuffer == null) { + this.__stage3D.__vertexBuffer = this.createVertexBuffer(4,5); + } + var scaledWidth = wantsBestResolution ? width : width * this.__stage.window.__scale | 0; + var scaledHeight = wantsBestResolution ? height : height * this.__stage.window.__scale | 0; + var vertexData = openfl_Vector.toFloatVector(null,null,null,[scaledWidth,scaledHeight,0,1,1,0,scaledHeight,0,0,1,scaledWidth,0,0,1,0,0,0,0,0,0.0]); + this.__stage3D.__vertexBuffer.uploadFromVector(vertexData,0,20); + if(this.__stage3D.__indexBuffer == null) { + this.__stage3D.__indexBuffer = this.createIndexBuffer(6); + var indexData = openfl_Vector.toIntVector(null,null,null,[0,1,2,2,1,3]); + this.__stage3D.__indexBuffer.uploadFromVector(indexData,0,6); + } + } + this.backBufferWidth = width; + this.backBufferHeight = height; + this.__backBufferAntiAlias = antiAlias; + this.__state.backBufferEnableDepthAndStencil = enableDepthAndStencil; + this.__backBufferWantsBestResolution = wantsBestResolution; + this.__backBufferWantsBestResolutionOnBrowserZoom = wantsBestResolutionOnBrowserZoom; + this.__state.__primaryGLFramebuffer = this.__backBufferTexture.__getGLFramebuffer(enableDepthAndStencil,antiAlias,0); + this.__frontBufferTexture.__getGLFramebuffer(enableDepthAndStencil,antiAlias,0); + } + } + ,createCubeTexture: function(size,format,optimizeForRenderToTexture,streamingLevels) { + if(streamingLevels == null) { + streamingLevels = 0; + } + return new openfl_display3D_textures_CubeTexture(this,size,format,optimizeForRenderToTexture,streamingLevels); + } + ,createIndexBuffer: function(numIndices,bufferUsage) { + if(bufferUsage == null) { + bufferUsage = 1; + } + return new openfl_display3D_IndexBuffer3D(this,numIndices,bufferUsage); + } + ,createProgram: function(format) { + if(format == null) { + format = 0; + } + return new openfl_display3D_Program3D(this,format); + } + ,createRectangleTexture: function(width,height,format,optimizeForRenderToTexture) { + return new openfl_display3D_textures_RectangleTexture(this,width,height,openfl_display3D_Context3DTextureFormat.toString(format),optimizeForRenderToTexture); + } + ,createTexture: function(width,height,format,optimizeForRenderToTexture,streamingLevels) { + if(streamingLevels == null) { + streamingLevels = 0; + } + return new openfl_display3D_textures_Texture(this,width,height,format,optimizeForRenderToTexture,streamingLevels); + } + ,createVertexBuffer: function(numVertices,data32PerVertex,bufferUsage) { + if(bufferUsage == null) { + bufferUsage = 1; + } + return new openfl_display3D_VertexBuffer3D(this,numVertices,data32PerVertex,openfl_display3D_Context3DBufferUsage.toString(bufferUsage)); + } + ,createVideoTexture: function() { + return new openfl_display3D_textures_VideoTexture(this); + } + ,dispose: function(recreate) { + if(recreate == null) { + recreate = true; + } + this.gl = null; + this.__dispose(); + } + ,drawToBitmapData: function(destination,srcRect,destPoint) { + if(destination == null) { + return; + } + var sourceRect = srcRect != null ? srcRect.__toLimeRectangle() : new lime_math_Rectangle(0,0,this.backBufferWidth,this.backBufferHeight); + var destVector = destPoint != null ? destPoint.__toLimeVector2() : new lime_math_Vector2(); + if(this.__stage.context3D == this) { + if(this.__stage.window != null) { + if(this.__stage3D != null) { + var xa = -this.__stage3D.get_x() | 0; + var ya = -this.__stage3D.get_y() | 0; + destVector.x = xa; + destVector.y = ya; + } + var image = this.__stage.window.readPixels(); + destination.image.copyPixels(image,sourceRect,destVector); + } + } else if(this.__backBufferTexture != null) { + var cacheRenderToTexture = this.__state.renderToTexture; + this.setRenderToBackBuffer(); + this.__flushGLFramebuffer(); + this.__flushGLViewport(); + var elements = this.backBufferWidth * this.backBufferHeight * 4; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,0); + } else { + this1 = new Uint8Array(buffer,0,len); + } + } else { + this1 = null; + } + var data = this1; + var this1 = this.gl; + var width = this.backBufferWidth; + var height = this.backBufferHeight; + var format = this.__backBufferTexture.__format; + var type = this.gl.UNSIGNED_BYTE; + var pixels = data; + var dstOffset = null; + if(dstOffset != null) { + this1.readPixels(0,0,width,height,format,type,pixels,dstOffset); + } else { + this1.readPixels(0,0,width,height,format,type,pixels); + } + var image = new lime_graphics_Image(new lime_graphics_ImageBuffer(data,this.backBufferWidth,this.backBufferHeight,32,2)); + destination.image.copyPixels(image,sourceRect,destVector); + if(cacheRenderToTexture != null) { + this.setRenderToTexture(cacheRenderToTexture,this.__state.renderToTextureDepthStencil,this.__state.renderToTextureAntiAlias,this.__state.renderToTextureSurfaceSelector); + } + } + } + ,drawTriangles: function(indexBuffer,firstIndex,numTriangles) { + if(numTriangles == null) { + numTriangles = -1; + } + if(firstIndex == null) { + firstIndex = 0; + } + if(this.__state.renderToTexture == null) { + if(this.__stage.context3D == this && !this.__stage.__renderer.__cleared) { + this.__stage.__renderer.__clear(); + } else if(!this.__cleared) { + this.clear(0,0,0,0,1,0,1); + } + } + this.__flushGL(); + if(this.__state.program != null) { + this.__state.program.__flush(); + } + var count = numTriangles == -1 ? indexBuffer.__numIndices : numTriangles * 3; + this.__bindGLElementArrayBuffer(indexBuffer.__id); + this.gl.drawElements(this.gl.TRIANGLES,count,this.gl.UNSIGNED_SHORT,firstIndex * 2); + } + ,present: function() { + this.setRenderToBackBuffer(); + if(this.__stage3D != null && this.__backBufferTexture != null) { + if(!this.__cleared) { + this.clear(0,0,0,0,1,0,1); + } + var cacheBuffer = this.__backBufferTexture; + this.__backBufferTexture = this.__frontBufferTexture; + this.__frontBufferTexture = cacheBuffer; + this.__state.__primaryGLFramebuffer = this.__backBufferTexture.__getGLFramebuffer(this.__state.backBufferEnableDepthAndStencil,this.__backBufferAntiAlias,0); + this.__cleared = false; + } + this.__present = true; + } + ,setBlendFactors: function(sourceFactor,destinationFactor) { + this.setBlendFactorsSeparate(sourceFactor,destinationFactor,sourceFactor,destinationFactor); + } + ,setBlendFactorsSeparate: function(sourceRGBFactor,destinationRGBFactor,sourceAlphaFactor,destinationAlphaFactor) { + this.__state.blendSourceRGBFactor = sourceRGBFactor; + this.__state.blendDestinationRGBFactor = destinationRGBFactor; + this.__state.blendSourceAlphaFactor = sourceAlphaFactor; + this.__state.blendDestinationAlphaFactor = destinationAlphaFactor; + this.__setGLBlendEquation(this.gl.FUNC_ADD); + } + ,setColorMask: function(red,green,blue,alpha) { + this.__state.colorMaskRed = red; + this.__state.colorMaskGreen = green; + this.__state.colorMaskBlue = blue; + this.__state.colorMaskAlpha = alpha; + } + ,setCulling: function(triangleFaceToCull) { + this.__state.culling = triangleFaceToCull; + } + ,setDepthTest: function(depthMask,passCompareMode) { + this.__state.depthMask = depthMask; + this.__state.depthCompareMode = passCompareMode; + } + ,setProgram: function(program) { + this.__state.program = program; + this.__state.shader = null; + if(program != null) { + var _g = 0; + var _g1 = program.__samplerStates.length; + while(_g < _g1) { + var i = _g++; + if(this.__state.samplerStates[i] == null) { + this.__state.samplerStates[i] = program.__samplerStates[i].clone(); + } else { + this.__state.samplerStates[i].copyFrom(program.__samplerStates[i]); + } + } + } + } + ,setProgramConstantsFromByteArray: function(programType,firstRegister,numRegisters,data,byteArrayOffset) { + if(numRegisters == 0 || this.__state.program == null) { + return; + } + if(!(this.__state.program != null && this.__state.program.__format == 1)) { + if(numRegisters == -1) { + numRegisters = (openfl_utils_ByteArray.get_length(data) >>> 2) - byteArrayOffset; + } + var isVertex = programType == 1; + var dest = isVertex ? this.__vertexConstants : this.__fragmentConstants; + var bytes = openfl_utils_ByteArray.toBytes(data); + var byteOffset = 0; + var len = null; + if(byteOffset == null) { + byteOffset = 0; + } + var floatData = byteOffset == null ? new Float32Array(bytes.b.bufferValue) : len == null ? new Float32Array(bytes.b.bufferValue,byteOffset) : new Float32Array(bytes.b.bufferValue,byteOffset,len); + var outOffset = firstRegister * 4; + var inOffset = UInt.toFloat(byteArrayOffset) / UInt.toFloat(4) | 0; + var _g = 0; + var _g1 = numRegisters * 4; + while(_g < _g1) { + var i = _g++; + dest[outOffset + i] = floatData[inOffset + i]; + } + if(this.__state.program != null) { + this.__state.program.__markDirty(isVertex,firstRegister,numRegisters); + } + } + } + ,setProgramConstantsFromMatrix: function(programType,firstRegister,matrix,transposedMatrix) { + if(transposedMatrix == null) { + transposedMatrix = false; + } + if(this.__state.program != null && this.__state.program.__format == 1) { + this.__flushGLProgram(); + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var data = new Float32Array(16); + data[0] = matrix.rawData.get(0); + data[1] = matrix.rawData.get(1); + data[2] = matrix.rawData.get(2); + data[3] = matrix.rawData.get(3); + data[4] = matrix.rawData.get(4); + data[5] = matrix.rawData.get(5); + data[6] = matrix.rawData.get(6); + data[7] = matrix.rawData.get(7); + data[8] = matrix.rawData.get(8); + data[9] = matrix.rawData.get(9); + data[10] = matrix.rawData.get(10); + data[11] = matrix.rawData.get(11); + data[12] = matrix.rawData.get(12); + data[13] = matrix.rawData.get(13); + data[14] = matrix.rawData.get(14); + data[15] = matrix.rawData.get(15); + lime_graphics_WebGLRenderContext.uniformMatrix4fv(this.gl,firstRegister,transposedMatrix,data); + } else { + var isVertex = programType == 1; + var dest = isVertex ? this.__vertexConstants : this.__fragmentConstants; + var source = matrix.rawData; + var i = firstRegister * 4; + if(transposedMatrix) { + dest[i++] = source.get(0); + dest[i++] = source.get(4); + dest[i++] = source.get(8); + dest[i++] = source.get(12); + dest[i++] = source.get(1); + dest[i++] = source.get(5); + dest[i++] = source.get(9); + dest[i++] = source.get(13); + dest[i++] = source.get(2); + dest[i++] = source.get(6); + dest[i++] = source.get(10); + dest[i++] = source.get(14); + dest[i++] = source.get(3); + dest[i++] = source.get(7); + dest[i++] = source.get(11); + dest[i++] = source.get(15); + } else { + dest[i++] = source.get(0); + dest[i++] = source.get(1); + dest[i++] = source.get(2); + dest[i++] = source.get(3); + dest[i++] = source.get(4); + dest[i++] = source.get(5); + dest[i++] = source.get(6); + dest[i++] = source.get(7); + dest[i++] = source.get(8); + dest[i++] = source.get(9); + dest[i++] = source.get(10); + dest[i++] = source.get(11); + dest[i++] = source.get(12); + dest[i++] = source.get(13); + dest[i++] = source.get(14); + dest[i++] = source.get(15); + } + if(this.__state.program != null) { + this.__state.program.__markDirty(isVertex,firstRegister,4); + } + } + } + ,setProgramConstantsFromVector: function(programType,firstRegister,data,numRegisters) { + if(numRegisters == null) { + numRegisters = -1; + } + if(numRegisters == 0) { + return; + } + if(!(this.__state.program != null && this.__state.program.__format == 1)) { + if(numRegisters == -1) { + numRegisters = data.get_length() >> 2; + } + var isVertex = programType == 1; + var dest = isVertex ? this.__vertexConstants : this.__fragmentConstants; + var source = data; + var sourceIndex = 0; + var destIndex = firstRegister * 4; + var _g = 0; + var _g1 = numRegisters; + while(_g < _g1) { + var i = _g++; + dest[destIndex++] = source.get(sourceIndex++); + dest[destIndex++] = source.get(sourceIndex++); + dest[destIndex++] = source.get(sourceIndex++); + dest[destIndex++] = source.get(sourceIndex++); + } + if(this.__state.program != null) { + this.__state.program.__markDirty(isVertex,firstRegister,numRegisters); + } + } + } + ,setRenderToBackBuffer: function() { + this.__state.renderToTexture = null; + } + ,setRenderToTexture: function(texture,enableDepthAndStencil,antiAlias,surfaceSelector) { + if(surfaceSelector == null) { + surfaceSelector = 0; + } + if(antiAlias == null) { + antiAlias = 0; + } + if(enableDepthAndStencil == null) { + enableDepthAndStencil = false; + } + this.__state.renderToTexture = texture; + this.__state.renderToTextureDepthStencil = enableDepthAndStencil; + this.__state.renderToTextureAntiAlias = antiAlias; + this.__state.renderToTextureSurfaceSelector = surfaceSelector; + } + ,setSamplerStateAt: function(sampler,wrap,filter,mipfilter) { + if(this.__state.samplerStates[sampler] == null) { + this.__state.samplerStates[sampler] = new openfl_display__$internal_SamplerState(); + } + var state = this.__state.samplerStates[sampler]; + state.wrap = wrap; + state.filter = filter; + state.mipfilter = mipfilter; + } + ,setScissorRectangle: function(rectangle) { + if(rectangle != null) { + this.__state.scissorEnabled = true; + this.__state.scissorRectangle.copyFrom(rectangle); + } else { + this.__state.scissorEnabled = false; + } + } + ,setStencilActions: function(triangleFace,compareMode,actionOnBothPass,actionOnDepthFail,actionOnDepthPassStencilFail) { + if(actionOnDepthPassStencilFail == null) { + actionOnDepthPassStencilFail = 5; + } + if(actionOnDepthFail == null) { + actionOnDepthFail = 5; + } + if(actionOnBothPass == null) { + actionOnBothPass = 5; + } + if(compareMode == null) { + compareMode = 0; + } + if(triangleFace == null) { + triangleFace = 2; + } + this.__state.stencilTriangleFace = triangleFace; + this.__state.stencilCompareMode = compareMode; + this.__state.stencilPass = actionOnBothPass; + this.__state.stencilDepthFail = actionOnDepthFail; + this.__state.stencilFail = actionOnDepthPassStencilFail; + } + ,setStencilReferenceValue: function(referenceValue,readMask,writeMask) { + if(writeMask == null) { + writeMask = 255; + } + if(readMask == null) { + readMask = 255; + } + this.__state.stencilReferenceValue = referenceValue; + this.__state.stencilReadMask = readMask; + this.__state.stencilWriteMask = writeMask; + } + ,setTextureAt: function(sampler,texture) { + this.__state.textures[sampler] = texture; + } + ,setVertexBufferAt: function(index,buffer,bufferOffset,format) { + if(format == null) { + format = 4; + } + if(bufferOffset == null) { + bufferOffset = 0; + } + if(index < 0) { + return; + } + if(buffer == null) { + this.gl.disableVertexAttribArray(index); + this.__bindGLArrayBuffer(null); + return; + } + this.__bindGLArrayBuffer(buffer.__id); + this.gl.enableVertexAttribArray(index); + var byteOffset = bufferOffset * 4; + switch(format) { + case 0: + this.gl.vertexAttribPointer(index,4,this.gl.UNSIGNED_BYTE,true,buffer.__stride,byteOffset); + break; + case 1: + this.gl.vertexAttribPointer(index,1,this.gl.FLOAT,false,buffer.__stride,byteOffset); + break; + case 2: + this.gl.vertexAttribPointer(index,2,this.gl.FLOAT,false,buffer.__stride,byteOffset); + break; + case 3: + this.gl.vertexAttribPointer(index,3,this.gl.FLOAT,false,buffer.__stride,byteOffset); + break; + case 4: + this.gl.vertexAttribPointer(index,4,this.gl.FLOAT,false,buffer.__stride,byteOffset); + break; + default: + throw new openfl_errors_IllegalOperationError(); + } + } + ,__bindGLArrayBuffer: function(buffer) { + if(this.__contextState.__currentGLArrayBuffer != buffer) { + this.gl.bindBuffer(this.gl.ARRAY_BUFFER,buffer); + this.__contextState.__currentGLArrayBuffer = buffer; + } + } + ,__bindGLElementArrayBuffer: function(buffer) { + if(this.__contextState.__currentGLElementArrayBuffer != buffer) { + this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,buffer); + this.__contextState.__currentGLElementArrayBuffer = buffer; + } + } + ,__bindGLFramebuffer: function(framebuffer) { + if(this.__contextState.__currentGLFramebuffer != framebuffer) { + this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,framebuffer); + this.__contextState.__currentGLFramebuffer = framebuffer; + } + } + ,__bindGLTexture2D: function(texture) { + this.gl.bindTexture(this.gl.TEXTURE_2D,texture); + this.__contextState.__currentGLTexture2D = texture; + } + ,__bindGLTextureCubeMap: function(texture) { + this.gl.bindTexture(this.gl.TEXTURE_CUBE_MAP,texture); + this.__contextState.__currentGLTextureCubeMap = texture; + } + ,__dispose: function() { + this.driverInfo += " (Disposed)"; + if(this.__stage3D != null) { + this.__stage3D.__indexBuffer = null; + this.__stage3D.__vertexBuffer = null; + this.__stage3D.context3D = null; + this.__stage3D = null; + } + this.__backBufferTexture = null; + this.__context = null; + this.__renderStage3DProgram = null; + this.__fragmentConstants = null; + this.__frontBufferTexture = null; + this.__positionScale = null; + this.__present = false; + this.__quadIndexBuffer = null; + this.__stage = null; + this.__vertexConstants = null; + } + ,__drawTriangles: function(firstIndex,count) { + if(firstIndex == null) { + firstIndex = 0; + } + if(this.__state.renderToTexture == null) { + if(this.__stage.context3D == this && !this.__stage.__renderer.__cleared) { + this.__stage.__renderer.__clear(); + } else if(!this.__cleared) { + this.clear(0,0,0,0,1,0,1); + } + } + this.__flushGL(); + if(this.__state.program != null) { + this.__state.program.__flush(); + } + this.gl.drawArrays(this.gl.TRIANGLES,firstIndex,count); + } + ,__flushGL: function() { + this.__flushGLProgram(); + this.__flushGLFramebuffer(); + this.__flushGLViewport(); + this.__flushGLBlend(); + if(this.__contextState.colorMaskRed != this.__state.colorMaskRed || this.__contextState.colorMaskGreen != this.__state.colorMaskGreen || this.__contextState.colorMaskBlue != this.__state.colorMaskBlue || this.__contextState.colorMaskAlpha != this.__state.colorMaskAlpha) { + this.gl.colorMask(this.__state.colorMaskRed,this.__state.colorMaskGreen,this.__state.colorMaskBlue,this.__state.colorMaskAlpha); + this.__contextState.colorMaskRed = this.__state.colorMaskRed; + this.__contextState.colorMaskGreen = this.__state.colorMaskGreen; + this.__contextState.colorMaskBlue = this.__state.colorMaskBlue; + this.__contextState.colorMaskAlpha = this.__state.colorMaskAlpha; + } + this.__flushGLCulling(); + this.__flushGLDepth(); + this.__flushGLScissor(); + this.__flushGLStencil(); + this.__flushGLTextures(); + } + ,__flushGLBlend: function() { + if(this.__contextState.blendDestinationRGBFactor != this.__state.blendDestinationRGBFactor || this.__contextState.blendSourceRGBFactor != this.__state.blendSourceRGBFactor || this.__contextState.blendDestinationAlphaFactor != this.__state.blendDestinationAlphaFactor || this.__contextState.blendSourceAlphaFactor != this.__state.blendSourceAlphaFactor) { + this.__setGLBlend(true); + if(this.__state.blendDestinationRGBFactor == this.__state.blendDestinationAlphaFactor && this.__state.blendSourceRGBFactor == this.__state.blendSourceAlphaFactor) { + this.gl.blendFunc(this.__getGLBlend(this.__state.blendSourceRGBFactor),this.__getGLBlend(this.__state.blendDestinationRGBFactor)); + } else { + this.gl.blendFuncSeparate(this.__getGLBlend(this.__state.blendSourceRGBFactor),this.__getGLBlend(this.__state.blendDestinationRGBFactor),this.__getGLBlend(this.__state.blendSourceAlphaFactor),this.__getGLBlend(this.__state.blendDestinationAlphaFactor)); + } + this.__contextState.blendDestinationRGBFactor = this.__state.blendDestinationRGBFactor; + this.__contextState.blendSourceRGBFactor = this.__state.blendSourceRGBFactor; + this.__contextState.blendDestinationAlphaFactor = this.__state.blendDestinationAlphaFactor; + this.__contextState.blendSourceAlphaFactor = this.__state.blendSourceAlphaFactor; + } + } + ,__flushGLColor: function() { + if(this.__contextState.colorMaskRed != this.__state.colorMaskRed || this.__contextState.colorMaskGreen != this.__state.colorMaskGreen || this.__contextState.colorMaskBlue != this.__state.colorMaskBlue || this.__contextState.colorMaskAlpha != this.__state.colorMaskAlpha) { + this.gl.colorMask(this.__state.colorMaskRed,this.__state.colorMaskGreen,this.__state.colorMaskBlue,this.__state.colorMaskAlpha); + this.__contextState.colorMaskRed = this.__state.colorMaskRed; + this.__contextState.colorMaskGreen = this.__state.colorMaskGreen; + this.__contextState.colorMaskBlue = this.__state.colorMaskBlue; + this.__contextState.colorMaskAlpha = this.__state.colorMaskAlpha; + } + } + ,__flushGLCulling: function() { + if(this.__contextState.culling != this.__state.culling) { + if(this.__state.culling == 3) { + this.__setGLCullFace(false); + } else { + this.__setGLCullFace(true); + switch(this.__state.culling) { + case 0: + this.gl.cullFace(this.gl.BACK); + break; + case 1: + this.gl.cullFace(this.gl.FRONT); + break; + case 2: + this.gl.cullFace(this.gl.FRONT_AND_BACK); + break; + case 3: + break; + default: + throw new openfl_errors_IllegalOperationError(); + } + } + this.__contextState.culling = this.__state.culling; + } + } + ,__flushGLDepth: function() { + var depthMask = this.__state.depthMask && (this.__state.renderToTexture != null ? this.__state.renderToTextureDepthStencil : this.__state.backBufferEnableDepthAndStencil); + if(this.__contextState.depthMask != depthMask) { + this.gl.depthMask(depthMask); + this.__contextState.depthMask = depthMask; + } + if(this.__contextState.depthCompareMode != this.__state.depthCompareMode) { + switch(this.__state.depthCompareMode) { + case 0: + this.gl.depthFunc(this.gl.ALWAYS); + break; + case 1: + this.gl.depthFunc(this.gl.EQUAL); + break; + case 2: + this.gl.depthFunc(this.gl.GREATER); + break; + case 3: + this.gl.depthFunc(this.gl.GEQUAL); + break; + case 4: + this.gl.depthFunc(this.gl.LESS); + break; + case 5: + this.gl.depthFunc(this.gl.LEQUAL); + break; + case 6: + this.gl.depthFunc(this.gl.NEVER); + break; + case 7: + this.gl.depthFunc(this.gl.NOTEQUAL); + break; + default: + throw new openfl_errors_IllegalOperationError(); + } + this.__contextState.depthCompareMode = this.__state.depthCompareMode; + } + } + ,__flushGLFramebuffer: function() { + if(this.__state.renderToTexture != null) { + if(this.__contextState.renderToTexture != this.__state.renderToTexture || this.__contextState.renderToTextureSurfaceSelector != this.__state.renderToTextureSurfaceSelector) { + var framebuffer = this.__state.renderToTexture.__getGLFramebuffer(this.__state.renderToTextureDepthStencil,this.__state.renderToTextureAntiAlias,this.__state.renderToTextureSurfaceSelector); + this.__bindGLFramebuffer(framebuffer); + this.__contextState.renderToTexture = this.__state.renderToTexture; + this.__contextState.renderToTextureAntiAlias = this.__state.renderToTextureAntiAlias; + this.__contextState.renderToTextureDepthStencil = this.__state.renderToTextureDepthStencil; + this.__contextState.renderToTextureSurfaceSelector = this.__state.renderToTextureSurfaceSelector; + } + this.__setGLDepthTest(this.__state.renderToTextureDepthStencil); + this.__setGLStencilTest(this.__state.renderToTextureDepthStencil); + this.__setGLFrontFace(true); + } else { + if(this.__stage == null && this.backBufferWidth == 0 && this.backBufferHeight == 0) { + throw new openfl_errors_Error("Context3D backbuffer has not been configured"); + } + if(this.__contextState.renderToTexture != null || this.__contextState.__currentGLFramebuffer != this.__state.__primaryGLFramebuffer || this.__contextState.backBufferEnableDepthAndStencil != this.__state.backBufferEnableDepthAndStencil) { + this.__bindGLFramebuffer(this.__state.__primaryGLFramebuffer); + this.__contextState.renderToTexture = null; + this.__contextState.backBufferEnableDepthAndStencil = this.__state.backBufferEnableDepthAndStencil; + } + this.__setGLDepthTest(this.__state.backBufferEnableDepthAndStencil); + this.__setGLStencilTest(this.__state.backBufferEnableDepthAndStencil); + this.__setGLFrontFace(this.__stage.context3D != this); + } + } + ,__flushGLProgram: function() { + var shader = this.__state.shader; + var program = this.__state.program; + if(this.__contextState.shader != shader) { + if(this.__contextState.shader != null) { + this.__contextState.shader.__disable(); + } + if(shader != null) { + shader.__enable(); + } + this.__contextState.shader = shader; + } + if(this.__contextState.program != program) { + if(this.__contextState.program != null) { + this.__contextState.program.__disable(); + } + if(program != null) { + program.__enable(); + } + this.__contextState.program = program; + } + if(program != null && program.__format == 0) { + this.__positionScale[1] = this.__stage.context3D == this && this.__state.renderToTexture == null ? 1.0 : -1.0; + program.__setPositionScale(this.__positionScale); + } + } + ,__flushGLScissor: function() { + if(!this.__state.scissorEnabled) { + if(this.__contextState.scissorEnabled != this.__state.scissorEnabled) { + this.__setGLScissorTest(false); + this.__contextState.scissorEnabled = false; + } + } else { + this.__setGLScissorTest(true); + this.__contextState.scissorEnabled = true; + var scissorX = this.__state.scissorRectangle.x | 0; + var scissorY = this.__state.scissorRectangle.y | 0; + var scissorWidth = this.__state.scissorRectangle.width | 0; + var scissorHeight = this.__state.scissorRectangle.height | 0; + if(this.__backBufferWantsBestResolution) { + scissorX = this.__state.scissorRectangle.x * this.__stage.window.__scale | 0; + scissorY = this.__state.scissorRectangle.y * this.__stage.window.__scale | 0; + scissorWidth = this.__state.scissorRectangle.width * this.__stage.window.__scale | 0; + scissorHeight = this.__state.scissorRectangle.height * this.__stage.window.__scale | 0; + } + if(this.__state.renderToTexture == null && this.__stage3D == null) { + var contextHeight = this.__stage.window.__height * this.__stage.window.__scale | 0; + scissorY = contextHeight - scissorHeight - scissorY; + } + if(this.__contextState.scissorRectangle.x != scissorX || this.__contextState.scissorRectangle.y != scissorY || this.__contextState.scissorRectangle.width != scissorWidth || this.__contextState.scissorRectangle.height != scissorHeight) { + this.gl.scissor(scissorX,scissorY,scissorWidth,scissorHeight); + this.__contextState.scissorRectangle.setTo(scissorX,scissorY,scissorWidth,scissorHeight); + } + } + } + ,__flushGLStencil: function() { + if(this.__contextState.stencilTriangleFace != this.__state.stencilTriangleFace || this.__contextState.stencilPass != this.__state.stencilPass || this.__contextState.stencilDepthFail != this.__state.stencilDepthFail || this.__contextState.stencilFail != this.__state.stencilFail) { + this.gl.stencilOpSeparate(this.__getGLTriangleFace(this.__state.stencilTriangleFace),this.__getGLStencilAction(this.__state.stencilFail),this.__getGLStencilAction(this.__state.stencilDepthFail),this.__getGLStencilAction(this.__state.stencilPass)); + this.__contextState.stencilTriangleFace = this.__state.stencilTriangleFace; + this.__contextState.stencilPass = this.__state.stencilPass; + this.__contextState.stencilDepthFail = this.__state.stencilDepthFail; + this.__contextState.stencilFail = this.__state.stencilFail; + } + if(this.__contextState.stencilWriteMask != this.__state.stencilWriteMask) { + this.gl.stencilMask(this.__state.stencilWriteMask); + this.__contextState.stencilWriteMask = this.__state.stencilWriteMask; + } + if(this.__contextState.stencilCompareMode != this.__state.stencilCompareMode || this.__contextState.stencilReferenceValue != this.__state.stencilReferenceValue || this.__contextState.stencilReadMask != this.__state.stencilReadMask) { + this.gl.stencilFunc(this.__getGLCompareMode(this.__state.stencilCompareMode),this.__state.stencilReferenceValue,this.__state.stencilReadMask); + this.__contextState.stencilCompareMode = this.__state.stencilCompareMode; + this.__contextState.stencilReferenceValue = this.__state.stencilReferenceValue; + this.__contextState.stencilReadMask = this.__state.stencilReadMask; + } + } + ,__flushGLTextures: function() { + var sampler = 0; + var texture; + var samplerState; + var _g = 0; + var _g1 = this.__state.textures.length; + while(_g < _g1) { + var i = _g++; + texture = this.__state.textures[i]; + samplerState = this.__state.samplerStates[i]; + if(samplerState == null) { + this.__state.samplerStates[i] = new openfl_display__$internal_SamplerState(); + samplerState = this.__state.samplerStates[i]; + } + this.gl.activeTexture(this.gl.TEXTURE0 + sampler); + if(texture != null) { + if(texture.__textureTarget == this.gl.TEXTURE_2D) { + this.__bindGLTexture2D(texture.__getTexture()); + } else { + this.__bindGLTextureCubeMap(texture.__getTexture()); + } + this.__contextState.textures[i] = texture; + texture.__setSamplerState(samplerState); + } else { + this.__bindGLTexture2D(null); + } + if(this.__state.program != null && this.__state.program.__format == 0 && samplerState.textureAlpha) { + this.gl.activeTexture(this.gl.TEXTURE0 + sampler + 4); + if(texture != null && texture.__alphaTexture != null) { + if(texture.__alphaTexture.__textureTarget == this.gl.TEXTURE_2D) { + this.__bindGLTexture2D(texture.__alphaTexture.__getTexture()); + } else { + this.__bindGLTextureCubeMap(texture.__alphaTexture.__getTexture()); + } + texture.__alphaTexture.__setSamplerState(samplerState); + this.gl.uniform1i(this.__state.program.__agalAlphaSamplerEnabled[sampler].location,1); + } else { + this.__bindGLTexture2D(null); + if(this.__state.program.__agalAlphaSamplerEnabled[sampler] != null) { + this.gl.uniform1i(this.__state.program.__agalAlphaSamplerEnabled[sampler].location,0); + } + } + } + ++sampler; + } + } + ,__flushGLViewport: function() { + if(this.__state.renderToTexture == null) { + if(this.__stage.context3D == this) { + var scaledBackBufferWidth = this.backBufferWidth; + var scaledBackBufferHeight = this.backBufferHeight; + if(this.__stage3D == null && !this.__backBufferWantsBestResolution) { + scaledBackBufferWidth = this.backBufferWidth * this.__stage.window.__scale | 0; + scaledBackBufferHeight = this.backBufferHeight * this.__stage.window.__scale | 0; + } + var x = this.__stage3D == null ? 0 : this.__stage3D.get_x() | 0; + var y = this.__stage.window.__height * this.__stage.window.__scale - scaledBackBufferHeight - (this.__stage3D == null ? 0 : this.__stage3D.get_y()) | 0; + this.gl.viewport(x,y,scaledBackBufferWidth,scaledBackBufferHeight); + } else { + this.gl.viewport(0,0,this.backBufferWidth,this.backBufferHeight); + } + } else { + var width = 0; + var height = 0; + if(((this.__state.renderToTexture) instanceof openfl_display3D_textures_Texture)) { + var texture2D = this.__state.renderToTexture; + width = texture2D.__width; + height = texture2D.__height; + } else if(((this.__state.renderToTexture) instanceof openfl_display3D_textures_RectangleTexture)) { + var rectTexture = this.__state.renderToTexture; + width = rectTexture.__width; + height = rectTexture.__height; + } else if(((this.__state.renderToTexture) instanceof openfl_display3D_textures_CubeTexture)) { + var cubeTexture = this.__state.renderToTexture; + width = cubeTexture.__size; + height = cubeTexture.__size; + } + this.gl.viewport(0,0,width,height); + } + } + ,__getGLBlend: function(blendFactor) { + switch(blendFactor) { + case 0: + return this.gl.DST_ALPHA; + case 1: + return this.gl.DST_COLOR; + case 2: + return this.gl.ONE; + case 3: + return this.gl.ONE_MINUS_DST_ALPHA; + case 4: + return this.gl.ONE_MINUS_DST_COLOR; + case 5: + return this.gl.ONE_MINUS_SRC_ALPHA; + case 6: + return this.gl.ONE_MINUS_SRC_COLOR; + case 7: + return this.gl.SRC_ALPHA; + case 8: + return this.gl.SRC_COLOR; + case 9: + return this.gl.ZERO; + default: + throw new openfl_errors_IllegalOperationError(); + } + } + ,__getGLCompareMode: function(mode) { + switch(mode) { + case 0: + return this.gl.ALWAYS; + case 1: + return this.gl.EQUAL; + case 2: + return this.gl.GREATER; + case 3: + return this.gl.GEQUAL; + case 4: + return this.gl.LESS; + case 5: + return this.gl.LEQUAL; + case 6: + return this.gl.NEVER; + case 7: + return this.gl.NOTEQUAL; + default: + return this.gl.EQUAL; + } + } + ,__getGLStencilAction: function(action) { + switch(action) { + case 0: + return this.gl.DECR; + case 1: + return this.gl.DECR_WRAP; + case 2: + return this.gl.INCR; + case 3: + return this.gl.INCR_WRAP; + case 4: + return this.gl.INVERT; + case 5: + return this.gl.KEEP; + case 6: + return this.gl.REPLACE; + case 7: + return this.gl.ZERO; + default: + return this.gl.KEEP; + } + } + ,__getGLTriangleFace: function(face) { + switch(face) { + case 0: + return this.gl.BACK; + case 1: + return this.gl.FRONT; + case 2: + return this.gl.FRONT_AND_BACK; + case 3: + return this.gl.NONE; + default: + return this.gl.FRONT_AND_BACK; + } + } + ,__renderStage3D: function(stage3D) { + var context = stage3D.context3D; + if(context != null && context != this && context.__frontBufferTexture != null && stage3D.visible && this.backBufferHeight > 0 && this.backBufferWidth > 0) { + if(this.__renderStage3DProgram == null) { + var vertexAssembler = new openfl_utils_AGALMiniAssembler(); + vertexAssembler.assemble(openfl_display3D_Context3DProgramType.toString(1),"m44 op, va0, vc0\n" + "mov v0, va1"); + var fragmentAssembler = new openfl_utils_AGALMiniAssembler(); + fragmentAssembler.assemble(openfl_display3D_Context3DProgramType.toString(0),"tex ft1, v0, fs0 <2d,nearest,nomip>\n" + "mov oc, ft1"); + this.__renderStage3DProgram = this.createProgram(); + this.__renderStage3DProgram.upload(vertexAssembler.agalcode,fragmentAssembler.agalcode); + } + this.setProgram(this.__renderStage3DProgram); + this.setBlendFactors(2,9); + this.setColorMask(true,true,true,true); + this.setCulling(3); + this.setDepthTest(false,0); + this.setStencilActions(); + this.setStencilReferenceValue(0,0,0); + this.setScissorRectangle(null); + this.setTextureAt(0,context.__frontBufferTexture); + this.setVertexBufferAt(0,stage3D.__vertexBuffer,0,3); + this.setVertexBufferAt(1,stage3D.__vertexBuffer,3,2); + this.setProgramConstantsFromMatrix(1,0,stage3D.__renderTransform,true); + this.drawTriangles(stage3D.__indexBuffer); + this.__present = true; + } + } + ,__setGLBlend: function(enable) { + if(this.__contextState.__enableGLBlend != enable) { + if(enable) { + this.gl.enable(this.gl.BLEND); + } else { + this.gl.disable(this.gl.BLEND); + } + this.__contextState.__enableGLBlend = enable; + } + } + ,__setGLBlendEquation: function(value) { + if(this.__contextState.__glBlendEquation != value) { + this.gl.blendEquation(value); + this.__contextState.__glBlendEquation = value; + } + } + ,__setGLCullFace: function(enable) { + if(this.__contextState.__enableGLCullFace != enable) { + if(enable) { + this.gl.enable(this.gl.CULL_FACE); + } else { + this.gl.disable(this.gl.CULL_FACE); + } + this.__contextState.__enableGLCullFace = enable; + } + } + ,__setGLDepthTest: function(enable) { + if(this.__contextState.__enableGLDepthTest != enable) { + if(enable) { + this.gl.enable(this.gl.DEPTH_TEST); + } else { + this.gl.disable(this.gl.DEPTH_TEST); + } + this.__contextState.__enableGLDepthTest = enable; + } + } + ,__setGLFrontFace: function(counterClockWise) { + if(this.__contextState.__frontFaceGLCCW != counterClockWise) { + this.gl.frontFace(counterClockWise ? this.gl.CCW : this.gl.CW); + this.__contextState.__frontFaceGLCCW = counterClockWise; + } + } + ,__setGLScissorTest: function(enable) { + if(this.__contextState.__enableGLScissorTest != enable) { + if(enable) { + this.gl.enable(this.gl.SCISSOR_TEST); + } else { + this.gl.disable(this.gl.SCISSOR_TEST); + } + this.__contextState.__enableGLScissorTest = enable; + } + } + ,__setGLStencilTest: function(enable) { + if(this.__contextState.__enableGLStencilTest != enable) { + if(enable) { + this.gl.enable(this.gl.STENCIL_TEST); + } else { + this.gl.disable(this.gl.STENCIL_TEST); + } + this.__contextState.__enableGLStencilTest = enable; + } + } + ,get_enableErrorChecking: function() { + return this.__enableErrorChecking; + } + ,set_enableErrorChecking: function(value) { + return this.__enableErrorChecking = value; + } + ,get_totalGPUMemory: function() { + if(openfl_display3D_Context3D.__glMemoryCurrentAvailable != -1) { + var current = this.gl.getParameter(openfl_display3D_Context3D.__glMemoryCurrentAvailable); + var total = this.gl.getParameter(openfl_display3D_Context3D.__glMemoryTotalAvailable); + if(total > 0) { + return (total - current) * 1024; + } + } + return 0; + } + ,__class__: openfl_display3D_Context3D + ,__properties__: {get_totalGPUMemory:"get_totalGPUMemory",set_enableErrorChecking:"set_enableErrorChecking",get_enableErrorChecking:"get_enableErrorChecking"} +}); +var openfl_display3D_Context3DBlendFactor = {}; +openfl_display3D_Context3DBlendFactor.fromString = function(value) { + switch(value) { + case "destinationAlpha": + return 0; + case "destinationColor": + return 1; + case "one": + return 2; + case "oneMinusDestinationAlpha": + return 3; + case "oneMinusDestinationColor": + return 4; + case "oneMinusSourceAlpha": + return 5; + case "oneMinusSourceColor": + return 6; + case "sourceAlpha": + return 7; + case "sourceColor": + return 8; + case "zero": + return 9; + default: + return null; + } +}; +openfl_display3D_Context3DBlendFactor.toString = function(this1) { + switch(this1) { + case 0: + return "destinationAlpha"; + case 1: + return "destinationColor"; + case 2: + return "one"; + case 3: + return "oneMinusDestinationAlpha"; + case 4: + return "oneMinusDestinationColor"; + case 5: + return "oneMinusSourceAlpha"; + case 6: + return "oneMinusSourceColor"; + case 7: + return "sourceAlpha"; + case 8: + return "sourceColor"; + case 9: + return "zero"; + default: + return null; + } +}; +var openfl_display3D_Context3DBufferUsage = {}; +openfl_display3D_Context3DBufferUsage.fromString = function(value) { + switch(value) { + case "dynamicDraw": + return 0; + case "staticDraw": + return 1; + default: + return null; + } +}; +openfl_display3D_Context3DBufferUsage.toString = function(this1) { + switch(this1) { + case 0: + return "dynamicDraw"; + case 1: + return "staticDraw"; + default: + return null; + } +}; +var openfl_display3D_Context3DCompareMode = {}; +openfl_display3D_Context3DCompareMode.fromString = function(value) { + switch(value) { + case "always": + return 0; + case "equal": + return 1; + case "greater": + return 2; + case "greaterEqual": + return 3; + case "less": + return 4; + case "lessEqual": + return 5; + case "never": + return 6; + case "notEqual": + return 7; + default: + return null; + } +}; +openfl_display3D_Context3DCompareMode.toString = function(this1) { + switch(this1) { + case 0: + return "always"; + case 1: + return "equal"; + case 2: + return "greater"; + case 3: + return "greaterEqual"; + case 4: + return "less"; + case 5: + return "lessEqual"; + case 6: + return "never"; + case 7: + return "notEqual"; + default: + return null; + } +}; +var openfl_display3D_Context3DMipFilter = {}; +openfl_display3D_Context3DMipFilter.fromString = function(value) { + switch(value) { + case "miplinear": + return 0; + case "mipnearest": + return 1; + case "mipnone": + return 2; + default: + return null; + } +}; +openfl_display3D_Context3DMipFilter.toString = function(this1) { + switch(this1) { + case 0: + return "miplinear"; + case 1: + return "mipnearest"; + case 2: + return "mipnone"; + default: + return null; + } +}; +var openfl_display3D_Context3DProfile = {}; +openfl_display3D_Context3DProfile.fromString = function(value) { + switch(value) { + case "baseline": + return 0; + case "baselineConstrained": + return 1; + case "baselineExtended": + return 2; + case "standard": + return 3; + case "standardConstrained": + return 4; + case "standardExtended": + return 5; + default: + return null; + } +}; +openfl_display3D_Context3DProfile.toString = function(this1) { + switch(this1) { + case 0: + return "baseline"; + case 1: + return "baselineConstrained"; + case 2: + return "baselineExtended"; + case 3: + return "standard"; + case 4: + return "standardConstrained"; + case 5: + return "standardExtended"; + default: + return null; + } +}; +var openfl_display3D_Context3DProgramFormat = {}; +openfl_display3D_Context3DProgramFormat.fromString = function(value) { + switch(value) { + case "agal": + return 0; + case "glsl": + return 1; + default: + return null; + } +}; +openfl_display3D_Context3DProgramFormat.toString = function(this1) { + switch(this1) { + case 0: + return "agal"; + case 1: + return "glsl"; + default: + return null; + } +}; +var openfl_display3D_Context3DProgramType = {}; +openfl_display3D_Context3DProgramType.fromString = function(value) { + switch(value) { + case "fragment": + return 0; + case "vertex": + return 1; + default: + return null; + } +}; +openfl_display3D_Context3DProgramType.toString = function(this1) { + switch(this1) { + case 0: + return "fragment"; + case 1: + return "vertex"; + default: + return null; + } +}; +var openfl_display3D_Context3DRenderMode = {}; +openfl_display3D_Context3DRenderMode.fromString = function(value) { + switch(value) { + case "auto": + return 0; + case "software": + return 1; + default: + return null; + } +}; +openfl_display3D_Context3DRenderMode.toString = function(this1) { + switch(this1) { + case 0: + return "auto"; + case 1: + return "software"; + default: + return null; + } +}; +var openfl_display3D_Context3DStencilAction = {}; +openfl_display3D_Context3DStencilAction.fromString = function(value) { + switch(value) { + case "decrementSaturate": + return 0; + case "decrementWrap": + return 1; + case "incrementSaturate": + return 2; + case "incrementWrap": + return 3; + case "invert": + return 4; + case "keep": + return 5; + case "set": + return 6; + case "zero": + return 7; + default: + return null; + } +}; +openfl_display3D_Context3DStencilAction.toString = function(this1) { + switch(this1) { + case 0: + return "decrementSaturate"; + case 1: + return "decrementWrap"; + case 2: + return "incrementSaturate"; + case 3: + return "incrementWrap"; + case 4: + return "invert"; + case 5: + return "keep"; + case 6: + return "set"; + case 7: + return "zero"; + default: + return null; + } +}; +var openfl_display3D_Context3DTextureFilter = {}; +openfl_display3D_Context3DTextureFilter.fromString = function(value) { + switch(value) { + case "anisotropic16x": + return 0; + case "anisotropic2x": + return 1; + case "anisotropic4x": + return 2; + case "anisotropic8x": + return 3; + case "linear": + return 4; + case "nearest": + return 5; + default: + return null; + } +}; +openfl_display3D_Context3DTextureFilter.toString = function(this1) { + switch(this1) { + case 0: + return "anisotropic16x"; + case 1: + return "anisotropic2x"; + case 2: + return "anisotropic4x"; + case 3: + return "anisotropic8x"; + case 4: + return "linear"; + case 5: + return "nearest"; + default: + return null; + } +}; +var openfl_display3D_Context3DTextureFormat = {}; +openfl_display3D_Context3DTextureFormat.fromString = function(value) { + switch(value) { + case "bgrPacked565": + return 0; + case "bgra": + return 1; + case "bgraPacked4444": + return 2; + case "compressed": + return 3; + case "compressedAlpha": + return 4; + case "rgbaHalfFloat": + return 5; + default: + return null; + } +}; +openfl_display3D_Context3DTextureFormat.toString = function(this1) { + switch(this1) { + case 0: + return "bgrPacked565"; + case 1: + return "bgra"; + case 2: + return "bgraPacked4444"; + case 3: + return "compressed"; + case 4: + return "compressedAlpha"; + case 5: + return "rgbaHalfFloat"; + default: + return null; + } +}; +var openfl_display3D_Context3DTriangleFace = {}; +openfl_display3D_Context3DTriangleFace.fromString = function(value) { + switch(value) { + case "back": + return 0; + case "front": + return 1; + case "frontAndBack": + return 2; + case "none": + return 3; + default: + return null; + } +}; +openfl_display3D_Context3DTriangleFace.toString = function(this1) { + switch(this1) { + case 0: + return "back"; + case 1: + return "front"; + case 2: + return "frontAndBack"; + case 3: + return "none"; + default: + return null; + } +}; +var openfl_display3D_Context3DVertexBufferFormat = {}; +openfl_display3D_Context3DVertexBufferFormat.fromString = function(value) { + switch(value) { + case "bytes4": + return 0; + case "float1": + return 1; + case "float2": + return 2; + case "float3": + return 3; + case "float4": + return 4; + default: + return null; + } +}; +openfl_display3D_Context3DVertexBufferFormat.toString = function(this1) { + switch(this1) { + case 0: + return "bytes4"; + case 1: + return "float1"; + case 2: + return "float2"; + case 3: + return "float3"; + case 4: + return "float4"; + default: + return null; + } +}; +var openfl_display3D_Context3DWrapMode = {}; +openfl_display3D_Context3DWrapMode.fromString = function(value) { + switch(value) { + case "clamp": + return 0; + case "clamp_u_repeat_v": + return 1; + case "repeat": + return 2; + case "repeat_u_clamp_v": + return 3; + default: + return null; + } +}; +openfl_display3D_Context3DWrapMode.toString = function(this1) { + switch(this1) { + case 0: + return "clamp"; + case 1: + return "clamp_u_repeat_v"; + case 2: + return "repeat"; + case 3: + return "repeat_u_clamp_v"; + default: + return null; + } +}; +var openfl_display3D_IndexBuffer3D = function(context3D,numIndices,bufferUsage) { + this.__context = context3D; + this.__numIndices = numIndices; + var gl = this.__context.gl; + this.__id = gl.createBuffer(); + this.__usage = bufferUsage == 0 ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW; +}; +$hxClasses["openfl.display3D.IndexBuffer3D"] = openfl_display3D_IndexBuffer3D; +openfl_display3D_IndexBuffer3D.__name__ = "openfl.display3D.IndexBuffer3D"; +openfl_display3D_IndexBuffer3D.prototype = { + dispose: function() { + var gl = this.__context.gl; + gl.deleteBuffer(this.__id); + } + ,uploadFromByteArray: function(data,byteArrayOffset,startOffset,count) { + var offset = byteArrayOffset + startOffset * 2; + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = openfl_utils_ByteArray.toArrayBuffer(data); + var byteoffset = offset; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint16Array(elements); + } else if(array != null) { + this1 = new Uint16Array(array); + } else if(vector != null) { + this1 = new Uint16Array(vector.__array); + } else if(view != null) { + this1 = new Uint16Array(view); + } else if(buffer != null) { + if(count == null) { + this1 = new Uint16Array(buffer,byteoffset); + } else { + this1 = new Uint16Array(buffer,byteoffset,count); + } + } else { + this1 = null; + } + this.uploadFromTypedArray(this1); + } + ,uploadFromTypedArray: function(data,byteLength) { + if(byteLength == null) { + byteLength = -1; + } + if(data == null) { + return; + } + var gl = this.__context.gl; + this.__context.__bindGLElementArrayBuffer(this.__id); + lime_graphics_WebGLRenderContext.bufferData(gl,gl.ELEMENT_ARRAY_BUFFER,data,this.__usage); + } + ,uploadFromVector: function(data,startOffset,count) { + if(data == null) { + return; + } + var gl = this.__context.gl; + var length = startOffset + count; + var existingUInt16Array = this.__tempUInt16Array; + if(this.__tempUInt16Array == null || this.__tempUInt16Array.length < count) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(count != null) { + this1 = new Uint16Array(count); + } else if(array != null) { + this1 = new Uint16Array(array); + } else if(vector != null) { + this1 = new Uint16Array(vector.__array); + } else if(view != null) { + this1 = new Uint16Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint16Array(buffer,0); + } else { + this1 = new Uint16Array(buffer,0,len); + } + } else { + this1 = null; + } + this.__tempUInt16Array = this1; + if(existingUInt16Array != null) { + this.__tempUInt16Array.set(existingUInt16Array); + } + } + var _g = startOffset; + var _g1 = length; + while(_g < _g1) { + var i = _g++; + this.__tempUInt16Array[i - startOffset] = data.get(i); + } + this.uploadFromTypedArray(this.__tempUInt16Array); + } + ,__class__: openfl_display3D_IndexBuffer3D +}; +var openfl_display3D_Program3D = function(context3D,format) { + this.__context = context3D; + this.__format = format; + if(this.__format == 0) { + this.__agalSamplerUsageMask = 0; + this.__agalUniforms = new haxe_ds_List(); + this.__agalSamplerUniforms = new haxe_ds_List(); + this.__agalAlphaSamplerUniforms = new haxe_ds_List(); + this.__agalAlphaSamplerEnabled = []; + } else { + this.__glslAttribNames = []; + this.__glslAttribTypes = []; + this.__glslSamplerNames = []; + this.__glslUniformLocations = []; + this.__glslUniformNames = []; + this.__glslUniformTypes = []; + } + this.__samplerStates = []; +}; +$hxClasses["openfl.display3D.Program3D"] = openfl_display3D_Program3D; +openfl_display3D_Program3D.__name__ = "openfl.display3D.Program3D"; +openfl_display3D_Program3D.prototype = { + dispose: function() { + this.__deleteShaders(); + } + ,getAttributeIndex: function(name) { + if(this.__format == 0) { + if(StringTools.startsWith(name,"va")) { + return Std.parseInt(name.substring(2)); + } else { + return -1; + } + } else { + var _g = 0; + var _g1 = this.__glslAttribNames.length; + while(_g < _g1) { + var i = _g++; + if(this.__glslAttribNames[i] == name) { + return i; + } + } + return -1; + } + } + ,getConstantIndex: function(name) { + if(this.__format == 0) { + if(StringTools.startsWith(name,"vc")) { + return Std.parseInt(name.substring(2)); + } else if(StringTools.startsWith(name,"fc")) { + return Std.parseInt(name.substring(2)); + } else { + return -1; + } + } else { + var _g = 0; + var _g1 = this.__glslUniformNames.length; + while(_g < _g1) { + var i = _g++; + if(this.__glslUniformNames[i] == name) { + return this.__glslUniformLocations[i]; + } + } + return -1; + } + } + ,upload: function(vertexProgram,fragmentProgram) { + if(this.__format != 0) { + return; + } + var samplerStates = []; + var glslVertex = openfl_display3D__$internal_AGALConverter.convertToGLSL(vertexProgram,null); + var glslFragment = openfl_display3D__$internal_AGALConverter.convertToGLSL(fragmentProgram,samplerStates); + if(lime_utils_Log.level == 5) { + lime_utils_Log.info(glslVertex,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 399, className : "openfl.display3D.Program3D", methodName : "upload"}); + lime_utils_Log.info(glslFragment,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 400, className : "openfl.display3D.Program3D", methodName : "upload"}); + } + this.__deleteShaders(); + this.__uploadFromGLSL(glslVertex,glslFragment); + this.__buildAGALUniformList(); + var _g = 0; + var _g1 = samplerStates.length; + while(_g < _g1) { + var i = _g++; + this.__samplerStates[i] = samplerStates[i]; + } + } + ,uploadSources: function(vertexSource,fragmentSource) { + if(this.__format != 1) { + return; + } + var prefix = "#ifdef GL_ES\n\t\t\t#ifdef GL_FRAGMENT_PRECISION_HIGH\n\t\t\tprecision highp float;\n\t\t\t#else\n\t\t\tprecision mediump float;\n\t\t\t#endif\n\t\t\t#endif\n\t\t\t"; + var vertex = prefix + vertexSource; + var fragment = prefix + fragmentSource; + if(vertex == this.__glVertexSource && fragment == this.__glFragmentSource) { + return; + } + this.__processGLSLData(vertexSource,"attribute"); + this.__processGLSLData(vertexSource,"uniform"); + this.__processGLSLData(fragmentSource,"uniform"); + this.__deleteShaders(); + this.__uploadFromGLSL(vertex,fragment); + var samplerNames = this.__glslSamplerNames; + var attribNames = this.__glslAttribNames; + var attribTypes = this.__glslAttribTypes; + var uniformNames = this.__glslUniformNames; + this.__glslSamplerNames = []; + this.__glslAttribNames = []; + this.__glslAttribTypes = []; + this.__glslUniformLocations = []; + var gl = this.__context.gl; + var index; + var location; + var _g = 0; + while(_g < samplerNames.length) { + var name = samplerNames[_g]; + ++_g; + index = gl.getUniformLocation(this.__glProgram,name); + this.__glslSamplerNames[index] = name; + } + var _g = 0; + var _g1 = attribNames.length; + while(_g < _g1) { + var i = _g++; + index = gl.getAttribLocation(this.__glProgram,attribNames[i]); + this.__glslAttribNames[index] = attribNames[i]; + this.__glslAttribTypes[index] = attribTypes[i]; + } + var _g = 0; + var _g1 = uniformNames.length; + while(_g < _g1) { + var i = _g++; + location = gl.getUniformLocation(this.__glProgram,uniformNames[i]); + this.__glslUniformLocations[i] = location; + } + } + ,__buildAGALUniformList: function() { + if(this.__format == 1) { + return; + } + var gl = this.__context.gl; + this.__agalUniforms.clear(); + this.__agalSamplerUniforms.clear(); + this.__agalAlphaSamplerUniforms.clear(); + this.__agalAlphaSamplerEnabled = []; + this.__agalSamplerUsageMask = 0; + var numActive = 0; + numActive = gl.getProgramParameter(this.__glProgram,gl.ACTIVE_UNIFORMS); + var vertexUniforms = new haxe_ds_List(); + var fragmentUniforms = new haxe_ds_List(); + var _g = 0; + var _g1 = numActive; + while(_g < _g1) { + var i = _g++; + var info = gl.getActiveUniform(this.__glProgram,i); + var name = info.name; + var size = info.size; + var uniformType = info.type; + var uniform = new openfl_display3D_Uniform(this.__context); + uniform.name = name; + uniform.size = size; + uniform.type = uniformType; + uniform.location = gl.getUniformLocation(this.__glProgram,uniform.name); + var indexBracket = uniform.name.indexOf("["); + if(indexBracket >= 0) { + uniform.name = uniform.name.substring(0,indexBracket); + } + switch(uniform.type) { + case 35674: + uniform.regCount = 2; + break; + case 35675: + uniform.regCount = 3; + break; + case 35676: + uniform.regCount = 4; + break; + default: + uniform.regCount = 1; + } + uniform.regCount *= uniform.size; + this.__agalUniforms.add(uniform); + if(uniform.name == "vcPositionScale") { + this.__agalPositionScale = uniform; + } else if(StringTools.startsWith(uniform.name,"vc")) { + uniform.regIndex = Std.parseInt(uniform.name.substring(2)); + uniform.regData = this.__context.__vertexConstants; + vertexUniforms.add(uniform); + } else if(StringTools.startsWith(uniform.name,"fc")) { + uniform.regIndex = Std.parseInt(uniform.name.substring(2)); + uniform.regData = this.__context.__fragmentConstants; + fragmentUniforms.add(uniform); + } else if(StringTools.startsWith(uniform.name,"sampler") && uniform.name.indexOf("alpha") == -1) { + uniform.regIndex = Std.parseInt(uniform.name.substring(7)); + this.__agalSamplerUniforms.add(uniform); + var _g2 = 0; + var _g3 = uniform.regCount; + while(_g2 < _g3) { + var reg = _g2++; + this.__agalSamplerUsageMask |= 1 << uniform.regIndex + reg; + } + } else if(StringTools.startsWith(uniform.name,"sampler") && StringTools.endsWith(uniform.name,"_alpha")) { + var len = uniform.name.indexOf("_") - 7; + uniform.regIndex = Std.parseInt(uniform.name.substring(7,7 + len)) + 4; + this.__agalAlphaSamplerUniforms.add(uniform); + } else if(StringTools.startsWith(uniform.name,"sampler") && StringTools.endsWith(uniform.name,"_alphaEnabled")) { + uniform.regIndex = Std.parseInt(uniform.name.substring(7)); + this.__agalAlphaSamplerEnabled[uniform.regIndex] = uniform; + } + if(lime_utils_Log.level == 5) { + lime_utils_Log.verbose("" + i + " name:" + uniform.name + " type:" + uniform.type + " size:" + uniform.size + " location:" + Std.string(uniform.location),{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 577, className : "openfl.display3D.Program3D", methodName : "__buildAGALUniformList"}); + } + } + this.__agalVertexUniformMap = new openfl_display3D_UniformMap(Lambda.array(vertexUniforms)); + this.__agalFragmentUniformMap = new openfl_display3D_UniformMap(Lambda.array(fragmentUniforms)); + } + ,__deleteShaders: function() { + var gl = this.__context.gl; + if(this.__glProgram != null) { + this.__glProgram = null; + } + if(this.__glVertexShader != null) { + gl.deleteShader(this.__glVertexShader); + this.__glVertexShader = null; + } + if(this.__glFragmentShader != null) { + gl.deleteShader(this.__glFragmentShader); + this.__glFragmentShader = null; + } + } + ,__disable: function() { + var tmp = this.__format == 1; + } + ,__enable: function() { + var gl = this.__context.gl; + gl.useProgram(this.__glProgram); + if(this.__format == 0) { + this.__agalVertexUniformMap.markAllDirty(); + this.__agalFragmentUniformMap.markAllDirty(); + var _g_head = this.__agalSamplerUniforms.h; + while(_g_head != null) { + var val = _g_head.item; + _g_head = _g_head.next; + var sampler = val; + if(sampler.regCount == 1) { + gl.uniform1i(sampler.location,sampler.regIndex); + } else { + throw new openfl_errors_IllegalOperationError("!!! TODO: uniform location on webgl"); + } + } + var _g_head = this.__agalAlphaSamplerUniforms.h; + while(_g_head != null) { + var val = _g_head.item; + _g_head = _g_head.next; + var sampler = val; + if(sampler.regCount == 1) { + gl.uniform1i(sampler.location,sampler.regIndex); + } else { + throw new openfl_errors_IllegalOperationError("!!! TODO: uniform location on webgl"); + } + } + } + } + ,__flush: function() { + if(this.__format == 0) { + this.__agalVertexUniformMap.flush(); + this.__agalFragmentUniformMap.flush(); + } else { + return; + } + } + ,__getSamplerState: function(sampler) { + return this.__samplerStates[sampler]; + } + ,__markDirty: function(isVertex,index,count) { + if(this.__format == 1) { + return; + } + if(isVertex) { + this.__agalVertexUniformMap.markDirty(index,count); + } else { + this.__agalFragmentUniformMap.markDirty(index,count); + } + } + ,__processGLSLData: function(source,storageType) { + var lastMatch = 0; + var position; + var regex; + var name; + var type; + if(storageType == "uniform") { + regex = new EReg("uniform ([A-Za-z0-9]+) ([A-Za-z0-9_]+)",""); + } else { + regex = new EReg("attribute ([A-Za-z0-9]+) ([A-Za-z0-9_]+)",""); + } + while(regex.matchSub(source,lastMatch)) { + type = regex.matched(1); + name = regex.matched(2); + if(StringTools.startsWith(name,"gl_")) { + continue; + } + if(StringTools.startsWith(type,"sampler")) { + this.__glslSamplerNames.push(name); + } else { + var parameterType; + switch(type) { + case "bool": + parameterType = 0; + break; + case "bvec2": + parameterType = 1; + break; + case "bvec3": + parameterType = 2; + break; + case "bvec4": + parameterType = 3; + break; + case "dvec2":case "vec2": + parameterType = 5; + break; + case "dvec3":case "vec3": + parameterType = 6; + break; + case "dvec4":case "vec4": + parameterType = 7; + break; + case "double":case "float": + parameterType = 4; + break; + case "mat2":case "mat2x2": + parameterType = 12; + break; + case "mat2x3": + parameterType = 13; + break; + case "mat2x4": + parameterType = 14; + break; + case "mat3x2": + parameterType = 15; + break; + case "mat3":case "mat3x3": + parameterType = 16; + break; + case "mat3x4": + parameterType = 17; + break; + case "mat4x2": + parameterType = 18; + break; + case "mat4x3": + parameterType = 19; + break; + case "mat4":case "mat4x4": + parameterType = 20; + break; + case "int":case "uint": + parameterType = 8; + break; + case "ivec2":case "uvec2": + parameterType = 9; + break; + case "ivec3":case "uvec3": + parameterType = 10; + break; + case "ivec4":case "uvec4": + parameterType = 11; + break; + default: + parameterType = null; + } + if(storageType == "uniform") { + this.__glslUniformNames.push(name); + this.__glslUniformTypes.push(parameterType); + } else { + this.__glslAttribNames.push(name); + this.__glslAttribTypes.push(parameterType); + } + } + position = regex.matchedPos(); + lastMatch = position.pos + position.len; + } + } + ,__setPositionScale: function(positionScale) { + if(this.__format == 1) { + return; + } + if(this.__agalPositionScale != null) { + var gl = this.__context.gl; + var this1 = gl; + var location = this.__agalPositionScale.location; + var data = positionScale; + var srcOffset = null; + if(srcOffset != null) { + this1.uniform4fv(location,data,srcOffset,null); + } else { + this1.uniform4fv(location,data); + } + } + } + ,__setSamplerState: function(sampler,state) { + this.__samplerStates[sampler] = state; + } + ,__uploadFromGLSL: function(vertexShaderSource,fragmentShaderSource) { + var gl = this.__context.gl; + this.__glVertexSource = vertexShaderSource; + this.__glFragmentSource = fragmentShaderSource; + this.__glVertexShader = gl.createShader(gl.VERTEX_SHADER); + gl.shaderSource(this.__glVertexShader,vertexShaderSource); + gl.compileShader(this.__glVertexShader); + if(gl.getShaderParameter(this.__glVertexShader,gl.COMPILE_STATUS) == 0) { + var message = "Error compiling vertex shader"; + message += "\n" + gl.getShaderInfoLog(this.__glVertexShader); + message += "\n" + vertexShaderSource; + lime_utils_Log.error(message,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 869, className : "openfl.display3D.Program3D", methodName : "__uploadFromGLSL"}); + } + this.__glFragmentShader = gl.createShader(gl.FRAGMENT_SHADER); + gl.shaderSource(this.__glFragmentShader,fragmentShaderSource); + gl.compileShader(this.__glFragmentShader); + if(gl.getShaderParameter(this.__glFragmentShader,gl.COMPILE_STATUS) == 0) { + var message = "Error compiling fragment shader"; + message += "\n" + gl.getShaderInfoLog(this.__glFragmentShader); + message += "\n" + fragmentShaderSource; + lime_utils_Log.error(message,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 881, className : "openfl.display3D.Program3D", methodName : "__uploadFromGLSL"}); + } + this.__glProgram = gl.createProgram(); + if(this.__format == 0) { + var _g = 0; + while(_g < 16) { + var i = _g++; + var name = "va" + i; + if(vertexShaderSource.indexOf(" " + name) != -1) { + gl.bindAttribLocation(this.__glProgram,i,name); + } + } + } else { + var _g = 0; + var _g1 = this.__glslAttribNames; + while(_g < _g1.length) { + var name = _g1[_g]; + ++_g; + if(name.indexOf("Position") > -1 && StringTools.startsWith(name,"openfl_")) { + gl.bindAttribLocation(this.__glProgram,0,name); + break; + } + } + } + gl.attachShader(this.__glProgram,this.__glVertexShader); + gl.attachShader(this.__glProgram,this.__glFragmentShader); + gl.linkProgram(this.__glProgram); + if(gl.getProgramParameter(this.__glProgram,gl.LINK_STATUS) == 0) { + var message = "Unable to initialize the shader program"; + message += "\n" + gl.getProgramInfoLog(this.__glProgram); + lime_utils_Log.error(message,{ fileName : "openfl/display3D/Program3D.hx", lineNumber : 922, className : "openfl.display3D.Program3D", methodName : "__uploadFromGLSL"}); + } + } + ,__class__: openfl_display3D_Program3D +}; +var openfl_display3D_Uniform = function(context) { + this.context = context; + this.isDirty = true; + this.regDataPointer = new lime_utils_BytePointerData(null,0); +}; +$hxClasses["openfl.display3D.Uniform"] = openfl_display3D_Uniform; +openfl_display3D_Uniform.__name__ = "openfl.display3D.Uniform"; +openfl_display3D_Uniform.prototype = { + flush: function() { + var gl = this.context.gl; + var index = this.regIndex * 4; + switch(this.type) { + case 35664: + lime_graphics_WebGL2RenderContext.uniform2fv(gl,this.location,this.regData.subarray(index,index + this.regCount * 2)); + break; + case 35665: + var this1 = gl; + var location = this.location; + var data = this.regData.subarray(index,index + this.regCount * 3); + var srcOffset = null; + if(srcOffset != null) { + this1.uniform3fv(location,data,srcOffset,null); + } else { + this1.uniform3fv(location,data); + } + break; + case 35666: + var this1 = gl; + var location = this.location; + var data = this.regData.subarray(index,index + this.regCount * 4); + var srcOffset = null; + if(srcOffset != null) { + this1.uniform4fv(location,data,srcOffset,null); + } else { + this1.uniform4fv(location,data); + } + break; + case 35674: + lime_graphics_WebGLRenderContext.uniformMatrix2fv(gl,this.location,false,this.regData.subarray(index,index + this.size * 2 * 2)); + break; + case 35675: + lime_graphics_WebGLRenderContext.uniformMatrix3fv(gl,this.location,false,this.regData.subarray(index,index + this.size * 3 * 3)); + break; + case 35676: + lime_graphics_WebGLRenderContext.uniformMatrix4fv(gl,this.location,false,this.regData.subarray(index,index + this.size * 4 * 4)); + break; + default: + var this1 = gl; + var location = this.location; + var data = this.regData.subarray(index,index + this.regCount * 4); + var srcOffset = null; + if(srcOffset != null) { + this1.uniform4fv(location,data,srcOffset,null); + } else { + this1.uniform4fv(location,data); + } + } + } + ,__getUniformRegisters: function(index,size) { + return this.regData.subarray(index,index + size); + } + ,__class__: openfl_display3D_Uniform +}; +var openfl_display3D_UniformMap = function(list) { + this.__uniforms = list; + this.__uniforms.sort(function(a,b) { + return Reflect.compare(a.regIndex,b.regIndex); + }); + var total = 0; + var _g = 0; + var _g1 = this.__uniforms; + while(_g < _g1.length) { + var uniform = _g1[_g]; + ++_g; + if(uniform.regIndex + uniform.regCount > total) { + total = uniform.regIndex + uniform.regCount; + } + } + this.__registerLookup = openfl_Vector.toObjectVector(null,total); + var _g = 0; + var _g1 = this.__uniforms; + while(_g < _g1.length) { + var uniform = _g1[_g]; + ++_g; + var _g2 = 0; + var _g3 = uniform.regCount; + while(_g2 < _g3) { + var i = _g2++; + this.__registerLookup.set(uniform.regIndex + i,uniform); + } + } + this.__anyDirty = this.__allDirty = true; +}; +$hxClasses["openfl.display3D.UniformMap"] = openfl_display3D_UniformMap; +openfl_display3D_UniformMap.__name__ = "openfl.display3D.UniformMap"; +openfl_display3D_UniformMap.prototype = { + flush: function() { + if(this.__anyDirty) { + var _g = 0; + var _g1 = this.__uniforms; + while(_g < _g1.length) { + var uniform = _g1[_g]; + ++_g; + if(this.__allDirty || uniform.isDirty) { + uniform.flush(); + uniform.isDirty = false; + } + } + this.__anyDirty = this.__allDirty = false; + } + } + ,markAllDirty: function() { + this.__allDirty = true; + this.__anyDirty = true; + } + ,markDirty: function(start,count) { + if(this.__allDirty) { + return; + } + var end = start + count; + if(end > this.__registerLookup.get_length()) { + end = this.__registerLookup.get_length(); + } + var index = start; + while(index < end) { + var uniform = this.__registerLookup.get(index); + if(uniform != null) { + uniform.isDirty = true; + this.__anyDirty = true; + index = uniform.regIndex + uniform.regCount; + } else { + ++index; + } + } + } + ,__class__: openfl_display3D_UniformMap +}; +var openfl_display3D_VertexBuffer3D = function(context3D,numVertices,dataPerVertex,bufferUsage) { + this.__context = context3D; + this.__numVertices = numVertices; + this.__vertexSize = dataPerVertex; + var gl = this.__context.gl; + this.__id = gl.createBuffer(); + this.__stride = this.__vertexSize * 4; + this.__usage = openfl_display3D_Context3DBufferUsage.fromString(bufferUsage) == 0 ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW; +}; +$hxClasses["openfl.display3D.VertexBuffer3D"] = openfl_display3D_VertexBuffer3D; +openfl_display3D_VertexBuffer3D.__name__ = "openfl.display3D.VertexBuffer3D"; +openfl_display3D_VertexBuffer3D.prototype = { + dispose: function() { + var gl = this.__context.gl; + gl.deleteBuffer(this.__id); + } + ,uploadFromByteArray: function(data,byteArrayOffset,startVertex,numVertices) { + var offset = byteArrayOffset + startVertex * this.__stride; + var length = numVertices * this.__vertexSize; + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = openfl_utils_ByteArray.toArrayBuffer(data); + var byteoffset = offset; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Float32Array(elements); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer != null) { + if(length == null) { + this1 = new Float32Array(buffer,byteoffset); + } else { + this1 = new Float32Array(buffer,byteoffset,length); + } + } else { + this1 = null; + } + this.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this1)); + } + ,uploadFromTypedArray: function(data,byteLength) { + if(byteLength == null) { + byteLength = -1; + } + if(data == null) { + return; + } + var gl = this.__context.gl; + this.__context.__bindGLArrayBuffer(this.__id); + lime_graphics_WebGLRenderContext.bufferData(gl,gl.ARRAY_BUFFER,data,this.__usage); + } + ,uploadFromVector: function(data,startVertex,numVertices) { + if(data == null) { + return; + } + var gl = this.__context.gl; + var start = startVertex * this.__vertexSize; + var count = numVertices * this.__vertexSize; + var length = start + count; + var existingFloat32Array = this.__tempFloat32Array; + if(this.__tempFloat32Array == null || this.__tempFloat32Array.length < count) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(count != null) { + this1 = new Float32Array(count); + } else if(array != null) { + this1 = new Float32Array(array); + } else if(vector != null) { + this1 = new Float32Array(vector.__array); + } else if(view != null) { + this1 = new Float32Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Float32Array(buffer,0); + } else { + this1 = new Float32Array(buffer,0,len); + } + } else { + this1 = null; + } + this.__tempFloat32Array = this1; + if(existingFloat32Array != null) { + this.__tempFloat32Array.set(existingFloat32Array); + } + } + var _g = start; + var _g1 = length; + while(_g < _g1) { + var i = _g++; + this.__tempFloat32Array[i - start] = data.get(i); + } + this.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.__tempFloat32Array)); + } + ,__class__: openfl_display3D_VertexBuffer3D +}; +var openfl_display3D__$internal_AGALConverter = function() { }; +$hxClasses["openfl.display3D._internal.AGALConverter"] = openfl_display3D__$internal_AGALConverter; +openfl_display3D__$internal_AGALConverter.__name__ = "openfl.display3D._internal.AGALConverter"; +openfl_display3D__$internal_AGALConverter.prefixFromType = function(regType,programType) { + switch(regType) { + case 0: + return "va"; + case 1: + if(programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX) { + return "vc"; + } else { + return "fc"; + } + break; + case 2: + if(programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX) { + return "vt"; + } else { + return "ft"; + } + break; + case 3: + return "output_"; + case 4: + return "v"; + case 5: + return "sampler"; + default: + throw new openfl_errors_IllegalOperationError("Invalid data!"); + } +}; +openfl_display3D__$internal_AGALConverter.readUInt64 = function(byteArray) { + var low = byteArray.readInt(); + var high = byteArray.readInt(); + return new haxe__$Int64__$_$_$Int64(high,low); +}; +openfl_display3D__$internal_AGALConverter.convertToGLSL = function(agal,samplerState) { + agal.position = 0; + agal.__endian = 1; + var magic = agal.readByte() & 255; + if(magic == 176) { + return agal.readUTF(); + } + if(magic != 160) { + throw new openfl_errors_IllegalOperationError("Magic value must be 0xA0, may not be AGAL"); + } + var version = agal.readInt(); + if(version != 1) { + throw new openfl_errors_IllegalOperationError("Version must be 1"); + } + var shaderTypeID = agal.readByte() & 255; + if(shaderTypeID != 161) { + throw new openfl_errors_IllegalOperationError("Shader type ID must be 0xA1"); + } + var programType = (agal.readByte() & 255) == 0 ? openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX : openfl_display3D__$internal__$AGALConverter_ProgramType.FRAGMENT; + var map = new openfl_display3D__$internal_RegisterMap(); + var sb_b = ""; + while(true) { + var a = agal.position; + if(!UInt.gt(openfl_utils_ByteArray.get_length(agal),a)) { + break; + } + var opcode = agal.readInt(); + var dest = agal.readUnsignedInt(); + var source1 = openfl_display3D__$internal_AGALConverter.readUInt64(agal); + var source2 = openfl_display3D__$internal_AGALConverter.readUInt64(agal); + var dr = openfl_display3D__$internal__$AGALConverter_DestRegister.parse(dest,programType); + var sr1 = openfl_display3D__$internal__$AGALConverter_SourceRegister.parse(source1,programType,dr.mask); + var sr2 = openfl_display3D__$internal__$AGALConverter_SourceRegister.parse(source2,programType,dr.mask); + sb_b += "\t"; + switch(opcode) { + case 0: + sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + "; // mov"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 1: + sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " + " + sr2.toGLSL() + "; // add"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 2: + sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " - " + sr2.toGLSL() + "; // sub"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 3: + sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " * " + sr2.toGLSL() + "; // mul"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 4: + sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " / " + sr2.toGLSL() + "; // div"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 5: + var sr = sr1.toGLSL(); + if(sr.indexOf(".") > -1) { + sb_b += Std.string(dr.toGLSL() + " = 1.0 / " + sr1.toGLSL() + "; // rcp"); + } else { + sb_b += Std.string(dr.toGLSL() + " = vec4(1) / " + sr1.toGLSL() + "; // rcp"); + } + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 6: + sb_b += Std.string(dr.toGLSL() + " = min(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "); // min"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 7: + sb_b += Std.string(dr.toGLSL() + " = max(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "); // max"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 8: + sb_b += Std.string(dr.toGLSL() + " = fract(" + sr1.toGLSL() + "); // frc"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 9: + sb_b += Std.string(dr.toGLSL() + " = sqrt(" + sr1.toGLSL() + "); // sqrt"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 10: + sb_b += Std.string(dr.toGLSL() + " = inversesqrt(" + sr1.toGLSL() + "); // rsq"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 11: + sb_b += Std.string(dr.toGLSL() + " = pow(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "); // pow"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 12: + sb_b += Std.string(dr.toGLSL() + " = log2(" + sr1.toGLSL() + "); // log"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 13: + sb_b += Std.string(dr.toGLSL() + " = exp2(" + sr1.toGLSL() + "); // exp"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 14: + sb_b += Std.string(dr.toGLSL() + " = normalize(" + sr1.toGLSL() + "); // normalize"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 15: + sb_b += Std.string(dr.toGLSL() + " = sin(" + sr1.toGLSL() + "); // sin"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 16: + sb_b += Std.string(dr.toGLSL() + " = cos(" + sr1.toGLSL() + "); // cos"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 17: + sr1.sourceMask = sr2.sourceMask = 7; + sb_b += Std.string(dr.toGLSL() + " = cross(vec3(" + sr1.toGLSL() + "), vec3(" + sr2.toGLSL() + ")); // crs"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 18: + sr1.sourceMask = sr2.sourceMask = 7; + sb_b += Std.string(dr.toGLSL() + " = vec4(dot(vec3(" + sr1.toGLSL() + "), vec3(" + sr2.toGLSL() + ")))" + dr.getWriteMask() + "; // dp3"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 19: + sr1.sourceMask = sr2.sourceMask = 15; + sb_b += Std.string(dr.toGLSL() + " = vec4(dot(vec4(" + sr1.toGLSL() + "), vec4(" + sr2.toGLSL() + ")))" + dr.getWriteMask() + "; // dp4"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 20: + sb_b += Std.string(dr.toGLSL() + " = abs(" + sr1.toGLSL() + "); // abs"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 21: + sb_b += Std.string(dr.toGLSL() + " = -" + sr1.toGLSL() + "; // neg"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 22: + sb_b += Std.string(dr.toGLSL() + " = clamp(" + sr1.toGLSL() + ", 0.0, 1.0); // saturate"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 23: + var existingUsage = map.getRegisterUsage(sr2); + if(existingUsage != openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4 && existingUsage != openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY) { + sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " * mat3(" + sr2.toGLSL(false) + "); // m33"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.MATRIX_4_4); + } else { + sr1.sourceMask = sr2.sourceMask = 7; + sb_b += Std.string(dr.toGLSL() + " = vec3(" + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,0) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,1) + ")," + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,2) + ")); // m33"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,0); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,1); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,2); + } + break; + case 24: + var existingUsage1 = map.getRegisterUsage(sr2); + if(existingUsage1 != openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4 && existingUsage1 != openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY) { + sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " * " + sr2.toGLSL(false) + "; // m44"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.MATRIX_4_4); + } else { + sr1.sourceMask = sr2.sourceMask = 15; + sb_b += Std.string(dr.toGLSL() + " = vec4(" + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,0) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,1) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,2) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,3) + ")); // m44"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,0); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,1); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,2); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,3); + } + break; + case 25: + dr.mask &= 7; + var existingUsage2 = map.getRegisterUsage(sr2); + if(existingUsage2 != openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4 && existingUsage2 != openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY) { + sb_b += Std.string(dr.toGLSL() + " = " + sr1.toGLSL() + " * " + sr2.toGLSL(false) + "; // m34"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.MATRIX_4_4); + } else { + sr1.sourceMask = sr2.sourceMask = 15; + sb_b += Std.string(dr.toGLSL() + " = vec3(" + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,0) + "), " + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,1) + ")," + "dot(" + sr1.toGLSL(true) + "," + sr2.toGLSL(true,2) + ")); // m34"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,0); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,1); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,2); + } + break; + case 39: + sr1.sourceMask = 15; + sb_b += Std.string("if (any(lessThan(" + sr1.toGLSL() + ", vec4(0)))) discard;"); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 40: + var sampler = openfl_display3D__$internal__$AGALConverter_SamplerRegister.parse(source2,programType); + switch(sampler.d) { + case 0: + if(sampler.t == 2) { + sr1.sourceMask = 3; + map.addSaR(sampler,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_2D_ALPHA); + sb_b += Std.string("if (" + sampler.toGLSL() + "_alphaEnabled) {\n"); + sb_b += Std.string("\t\t" + dr.toGLSL() + " = vec4(texture2D(" + sampler.toGLSL() + ", " + sr1.toGLSL() + ").xyz, texture2D(" + sampler.toGLSL() + "_alpha, " + sr1.toGLSL() + ").x); // tex + alpha\n"); + sb_b += "\t} else {\n"; + sb_b += Std.string("\t\t" + dr.toGLSL() + " = texture2D(" + sampler.toGLSL() + ", " + sr1.toGLSL() + "); // tex\n"); + sb_b += "\t}"; + } else { + sr1.sourceMask = 3; + map.addSaR(sampler,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_2D); + sb_b += Std.string(dr.toGLSL() + " = texture2D(" + sampler.toGLSL() + ", " + sr1.toGLSL() + "); // tex"); + } + break; + case 1: + if(sampler.t == 2) { + sr1.sourceMask = 7; + map.addSaR(sampler,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_CUBE_ALPHA); + sb_b += Std.string("if (" + sampler.toGLSL() + "_alphaEnabled) {\n"); + sb_b += Std.string("\t\t" + dr.toGLSL() + " = vec4(textureCube(" + sampler.toGLSL() + ", " + sr1.toGLSL() + ").xyz, textureCube(" + sampler.toGLSL() + "_alpha, " + sr1.toGLSL() + ").x); // tex + alpha\n"); + sb_b += "\t} else {\n"; + sb_b += Std.string("\t\t" + dr.toGLSL() + " = textureCube(" + sampler.toGLSL() + ", " + sr1.toGLSL() + "); // tex"); + sb_b += "\t}"; + } else { + sr1.sourceMask = 7; + sb_b += Std.string(dr.toGLSL() + " = textureCube(" + sampler.toGLSL() + ", " + sr1.toGLSL() + "); // tex"); + map.addSaR(sampler,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_CUBE); + } + break; + } + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + if(samplerState != null) { + samplerState[sampler.n] = sampler.toSamplerState(); + } + break; + case 41: + sr1.sourceMask = sr2.sourceMask = 15; + sb_b += Std.string(dr.toGLSL() + " = vec4(greaterThanEqual(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "))" + dr.getWriteMask() + "; // ste"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 42: + sr1.sourceMask = sr2.sourceMask = 15; + sb_b += Std.string(dr.toGLSL() + " = vec4(lessThan(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "))" + dr.getWriteMask() + "; // slt"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 44: + sr1.sourceMask = sr2.sourceMask = 15; + sb_b += Std.string(dr.toGLSL() + " = vec4(equal(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "))" + dr.getWriteMask() + "; // seq"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + case 45: + sr1.sourceMask = sr2.sourceMask = 15; + sb_b += Std.string(dr.toGLSL() + " = vec4(notEqual(" + sr1.toGLSL() + ", " + sr2.toGLSL() + "))" + dr.getWriteMask() + "; // sne"); + map.addDR(dr,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr1,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + map.addSR(sr2,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + break; + default: + throw new openfl_errors_IllegalOperationError("Opcode " + opcode); + } + sb_b += "\n"; + } + if(openfl_display3D__$internal_AGALConverter.limitedProfile == null) { + var version = lime_graphics_opengl_GL.context.getParameter(7938); + openfl_display3D__$internal_AGALConverter.limitedProfile = version.indexOf("OpenGL ES") > -1 || version.indexOf("WebGL") > -1; + } + var glsl_b = ""; + glsl_b += Std.string("// AGAL " + (programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX ? "vertex" : "fragment") + " shader\n"); + if(openfl_display3D__$internal_AGALConverter.limitedProfile) { + glsl_b += "#version 100\n"; + glsl_b += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"; + glsl_b += "precision highp float;\n"; + glsl_b += "#else\n"; + glsl_b += "precision mediump float;\n"; + glsl_b += "#endif\n"; + } else { + glsl_b += "#version 120\n"; + } + glsl_b += Std.string(map.toGLSL(false)); + if(programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX) { + glsl_b += "uniform vec4 vcPositionScale;\n"; + } + glsl_b += "void main() {\n"; + glsl_b += Std.string(map.toGLSL(true)); + glsl_b += Std.string(sb_b); + if(programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX) { + glsl_b += "\tgl_Position *= vcPositionScale;\n"; + } + glsl_b += "}\n"; + return glsl_b; +}; +var openfl_display3D__$internal__$AGALConverter_DestRegister = function() { +}; +$hxClasses["openfl.display3D._internal._AGALConverter.DestRegister"] = openfl_display3D__$internal__$AGALConverter_DestRegister; +openfl_display3D__$internal__$AGALConverter_DestRegister.__name__ = "openfl.display3D._internal._AGALConverter.DestRegister"; +openfl_display3D__$internal__$AGALConverter_DestRegister.parse = function(v,programType) { + var dr = new openfl_display3D__$internal__$AGALConverter_DestRegister(); + dr.programType = programType; + dr.type = v >>> 24 & 15; + dr.mask = v >>> 16 & 15; + dr.n = v & 65535; + return dr; +}; +openfl_display3D__$internal__$AGALConverter_DestRegister.prototype = { + getWriteMask: function() { + var str = "."; + if((this.mask & 1) != 0) { + str += "x"; + } + if((this.mask & 2) != 0) { + str += "y"; + } + if((this.mask & 4) != 0) { + str += "z"; + } + if((this.mask & 8) != 0) { + str += "w"; + } + return str; + } + ,toGLSL: function(useMask) { + if(useMask == null) { + useMask = true; + } + var str; + if(this.type == 3) { + str = this.programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX ? "gl_Position" : "gl_FragColor"; + } else { + str = openfl_display3D__$internal_AGALConverter.prefixFromType(this.type,this.programType) + this.n; + } + if(useMask && this.mask != 15) { + str += this.getWriteMask(); + } + return str; + } + ,__class__: openfl_display3D__$internal__$AGALConverter_DestRegister +}; +var openfl_display3D__$internal__$AGALConverter_ProgramType = $hxEnums["openfl.display3D._internal._AGALConverter.ProgramType"] = { __ename__:"openfl.display3D._internal._AGALConverter.ProgramType",__constructs__:null + ,VERTEX: {_hx_name:"VERTEX",_hx_index:0,__enum__:"openfl.display3D._internal._AGALConverter.ProgramType",toString:$estr} + ,FRAGMENT: {_hx_name:"FRAGMENT",_hx_index:1,__enum__:"openfl.display3D._internal._AGALConverter.ProgramType",toString:$estr} +}; +openfl_display3D__$internal__$AGALConverter_ProgramType.__constructs__ = [openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX,openfl_display3D__$internal__$AGALConverter_ProgramType.FRAGMENT]; +var openfl_display3D__$internal_RegisterMap = function() { + this.mEntries = []; +}; +$hxClasses["openfl.display3D._internal.RegisterMap"] = openfl_display3D__$internal_RegisterMap; +openfl_display3D__$internal_RegisterMap.__name__ = "openfl.display3D._internal.RegisterMap"; +openfl_display3D__$internal_RegisterMap.prototype = { + add: function(type,name,number,usage) { + var _g = 0; + var _g1 = this.mEntries; + while(_g < _g1.length) { + var entry = _g1[_g]; + ++_g; + if(entry.type == type && entry.name == name && entry.number == number) { + if(entry.usage != usage) { + throw new openfl_errors_IllegalOperationError("Cannot use register in multiple ways yet (mat4/vec4)"); + } + return; + } + } + var entry = new openfl_display3D__$internal__$AGALConverter_RegisterMapEntry(); + entry.type = type; + entry.name = name; + entry.number = number; + entry.usage = usage; + this.mEntries.push(entry); + } + ,addDR: function(dr,usage) { + this.add(dr.type,dr.toGLSL(false),dr.n,usage); + } + ,addSaR: function(sr,usage) { + this.add(sr.type,sr.toGLSL(),sr.n,usage); + } + ,addSR: function(sr,usage,offset) { + if(offset == null) { + offset = 0; + } + if(sr.d != 0) { + this.add(sr.itype,openfl_display3D__$internal_AGALConverter.prefixFromType(sr.itype,sr.programType) + sr.n,sr.n,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4); + this.add(sr.type,openfl_display3D__$internal_AGALConverter.prefixFromType(sr.type,sr.programType) + sr.o,sr.o,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY); + return; + } + this.add(sr.type,sr.toGLSL(false,offset),sr.n + offset,usage); + } + ,getRegisterUsage: function(sr) { + if(sr.d != 0) { + return openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY; + } + return this.getUsage(sr.type,sr.toGLSL(false),sr.n); + } + ,getUsage: function(type,name,number) { + var _g = 0; + var _g1 = this.mEntries; + while(_g < _g1.length) { + var entry = _g1[_g]; + ++_g; + if(entry.type == type && entry.name == name && entry.number == number) { + return entry.usage; + } + } + return openfl_display3D__$internal__$AGALConverter_RegisterUsage.UNUSED; + } + ,toGLSL: function(tempRegistersOnly) { + this.mEntries.sort(function(a,b) { + return a.number - b.number; + }); + var entry; + this.mEntries.sort(function(a,b) { + return js_Boot.__cast(a.type , Int) - js_Boot.__cast(b.type , Int); + }); + var sb_b = ""; + var _g = 0; + var _g1 = this.mEntries.length; + while(_g < _g1) { + var i = _g++; + entry = this.mEntries[i]; + if(tempRegistersOnly && entry.type != 2 || !tempRegistersOnly && entry.type == 2) { + continue; + } + if(entry.type == 3) { + continue; + } + switch(entry.type) { + case 0: + sb_b += "attribute "; + break; + case 1: + sb_b += "uniform "; + break; + case 2: + sb_b += "\t"; + break; + case 3: + break; + case 4: + sb_b += "varying "; + break; + case 5: + sb_b += "uniform "; + break; + default: + throw new openfl_errors_IllegalOperationError(); + } + switch(entry.usage._hx_index) { + case 0: + lime_utils_Log.info("Missing switch patten: RegisterUsage.UNUSED",{ fileName : "openfl/display3D/_internal/AGALConverter.hx", lineNumber : 751, className : "openfl.display3D._internal.RegisterMap", methodName : "toGLSL"}); + break; + case 1: + sb_b += "vec4 "; + break; + case 2: + sb_b += "mat4 "; + break; + case 3: + sb_b += "sampler2D "; + break; + case 4: + break; + case 5: + sb_b += "samplerCube "; + break; + case 6: + break; + case 7: + sb_b += "vec4 "; + break; + } + if(entry.usage == openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_2D_ALPHA) { + sb_b += "sampler2D "; + sb_b += Std.string(entry.name); + sb_b += ";\n"; + sb_b += "uniform "; + sb_b += "sampler2D "; + sb_b += Std.string(entry.name + "_alpha"); + sb_b += ";\n"; + sb_b += "uniform "; + sb_b += "bool "; + sb_b += Std.string(entry.name + "_alphaEnabled"); + sb_b += ";\n"; + } else if(entry.usage == openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_CUBE_ALPHA) { + sb_b += "samplerCube "; + sb_b += Std.string(entry.name); + sb_b += ";\n"; + sb_b += "uniform "; + sb_b += "samplerCube "; + sb_b += Std.string(entry.name + "_alpha"); + sb_b += ";\n"; + sb_b += "uniform "; + sb_b += "bool "; + sb_b += Std.string(entry.name + "_alphaEnabled"); + sb_b += ";\n"; + } else if(entry.usage == openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY) { + sb_b += Std.string(entry.name + "[128]"); + sb_b += ";\n"; + } else { + sb_b += Std.string(entry.name); + sb_b += ";\n"; + } + } + return sb_b; + } + ,__class__: openfl_display3D__$internal_RegisterMap +}; +var openfl_display3D__$internal__$AGALConverter_RegisterMapEntry = function() { +}; +$hxClasses["openfl.display3D._internal._AGALConverter.RegisterMapEntry"] = openfl_display3D__$internal__$AGALConverter_RegisterMapEntry; +openfl_display3D__$internal__$AGALConverter_RegisterMapEntry.__name__ = "openfl.display3D._internal._AGALConverter.RegisterMapEntry"; +openfl_display3D__$internal__$AGALConverter_RegisterMapEntry.prototype = { + __class__: openfl_display3D__$internal__$AGALConverter_RegisterMapEntry +}; +var openfl_display3D__$internal__$AGALConverter_RegisterUsage = $hxEnums["openfl.display3D._internal._AGALConverter.RegisterUsage"] = { __ename__:"openfl.display3D._internal._AGALConverter.RegisterUsage",__constructs__:null + ,UNUSED: {_hx_name:"UNUSED",_hx_index:0,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr} + ,VECTOR_4: {_hx_name:"VECTOR_4",_hx_index:1,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr} + ,MATRIX_4_4: {_hx_name:"MATRIX_4_4",_hx_index:2,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr} + ,SAMPLER_2D: {_hx_name:"SAMPLER_2D",_hx_index:3,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr} + ,SAMPLER_2D_ALPHA: {_hx_name:"SAMPLER_2D_ALPHA",_hx_index:4,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr} + ,SAMPLER_CUBE: {_hx_name:"SAMPLER_CUBE",_hx_index:5,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr} + ,SAMPLER_CUBE_ALPHA: {_hx_name:"SAMPLER_CUBE_ALPHA",_hx_index:6,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr} + ,VECTOR_4_ARRAY: {_hx_name:"VECTOR_4_ARRAY",_hx_index:7,__enum__:"openfl.display3D._internal._AGALConverter.RegisterUsage",toString:$estr} +}; +openfl_display3D__$internal__$AGALConverter_RegisterUsage.__constructs__ = [openfl_display3D__$internal__$AGALConverter_RegisterUsage.UNUSED,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4,openfl_display3D__$internal__$AGALConverter_RegisterUsage.MATRIX_4_4,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_2D,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_2D_ALPHA,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_CUBE,openfl_display3D__$internal__$AGALConverter_RegisterUsage.SAMPLER_CUBE_ALPHA,openfl_display3D__$internal__$AGALConverter_RegisterUsage.VECTOR_4_ARRAY]; +var openfl_display3D__$internal__$AGALConverter_SamplerRegister = function() { +}; +$hxClasses["openfl.display3D._internal._AGALConverter.SamplerRegister"] = openfl_display3D__$internal__$AGALConverter_SamplerRegister; +openfl_display3D__$internal__$AGALConverter_SamplerRegister.__name__ = "openfl.display3D._internal._AGALConverter.SamplerRegister"; +openfl_display3D__$internal__$AGALConverter_SamplerRegister.parse = function(v,programType) { + var sr = new openfl_display3D__$internal__$AGALConverter_SamplerRegister(); + sr.programType = programType; + var b = 60; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 15; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.f = this_low; + var b = 56; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 15; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.m = this_low; + var b = 52; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 15; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.w = this_low; + var b = 48; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 15; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.s = this_low; + var b = 44; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 15; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.d = this_low; + var b = 40; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 15; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.t = this_low; + var b = 32; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 15; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.type = this_low; + var b = 16; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 255; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.b = this_low; + var b_high = 0; + var b_low = 65535; + var this_high = v.high & b_high; + var this_low = v.low & b_low; + sr.n = this_low; + return sr; +}; +openfl_display3D__$internal__$AGALConverter_SamplerRegister.prototype = { + toGLSL: function() { + var str = openfl_display3D__$internal_AGALConverter.prefixFromType(this.type,this.programType) + this.n; + return str; + } + ,toSamplerState: function() { + var wrap; + var filter; + var mipfilter; + switch(this.f) { + case 0: + filter = 5; + break; + case 1: + filter = 4; + break; + default: + throw new openfl_errors_IllegalOperationError(); + } + switch(this.m) { + case 0: + mipfilter = 2; + break; + case 1: + mipfilter = 1; + break; + case 2: + mipfilter = 0; + break; + default: + throw new openfl_errors_IllegalOperationError(); + } + switch(this.w) { + case 0: + wrap = 0; + break; + case 1: + wrap = 2; + break; + default: + throw new openfl_errors_IllegalOperationError(); + } + var ignoreSampler = (this.s & 4) == 4; + var centroid = (this.s & 1) == 1; + var textureAlpha = this.t == 2; + var lodBias = (this.b << 24 >> 24) / 8.0; + return new openfl_display__$internal_SamplerState(wrap,filter,mipfilter,lodBias,ignoreSampler,centroid,textureAlpha); + } + ,__class__: openfl_display3D__$internal__$AGALConverter_SamplerRegister +}; +var openfl_display3D__$internal__$AGALConverter_SourceRegister = function() { +}; +$hxClasses["openfl.display3D._internal._AGALConverter.SourceRegister"] = openfl_display3D__$internal__$AGALConverter_SourceRegister; +openfl_display3D__$internal__$AGALConverter_SourceRegister.__name__ = "openfl.display3D._internal._AGALConverter.SourceRegister"; +openfl_display3D__$internal__$AGALConverter_SourceRegister.parse = function(v,programType,sourceMask) { + var sr = new openfl_display3D__$internal__$AGALConverter_SourceRegister(); + sr.programType = programType; + var b = 63; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 1; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.d = this_low; + var b = 48; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 3; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.q = this_low; + var b = 40; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 15; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.itype = this_low; + var b = 32; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 15; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.type = this_low; + var b = 24; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 255; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.s = this_low; + var b = 16; + b &= 63; + var a = b == 0 ? new haxe__$Int64__$_$_$Int64(v.high,v.low) : b < 32 ? new haxe__$Int64__$_$_$Int64(v.high >> b,v.high << 32 - b | v.low >>> b) : new haxe__$Int64__$_$_$Int64(v.high >> 31,v.high >> b - 32); + var b_high = 0; + var b_low = 255; + var this_high = a.high & b_high; + var this_low = a.low & b_low; + sr.o = this_low; + var b_high = 0; + var b_low = 65535; + var this_high = v.high & b_high; + var this_low = v.low & b_low; + sr.n = this_low; + sr.sourceMask = sourceMask; + return sr; +}; +openfl_display3D__$internal__$AGALConverter_SourceRegister.prototype = { + toGLSL: function(emitSwizzle,offset) { + if(offset == null) { + offset = 0; + } + if(emitSwizzle == null) { + emitSwizzle = true; + } + if(this.type == 3) { + if(this.programType == openfl_display3D__$internal__$AGALConverter_ProgramType.VERTEX) { + return "gl_Position"; + } else { + return "gl_FragColor"; + } + } + var fullxyzw = this.s == 228 && this.sourceMask == 15; + var swizzle = ""; + if(this.type != 5 && !fullxyzw) { + if((this.sourceMask & 1) != 0) { + switch(this.s & 3) { + case 0: + swizzle += "x"; + break; + case 1: + swizzle += "y"; + break; + case 2: + swizzle += "z"; + break; + case 3: + swizzle += "w"; + break; + } + } + if((this.sourceMask & 2) != 0) { + switch(this.s >> 2 & 3) { + case 0: + swizzle += "x"; + break; + case 1: + swizzle += "y"; + break; + case 2: + swizzle += "z"; + break; + case 3: + swizzle += "w"; + break; + } + } + if((this.sourceMask & 4) != 0) { + switch(this.s >> 4 & 3) { + case 0: + swizzle += "x"; + break; + case 1: + swizzle += "y"; + break; + case 2: + swizzle += "z"; + break; + case 3: + swizzle += "w"; + break; + } + } + if((this.sourceMask & 8) != 0) { + switch(this.s >> 6 & 3) { + case 0: + swizzle += "x"; + break; + case 1: + swizzle += "y"; + break; + case 2: + swizzle += "z"; + break; + case 3: + swizzle += "w"; + break; + } + } + } + var str = openfl_display3D__$internal_AGALConverter.prefixFromType(this.type,this.programType); + if(this.d == 0) { + str += this.n + offset; + } else { + str += this.o; + var indexComponent = ""; + switch(this.q) { + case 0: + indexComponent = "x"; + break; + case 1: + indexComponent = "y"; + break; + case 2: + indexComponent = "z"; + break; + case 3: + indexComponent = "w"; + break; + } + var indexRegister = openfl_display3D__$internal_AGALConverter.prefixFromType(this.itype,this.programType) + this.n + "." + indexComponent; + str += "[ int(" + indexRegister + ") +" + offset + "]"; + } + if(emitSwizzle && swizzle != "") { + str += "." + swizzle; + } + return str; + } + ,__class__: openfl_display3D__$internal__$AGALConverter_SourceRegister +}; +var openfl_display3D__$internal_ATFReader = function(data,byteArrayOffset) { + this.version = 0; + data.position = byteArrayOffset; + var signature = data.readUTFBytes(3); + data.position = byteArrayOffset; + if(signature != "ATF") { + throw new openfl_errors_IllegalOperationError("ATF signature not found"); + } + var length = 0; + if(data.b[byteArrayOffset + 6] == 255) { + this.version = data.b[byteArrayOffset + 7]; + data.position = byteArrayOffset + 8; + length = this.__readUInt32(data); + } else { + this.version = 0; + data.position = byteArrayOffset + 3; + length = this.__readUInt24(data); + } + if(UInt.gt(js_Boot.__cast(byteArrayOffset + length , Int),openfl_utils_ByteArray.get_length(data))) { + throw new openfl_errors_IllegalOperationError("ATF length exceeds byte array length"); + } + this.data = data; +}; +$hxClasses["openfl.display3D._internal.ATFReader"] = openfl_display3D__$internal_ATFReader; +openfl_display3D__$internal_ATFReader.__name__ = "openfl.display3D._internal.ATFReader"; +openfl_display3D__$internal_ATFReader.prototype = { + readHeader: function(__width,__height,cubeMap) { + var tdata = this.data.readUnsignedByte(); + var type = tdata >>> 7; + if(!cubeMap && type != 0) { + throw new openfl_errors_IllegalOperationError("ATF Cube map not expected"); + } + if(cubeMap && type != 1) { + throw new openfl_errors_IllegalOperationError("ATF Cube map expected"); + } + this.cubeMap = cubeMap; + this.atfFormat = tdata & 127; + if(this.atfFormat != 3 && this.atfFormat != 5) { + lime_utils_Log.warn("Only ATF block compressed textures without JPEG-XR+LZMA are supported",{ fileName : "openfl/display3D/_internal/ATFReader.hx", lineNumber : 97, className : "openfl.display3D._internal.ATFReader", methodName : "readHeader"}); + } + this.width = 1 << this.data.readUnsignedByte(); + this.height = 1 << this.data.readUnsignedByte(); + if(this.width != __width || this.height != __height) { + throw new openfl_errors_IllegalOperationError("ATF width and height dont match"); + } + this.mipCount = this.data.readUnsignedByte(); + return this.atfFormat == 5; + } + ,readTextures: function(uploadCallback) { + var gpuFormats = this.version < 3 ? 3 : 4; + var sideCount = this.cubeMap ? 6 : 1; + var _g = 0; + var _g1 = sideCount; + while(_g < _g1) { + var side = _g++; + var _g2 = 0; + var _g3 = this.mipCount; + while(_g2 < _g3) { + var level = _g2++; + var _g4 = 0; + var _g5 = gpuFormats; + while(_g4 < _g5) { + var gpuFormat = _g4++; + var blockLength = this.version == 0 ? this.__readUInt24(this.data) : this.__readUInt32(this.data); + if(UInt.gt(this.data.position + blockLength,openfl_utils_ByteArray.get_length(this.data))) { + throw new openfl_errors_IllegalOperationError("Block length exceeds ATF file length"); + } + if(UInt.gt(blockLength,0)) { + var bytes = new haxe_io_Bytes(new ArrayBuffer(blockLength)); + var this1 = this.data; + var bytes1 = openfl_utils_ByteArray.fromBytes(bytes); + var offset = 0; + var length = blockLength; + if(length == null) { + length = 0; + } + if(offset == null) { + offset = 0; + } + this1.readBytes(bytes1,offset,length); + uploadCallback(side,level,gpuFormat,this.width >> level,this.height >> level,blockLength,bytes); + } + } + } + } + } + ,__readUInt24: function(data) { + var value = data.readUnsignedByte() << 16; + value = value | data.readUnsignedByte() << 8; + value = value | data.readUnsignedByte(); + return value; + } + ,__readUInt32: function(data) { + var value = data.readUnsignedByte() << 24; + value = value | data.readUnsignedByte() << 16; + value = value | data.readUnsignedByte() << 8; + value = value | data.readUnsignedByte(); + return value; + } + ,__class__: openfl_display3D__$internal_ATFReader +}; +var openfl_display3D__$internal_Context3DState = function() { + this.backBufferEnableDepthAndStencil = false; + this.blendDestinationAlphaFactor = 9; + this.blendSourceAlphaFactor = 2; + this.blendDestinationRGBFactor = 9; + this.blendSourceRGBFactor = 2; + this.colorMaskRed = true; + this.colorMaskGreen = true; + this.colorMaskBlue = true; + this.colorMaskAlpha = true; + this.culling = 3; + this.depthCompareMode = 4; + this.depthMask = true; + this.samplerStates = []; + this.scissorRectangle = new openfl_geom_Rectangle(); + this.stencilCompareMode = 0; + this.stencilDepthFail = 5; + this.stencilFail = 5; + this.stencilPass = 5; + this.stencilReadMask = 255; + this.stencilReferenceValue = 0; + this.stencilTriangleFace = 2; + this.stencilWriteMask = 255; + this.textures = []; + this.__frontFaceGLCCW = true; + this.__glBlendEquation = 32774; +}; +$hxClasses["openfl.display3D._internal.Context3DState"] = openfl_display3D__$internal_Context3DState; +openfl_display3D__$internal_Context3DState.__name__ = "openfl.display3D._internal.Context3DState"; +openfl_display3D__$internal_Context3DState.prototype = { + __class__: openfl_display3D__$internal_Context3DState +}; +var openfl_display3D_textures_TextureBase = function(context) { + openfl_events_EventDispatcher.call(this); + this.__context = context; + var gl = this.__context.gl; + this.__textureID = gl.createTexture(); + this.__textureContext = this.__context.__context; + if(openfl_display3D_textures_TextureBase.__supportsBGRA == null) { + openfl_display3D_textures_TextureBase.__textureInternalFormat = gl.RGBA; + var bgraExtension = null; + if(bgraExtension != null) { + openfl_display3D_textures_TextureBase.__supportsBGRA = true; + openfl_display3D_textures_TextureBase.__textureFormat = bgraExtension.BGRA_EXT; + if(context.__context.type == "opengles") { + openfl_display3D_textures_TextureBase.__textureInternalFormat = bgraExtension.BGRA_EXT; + } + } else { + openfl_display3D_textures_TextureBase.__supportsBGRA = false; + openfl_display3D_textures_TextureBase.__textureFormat = gl.RGBA; + } + openfl_display3D_textures_TextureBase.__compressedFormats = new haxe_ds_IntMap(); + openfl_display3D_textures_TextureBase.__compressedFormatsAlpha = new haxe_ds_IntMap(); + var dxtExtension = gl.getExtension("WEBGL_compressed_texture_s3tc"); + var etc1Extension = gl.getExtension("WEBGL_compressed_texture_etc1"); + var pvrtcExtension = gl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"); + if(dxtExtension != null) { + var v = dxtExtension.COMPRESSED_RGBA_S3TC_DXT1_EXT; + openfl_display3D_textures_TextureBase.__compressedFormats.h[0] = v; + var v = dxtExtension.COMPRESSED_RGBA_S3TC_DXT5_EXT; + openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[0] = v; + } + if(etc1Extension != null) { + var v = etc1Extension.COMPRESSED_RGB_ETC1_WEBGL; + openfl_display3D_textures_TextureBase.__compressedFormats.h[2] = v; + var v = etc1Extension.COMPRESSED_RGB_ETC1_WEBGL; + openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[2] = v; + } + if(pvrtcExtension != null) { + var v = pvrtcExtension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + openfl_display3D_textures_TextureBase.__compressedFormats.h[1] = v; + var v = pvrtcExtension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[1] = v; + } + } + this.__internalFormat = openfl_display3D_textures_TextureBase.__textureInternalFormat; + this.__format = openfl_display3D_textures_TextureBase.__textureFormat; +}; +$hxClasses["openfl.display3D.textures.TextureBase"] = openfl_display3D_textures_TextureBase; +openfl_display3D_textures_TextureBase.__name__ = "openfl.display3D.textures.TextureBase"; +openfl_display3D_textures_TextureBase.__super__ = openfl_events_EventDispatcher; +openfl_display3D_textures_TextureBase.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + dispose: function() { + var gl = this.__context.gl; + if(this.__alphaTexture != null) { + this.__alphaTexture.dispose(); + this.__alphaTexture = null; + } + if(this.__textureID != null) { + gl.deleteTexture(this.__textureID); + this.__textureID = null; + } + if(this.__glFramebuffer != null) { + gl.deleteFramebuffer(this.__glFramebuffer); + this.__glFramebuffer = null; + } + if(this.__glDepthRenderbuffer != null) { + gl.deleteRenderbuffer(this.__glDepthRenderbuffer); + this.__glDepthRenderbuffer = null; + } + if(this.__glStencilRenderbuffer != null) { + gl.deleteRenderbuffer(this.__glStencilRenderbuffer); + this.__glStencilRenderbuffer = null; + } + } + ,__getGLFramebuffer: function(enableDepthAndStencil,antiAlias,surfaceSelector) { + var gl = this.__context.gl; + if(this.__glFramebuffer == null) { + this.__glFramebuffer = gl.createFramebuffer(); + this.__context.__bindGLFramebuffer(this.__glFramebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_2D,this.__textureID,0); + if(this.__context.__enableErrorChecking) { + var code = gl.checkFramebufferStatus(gl.FRAMEBUFFER); + if(code != gl.FRAMEBUFFER_COMPLETE) { + lime_utils_Log.warn("Error: Context3D.setRenderToTexture status:" + code + " width:" + this.__width + " height:" + this.__height,{ fileName : "openfl/display3D/textures/TextureBase.hx", lineNumber : 201, className : "openfl.display3D.textures.TextureBase", methodName : "__getGLFramebuffer"}); + } + } + } + if(enableDepthAndStencil && this.__glDepthRenderbuffer == null) { + this.__context.__bindGLFramebuffer(this.__glFramebuffer); + if(openfl_display3D_Context3D.__glDepthStencil != 0) { + this.__glDepthRenderbuffer = gl.createRenderbuffer(); + this.__glStencilRenderbuffer = this.__glDepthRenderbuffer; + gl.bindRenderbuffer(gl.RENDERBUFFER,this.__glDepthRenderbuffer); + gl.renderbufferStorage(gl.RENDERBUFFER,openfl_display3D_Context3D.__glDepthStencil,this.__width,this.__height); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.DEPTH_STENCIL_ATTACHMENT,gl.RENDERBUFFER,this.__glDepthRenderbuffer); + } else { + this.__glDepthRenderbuffer = gl.createRenderbuffer(); + this.__glStencilRenderbuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER,this.__glDepthRenderbuffer); + gl.renderbufferStorage(gl.RENDERBUFFER,gl.DEPTH_COMPONENT16,this.__width,this.__height); + gl.bindRenderbuffer(gl.RENDERBUFFER,this.__glStencilRenderbuffer); + gl.renderbufferStorage(gl.RENDERBUFFER,gl.STENCIL_INDEX8,this.__width,this.__height); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.DEPTH_ATTACHMENT,gl.RENDERBUFFER,this.__glDepthRenderbuffer); + gl.framebufferRenderbuffer(gl.FRAMEBUFFER,gl.STENCIL_ATTACHMENT,gl.RENDERBUFFER,this.__glStencilRenderbuffer); + } + if(this.__context.__enableErrorChecking) { + var code = gl.checkFramebufferStatus(gl.FRAMEBUFFER); + if(code != gl.FRAMEBUFFER_COMPLETE) { + lime_utils_Log.warn("Error: Context3D.setRenderToTexture status:" + code + " width:" + this.__width + " height:" + this.__height,{ fileName : "openfl/display3D/textures/TextureBase.hx", lineNumber : 239, className : "openfl.display3D.textures.TextureBase", methodName : "__getGLFramebuffer"}); + } + } + gl.bindRenderbuffer(gl.RENDERBUFFER,null); + } + return this.__glFramebuffer; + } + ,__getImage: function(bitmapData) { + var image = bitmapData.image; + if(!bitmapData.__isValid || image == null) { + return null; + } + lime__$internal_graphics_ImageCanvasUtil.sync(image,false); + var gl = this.__context.gl; + if(image.type != lime_graphics_ImageType.DATA && !image.get_premultiplied()) { + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1); + } else if(!image.get_premultiplied() && image.get_transparent()) { + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0); + image = image.clone(); + image.set_premultiplied(true); + } + if(image.get_format() != 0) { + image = image.clone(); + image.set_format(0); + image.buffer.premultiplied = true; + } + return image; + } + ,__getTexture: function() { + return this.__textureID; + } + ,__setSamplerState: function(state) { + if(!state.equals(this.__samplerState)) { + var gl = this.__context.gl; + if(this.__textureTarget == this.__context.gl.TEXTURE_CUBE_MAP) { + this.__context.__bindGLTextureCubeMap(this.__textureID); + } else { + this.__context.__bindGLTexture2D(this.__textureID); + } + var wrapModeS = 0; + var wrapModeT = 0; + switch(state.wrap) { + case 0: + wrapModeS = gl.CLAMP_TO_EDGE; + wrapModeT = gl.CLAMP_TO_EDGE; + break; + case 1: + wrapModeS = gl.CLAMP_TO_EDGE; + wrapModeT = gl.REPEAT; + break; + case 2: + wrapModeS = gl.REPEAT; + wrapModeT = gl.REPEAT; + break; + case 3: + wrapModeS = gl.REPEAT; + wrapModeT = gl.CLAMP_TO_EDGE; + break; + default: + throw new openfl_errors_Error("wrap bad enum"); + } + var magFilter = 0; + var minFilter = 0; + if(state.filter == 5) { + magFilter = gl.NEAREST; + } else { + magFilter = gl.LINEAR; + } + switch(state.mipfilter) { + case 0: + minFilter = state.filter == 5 ? gl.NEAREST_MIPMAP_LINEAR : gl.LINEAR_MIPMAP_LINEAR; + break; + case 1: + minFilter = state.filter == 5 ? gl.NEAREST_MIPMAP_NEAREST : gl.LINEAR_MIPMAP_NEAREST; + break; + case 2: + minFilter = state.filter == 5 ? gl.NEAREST : gl.LINEAR; + break; + default: + throw new openfl_errors_Error("mipfiter bad enum"); + } + gl.texParameteri(this.__textureTarget,gl.TEXTURE_MIN_FILTER,minFilter); + gl.texParameteri(this.__textureTarget,gl.TEXTURE_MAG_FILTER,magFilter); + gl.texParameteri(this.__textureTarget,gl.TEXTURE_WRAP_S,wrapModeS); + gl.texParameteri(this.__textureTarget,gl.TEXTURE_WRAP_T,wrapModeT); + var tmp = state.lodBias != 0.0; + if(this.__samplerState == null) { + this.__samplerState = state.clone(); + } + this.__samplerState.copyFrom(state); + return true; + } + return false; + } + ,__uploadFromImage: function(image) { + var gl = this.__context.gl; + var internalFormat; + var format; + if(this.__textureTarget != gl.TEXTURE_2D) { + return; + } + if(image.buffer.bitsPerPixel == 1) { + internalFormat = gl.ALPHA; + format = gl.ALPHA; + } else { + internalFormat = openfl_display3D_textures_TextureBase.__textureInternalFormat; + format = openfl_display3D_textures_TextureBase.__textureFormat; + } + this.__context.__bindGLTexture2D(this.__textureID); + if(image.type != lime_graphics_ImageType.DATA && !image.get_premultiplied()) { + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1); + } else if(!image.get_premultiplied() && image.get_transparent()) { + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1); + } + if(image.type == lime_graphics_ImageType.DATA) { + lime_graphics_WebGLRenderContext.texImage2D(gl,gl.TEXTURE_2D,0,internalFormat,image.buffer.width,image.buffer.height,0,format,gl.UNSIGNED_BYTE,image.get_data()); + } else { + lime_graphics_WebGLRenderContext.texImage2D(gl,gl.TEXTURE_2D,0,internalFormat,format,gl.UNSIGNED_BYTE,image.get_src()); + } + this.__context.__bindGLTexture2D(null); + } + ,__class__: openfl_display3D_textures_TextureBase +}); +var openfl_display3D_textures_CubeTexture = function(context,size,format,optimizeForRenderToTexture,streamingLevels) { + openfl_display3D_textures_TextureBase.call(this,context); + this.__size = size; + this.__width = this.__height = this.__size; + this.__optimizeForRenderToTexture = optimizeForRenderToTexture; + this.__streamingLevels = streamingLevels; + this.__textureTarget = this.__context.gl.TEXTURE_CUBE_MAP; + this.__uploadedSides = 0; +}; +$hxClasses["openfl.display3D.textures.CubeTexture"] = openfl_display3D_textures_CubeTexture; +openfl_display3D_textures_CubeTexture.__name__ = "openfl.display3D.textures.CubeTexture"; +openfl_display3D_textures_CubeTexture.__super__ = openfl_display3D_textures_TextureBase; +openfl_display3D_textures_CubeTexture.prototype = $extend(openfl_display3D_textures_TextureBase.prototype,{ + uploadCompressedTextureFromByteArray: function(data,byteArrayOffset,async) { + if(async == null) { + async = false; + } + var _gthis = this; + if(!async) { + this.__uploadCompressedTextureFromByteArray(data,byteArrayOffset); + } else { + haxe_Timer.delay(function() { + _gthis.__uploadCompressedTextureFromByteArray(data,byteArrayOffset); + var event = null; + event = new openfl_events_Event("textureReady"); + _gthis.dispatchEvent(event); + },1); + } + } + ,uploadFromBitmapData: function(source,side,miplevel,generateMipmap) { + if(generateMipmap == null) { + generateMipmap = false; + } + if(miplevel == null) { + miplevel = 0; + } + if(source == null) { + return; + } + var size = this.__size >> miplevel; + if(size == 0) { + return; + } + var image = this.__getImage(source); + if(image == null) { + return; + } + if(miplevel == 0 && image.buffer != null && image.buffer.data == null && image.buffer.get_src() != null) { + var gl = this.__context.gl; + var size = this.__size >> miplevel; + if(size == 0) { + return; + } + var target = this.__sideToTarget(side); + this.__context.__bindGLTextureCubeMap(this.__textureID); + lime_graphics_WebGLRenderContext.texImage2D(gl,target,miplevel,this.__internalFormat,this.__format,gl.UNSIGNED_BYTE,image.buffer.get_src()); + this.__context.__bindGLTextureCubeMap(null); + this.__uploadedSides |= 1 << side; + return; + } + this.uploadFromTypedArray(image.get_data(),side,miplevel); + } + ,uploadFromByteArray: function(data,byteArrayOffset,side,miplevel) { + if(miplevel == null) { + miplevel = 0; + } + if(byteArrayOffset == 0) { + this.uploadFromTypedArray(data.b,side,miplevel); + return; + } + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = openfl_utils_ByteArray.toArrayBuffer(data); + var byteoffset = byteArrayOffset; + var len = null; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,byteoffset); + } else { + this1 = new Uint8Array(buffer,byteoffset,len); + } + } else { + this1 = null; + } + this.uploadFromTypedArray(this1,side,miplevel); + } + ,uploadFromTypedArray: function(data,side,miplevel) { + if(miplevel == null) { + miplevel = 0; + } + if(data == null) { + return; + } + var gl = this.__context.gl; + var size = this.__size >> miplevel; + if(size == 0) { + return; + } + var target = this.__sideToTarget(side); + this.__context.__bindGLTextureCubeMap(this.__textureID); + lime_graphics_WebGLRenderContext.texImage2D(gl,target,miplevel,this.__internalFormat,size,size,0,this.__format,gl.UNSIGNED_BYTE,data); + this.__context.__bindGLTextureCubeMap(null); + this.__uploadedSides |= 1 << side; + } + ,__getGLFramebuffer: function(enableDepthAndStencil,antiAlias,surfaceSelector) { + var gl = this.__context.gl; + if(this.__glFramebuffer == null) { + this.__glFramebuffer = gl.createFramebuffer(); + this.__framebufferSurface = -1; + } + if(this.__framebufferSurface != surfaceSelector) { + this.__framebufferSurface = surfaceSelector; + this.__context.__bindGLFramebuffer(this.__glFramebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER,gl.COLOR_ATTACHMENT0,gl.TEXTURE_CUBE_MAP_POSITIVE_X + surfaceSelector,this.__textureID,0); + if(this.__context.__enableErrorChecking) { + var code = gl.checkFramebufferStatus(gl.FRAMEBUFFER); + if(code != gl.FRAMEBUFFER_COMPLETE) { + lime_utils_Log.error("Error: Context3D.setRenderToTexture status:" + code + " width:" + this.__width + " height:" + this.__height,{ fileName : "openfl/display3D/textures/CubeTexture.hx", lineNumber : 279, className : "openfl.display3D.textures.CubeTexture", methodName : "__getGLFramebuffer"}); + } + } + } + return openfl_display3D_textures_TextureBase.prototype.__getGLFramebuffer.call(this,enableDepthAndStencil,antiAlias,surfaceSelector); + } + ,__setSamplerState: function(state) { + if(openfl_display3D_textures_TextureBase.prototype.__setSamplerState.call(this,state)) { + var gl = this.__context.gl; + if(state.mipfilter != 2 && !this.__samplerState.mipmapGenerated) { + gl.generateMipmap(gl.TEXTURE_CUBE_MAP); + this.__samplerState.mipmapGenerated = true; + } + if(openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy != 0) { + var aniso; + switch(state.filter) { + case 0: + aniso = 16; + break; + case 1: + aniso = 2; + break; + case 2: + aniso = 4; + break; + case 3: + aniso = 8; + break; + default: + aniso = 1; + } + if(aniso > openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy) { + aniso = openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy; + } + gl.texParameterf(gl.TEXTURE_CUBE_MAP,openfl_display3D_Context3D.__glTextureMaxAnisotropy,aniso); + } + return true; + } + return false; + } + ,__sideToTarget: function(side) { + var gl = this.__context.gl; + switch(side) { + case 0: + return gl.TEXTURE_CUBE_MAP_POSITIVE_X; + case 1: + return gl.TEXTURE_CUBE_MAP_NEGATIVE_X; + case 2: + return gl.TEXTURE_CUBE_MAP_POSITIVE_Y; + case 3: + return gl.TEXTURE_CUBE_MAP_NEGATIVE_Y; + case 4: + return gl.TEXTURE_CUBE_MAP_POSITIVE_Z; + case 5: + return gl.TEXTURE_CUBE_MAP_NEGATIVE_Z; + default: + throw new openfl_errors_IllegalOperationError(); + } + } + ,__uploadCompressedTextureFromByteArray: function(data,byteArrayOffset) { + var _gthis = this; + var reader = new openfl_display3D__$internal_ATFReader(data,byteArrayOffset); + var alpha = reader.readHeader(this.__size,this.__size,true); + var gl = this.__context.gl; + this.__context.__bindGLTextureCubeMap(this.__textureID); + var hasTexture = false; + reader.readTextures(function(side,level,gpuFormat,width,height,blockLength,bytes) { + var format = alpha ? openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[gpuFormat] : openfl_display3D_textures_TextureBase.__compressedFormats.h[gpuFormat]; + if(format == 0) { + return; + } + hasTexture = true; + var target = _gthis.__sideToTarget(side); + _gthis.__format = format; + _gthis.__internalFormat = format; + if(alpha && gpuFormat == 2) { + var size = blockLength / 2 | 0; + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytes.b.buffer; + var byteoffset = 0; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(size == null) { + this1 = new Uint8Array(buffer,byteoffset); + } else { + this1 = new Uint8Array(buffer,byteoffset,size); + } + } else { + this1 = null; + } + lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,target,level,_gthis.__internalFormat,width,height,0,this1); + var alphaTexture = new openfl_display3D_textures_CubeTexture(_gthis.__context,_gthis.__size,3,_gthis.__optimizeForRenderToTexture,_gthis.__streamingLevels); + alphaTexture.__format = format; + alphaTexture.__internalFormat = format; + _gthis.__context.__bindGLTextureCubeMap(alphaTexture.__textureID); + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytes.b.buffer; + var byteoffset = size; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(size == null) { + this1 = new Uint8Array(buffer,byteoffset); + } else { + this1 = new Uint8Array(buffer,byteoffset,size); + } + } else { + this1 = null; + } + lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,target,level,alphaTexture.__internalFormat,width,height,0,this1); + _gthis.__alphaTexture = alphaTexture; + } else { + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytes.b.buffer; + var byteoffset = 0; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(blockLength == null) { + this1 = new Uint8Array(buffer,byteoffset); + } else { + this1 = new Uint8Array(buffer,byteoffset,blockLength); + } + } else { + this1 = null; + } + lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,target,level,_gthis.__internalFormat,width,height,0,this1); + } + }); + if(!hasTexture) { + var elements = this.__size * this.__size * 4; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,0); + } else { + this1 = new Uint8Array(buffer,0,len); + } + } else { + this1 = null; + } + var data = this1; + lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(0),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data); + var elements = this.__size * this.__size * 4; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,0); + } else { + this1 = new Uint8Array(buffer,0,len); + } + } else { + this1 = null; + } + var data = this1; + lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(1),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data); + var elements = this.__size * this.__size * 4; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,0); + } else { + this1 = new Uint8Array(buffer,0,len); + } + } else { + this1 = null; + } + var data = this1; + lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(2),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data); + var elements = this.__size * this.__size * 4; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,0); + } else { + this1 = new Uint8Array(buffer,0,len); + } + } else { + this1 = null; + } + var data = this1; + lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(3),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data); + var elements = this.__size * this.__size * 4; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,0); + } else { + this1 = new Uint8Array(buffer,0,len); + } + } else { + this1 = null; + } + var data = this1; + lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(4),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data); + var elements = this.__size * this.__size * 4; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,0); + } else { + this1 = new Uint8Array(buffer,0,len); + } + } else { + this1 = null; + } + var data = this1; + lime_graphics_WebGLRenderContext.texImage2D(gl,this.__sideToTarget(5),0,this.__internalFormat,this.__size,this.__size,0,this.__format,gl.UNSIGNED_BYTE,data); + } + this.__context.__bindGLTextureCubeMap(null); + } + ,__class__: openfl_display3D_textures_CubeTexture +}); +var openfl_display3D_textures_RectangleTexture = function(context,width,height,format,optimizeForRenderToTexture) { + openfl_display3D_textures_TextureBase.call(this,context); + this.__width = width; + this.__height = height; + this.__optimizeForRenderToTexture = optimizeForRenderToTexture; + this.__textureTarget = this.__context.gl.TEXTURE_2D; + this.uploadFromTypedArray(null); + if(optimizeForRenderToTexture) { + this.__getGLFramebuffer(true,0,0); + } +}; +$hxClasses["openfl.display3D.textures.RectangleTexture"] = openfl_display3D_textures_RectangleTexture; +openfl_display3D_textures_RectangleTexture.__name__ = "openfl.display3D.textures.RectangleTexture"; +openfl_display3D_textures_RectangleTexture.__super__ = openfl_display3D_textures_TextureBase; +openfl_display3D_textures_RectangleTexture.prototype = $extend(openfl_display3D_textures_TextureBase.prototype,{ + uploadFromBitmapData: function(source) { + if(source == null) { + return; + } + var image = this.__getImage(source); + if(image == null) { + return; + } + if(image.buffer != null && image.buffer.data == null && image.buffer.get_src() != null) { + var gl = this.__context.gl; + this.__context.__bindGLTexture2D(this.__textureID); + lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,0,this.__internalFormat,this.__format,gl.UNSIGNED_BYTE,image.buffer.get_src()); + this.__context.__bindGLTexture2D(null); + return; + } + this.uploadFromTypedArray(image.get_data()); + } + ,uploadFromByteArray: function(data,byteArrayOffset) { + if(byteArrayOffset == 0) { + this.uploadFromTypedArray(data.b); + return; + } + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = openfl_utils_ByteArray.toArrayBuffer(data); + var byteoffset = byteArrayOffset; + var len = null; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,byteoffset); + } else { + this1 = new Uint8Array(buffer,byteoffset,len); + } + } else { + this1 = null; + } + this.uploadFromTypedArray(this1); + } + ,uploadFromTypedArray: function(data) { + var gl = this.__context.gl; + this.__context.__bindGLTexture2D(this.__textureID); + lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,0,this.__internalFormat,this.__width,this.__height,0,this.__format,gl.UNSIGNED_BYTE,data); + this.__context.__bindGLTexture2D(null); + } + ,__setSamplerState: function(state) { + if(openfl_display3D_textures_TextureBase.prototype.__setSamplerState.call(this,state)) { + var gl = this.__context.gl; + if(openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy != 0) { + var aniso; + switch(state.filter) { + case 0: + aniso = 16; + break; + case 1: + aniso = 2; + break; + case 2: + aniso = 4; + break; + case 3: + aniso = 8; + break; + default: + aniso = 1; + } + if(aniso > openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy) { + aniso = openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy; + } + gl.texParameterf(gl.TEXTURE_2D,openfl_display3D_Context3D.__glTextureMaxAnisotropy,aniso); + } + return true; + } + return false; + } + ,__class__: openfl_display3D_textures_RectangleTexture +}); +var openfl_display3D_textures_Texture = function(context,width,height,format,optimizeForRenderToTexture,streamingLevels) { + openfl_display3D_textures_TextureBase.call(this,context); + this.__width = width; + this.__height = height; + this.__optimizeForRenderToTexture = optimizeForRenderToTexture; + this.__streamingLevels = streamingLevels; + var gl = this.__context.gl; + this.__textureTarget = gl.TEXTURE_2D; + this.__context.__bindGLTexture2D(this.__textureID); + lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,0,this.__internalFormat,this.__width,this.__height,0,this.__format,gl.UNSIGNED_BYTE,null); + this.__context.__bindGLTexture2D(null); + if(optimizeForRenderToTexture) { + this.__getGLFramebuffer(true,0,0); + } +}; +$hxClasses["openfl.display3D.textures.Texture"] = openfl_display3D_textures_Texture; +openfl_display3D_textures_Texture.__name__ = "openfl.display3D.textures.Texture"; +openfl_display3D_textures_Texture.__super__ = openfl_display3D_textures_TextureBase; +openfl_display3D_textures_Texture.prototype = $extend(openfl_display3D_textures_TextureBase.prototype,{ + uploadCompressedTextureFromByteArray: function(data,byteArrayOffset,async) { + if(async == null) { + async = false; + } + var _gthis = this; + if(!async) { + this.__uploadCompressedTextureFromByteArray(data,byteArrayOffset); + } else { + haxe_Timer.delay(function() { + _gthis.__uploadCompressedTextureFromByteArray(data,byteArrayOffset); + var event = null; + event = new openfl_events_Event("textureReady"); + _gthis.dispatchEvent(event); + },1); + } + } + ,uploadFromBitmapData: function(source,miplevel,generateMipmap) { + if(generateMipmap == null) { + generateMipmap = false; + } + if(miplevel == null) { + miplevel = 0; + } + if(source == null) { + return; + } + var width = this.__width >> miplevel; + var height = this.__height >> miplevel; + if(width == 0 && height == 0) { + return; + } + if(width == 0) { + width = 1; + } + if(height == 0) { + height = 1; + } + if(source.width != width || source.height != height) { + var copy = new openfl_display_BitmapData(width,height,true,0); + copy.draw(source); + source = copy; + } + var image = this.__getImage(source); + if(image == null) { + return; + } + if(miplevel == 0 && image.buffer != null && image.buffer.data == null && image.buffer.get_src() != null) { + var gl = this.__context.gl; + var width = this.__width >> miplevel; + var height = this.__height >> miplevel; + if(width == 0 && height == 0) { + return; + } + if(width == 0) { + width = 1; + } + if(height == 0) { + height = 1; + } + this.__context.__bindGLTexture2D(this.__textureID); + lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,miplevel,this.__internalFormat,this.__format,gl.UNSIGNED_BYTE,image.buffer.get_src()); + this.__context.__bindGLTexture2D(null); + return; + } + this.uploadFromTypedArray(image.get_data(),miplevel); + } + ,uploadFromByteArray: function(data,byteArrayOffset,miplevel) { + if(miplevel == null) { + miplevel = 0; + } + if(byteArrayOffset == 0) { + this.uploadFromTypedArray(data.b,miplevel); + return; + } + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = openfl_utils_ByteArray.toArrayBuffer(data); + var byteoffset = byteArrayOffset; + var len = null; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,byteoffset); + } else { + this1 = new Uint8Array(buffer,byteoffset,len); + } + } else { + this1 = null; + } + this.uploadFromTypedArray(this1,miplevel); + } + ,uploadFromTypedArray: function(data,miplevel) { + if(miplevel == null) { + miplevel = 0; + } + if(data == null) { + return; + } + var gl = this.__context.gl; + var width = this.__width >> miplevel; + var height = this.__height >> miplevel; + if(width == 0 && height == 0) { + return; + } + if(width == 0) { + width = 1; + } + if(height == 0) { + height = 1; + } + this.__context.__bindGLTexture2D(this.__textureID); + lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,miplevel,this.__internalFormat,width,height,0,this.__format,gl.UNSIGNED_BYTE,data); + this.__context.__bindGLTexture2D(null); + } + ,__setSamplerState: function(state) { + if(openfl_display3D_textures_TextureBase.prototype.__setSamplerState.call(this,state)) { + var gl = this.__context.gl; + if(state.mipfilter != 2 && !this.__samplerState.mipmapGenerated) { + gl.generateMipmap(gl.TEXTURE_2D); + this.__samplerState.mipmapGenerated = true; + } + if(openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy != 0) { + var aniso; + switch(state.filter) { + case 0: + aniso = 16; + break; + case 1: + aniso = 2; + break; + case 2: + aniso = 4; + break; + case 3: + aniso = 8; + break; + default: + aniso = 1; + } + if(aniso > openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy) { + aniso = openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy; + } + gl.texParameterf(gl.TEXTURE_2D,openfl_display3D_Context3D.__glTextureMaxAnisotropy,aniso); + } + return true; + } + return false; + } + ,__uploadCompressedTextureFromByteArray: function(data,byteArrayOffset) { + var _gthis = this; + var reader = new openfl_display3D__$internal_ATFReader(data,byteArrayOffset); + var alpha = reader.readHeader(this.__width,this.__height,false); + var context = this.__context; + var gl = context.gl; + this.__context.__bindGLTexture2D(this.__textureID); + var hasTexture = false; + reader.readTextures(function(target,level,gpuFormat,width,height,blockLength,bytes) { + var format = alpha ? openfl_display3D_textures_TextureBase.__compressedFormatsAlpha.h[gpuFormat] : openfl_display3D_textures_TextureBase.__compressedFormats.h[gpuFormat]; + if(format == 0) { + return; + } + hasTexture = true; + _gthis.__format = format; + _gthis.__internalFormat = format; + if(alpha && gpuFormat == 2) { + var size = blockLength / 2 | 0; + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytes.b.buffer; + var byteoffset = 0; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(size == null) { + this1 = new Uint8Array(buffer,byteoffset); + } else { + this1 = new Uint8Array(buffer,byteoffset,size); + } + } else { + this1 = null; + } + lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,_gthis.__textureTarget,level,_gthis.__internalFormat,width,height,0,this1); + var alphaTexture = new openfl_display3D_textures_Texture(_gthis.__context,_gthis.__width,_gthis.__height,3,_gthis.__optimizeForRenderToTexture,_gthis.__streamingLevels); + alphaTexture.__format = format; + alphaTexture.__internalFormat = format; + _gthis.__context.__bindGLTexture2D(alphaTexture.__textureID); + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytes.b.buffer; + var byteoffset = size; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(size == null) { + this1 = new Uint8Array(buffer,byteoffset); + } else { + this1 = new Uint8Array(buffer,byteoffset,size); + } + } else { + this1 = null; + } + lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,alphaTexture.__textureTarget,level,alphaTexture.__internalFormat,width,height,0,this1); + _gthis.__alphaTexture = alphaTexture; + } else { + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = bytes.b.buffer; + var byteoffset = 0; + if(byteoffset == null) { + byteoffset = 0; + } + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(blockLength == null) { + this1 = new Uint8Array(buffer,byteoffset); + } else { + this1 = new Uint8Array(buffer,byteoffset,blockLength); + } + } else { + this1 = null; + } + lime_graphics_WebGLRenderContext.compressedTexImage2D(gl,_gthis.__textureTarget,level,_gthis.__internalFormat,width,height,0,this1); + } + }); + if(!hasTexture) { + var elements = this.__width * this.__height * 4; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,0); + } else { + this1 = new Uint8Array(buffer,0,len); + } + } else { + this1 = null; + } + var data = this1; + lime_graphics_WebGLRenderContext.texImage2D(gl,this.__textureTarget,0,this.__internalFormat,this.__width,this.__height,0,this.__format,gl.UNSIGNED_BYTE,data); + } + this.__context.__bindGLTexture2D(null); + } + ,__class__: openfl_display3D_textures_Texture +}); +var openfl_display3D_textures_VideoTexture = function(context) { + openfl_display3D_textures_TextureBase.call(this,context); + this.__textureTarget = this.__context.gl.TEXTURE_2D; +}; +$hxClasses["openfl.display3D.textures.VideoTexture"] = openfl_display3D_textures_VideoTexture; +openfl_display3D_textures_VideoTexture.__name__ = "openfl.display3D.textures.VideoTexture"; +openfl_display3D_textures_VideoTexture.__super__ = openfl_display3D_textures_TextureBase; +openfl_display3D_textures_VideoTexture.prototype = $extend(openfl_display3D_textures_TextureBase.prototype,{ + attachNetStream: function(netStream) { + var _gthis = this; + if(this.__netStream != null) { + this.__netStream.__video.removeEventListener("canplay",$bind(this,this.__onCanPlay),false); + } + this.__cacheTime = -1; + this.__netStream = netStream; + if(this.__netStream != null) { + if(this.__netStream.__video.readyState >= 2) { + haxe_Timer.delay(function() { + _gthis.__textureReady(); + },0); + } else { + this.__netStream.__video.addEventListener("canplay",$bind(this,this.__onCanPlay),false); + } + } + } + ,dispose: function() { + if(this.__netStream != null && this.__netStream.__video != null) { + this.__netStream.__video.removeEventListener("timeupdate",$bind(this,this.__onTimeUpdate)); + } + openfl_display3D_textures_TextureBase.prototype.dispose.call(this); + } + ,__onCanPlay: function(_) { + this.__netStream.__video.addEventListener("timeupdate",$bind(this,this.__onTimeUpdate)); + this.__textureReady(); + } + ,__onTimeUpdate: function(_) { + if(this.__netStream != null && this.__netStream.__video.currentTime != this.__cacheTime && this.__netStream.__video.readyState >= 2) { + this.__textureReady(); + } + } + ,__getTexture: function() { + if(this.__netStream.__video.currentTime != this.__cacheTime && this.__netStream.__video.readyState >= 2) { + var gl = this.__context.gl; + this.__context.__bindGLTexture2D(this.__textureID); + lime_graphics_WebGLRenderContext.texImage2D(gl,gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,this.__netStream.__video); + this.__cacheTime = this.__netStream.__video.currentTime; + } + return this.__textureID; + } + ,__textureReady: function() { + this.videoWidth = this.__netStream.__video.videoWidth; + this.videoHeight = this.__netStream.__video.videoHeight; + var event = null; + event = new openfl_events_Event("textureReady"); + this.dispatchEvent(event); + } + ,__class__: openfl_display3D_textures_VideoTexture +}); +var openfl_errors_Error = function(message,id) { + if(id == null) { + id = 0; + } + if(message == null) { + message = ""; + } + haxe_Exception.call(this,message); + this.errorID = id; + this.name = "Error"; + this.__skipStack++; +}; +$hxClasses["openfl.errors.Error"] = openfl_errors_Error; +openfl_errors_Error.__name__ = "openfl.errors.Error"; +openfl_errors_Error.__super__ = haxe_Exception; +openfl_errors_Error.prototype = $extend(haxe_Exception.prototype,{ + getStackTrace: function() { + return haxe_CallStack.toString(haxe_CallStack.exceptionStack()); + } + ,toString: function() { + if(this.get_message() != null) { + return this.get_message(); + } else { + return "Error"; + } + } + ,__class__: openfl_errors_Error +}); +var openfl_errors_ArgumentError = function(message) { + if(message == null) { + message = ""; + } + openfl_errors_Error.call(this,message); + this.name = "ArgumentError"; + this.__skipStack++; +}; +$hxClasses["openfl.errors.ArgumentError"] = openfl_errors_ArgumentError; +openfl_errors_ArgumentError.__name__ = "openfl.errors.ArgumentError"; +openfl_errors_ArgumentError.__super__ = openfl_errors_Error; +openfl_errors_ArgumentError.prototype = $extend(openfl_errors_Error.prototype,{ + __class__: openfl_errors_ArgumentError +}); +var openfl_errors_IOError = function(message) { + if(message == null) { + message = ""; + } + openfl_errors_Error.call(this,message); + this.name = "IOError"; + this.__skipStack++; +}; +$hxClasses["openfl.errors.IOError"] = openfl_errors_IOError; +openfl_errors_IOError.__name__ = "openfl.errors.IOError"; +openfl_errors_IOError.__super__ = openfl_errors_Error; +openfl_errors_IOError.prototype = $extend(openfl_errors_Error.prototype,{ + __class__: openfl_errors_IOError +}); +var openfl_errors_EOFError = function(message,id) { + if(id == null) { + id = 0; + } + openfl_errors_IOError.call(this,"End of file was encountered"); + this.name = "EOFError"; + this.errorID = 2030; + this.__skipStack++; +}; +$hxClasses["openfl.errors.EOFError"] = openfl_errors_EOFError; +openfl_errors_EOFError.__name__ = "openfl.errors.EOFError"; +openfl_errors_EOFError.__super__ = openfl_errors_IOError; +openfl_errors_EOFError.prototype = $extend(openfl_errors_IOError.prototype,{ + __class__: openfl_errors_EOFError +}); +var openfl_errors_IllegalOperationError = function(message) { + if(message == null) { + message = ""; + } + openfl_errors_Error.call(this,message,0); + this.name = "IllegalOperationError"; + this.__skipStack++; +}; +$hxClasses["openfl.errors.IllegalOperationError"] = openfl_errors_IllegalOperationError; +openfl_errors_IllegalOperationError.__name__ = "openfl.errors.IllegalOperationError"; +openfl_errors_IllegalOperationError.__super__ = openfl_errors_Error; +openfl_errors_IllegalOperationError.prototype = $extend(openfl_errors_Error.prototype,{ + __class__: openfl_errors_IllegalOperationError +}); +var openfl_errors_RangeError = function(message) { + if(message == null) { + message = ""; + } + openfl_errors_Error.call(this,message,0); + this.name = "RangeError"; + this.__skipStack++; +}; +$hxClasses["openfl.errors.RangeError"] = openfl_errors_RangeError; +openfl_errors_RangeError.__name__ = "openfl.errors.RangeError"; +openfl_errors_RangeError.__super__ = openfl_errors_Error; +openfl_errors_RangeError.prototype = $extend(openfl_errors_Error.prototype,{ + __class__: openfl_errors_RangeError +}); +var openfl_errors_TypeError = function(message) { + if(message == null) { + message = ""; + } + openfl_errors_Error.call(this,message,0); + this.name = "TypeError"; + this.__skipStack++; +}; +$hxClasses["openfl.errors.TypeError"] = openfl_errors_TypeError; +openfl_errors_TypeError.__name__ = "openfl.errors.TypeError"; +openfl_errors_TypeError.__super__ = openfl_errors_Error; +openfl_errors_TypeError.prototype = $extend(openfl_errors_Error.prototype,{ + __class__: openfl_errors_TypeError +}); +var openfl_events_ActivityEvent = function(type,bubbles,cancelable,activating) { + if(activating == null) { + activating = false; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_Event.call(this,type,bubbles,cancelable); + this.activating = activating; +}; +$hxClasses["openfl.events.ActivityEvent"] = openfl_events_ActivityEvent; +openfl_events_ActivityEvent.__name__ = "openfl.events.ActivityEvent"; +openfl_events_ActivityEvent.__super__ = openfl_events_Event; +openfl_events_ActivityEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var event = new openfl_events_ActivityEvent(this.type,this.bubbles,this.cancelable,this.activating); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("ActivityEvent",["type","bubbles","cancelable","activating"]); + } + ,__init: function() { + openfl_events_Event.prototype.__init.call(this); + this.activating = false; + } + ,__class__: openfl_events_ActivityEvent +}); +var openfl_events_TextEvent = function(type,bubbles,cancelable,text) { + if(text == null) { + text = ""; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_Event.call(this,type,bubbles,cancelable); + this.text = text; +}; +$hxClasses["openfl.events.TextEvent"] = openfl_events_TextEvent; +openfl_events_TextEvent.__name__ = "openfl.events.TextEvent"; +openfl_events_TextEvent.__super__ = openfl_events_Event; +openfl_events_TextEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var event = new openfl_events_TextEvent(this.type,this.bubbles,this.cancelable,this.text); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("TextEvent",["type","bubbles","cancelable","text"]); + } + ,__init: function() { + openfl_events_Event.prototype.__init.call(this); + this.text = ""; + } + ,__class__: openfl_events_TextEvent +}); +var openfl_events_ErrorEvent = function(type,bubbles,cancelable,text,id) { + if(id == null) { + id = 0; + } + if(text == null) { + text = ""; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_TextEvent.call(this,type,bubbles,cancelable,text); + this.errorID = id; +}; +$hxClasses["openfl.events.ErrorEvent"] = openfl_events_ErrorEvent; +openfl_events_ErrorEvent.__name__ = "openfl.events.ErrorEvent"; +openfl_events_ErrorEvent.__super__ = openfl_events_TextEvent; +openfl_events_ErrorEvent.prototype = $extend(openfl_events_TextEvent.prototype,{ + clone: function() { + var event = new openfl_events_ErrorEvent(this.type,this.bubbles,this.cancelable,this.text,this.errorID); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("ErrorEvent",["type","bubbles","cancelable","text","errorID"]); + } + ,__init: function() { + openfl_events_TextEvent.prototype.__init.call(this); + this.errorID = 0; + } + ,__class__: openfl_events_ErrorEvent +}); +var openfl_events__$EventDispatcher_DispatchIterator = function(list) { + this.active = false; + this.reset(list); +}; +$hxClasses["openfl.events._EventDispatcher.DispatchIterator"] = openfl_events__$EventDispatcher_DispatchIterator; +openfl_events__$EventDispatcher_DispatchIterator.__name__ = "openfl.events._EventDispatcher.DispatchIterator"; +openfl_events__$EventDispatcher_DispatchIterator.prototype = { + copy: function() { + if(!this.isCopy) { + this.list = this.list.slice(); + this.isCopy = true; + } + } + ,hasNext: function() { + return this.index < this.list.length; + } + ,next: function() { + return this.list[this.index++]; + } + ,remove: function(listener,listIndex) { + if(this.active) { + if(!this.isCopy) { + if(listIndex < this.index) { + this.index--; + } + } else { + var _g = this.index; + var _g1 = this.list.length; + while(_g < _g1) { + var i = _g++; + if(this.list[i] == listener) { + this.list.splice(i,1); + break; + } + } + } + } + } + ,reset: function(list) { + this.list = list; + this.isCopy = false; + this.index = 0; + } + ,start: function() { + this.active = true; + } + ,stop: function() { + this.active = false; + } + ,__class__: openfl_events__$EventDispatcher_DispatchIterator +}; +var openfl_events__$EventDispatcher_Listener = function(callback,useCapture,priority,useWeakReference) { + if(useWeakReference && openfl_events__$EventDispatcher_Listener.supportsWeakReference) { + this.weakRefCallback = new WeakRef(callback); + } else { + this.callback = callback; + } + this.useCapture = useCapture; + this.priority = priority; + this.useWeakReference = useWeakReference; +}; +$hxClasses["openfl.events._EventDispatcher.Listener"] = openfl_events__$EventDispatcher_Listener; +openfl_events__$EventDispatcher_Listener.__name__ = "openfl.events._EventDispatcher.Listener"; +openfl_events__$EventDispatcher_Listener.prototype = { + match: function(callback,useCapture) { + var resolvedCallback = this.callback; + if(this.weakRefCallback != null) { + resolvedCallback = this.weakRefCallback.deref(); + if(resolvedCallback == null) { + return false; + } + } + if(resolvedCallback == callback) { + return this.useCapture == useCapture; + } else { + return false; + } + } + ,__class__: openfl_events__$EventDispatcher_Listener +}; +var openfl_events_EventType = {}; +openfl_events_EventType.equals = function(a,b) { + return a == b; +}; +openfl_events_EventType.notEquals = function(a,b) { + return a != b; +}; +var openfl_events_FocusEvent = function(type,bubbles,cancelable,relatedObject,shiftKey,keyCode) { + if(keyCode == null) { + keyCode = 0; + } + if(shiftKey == null) { + shiftKey = false; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_Event.call(this,type,bubbles,cancelable); + this.keyCode = keyCode; + this.shiftKey = shiftKey; + this.relatedObject = relatedObject; +}; +$hxClasses["openfl.events.FocusEvent"] = openfl_events_FocusEvent; +openfl_events_FocusEvent.__name__ = "openfl.events.FocusEvent"; +openfl_events_FocusEvent.__super__ = openfl_events_Event; +openfl_events_FocusEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var event = new openfl_events_FocusEvent(this.type,this.bubbles,this.cancelable,this.relatedObject,this.shiftKey,this.keyCode); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("FocusEvent",["type","bubbles","cancelable","relatedObject","shiftKey","keyCode"]); + } + ,__init: function() { + openfl_events_Event.prototype.__init.call(this); + this.keyCode = 0; + this.shiftKey = false; + this.relatedObject = null; + } + ,__class__: openfl_events_FocusEvent +}); +var openfl_events_FullScreenEvent = function(type,bubbles,cancelable,fullScreen,interactive) { + if(interactive == null) { + interactive = false; + } + if(fullScreen == null) { + fullScreen = false; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_ActivityEvent.call(this,type,bubbles,cancelable); + this.fullScreen = fullScreen; + this.interactive = interactive; +}; +$hxClasses["openfl.events.FullScreenEvent"] = openfl_events_FullScreenEvent; +openfl_events_FullScreenEvent.__name__ = "openfl.events.FullScreenEvent"; +openfl_events_FullScreenEvent.__super__ = openfl_events_ActivityEvent; +openfl_events_FullScreenEvent.prototype = $extend(openfl_events_ActivityEvent.prototype,{ + clone: function() { + var event = new openfl_events_FullScreenEvent(this.type,this.bubbles,this.cancelable,this.fullScreen,this.interactive); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("FullscreenEvent",["type","bubbles","cancelable","fullscreen","interactive"]); + } + ,__init: function() { + openfl_events_ActivityEvent.prototype.__init.call(this); + this.fullScreen = false; + this.interactive = false; + } + ,__class__: openfl_events_FullScreenEvent +}); +var openfl_events_GameInputEvent = function(type,bubbles,cancelable,device) { + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = true; + } + openfl_events_Event.call(this,type,bubbles,cancelable); + this.device = device; +}; +$hxClasses["openfl.events.GameInputEvent"] = openfl_events_GameInputEvent; +openfl_events_GameInputEvent.__name__ = "openfl.events.GameInputEvent"; +openfl_events_GameInputEvent.__super__ = openfl_events_Event; +openfl_events_GameInputEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var event = new openfl_events_GameInputEvent(this.type,this.bubbles,this.cancelable,this.device); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("GameInputEvent",["type","bubbles","cancelable","device"]); + } + ,__init: function() { + openfl_events_Event.prototype.__init.call(this); + this.bubbles = true; + this.device = null; + } + ,__class__: openfl_events_GameInputEvent +}); +var openfl_events_HTTPStatusEvent = function(type,bubbles,cancelable,status,redirected) { + if(redirected == null) { + redirected = false; + } + if(status == null) { + status = 0; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + this.responseHeaders = []; + this.status = status; + this.redirected = redirected; + openfl_events_Event.call(this,type,bubbles,cancelable); +}; +$hxClasses["openfl.events.HTTPStatusEvent"] = openfl_events_HTTPStatusEvent; +openfl_events_HTTPStatusEvent.__name__ = "openfl.events.HTTPStatusEvent"; +openfl_events_HTTPStatusEvent.__super__ = openfl_events_Event; +openfl_events_HTTPStatusEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var event = new openfl_events_HTTPStatusEvent(this.type,this.bubbles,this.cancelable,this.status,this.redirected); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("HTTPStatusEvent",["type","bubbles","cancelable","status","redirected"]); + } + ,__init: function() { + openfl_events_Event.prototype.__init.call(this); + this.status = 0; + this.redirected = false; + } + ,__class__: openfl_events_HTTPStatusEvent +}); +var openfl_events_IOErrorEvent = function(type,bubbles,cancelable,text,id) { + if(id == null) { + id = 0; + } + if(text == null) { + text = ""; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = true; + } + openfl_events_ErrorEvent.call(this,type,bubbles,cancelable,text,id); +}; +$hxClasses["openfl.events.IOErrorEvent"] = openfl_events_IOErrorEvent; +openfl_events_IOErrorEvent.__name__ = "openfl.events.IOErrorEvent"; +openfl_events_IOErrorEvent.__super__ = openfl_events_ErrorEvent; +openfl_events_IOErrorEvent.prototype = $extend(openfl_events_ErrorEvent.prototype,{ + clone: function() { + var event = new openfl_events_IOErrorEvent(this.type,this.bubbles,this.cancelable,this.text,this.errorID); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("IOErrorEvent",["type","bubbles","cancelable","text","errorID"]); + } + ,__class__: openfl_events_IOErrorEvent +}); +var openfl_events_KeyboardEvent = function(type,bubbles,cancelable,charCodeValue,keyCodeValue,keyLocationValue,ctrlKeyValue,altKeyValue,shiftKeyValue,controlKeyValue,commandKeyValue) { + if(commandKeyValue == null) { + commandKeyValue = false; + } + if(controlKeyValue == null) { + controlKeyValue = false; + } + if(shiftKeyValue == null) { + shiftKeyValue = false; + } + if(altKeyValue == null) { + altKeyValue = false; + } + if(ctrlKeyValue == null) { + ctrlKeyValue = false; + } + if(keyCodeValue == null) { + keyCodeValue = 0; + } + if(charCodeValue == null) { + charCodeValue = 0; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_Event.call(this,type,bubbles,cancelable); + this.charCode = charCodeValue; + this.keyCode = keyCodeValue; + this.keyLocation = keyLocationValue != null ? keyLocationValue : 0; + this.ctrlKey = ctrlKeyValue; + this.altKey = altKeyValue; + this.shiftKey = shiftKeyValue; + this.controlKey = controlKeyValue; + this.commandKey = commandKeyValue; + this.__updateAfterEventFlag = false; +}; +$hxClasses["openfl.events.KeyboardEvent"] = openfl_events_KeyboardEvent; +openfl_events_KeyboardEvent.__name__ = "openfl.events.KeyboardEvent"; +openfl_events_KeyboardEvent.__super__ = openfl_events_Event; +openfl_events_KeyboardEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var event = new openfl_events_KeyboardEvent(this.type,this.bubbles,this.cancelable,this.charCode,this.keyCode,this.keyLocation,this.ctrlKey,this.altKey,this.shiftKey,this.controlKey,this.commandKey); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("KeyboardEvent",["type","bubbles","cancelable","charCode","keyCode","keyLocation","ctrlKey","altKey","shiftKey"]); + } + ,updateAfterEvent: function() { + this.__updateAfterEventFlag = true; + } + ,__init: function() { + openfl_events_Event.prototype.__init.call(this); + this.charCode = 0; + this.keyCode = 0; + this.keyLocation = 0; + this.ctrlKey = false; + this.altKey = false; + this.shiftKey = false; + this.controlKey = false; + this.commandKey = false; + this.__updateAfterEventFlag = false; + } + ,__class__: openfl_events_KeyboardEvent +}); +var openfl_events_MouseEvent = function(type,bubbles,cancelable,localX,localY,relatedObject,ctrlKey,altKey,shiftKey,buttonDown,delta,commandKey,controlKey,clickCount) { + if(clickCount == null) { + clickCount = 0; + } + if(controlKey == null) { + controlKey = false; + } + if(commandKey == null) { + commandKey = false; + } + if(delta == null) { + delta = 0; + } + if(buttonDown == null) { + buttonDown = false; + } + if(shiftKey == null) { + shiftKey = false; + } + if(altKey == null) { + altKey = false; + } + if(ctrlKey == null) { + ctrlKey = false; + } + if(localY == null) { + localY = 0; + } + if(localX == null) { + localX = 0; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = true; + } + openfl_events_Event.call(this,type,bubbles,cancelable); + this.shiftKey = shiftKey; + this.altKey = altKey; + this.ctrlKey = ctrlKey; + this.bubbles = bubbles; + this.relatedObject = relatedObject; + this.delta = delta; + this.localX = localX; + this.localY = localY; + this.buttonDown = buttonDown; + this.commandKey = commandKey; + this.controlKey = controlKey; + this.clickCount = clickCount; + this.isRelatedObjectInaccessible = false; + this.stageX = NaN; + this.stageY = NaN; + this.__updateAfterEventFlag = false; +}; +$hxClasses["openfl.events.MouseEvent"] = openfl_events_MouseEvent; +openfl_events_MouseEvent.__name__ = "openfl.events.MouseEvent"; +openfl_events_MouseEvent.__create = function(type,button,clickCount,stageX,stageY,local,target,delta) { + if(delta == null) { + delta = 0; + } + var event = new openfl_events_MouseEvent(type,true,false,local.x,local.y,null,openfl_events_MouseEvent.__ctrlKey,openfl_events_MouseEvent.__altKey,openfl_events_MouseEvent.__shiftKey,openfl_events_MouseEvent.__buttonDown,delta,openfl_events_MouseEvent.__commandKey,openfl_events_MouseEvent.__controlKey,clickCount); + event.stageX = stageX; + event.stageY = stageY; + event.target = target; + return event; +}; +openfl_events_MouseEvent.__super__ = openfl_events_Event; +openfl_events_MouseEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var event = new openfl_events_MouseEvent(this.type,this.bubbles,this.cancelable,this.localX,this.localY,this.relatedObject,this.ctrlKey,this.altKey,this.shiftKey,this.buttonDown,this.delta,this.commandKey,this.controlKey,this.clickCount); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("MouseEvent",["type","bubbles","cancelable","localX","localY","relatedObject","ctrlKey","altKey","shiftKey","buttonDown","delta"]); + } + ,updateAfterEvent: function() { + this.__updateAfterEventFlag = true; + } + ,__init: function() { + openfl_events_Event.prototype.__init.call(this); + this.bubbles = true; + this.shiftKey = false; + this.altKey = false; + this.ctrlKey = false; + this.relatedObject = null; + this.delta = 0; + this.localX = 0; + this.localY = 0; + this.buttonDown = false; + this.commandKey = false; + this.controlKey = false; + this.clickCount = 0; + this.isRelatedObjectInaccessible = false; + this.stageX = NaN; + this.stageY = NaN; + this.__updateAfterEventFlag = false; + } + ,__class__: openfl_events_MouseEvent +}); +var openfl_events_NetStatusEvent = function(type,bubbles,cancelable,info) { + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + this.info = info; + openfl_events_Event.call(this,type,bubbles,cancelable); +}; +$hxClasses["openfl.events.NetStatusEvent"] = openfl_events_NetStatusEvent; +openfl_events_NetStatusEvent.__name__ = "openfl.events.NetStatusEvent"; +openfl_events_NetStatusEvent.__super__ = openfl_events_Event; +openfl_events_NetStatusEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var event = new openfl_events_NetStatusEvent(this.type,this.bubbles,this.cancelable,this.info); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("NetStatusEvent",["type","bubbles","cancelable","info"]); + } + ,__init: function() { + openfl_events_Event.prototype.__init.call(this); + this.info = null; + } + ,__class__: openfl_events_NetStatusEvent +}); +var openfl_events_ProgressEvent = function(type,bubbles,cancelable,bytesLoaded,bytesTotal) { + if(bytesTotal == null) { + bytesTotal = 0; + } + if(bytesLoaded == null) { + bytesLoaded = 0; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_Event.call(this,type,bubbles,cancelable); + this.bytesLoaded = bytesLoaded; + this.bytesTotal = bytesTotal; +}; +$hxClasses["openfl.events.ProgressEvent"] = openfl_events_ProgressEvent; +openfl_events_ProgressEvent.__name__ = "openfl.events.ProgressEvent"; +openfl_events_ProgressEvent.__super__ = openfl_events_Event; +openfl_events_ProgressEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var event = new openfl_events_ProgressEvent(this.type,this.bubbles,this.cancelable,this.bytesLoaded,this.bytesTotal); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("ProgressEvent",["type","bubbles","cancelable","bytesLoaded","bytesTotal"]); + } + ,__init: function() { + openfl_events_Event.prototype.__init.call(this); + this.bytesLoaded = 0; + this.bytesTotal = 0; + } + ,__class__: openfl_events_ProgressEvent +}); +var openfl_events_RenderEvent = function(type,bubbles,cancelable,objectMatrix,objectColorTransform,allowSmoothing) { + if(allowSmoothing == null) { + allowSmoothing = true; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_Event.call(this,type,bubbles,cancelable); + this.objectMatrix = objectMatrix; + this.objectColorTransform = objectColorTransform; + this.allowSmoothing = allowSmoothing; +}; +$hxClasses["openfl.events.RenderEvent"] = openfl_events_RenderEvent; +openfl_events_RenderEvent.__name__ = "openfl.events.RenderEvent"; +openfl_events_RenderEvent.__super__ = openfl_events_Event; +openfl_events_RenderEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var event = new openfl_events_RenderEvent(this.type,this.bubbles,this.cancelable,this.objectMatrix.clone(),this.objectColorTransform.__clone(),this.allowSmoothing); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("RenderEvent",["type","bubbles","cancelable"]); + } + ,__init: function() { + openfl_events_Event.prototype.__init.call(this); + this.objectMatrix = null; + this.objectColorTransform = null; + this.allowSmoothing = false; + this.renderer = null; + } + ,__class__: openfl_events_RenderEvent +}); +var openfl_events_SampleDataEvent = function(type,bubbles,cancelable) { + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_Event.call(this,type,bubbles,cancelable); + this.data = new openfl_utils_ByteArrayData(0); + this.data.__endian = 1; + this.position = 0.0; +}; +$hxClasses["openfl.events.SampleDataEvent"] = openfl_events_SampleDataEvent; +openfl_events_SampleDataEvent.__name__ = "openfl.events.SampleDataEvent"; +openfl_events_SampleDataEvent.__super__ = openfl_events_Event; +openfl_events_SampleDataEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var event = new openfl_events_SampleDataEvent(this.type,this.bubbles,this.cancelable); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + event.data = this.data; + event.position = this.position; + return event; + } + ,toString: function() { + return this.__formatToString("SampleDataEvent",["type","bubbles","cancelable"]); + } + ,__init: function() { + openfl_events_Event.prototype.__init.call(this); + this.data = new openfl_utils_ByteArrayData(0); + this.data.__endian = 1; + this.position = 0.0; + } + ,getBufferSize: function() { + var bufferSize = UInt.toFloat(openfl_utils_ByteArray.get_length(this.data)) / UInt.toFloat(4) / 2 | 0; + if(bufferSize > 0) { + if(bufferSize != 0 && (bufferSize & bufferSize - 1) == 0 && bufferSize >= 2048 && bufferSize <= 8192) { + this.tempBuffer = new Float32Array(bufferSize * 2); + return bufferSize; + } else { + throw new openfl_errors_Error("To be consistent with flash the listener function registered to SampleDataEvent has to provide 2048, 4096 or 8192 samples if targeting HTML5."); + } + } + return 0; + } + ,getSamples: function(event) { + this.data.position = 0; + this.tempBuffer = haxe_io_Float32Array.fromBytes(openfl_utils_ByteArray.toBytes(this.data)); + this.leftChannel = event.outputBuffer.getChannelData(0); + this.rightChannel = event.outputBuffer.getChannelData(1); + var pos = 0; + var bufferLength = UInt.toFloat(openfl_utils_ByteArray.get_length(this.data)) / UInt.toFloat(2) | 0; + var _g = 0; + var _g1 = bufferLength; + while(_g < _g1) { + var i = _g++; + this.leftChannel[i] = this.tempBuffer[pos++]; + this.rightChannel[i] = this.tempBuffer[pos++]; + } + } + ,__class__: openfl_events_SampleDataEvent +}); +var openfl_events_SecurityErrorEvent = function(type,bubbles,cancelable,text,id) { + if(id == null) { + id = 0; + } + if(text == null) { + text = ""; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = false; + } + openfl_events_ErrorEvent.call(this,type,bubbles,cancelable,text,id); +}; +$hxClasses["openfl.events.SecurityErrorEvent"] = openfl_events_SecurityErrorEvent; +openfl_events_SecurityErrorEvent.__name__ = "openfl.events.SecurityErrorEvent"; +openfl_events_SecurityErrorEvent.__super__ = openfl_events_ErrorEvent; +openfl_events_SecurityErrorEvent.prototype = $extend(openfl_events_ErrorEvent.prototype,{ + clone: function() { + var event = new openfl_events_SecurityErrorEvent(this.type,this.bubbles,this.cancelable,this.text,this.errorID); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("SecurityErrorEvent",["type","bubbles","cancelable","text","errorID"]); + } + ,__class__: openfl_events_SecurityErrorEvent +}); +var openfl_events_TouchEvent = function(type,bubbles,cancelable,touchPointID,isPrimaryTouchPoint,localX,localY,sizeX,sizeY,pressure,relatedObject,ctrlKey,altKey,shiftKey,commandKey,controlKey,timestamp,touchIntent,samples,isTouchPointCanceled) { + if(isTouchPointCanceled == null) { + isTouchPointCanceled = false; + } + if(timestamp == null) { + timestamp = 0; + } + if(controlKey == null) { + controlKey = false; + } + if(commandKey == null) { + commandKey = false; + } + if(shiftKey == null) { + shiftKey = false; + } + if(altKey == null) { + altKey = false; + } + if(ctrlKey == null) { + ctrlKey = false; + } + if(pressure == null) { + pressure = 0; + } + if(sizeY == null) { + sizeY = 0; + } + if(sizeX == null) { + sizeX = 0; + } + if(localY == null) { + localY = 0; + } + if(localX == null) { + localX = 0; + } + if(isPrimaryTouchPoint == null) { + isPrimaryTouchPoint = false; + } + if(touchPointID == null) { + touchPointID = 0; + } + if(cancelable == null) { + cancelable = false; + } + if(bubbles == null) { + bubbles = true; + } + openfl_events_Event.call(this,type,bubbles,cancelable); + this.touchPointID = touchPointID; + this.isPrimaryTouchPoint = isPrimaryTouchPoint; + this.localX = localX; + this.localY = localY; + this.sizeX = sizeX; + this.sizeY = sizeY; + this.pressure = pressure; + this.relatedObject = relatedObject; + this.ctrlKey = ctrlKey; + this.altKey = altKey; + this.shiftKey = shiftKey; + this.commandKey = commandKey; + this.controlKey = controlKey; + this.stageX = NaN; + this.stageY = NaN; + this.__updateAfterEventFlag = false; +}; +$hxClasses["openfl.events.TouchEvent"] = openfl_events_TouchEvent; +openfl_events_TouchEvent.__name__ = "openfl.events.TouchEvent"; +openfl_events_TouchEvent.__create = function(type,touch,stageX,stageY,local,target) { + var evt = new openfl_events_TouchEvent(type,true,false,0,true,local.x,local.y,1,1,1); + evt.stageX = stageX; + evt.stageY = stageY; + evt.target = target; + return evt; +}; +openfl_events_TouchEvent.__super__ = openfl_events_Event; +openfl_events_TouchEvent.prototype = $extend(openfl_events_Event.prototype,{ + clone: function() { + var event = new openfl_events_TouchEvent(this.type,this.bubbles,this.cancelable,this.touchPointID,this.isPrimaryTouchPoint,this.localX,this.localY,this.sizeX,this.sizeY,this.pressure,this.relatedObject,this.ctrlKey,this.altKey,this.shiftKey,this.commandKey,this.controlKey); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("TouchEvent",["type","bubbles","cancelable","touchPointID","isPrimaryTouchPoint","localX","localY","sizeX","sizeY","pressure","relatedObject","ctrlKey","altKey","shiftKey","commandKey","controlKey"]); + } + ,updateAfterEvent: function() { + this.__updateAfterEventFlag = true; + } + ,__init: function() { + openfl_events_Event.prototype.__init.call(this); + this.bubbles = true; + this.touchPointID = 0; + this.isPrimaryTouchPoint = false; + this.localX = 0; + this.localY = 0; + this.sizeX = 0; + this.sizeY = 0; + this.pressure = 0; + this.relatedObject = null; + this.ctrlKey = false; + this.altKey = false; + this.shiftKey = false; + this.commandKey = false; + this.controlKey = false; + this.stageX = NaN; + this.stageY = NaN; + this.__updateAfterEventFlag = false; + } + ,__class__: openfl_events_TouchEvent +}); +var openfl_events_UncaughtErrorEvent = function(type,bubbles,cancelable,error) { + if(cancelable == null) { + cancelable = true; + } + if(bubbles == null) { + bubbles = true; + } + openfl_events_ErrorEvent.call(this,type,bubbles,cancelable); + this.error = error; +}; +$hxClasses["openfl.events.UncaughtErrorEvent"] = openfl_events_UncaughtErrorEvent; +openfl_events_UncaughtErrorEvent.__name__ = "openfl.events.UncaughtErrorEvent"; +openfl_events_UncaughtErrorEvent.__super__ = openfl_events_ErrorEvent; +openfl_events_UncaughtErrorEvent.prototype = $extend(openfl_events_ErrorEvent.prototype,{ + clone: function() { + var event = new openfl_events_UncaughtErrorEvent(this.type,this.bubbles,this.cancelable,this.error); + event.target = this.target; + event.currentTarget = this.currentTarget; + event.eventPhase = this.eventPhase; + return event; + } + ,toString: function() { + return this.__formatToString("UncaughtErrorEvent",["type","bubbles","cancelable","error"]); + } + ,__init: function() { + openfl_events_ErrorEvent.prototype.__init.call(this); + this.bubbles = true; + this.cancelable = true; + this.error = null; + } + ,__class__: openfl_events_UncaughtErrorEvent +}); +var openfl_events_UncaughtErrorEvents = function() { + this.__enabled = true; + openfl_events_EventDispatcher.call(this); +}; +$hxClasses["openfl.events.UncaughtErrorEvents"] = openfl_events_UncaughtErrorEvents; +openfl_events_UncaughtErrorEvents.__name__ = "openfl.events.UncaughtErrorEvents"; +openfl_events_UncaughtErrorEvents.__super__ = openfl_events_EventDispatcher; +openfl_events_UncaughtErrorEvents.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + addEventListener: function(type,listener,useCapture,priority,useWeakReference) { + if(useWeakReference == null) { + useWeakReference = false; + } + if(priority == null) { + priority = 0; + } + if(useCapture == null) { + useCapture = false; + } + openfl_events_EventDispatcher.prototype.addEventListener.call(this,type,listener,useCapture,priority,useWeakReference); + if(Object.prototype.hasOwnProperty.call(this.__eventMap.h,"uncaughtError")) { + this.__enabled = true; + } + } + ,removeEventListener: function(type,listener,useCapture) { + if(useCapture == null) { + useCapture = false; + } + openfl_events_EventDispatcher.prototype.removeEventListener.call(this,type,listener,useCapture); + if(!Object.prototype.hasOwnProperty.call(this.__eventMap.h,"uncaughtError")) { + this.__enabled = false; + } + } + ,__class__: openfl_events_UncaughtErrorEvents +}); +var openfl_filters_BitmapFilter = function() { + this.__bottomExtension = 0; + this.__leftExtension = 0; + this.__needSecondBitmapData = true; + this.__numShaderPasses = 0; + this.__preserveObject = false; + this.__rightExtension = 0; + this.__shaderBlendMode = 10; + this.__topExtension = 0; + this.__smooth = true; +}; +$hxClasses["openfl.filters.BitmapFilter"] = openfl_filters_BitmapFilter; +openfl_filters_BitmapFilter.__name__ = "openfl.filters.BitmapFilter"; +openfl_filters_BitmapFilter.prototype = { + clone: function() { + return new openfl_filters_BitmapFilter(); + } + ,__applyFilter: function(bitmapData,sourceBitmapData,sourceRect,destPoint) { + return sourceBitmapData; + } + ,__initShader: function(renderer,pass,sourceBitmapData) { + return null; + } + ,__class__: openfl_filters_BitmapFilter +}; +var openfl_filters_ShaderFilter = function(shader) { + this.blendMode = 10; + openfl_filters_BitmapFilter.call(this); + this.shader = shader; + this.__numShaderPasses = 1; +}; +$hxClasses["openfl.filters.ShaderFilter"] = openfl_filters_ShaderFilter; +openfl_filters_ShaderFilter.__name__ = "openfl.filters.ShaderFilter"; +openfl_filters_ShaderFilter.__super__ = openfl_filters_BitmapFilter; +openfl_filters_ShaderFilter.prototype = $extend(openfl_filters_BitmapFilter.prototype,{ + clone: function() { + var filter = new openfl_filters_ShaderFilter(this.shader); + filter.set_bottomExtension(this.get_bottomExtension()); + filter.set_leftExtension(this.get_leftExtension()); + filter.set_rightExtension(this.get_rightExtension()); + filter.set_topExtension(this.get_topExtension()); + filter.blendMode = this.blendMode; + return filter; + } + ,invalidate: function() { + this.__renderDirty = true; + } + ,get_topExtension: function() { + return this.__topExtension; + } + ,set_topExtension: function(value) { + this.__topExtension = value; + return this.__topExtension; + } + ,get_bottomExtension: function() { + return this.__bottomExtension; + } + ,set_bottomExtension: function(value) { + this.__bottomExtension = value; + return this.__bottomExtension; + } + ,get_leftExtension: function() { + return this.__leftExtension; + } + ,set_leftExtension: function(value) { + this.__leftExtension = value; + return this.__leftExtension; + } + ,get_rightExtension: function() { + return this.__rightExtension; + } + ,set_rightExtension: function(value) { + this.__rightExtension = value; + return this.__rightExtension; + } + ,__initShader: function(renderer,pass,sourceBitmapData) { + this.__shaderBlendMode = this.blendMode; + return this.shader; + } + ,__class__: openfl_filters_ShaderFilter + ,__properties__: {set_topExtension:"set_topExtension",get_topExtension:"get_topExtension",set_rightExtension:"set_rightExtension",get_rightExtension:"get_rightExtension",set_leftExtension:"set_leftExtension",get_leftExtension:"get_leftExtension",set_bottomExtension:"set_bottomExtension",get_bottomExtension:"get_bottomExtension"} +}); +var openfl_geom_Matrix3D = function(v) { + if(v != null && v.get_length() == 16) { + this.rawData = v.concat(null); + } else { + this.rawData = openfl_Vector.toFloatVector(null,null,null,[1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]); + } +}; +$hxClasses["openfl.geom.Matrix3D"] = openfl_geom_Matrix3D; +openfl_geom_Matrix3D.__name__ = "openfl.geom.Matrix3D"; +openfl_geom_Matrix3D.create2D = function(x,y,scale,rotation) { + if(rotation == null) { + rotation = 0; + } + if(scale == null) { + scale = 1; + } + var theta = rotation * Math.PI / 180.0; + var c = Math.cos(theta); + var s = Math.sin(theta); + return new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[c * scale,-s * scale,0,0,s * scale,c * scale,0,0,0,0,1,0,x,y,0,1])); +}; +openfl_geom_Matrix3D.createABCD = function(a,b,c,d,tx,ty) { + return new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[a,b,0,0,c,d,0,0,0,0,1,0,tx,ty,0,1])); +}; +openfl_geom_Matrix3D.createOrtho = function(x0,x1,y0,y1,zNear,zFar) { + var sx = 1.0 / (x1 - x0); + var sy = 1.0 / (y1 - y0); + var sz = 1.0 / (zFar - zNear); + return new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[2.0 * sx,0,0,0,0,2.0 * sy,0,0,0,0,-2.0 * sz,0,-(x0 + x1) * sx,-(y0 + y1) * sy,-(zNear + zFar) * sz,1])); +}; +openfl_geom_Matrix3D.interpolate = function(thisMat,toMat,percent) { + var m = new openfl_geom_Matrix3D(); + var _g = 0; + while(_g < 16) { + var i = _g++; + m.rawData.set(i,thisMat.rawData.get(i) + (toMat.rawData.get(i) - thisMat.rawData.get(i)) * percent); + } + return m; +}; +openfl_geom_Matrix3D.interpolateToOutput = function(thisMat,toMat,percent,output) { + if(output == null) { + output = new openfl_geom_Matrix3D(); + } + var _g = 0; + while(_g < 16) { + var i = _g++; + output.rawData.set(i,thisMat.rawData.get(i) + (toMat.rawData.get(i) - thisMat.rawData.get(i)) * percent); + } + return output; +}; +openfl_geom_Matrix3D.__getAxisRotation = function(x,y,z,degrees) { + var m = new openfl_geom_Matrix3D(); + var a1 = new openfl_geom_Vector3D(x,y,z); + var rad = -degrees * (Math.PI / 180); + var c = Math.cos(rad); + var s = Math.sin(rad); + var t = 1.0 - c; + m.rawData.set(0,c + a1.x * a1.x * t); + m.rawData.set(5,c + a1.y * a1.y * t); + m.rawData.set(10,c + a1.z * a1.z * t); + var tmp1 = a1.x * a1.y * t; + var tmp2 = a1.z * s; + m.rawData.set(4,tmp1 + tmp2); + m.rawData.set(1,tmp1 - tmp2); + tmp1 = a1.x * a1.z * t; + tmp2 = a1.y * s; + m.rawData.set(8,tmp1 - tmp2); + m.rawData.set(2,tmp1 + tmp2); + tmp1 = a1.y * a1.z * t; + tmp2 = a1.x * s; + m.rawData.set(9,tmp1 + tmp2); + m.rawData.set(6,tmp1 - tmp2); + return m; +}; +openfl_geom_Matrix3D.prototype = { + append: function(lhs) { + var m111 = this.rawData.get(0); + var m121 = this.rawData.get(4); + var m131 = this.rawData.get(8); + var m141 = this.rawData.get(12); + var m112 = this.rawData.get(1); + var m122 = this.rawData.get(5); + var m132 = this.rawData.get(9); + var m142 = this.rawData.get(13); + var m113 = this.rawData.get(2); + var m123 = this.rawData.get(6); + var m133 = this.rawData.get(10); + var m143 = this.rawData.get(14); + var m114 = this.rawData.get(3); + var m124 = this.rawData.get(7); + var m134 = this.rawData.get(11); + var m144 = this.rawData.get(15); + var m211 = lhs.rawData.get(0); + var m221 = lhs.rawData.get(4); + var m231 = lhs.rawData.get(8); + var m241 = lhs.rawData.get(12); + var m212 = lhs.rawData.get(1); + var m222 = lhs.rawData.get(5); + var m232 = lhs.rawData.get(9); + var m242 = lhs.rawData.get(13); + var m213 = lhs.rawData.get(2); + var m223 = lhs.rawData.get(6); + var m233 = lhs.rawData.get(10); + var m243 = lhs.rawData.get(14); + var m214 = lhs.rawData.get(3); + var m224 = lhs.rawData.get(7); + var m234 = lhs.rawData.get(11); + var m244 = lhs.rawData.get(15); + this.rawData.set(0,m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241); + this.rawData.set(1,m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242); + this.rawData.set(2,m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243); + this.rawData.set(3,m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244); + this.rawData.set(4,m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241); + this.rawData.set(5,m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242); + this.rawData.set(6,m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243); + this.rawData.set(7,m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244); + this.rawData.set(8,m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241); + this.rawData.set(9,m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242); + this.rawData.set(10,m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243); + this.rawData.set(11,m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244); + this.rawData.set(12,m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241); + this.rawData.set(13,m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242); + this.rawData.set(14,m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243); + this.rawData.set(15,m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244); + } + ,appendRotation: function(degrees,axis,pivotPoint) { + var tz = 0; + var ty = tz; + var tx = ty; + if(pivotPoint != null) { + tx = pivotPoint.x; + ty = pivotPoint.y; + tz = pivotPoint.z; + } + var radian = degrees * Math.PI / 180; + var cos = Math.cos(radian); + var sin = Math.sin(radian); + var x = axis.x; + var y = axis.y; + var z = axis.z; + var x2 = x * x; + var y2 = y * y; + var z2 = z * z; + var ls = x2 + y2 + z2; + if(ls != 0) { + var l = Math.sqrt(ls); + x /= l; + y /= l; + z /= l; + x2 /= ls; + y2 /= ls; + z2 /= ls; + } + var ccos = 1 - cos; + var m = new openfl_geom_Matrix3D(); + var d = m.rawData; + d.set(0,x2 + (y2 + z2) * cos); + d.set(1,x * y * ccos + z * sin); + d.set(2,x * z * ccos - y * sin); + d.set(4,x * y * ccos - z * sin); + d.set(5,y2 + (x2 + z2) * cos); + d.set(6,y * z * ccos + x * sin); + d.set(8,x * z * ccos + y * sin); + d.set(9,y * z * ccos - x * sin); + d.set(10,z2 + (x2 + y2) * cos); + d.set(12,(tx * (y2 + z2) - x * (ty * y + tz * z)) * ccos + (ty * z - tz * y) * sin); + d.set(13,(ty * (x2 + z2) - y * (tx * x + tz * z)) * ccos + (tz * x - tx * z) * sin); + d.set(14,(tz * (x2 + y2) - z * (tx * x + ty * y)) * ccos + (tx * y - ty * x) * sin); + this.append(m); + } + ,appendScale: function(xScale,yScale,zScale) { + this.append(new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[xScale,0.0,0.0,0.0,0.0,yScale,0.0,0.0,0.0,0.0,zScale,0.0,0.0,0.0,0.0,1.0]))); + } + ,appendTranslation: function(x,y,z) { + var _g = this.rawData; + _g.set(12,_g.get(12) + x); + var _g = this.rawData; + _g.set(13,_g.get(13) + y); + var _g = this.rawData; + _g.set(14,_g.get(14) + z); + } + ,clone: function() { + return new openfl_geom_Matrix3D(this.rawData.copy()); + } + ,copyColumnFrom: function(column,vector3D) { + switch(column) { + case 0: + this.rawData.set(0,vector3D.x); + this.rawData.set(1,vector3D.y); + this.rawData.set(2,vector3D.z); + this.rawData.set(3,vector3D.w); + break; + case 1: + this.rawData.set(4,vector3D.x); + this.rawData.set(5,vector3D.y); + this.rawData.set(6,vector3D.z); + this.rawData.set(7,vector3D.w); + break; + case 2: + this.rawData.set(8,vector3D.x); + this.rawData.set(9,vector3D.y); + this.rawData.set(10,vector3D.z); + this.rawData.set(11,vector3D.w); + break; + case 3: + this.rawData.set(12,vector3D.x); + this.rawData.set(13,vector3D.y); + this.rawData.set(14,vector3D.z); + this.rawData.set(15,vector3D.w); + break; + default: + } + } + ,copyColumnTo: function(column,vector3D) { + switch(column) { + case 0: + vector3D.x = this.rawData.get(0); + vector3D.y = this.rawData.get(1); + vector3D.z = this.rawData.get(2); + vector3D.w = this.rawData.get(3); + break; + case 1: + vector3D.x = this.rawData.get(4); + vector3D.y = this.rawData.get(5); + vector3D.z = this.rawData.get(6); + vector3D.w = this.rawData.get(7); + break; + case 2: + vector3D.x = this.rawData.get(8); + vector3D.y = this.rawData.get(9); + vector3D.z = this.rawData.get(10); + vector3D.w = this.rawData.get(11); + break; + case 3: + vector3D.x = this.rawData.get(12); + vector3D.y = this.rawData.get(13); + vector3D.z = this.rawData.get(14); + vector3D.w = this.rawData.get(15); + break; + default: + } + } + ,copyFrom: function(other) { + this.rawData = other.rawData.copy(); + } + ,copyRawDataFrom: function(vector,index,transpose) { + if(transpose == null) { + transpose = false; + } + if(index == null) { + index = 0; + } + if(transpose) { + this.transpose(); + } + var length = vector.get_length() - index; + var _g = 0; + var _g1 = length; + while(_g < _g1) { + var i = _g++; + this.rawData.set(i,vector.get(i + index)); + } + if(transpose) { + this.transpose(); + } + } + ,copyRawDataTo: function(vector,index,transpose) { + if(transpose == null) { + transpose = false; + } + if(index == null) { + index = 0; + } + if(transpose) { + this.transpose(); + } + var _g = 0; + var _g1 = this.rawData.get_length(); + while(_g < _g1) { + var i = _g++; + vector.set(i + index,this.rawData.get(i)); + } + if(transpose) { + this.transpose(); + } + } + ,copyRowFrom: function(row,vector3D) { + switch(row) { + case 0: + this.rawData.set(0,vector3D.x); + this.rawData.set(4,vector3D.y); + this.rawData.set(8,vector3D.z); + this.rawData.set(12,vector3D.w); + break; + case 1: + this.rawData.set(1,vector3D.x); + this.rawData.set(5,vector3D.y); + this.rawData.set(9,vector3D.z); + this.rawData.set(13,vector3D.w); + break; + case 2: + this.rawData.set(2,vector3D.x); + this.rawData.set(6,vector3D.y); + this.rawData.set(10,vector3D.z); + this.rawData.set(14,vector3D.w); + break; + case 3: + this.rawData.set(3,vector3D.x); + this.rawData.set(7,vector3D.y); + this.rawData.set(11,vector3D.z); + this.rawData.set(15,vector3D.w); + break; + default: + } + } + ,copyRowTo: function(row,vector3D) { + switch(row) { + case 0: + vector3D.x = this.rawData.get(0); + vector3D.y = this.rawData.get(4); + vector3D.z = this.rawData.get(8); + vector3D.w = this.rawData.get(12); + break; + case 1: + vector3D.x = this.rawData.get(1); + vector3D.y = this.rawData.get(5); + vector3D.z = this.rawData.get(9); + vector3D.w = this.rawData.get(13); + break; + case 2: + vector3D.x = this.rawData.get(2); + vector3D.y = this.rawData.get(6); + vector3D.z = this.rawData.get(10); + vector3D.w = this.rawData.get(14); + break; + case 3: + vector3D.x = this.rawData.get(3); + vector3D.y = this.rawData.get(7); + vector3D.z = this.rawData.get(11); + vector3D.w = this.rawData.get(15); + break; + default: + } + } + ,copyToMatrix3D: function(other) { + other.rawData = this.rawData.copy(); + } + ,decompose: function(orientationStyle) { + if(orientationStyle == null) { + orientationStyle = 1; + } + var vec = openfl_Vector.toObjectVector(null); + var m = this.clone(); + var mr = m.rawData.copy(); + var pos = new openfl_geom_Vector3D(mr.get(12),mr.get(13),mr.get(14)); + mr.set(12,0); + mr.set(13,0); + mr.set(14,0); + var scale = new openfl_geom_Vector3D(); + scale.x = Math.sqrt(mr.get(0) * mr.get(0) + mr.get(1) * mr.get(1) + mr.get(2) * mr.get(2)); + scale.y = Math.sqrt(mr.get(4) * mr.get(4) + mr.get(5) * mr.get(5) + mr.get(6) * mr.get(6)); + scale.z = Math.sqrt(mr.get(8) * mr.get(8) + mr.get(9) * mr.get(9) + mr.get(10) * mr.get(10)); + if(mr.get(0) * (mr.get(5) * mr.get(10) - mr.get(6) * mr.get(9)) - mr.get(1) * (mr.get(4) * mr.get(10) - mr.get(6) * mr.get(8)) + mr.get(2) * (mr.get(4) * mr.get(9) - mr.get(5) * mr.get(8)) < 0) { + scale.z = -scale.z; + } + var _g = mr; + _g.set(0,_g.get(0) / scale.x); + var _g = mr; + _g.set(1,_g.get(1) / scale.x); + var _g = mr; + _g.set(2,_g.get(2) / scale.x); + var _g = mr; + _g.set(4,_g.get(4) / scale.y); + var _g = mr; + _g.set(5,_g.get(5) / scale.y); + var _g = mr; + _g.set(6,_g.get(6) / scale.y); + var _g = mr; + _g.set(8,_g.get(8) / scale.z); + var _g = mr; + _g.set(9,_g.get(9) / scale.z); + var _g = mr; + _g.set(10,_g.get(10) / scale.z); + var rot = new openfl_geom_Vector3D(); + switch(orientationStyle) { + case 0: + rot.w = Math.acos((mr.get(0) + mr.get(5) + mr.get(10) - 1) / 2); + var len = Math.sqrt((mr.get(6) - mr.get(9)) * (mr.get(6) - mr.get(9)) + (mr.get(8) - mr.get(2)) * (mr.get(8) - mr.get(2)) + (mr.get(1) - mr.get(4)) * (mr.get(1) - mr.get(4))); + if(len != 0) { + rot.x = (mr.get(6) - mr.get(9)) / len; + rot.y = (mr.get(8) - mr.get(2)) / len; + rot.z = (mr.get(1) - mr.get(4)) / len; + } else { + rot.x = rot.y = rot.z = 0; + } + break; + case 1: + rot.y = Math.asin(-mr.get(2)); + if(mr.get(2) != 1 && mr.get(2) != -1) { + rot.x = Math.atan2(mr.get(6),mr.get(10)); + rot.z = Math.atan2(mr.get(1),mr.get(0)); + } else { + rot.z = 0; + rot.x = Math.atan2(mr.get(4),mr.get(5)); + } + break; + case 2: + var tr = mr.get(0) + mr.get(5) + mr.get(10); + if(tr > 0) { + rot.w = Math.sqrt(1 + tr) / 2; + rot.x = (mr.get(6) - mr.get(9)) / (4 * rot.w); + rot.y = (mr.get(8) - mr.get(2)) / (4 * rot.w); + rot.z = (mr.get(1) - mr.get(4)) / (4 * rot.w); + } else if(mr.get(0) > mr.get(5) && mr.get(0) > mr.get(10)) { + rot.x = Math.sqrt(1 + mr.get(0) - mr.get(5) - mr.get(10)) / 2; + rot.w = (mr.get(6) - mr.get(9)) / (4 * rot.x); + rot.y = (mr.get(1) + mr.get(4)) / (4 * rot.x); + rot.z = (mr.get(8) + mr.get(2)) / (4 * rot.x); + } else if(mr.get(5) > mr.get(10)) { + rot.y = Math.sqrt(1 + mr.get(5) - mr.get(0) - mr.get(10)) / 2; + rot.x = (mr.get(1) + mr.get(4)) / (4 * rot.y); + rot.w = (mr.get(8) - mr.get(2)) / (4 * rot.y); + rot.z = (mr.get(6) + mr.get(9)) / (4 * rot.y); + } else { + rot.z = Math.sqrt(1 + mr.get(10) - mr.get(0) - mr.get(5)) / 2; + rot.x = (mr.get(8) + mr.get(2)) / (4 * rot.z); + rot.y = (mr.get(6) + mr.get(9)) / (4 * rot.z); + rot.w = (mr.get(1) - mr.get(4)) / (4 * rot.z); + } + break; + } + vec.push(pos); + vec.push(rot); + vec.push(scale); + return vec; + } + ,decomposeToOutput: function(orientationStyle,output) { + if(orientationStyle == null) { + orientationStyle = 1; + } + if(output == null) { + output = openfl_Vector.toObjectVector(null); + } + var m = this.clone(); + var mr = m.rawData.copy(); + var pos = output.get(0); + if(pos == null) { + pos = new openfl_geom_Vector3D(mr.get(12),mr.get(13),mr.get(14)); + } else { + pos.setTo(mr.get(12),mr.get(13),mr.get(14)); + } + mr.set(12,0); + mr.set(13,0); + mr.set(14,0); + var scale = output.get(1); + if(scale == null) { + scale = new openfl_geom_Vector3D(); + } + scale.x = Math.sqrt(mr.get(0) * mr.get(0) + mr.get(1) * mr.get(1) + mr.get(2) * mr.get(2)); + scale.y = Math.sqrt(mr.get(4) * mr.get(4) + mr.get(5) * mr.get(5) + mr.get(6) * mr.get(6)); + scale.z = Math.sqrt(mr.get(8) * mr.get(8) + mr.get(9) * mr.get(9) + mr.get(10) * mr.get(10)); + if(mr.get(0) * (mr.get(5) * mr.get(10) - mr.get(6) * mr.get(9)) - mr.get(1) * (mr.get(4) * mr.get(10) - mr.get(6) * mr.get(8)) + mr.get(2) * (mr.get(4) * mr.get(9) - mr.get(5) * mr.get(8)) < 0) { + scale.z = -scale.z; + } + var _g = mr; + _g.set(0,_g.get(0) / scale.x); + var _g = mr; + _g.set(1,_g.get(1) / scale.x); + var _g = mr; + _g.set(2,_g.get(2) / scale.x); + var _g = mr; + _g.set(4,_g.get(4) / scale.y); + var _g = mr; + _g.set(5,_g.get(5) / scale.y); + var _g = mr; + _g.set(6,_g.get(6) / scale.y); + var _g = mr; + _g.set(8,_g.get(8) / scale.z); + var _g = mr; + _g.set(9,_g.get(9) / scale.z); + var _g = mr; + _g.set(10,_g.get(10) / scale.z); + var rot = output.get(2); + if(rot == null) { + rot = new openfl_geom_Vector3D(); + } + switch(orientationStyle) { + case 0: + rot.w = Math.acos((mr.get(0) + mr.get(5) + mr.get(10) - 1) / 2); + var len = Math.sqrt((mr.get(6) - mr.get(9)) * (mr.get(6) - mr.get(9)) + (mr.get(8) - mr.get(2)) * (mr.get(8) - mr.get(2)) + (mr.get(1) - mr.get(4)) * (mr.get(1) - mr.get(4))); + if(len != 0) { + rot.x = (mr.get(6) - mr.get(9)) / len; + rot.y = (mr.get(8) - mr.get(2)) / len; + rot.z = (mr.get(1) - mr.get(4)) / len; + } else { + rot.x = rot.y = rot.z = 0; + } + break; + case 1: + rot.y = Math.asin(-mr.get(2)); + if(mr.get(2) != 1 && mr.get(2) != -1) { + rot.x = Math.atan2(mr.get(6),mr.get(10)); + rot.z = Math.atan2(mr.get(1),mr.get(0)); + } else { + rot.z = 0; + rot.x = Math.atan2(mr.get(4),mr.get(5)); + } + break; + case 2: + var tr = mr.get(0) + mr.get(5) + mr.get(10); + if(tr > 0) { + rot.w = Math.sqrt(1 + tr) / 2; + rot.x = (mr.get(6) - mr.get(9)) / (4 * rot.w); + rot.y = (mr.get(8) - mr.get(2)) / (4 * rot.w); + rot.z = (mr.get(1) - mr.get(4)) / (4 * rot.w); + } else if(mr.get(0) > mr.get(5) && mr.get(0) > mr.get(10)) { + rot.x = Math.sqrt(1 + mr.get(0) - mr.get(5) - mr.get(10)) / 2; + rot.w = (mr.get(6) - mr.get(9)) / (4 * rot.x); + rot.y = (mr.get(1) + mr.get(4)) / (4 * rot.x); + rot.z = (mr.get(8) + mr.get(2)) / (4 * rot.x); + } else if(mr.get(5) > mr.get(10)) { + rot.y = Math.sqrt(1 + mr.get(5) - mr.get(0) - mr.get(10)) / 2; + rot.x = (mr.get(1) + mr.get(4)) / (4 * rot.y); + rot.w = (mr.get(8) - mr.get(2)) / (4 * rot.y); + rot.z = (mr.get(6) + mr.get(9)) / (4 * rot.y); + } else { + rot.z = Math.sqrt(1 + mr.get(10) - mr.get(0) - mr.get(5)) / 2; + rot.x = (mr.get(8) + mr.get(2)) / (4 * rot.z); + rot.y = (mr.get(6) + mr.get(9)) / (4 * rot.z); + rot.w = (mr.get(1) - mr.get(4)) / (4 * rot.z); + } + break; + } + output.set(0,pos); + output.set(1,rot); + output.set(2,scale); + return output; + } + ,deltaTransformVector: function(v) { + var x = v.x; + var y = v.y; + var z = v.z; + return new openfl_geom_Vector3D(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10),x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11)); + } + ,deltaTransformVectorToOutput: function(v,output) { + var x = v.x; + var y = v.y; + var z = v.z; + if(output != null) { + output.setTo(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10)); + output.w = x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11); + return output; + } + return new openfl_geom_Vector3D(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10),x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11)); + } + ,identity: function() { + this.rawData = openfl_Vector.toFloatVector(null,null,null,[1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]); + } + ,interpolateTo: function(toMat,percent) { + var _g = 0; + while(_g < 16) { + var i = _g++; + this.rawData.set(i,this.rawData.get(i) + (toMat.rawData.get(i) - this.rawData.get(i)) * percent); + } + } + ,invert: function() { + var d = this.get_determinant(); + var invertable = Math.abs(d) > 0.00000000001; + if(invertable) { + d = 1 / d; + var m11 = this.rawData.get(0); + var m21 = this.rawData.get(4); + var m31 = this.rawData.get(8); + var m41 = this.rawData.get(12); + var m12 = this.rawData.get(1); + var m22 = this.rawData.get(5); + var m32 = this.rawData.get(9); + var m42 = this.rawData.get(13); + var m13 = this.rawData.get(2); + var m23 = this.rawData.get(6); + var m33 = this.rawData.get(10); + var m43 = this.rawData.get(14); + var m14 = this.rawData.get(3); + var m24 = this.rawData.get(7); + var m34 = this.rawData.get(11); + var m44 = this.rawData.get(15); + this.rawData.set(0,d * (m22 * (m33 * m44 - m43 * m34) - m32 * (m23 * m44 - m43 * m24) + m42 * (m23 * m34 - m33 * m24))); + this.rawData.set(1,-d * (m12 * (m33 * m44 - m43 * m34) - m32 * (m13 * m44 - m43 * m14) + m42 * (m13 * m34 - m33 * m14))); + this.rawData.set(2,d * (m12 * (m23 * m44 - m43 * m24) - m22 * (m13 * m44 - m43 * m14) + m42 * (m13 * m24 - m23 * m14))); + this.rawData.set(3,-d * (m12 * (m23 * m34 - m33 * m24) - m22 * (m13 * m34 - m33 * m14) + m32 * (m13 * m24 - m23 * m14))); + this.rawData.set(4,-d * (m21 * (m33 * m44 - m43 * m34) - m31 * (m23 * m44 - m43 * m24) + m41 * (m23 * m34 - m33 * m24))); + this.rawData.set(5,d * (m11 * (m33 * m44 - m43 * m34) - m31 * (m13 * m44 - m43 * m14) + m41 * (m13 * m34 - m33 * m14))); + this.rawData.set(6,-d * (m11 * (m23 * m44 - m43 * m24) - m21 * (m13 * m44 - m43 * m14) + m41 * (m13 * m24 - m23 * m14))); + this.rawData.set(7,d * (m11 * (m23 * m34 - m33 * m24) - m21 * (m13 * m34 - m33 * m14) + m31 * (m13 * m24 - m23 * m14))); + this.rawData.set(8,d * (m21 * (m32 * m44 - m42 * m34) - m31 * (m22 * m44 - m42 * m24) + m41 * (m22 * m34 - m32 * m24))); + this.rawData.set(9,-d * (m11 * (m32 * m44 - m42 * m34) - m31 * (m12 * m44 - m42 * m14) + m41 * (m12 * m34 - m32 * m14))); + this.rawData.set(10,d * (m11 * (m22 * m44 - m42 * m24) - m21 * (m12 * m44 - m42 * m14) + m41 * (m12 * m24 - m22 * m14))); + this.rawData.set(11,-d * (m11 * (m22 * m34 - m32 * m24) - m21 * (m12 * m34 - m32 * m14) + m31 * (m12 * m24 - m22 * m14))); + this.rawData.set(12,-d * (m21 * (m32 * m43 - m42 * m33) - m31 * (m22 * m43 - m42 * m23) + m41 * (m22 * m33 - m32 * m23))); + this.rawData.set(13,d * (m11 * (m32 * m43 - m42 * m33) - m31 * (m12 * m43 - m42 * m13) + m41 * (m12 * m33 - m32 * m13))); + this.rawData.set(14,-d * (m11 * (m22 * m43 - m42 * m23) - m21 * (m12 * m43 - m42 * m13) + m41 * (m12 * m23 - m22 * m13))); + this.rawData.set(15,d * (m11 * (m22 * m33 - m32 * m23) - m21 * (m12 * m33 - m32 * m13) + m31 * (m12 * m23 - m22 * m13))); + } + return invertable; + } + ,pointAt: function(pos,at,up) { + if(at == null) { + at = new openfl_geom_Vector3D(0,0,-1); + } + if(up == null) { + up = new openfl_geom_Vector3D(0,-1,0); + } + var dir = at.subtract(pos); + var vup = up.clone(); + dir.normalize(); + vup.normalize(); + var dir2 = dir.clone(); + dir2.scaleBy(vup.dotProduct(dir)); + vup = vup.subtract(dir2); + if(vup.get_length() > 0) { + vup.normalize(); + } else if(dir.x != 0) { + vup = new openfl_geom_Vector3D(-dir.y,dir.x,0); + } else { + vup = new openfl_geom_Vector3D(1,0,0); + } + var right = vup.crossProduct(dir); + right.normalize(); + this.rawData.set(0,right.x); + this.rawData.set(4,right.y); + this.rawData.set(8,right.z); + this.rawData.set(12,0.0); + this.rawData.set(1,vup.x); + this.rawData.set(5,vup.y); + this.rawData.set(9,vup.z); + this.rawData.set(13,0.0); + this.rawData.set(2,dir.x); + this.rawData.set(6,dir.y); + this.rawData.set(10,dir.z); + this.rawData.set(14,0.0); + this.rawData.set(3,pos.x); + this.rawData.set(7,pos.y); + this.rawData.set(11,pos.z); + this.rawData.set(15,1.0); + } + ,prepend: function(rhs) { + var m111 = rhs.rawData.get(0); + var m121 = rhs.rawData.get(4); + var m131 = rhs.rawData.get(8); + var m141 = rhs.rawData.get(12); + var m112 = rhs.rawData.get(1); + var m122 = rhs.rawData.get(5); + var m132 = rhs.rawData.get(9); + var m142 = rhs.rawData.get(13); + var m113 = rhs.rawData.get(2); + var m123 = rhs.rawData.get(6); + var m133 = rhs.rawData.get(10); + var m143 = rhs.rawData.get(14); + var m114 = rhs.rawData.get(3); + var m124 = rhs.rawData.get(7); + var m134 = rhs.rawData.get(11); + var m144 = rhs.rawData.get(15); + var m211 = this.rawData.get(0); + var m221 = this.rawData.get(4); + var m231 = this.rawData.get(8); + var m241 = this.rawData.get(12); + var m212 = this.rawData.get(1); + var m222 = this.rawData.get(5); + var m232 = this.rawData.get(9); + var m242 = this.rawData.get(13); + var m213 = this.rawData.get(2); + var m223 = this.rawData.get(6); + var m233 = this.rawData.get(10); + var m243 = this.rawData.get(14); + var m214 = this.rawData.get(3); + var m224 = this.rawData.get(7); + var m234 = this.rawData.get(11); + var m244 = this.rawData.get(15); + this.rawData.set(0,m111 * m211 + m112 * m221 + m113 * m231 + m114 * m241); + this.rawData.set(1,m111 * m212 + m112 * m222 + m113 * m232 + m114 * m242); + this.rawData.set(2,m111 * m213 + m112 * m223 + m113 * m233 + m114 * m243); + this.rawData.set(3,m111 * m214 + m112 * m224 + m113 * m234 + m114 * m244); + this.rawData.set(4,m121 * m211 + m122 * m221 + m123 * m231 + m124 * m241); + this.rawData.set(5,m121 * m212 + m122 * m222 + m123 * m232 + m124 * m242); + this.rawData.set(6,m121 * m213 + m122 * m223 + m123 * m233 + m124 * m243); + this.rawData.set(7,m121 * m214 + m122 * m224 + m123 * m234 + m124 * m244); + this.rawData.set(8,m131 * m211 + m132 * m221 + m133 * m231 + m134 * m241); + this.rawData.set(9,m131 * m212 + m132 * m222 + m133 * m232 + m134 * m242); + this.rawData.set(10,m131 * m213 + m132 * m223 + m133 * m233 + m134 * m243); + this.rawData.set(11,m131 * m214 + m132 * m224 + m133 * m234 + m134 * m244); + this.rawData.set(12,m141 * m211 + m142 * m221 + m143 * m231 + m144 * m241); + this.rawData.set(13,m141 * m212 + m142 * m222 + m143 * m232 + m144 * m242); + this.rawData.set(14,m141 * m213 + m142 * m223 + m143 * m233 + m144 * m243); + this.rawData.set(15,m141 * m214 + m142 * m224 + m143 * m234 + m144 * m244); + } + ,prependRotation: function(degrees,axis,pivotPoint) { + var tz = 0; + var ty = tz; + var tx = ty; + if(pivotPoint != null) { + tx = pivotPoint.x; + ty = pivotPoint.y; + tz = pivotPoint.z; + } + var radian = degrees * Math.PI / 180; + var cos = Math.cos(radian); + var sin = Math.sin(radian); + var x = axis.x; + var y = axis.y; + var z = axis.z; + var x2 = x * x; + var y2 = y * y; + var z2 = z * z; + var ls = x2 + y2 + z2; + if(ls != 0) { + var l = Math.sqrt(ls); + x /= l; + y /= l; + z /= l; + x2 /= ls; + y2 /= ls; + z2 /= ls; + } + var ccos = 1 - cos; + var m = new openfl_geom_Matrix3D(); + var d = m.rawData; + d.set(0,x2 + (y2 + z2) * cos); + d.set(1,x * y * ccos + z * sin); + d.set(2,x * z * ccos - y * sin); + d.set(4,x * y * ccos - z * sin); + d.set(5,y2 + (x2 + z2) * cos); + d.set(6,y * z * ccos + x * sin); + d.set(8,x * z * ccos + y * sin); + d.set(9,y * z * ccos - x * sin); + d.set(10,z2 + (x2 + y2) * cos); + d.set(12,(tx * (y2 + z2) - x * (ty * y + tz * z)) * ccos + (ty * z - tz * y) * sin); + d.set(13,(ty * (x2 + z2) - y * (tx * x + tz * z)) * ccos + (tz * x - tx * z) * sin); + d.set(14,(tz * (x2 + y2) - z * (tx * x + ty * y)) * ccos + (tx * y - ty * x) * sin); + this.prepend(m); + } + ,prependScale: function(xScale,yScale,zScale) { + this.prepend(new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[xScale,0.0,0.0,0.0,0.0,yScale,0.0,0.0,0.0,0.0,zScale,0.0,0.0,0.0,0.0,1.0]))); + } + ,prependTranslation: function(x,y,z) { + var m = new openfl_geom_Matrix3D(); + m.set_position(new openfl_geom_Vector3D(x,y,z)); + this.prepend(m); + } + ,recompose: function(components,orientationStyle) { + if(orientationStyle == null) { + orientationStyle = 1; + } + if(components.get_length() < 3 || components.get(2).x == 0 || components.get(2).y == 0 || components.get(2).z == 0) { + return false; + } + this.identity(); + var scale = []; + scale[0] = scale[1] = scale[2] = components.get(2).x; + scale[4] = scale[5] = scale[6] = components.get(2).y; + scale[8] = scale[9] = scale[10] = components.get(2).z; + if(orientationStyle == 1) { + var cx = Math.cos(components.get(1).x); + var cy = Math.cos(components.get(1).y); + var cz = Math.cos(components.get(1).z); + var sx = Math.sin(components.get(1).x); + var sy = Math.sin(components.get(1).y); + var sz = Math.sin(components.get(1).z); + this.rawData.set(0,cy * cz * scale[0]); + this.rawData.set(1,cy * sz * scale[1]); + this.rawData.set(2,-sy * scale[2]); + this.rawData.set(3,0); + this.rawData.set(4,(sx * sy * cz - cx * sz) * scale[4]); + this.rawData.set(5,(sx * sy * sz + cx * cz) * scale[5]); + this.rawData.set(6,sx * cy * scale[6]); + this.rawData.set(7,0); + this.rawData.set(8,(cx * sy * cz + sx * sz) * scale[8]); + this.rawData.set(9,(cx * sy * sz - sx * cz) * scale[9]); + this.rawData.set(10,cx * cy * scale[10]); + this.rawData.set(11,0); + this.rawData.set(12,components.get(0).x); + this.rawData.set(13,components.get(0).y); + this.rawData.set(14,components.get(0).z); + this.rawData.set(15,1); + } else { + var x = components.get(1).x; + var y = components.get(1).y; + var z = components.get(1).z; + var w = components.get(1).w; + if(orientationStyle == 0) { + x *= Math.sin(w / 2); + y *= Math.sin(w / 2); + z *= Math.sin(w / 2); + w = Math.cos(w / 2); + } + this.rawData.set(0,(1 - 2 * y * y - 2 * z * z) * scale[0]); + this.rawData.set(1,(2 * x * y + 2 * w * z) * scale[1]); + this.rawData.set(2,(2 * x * z - 2 * w * y) * scale[2]); + this.rawData.set(3,0); + this.rawData.set(4,(2 * x * y - 2 * w * z) * scale[4]); + this.rawData.set(5,(1 - 2 * x * x - 2 * z * z) * scale[5]); + this.rawData.set(6,(2 * y * z + 2 * w * x) * scale[6]); + this.rawData.set(7,0); + this.rawData.set(8,(2 * x * z + 2 * w * y) * scale[8]); + this.rawData.set(9,(2 * y * z - 2 * w * x) * scale[9]); + this.rawData.set(10,(1 - 2 * x * x - 2 * y * y) * scale[10]); + this.rawData.set(11,0); + this.rawData.set(12,components.get(0).x); + this.rawData.set(13,components.get(0).y); + this.rawData.set(14,components.get(0).z); + this.rawData.set(15,1); + } + if(components.get(2).x == 0) { + this.rawData.set(0,1e-15); + } + if(components.get(2).y == 0) { + this.rawData.set(5,1e-15); + } + if(components.get(2).z == 0) { + this.rawData.set(10,1e-15); + } + return !(components.get(2).x == 0 || components.get(2).y == 0 || components.get(2).y == 0); + } + ,transformVector: function(v) { + var x = v.x; + var y = v.y; + var z = v.z; + return new openfl_geom_Vector3D(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8) + this.rawData.get(12),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9) + this.rawData.get(13),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10) + this.rawData.get(14),x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11) + this.rawData.get(15)); + } + ,transformVectorToOutput: function(v,output) { + var x = v.x; + var y = v.y; + var z = v.z; + if(output != null) { + output.setTo(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8) + this.rawData.get(12),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9) + this.rawData.get(13),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10) + this.rawData.get(14)); + output.w = x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11) + this.rawData.get(15); + return output; + } + return new openfl_geom_Vector3D(x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8) + this.rawData.get(12),x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9) + this.rawData.get(13),x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10) + this.rawData.get(14),x * this.rawData.get(3) + y * this.rawData.get(7) + z * this.rawData.get(11) + this.rawData.get(15)); + } + ,transformVectors: function(vin,vout) { + var i = 0; + var x; + var y; + var z; + while(i + 3 <= vin.get_length()) { + x = vin.get(i); + y = vin.get(i + 1); + z = vin.get(i + 2); + vout.set(i,x * this.rawData.get(0) + y * this.rawData.get(4) + z * this.rawData.get(8) + this.rawData.get(12)); + vout.set(i + 1,x * this.rawData.get(1) + y * this.rawData.get(5) + z * this.rawData.get(9) + this.rawData.get(13)); + vout.set(i + 2,x * this.rawData.get(2) + y * this.rawData.get(6) + z * this.rawData.get(10) + this.rawData.get(14)); + i += 3; + } + } + ,transpose: function() { + var oRawData = this.rawData.copy(); + this.rawData.set(1,oRawData.get(4)); + this.rawData.set(2,oRawData.get(8)); + this.rawData.set(3,oRawData.get(12)); + this.rawData.set(4,oRawData.get(1)); + this.rawData.set(6,oRawData.get(9)); + this.rawData.set(7,oRawData.get(13)); + this.rawData.set(8,oRawData.get(2)); + this.rawData.set(9,oRawData.get(6)); + this.rawData.set(11,oRawData.get(14)); + this.rawData.set(12,oRawData.get(3)); + this.rawData.set(13,oRawData.get(7)); + this.rawData.set(14,oRawData.get(11)); + } + ,get_determinant: function() { + return (this.rawData.get(0) * this.rawData.get(5) - this.rawData.get(4) * this.rawData.get(1)) * (this.rawData.get(10) * this.rawData.get(15) - this.rawData.get(14) * this.rawData.get(11)) - (this.rawData.get(0) * this.rawData.get(9) - this.rawData.get(8) * this.rawData.get(1)) * (this.rawData.get(6) * this.rawData.get(15) - this.rawData.get(14) * this.rawData.get(7)) + (this.rawData.get(0) * this.rawData.get(13) - this.rawData.get(12) * this.rawData.get(1)) * (this.rawData.get(6) * this.rawData.get(11) - this.rawData.get(10) * this.rawData.get(7)) + (this.rawData.get(4) * this.rawData.get(9) - this.rawData.get(8) * this.rawData.get(5)) * (this.rawData.get(2) * this.rawData.get(15) - this.rawData.get(14) * this.rawData.get(3)) - (this.rawData.get(4) * this.rawData.get(13) - this.rawData.get(12) * this.rawData.get(5)) * (this.rawData.get(2) * this.rawData.get(11) - this.rawData.get(10) * this.rawData.get(3)) + (this.rawData.get(8) * this.rawData.get(13) - this.rawData.get(12) * this.rawData.get(9)) * (this.rawData.get(2) * this.rawData.get(7) - this.rawData.get(6) * this.rawData.get(3)); + } + ,get_position: function() { + return new openfl_geom_Vector3D(this.rawData.get(12),this.rawData.get(13),this.rawData.get(14)); + } + ,set_position: function(val) { + this.rawData.set(12,val.x); + this.rawData.set(13,val.y); + this.rawData.set(14,val.z); + return val; + } + ,__class__: openfl_geom_Matrix3D + ,__properties__: {set_position:"set_position",get_position:"get_position",get_determinant:"get_determinant"} +}; +var openfl_geom_Orientation3D = {}; +openfl_geom_Orientation3D.fromString = function(value) { + switch(value) { + case "axisAngle": + return 0; + case "eulerAngles": + return 1; + case "quaternion": + return 2; + default: + return null; + } +}; +openfl_geom_Orientation3D.toString = function(this1) { + switch(this1) { + case 0: + return "axisAngle"; + case 1: + return "eulerAngles"; + case 2: + return "quaternion"; + default: + return null; + } +}; +var openfl_geom_Transform = function(displayObject) { + this.__colorTransform = new openfl_geom_ColorTransform(); + this.concatenatedColorTransform = new openfl_geom_ColorTransform(); + this.pixelBounds = new openfl_geom_Rectangle(); + this.__displayObject = displayObject; + this.__hasMatrix = true; +}; +$hxClasses["openfl.geom.Transform"] = openfl_geom_Transform; +openfl_geom_Transform.__name__ = "openfl.geom.Transform"; +openfl_geom_Transform.prototype = { + get_colorTransform: function() { + return this.__colorTransform.__clone(); + } + ,set_colorTransform: function(value) { + if(!this.__colorTransform.__equals(value,false)) { + this.__colorTransform.__copyFrom(value); + if(value != null) { + this.__displayObject.set_alpha(value.alphaMultiplier); + } + var _this = this.__displayObject; + if(!_this.__renderDirty) { + _this.__renderDirty = true; + _this.__setParentRenderDirty(); + } + } + return this.__colorTransform; + } + ,get_concatenatedMatrix: function() { + if(this.__hasMatrix) { + return this.__displayObject.__getWorldTransform().clone(); + } + return null; + } + ,get_matrix: function() { + if(this.__hasMatrix) { + return this.__displayObject.__transform.clone(); + } + return null; + } + ,set_matrix: function(value) { + if(value == null) { + this.__hasMatrix = false; + return null; + } + this.__hasMatrix = true; + this.__hasMatrix3D = false; + if(this.__displayObject != null) { + this.__setTransform(value.a,value.b,value.c,value.d,value.tx,value.ty); + } + return value; + } + ,get_matrix3D: function() { + if(this.__hasMatrix3D) { + var matrix = this.__displayObject.__transform; + return new openfl_geom_Matrix3D(openfl_Vector.toFloatVector(null,null,null,[matrix.a,matrix.b,0.0,0.0,matrix.c,matrix.d,0.0,0.0,0.0,0.0,1.0,0.0,matrix.tx,matrix.ty,0.0,1.0])); + } + return null; + } + ,set_matrix3D: function(value) { + if(value == null) { + this.__hasMatrix3D = false; + return null; + } + this.__hasMatrix = false; + this.__hasMatrix3D = true; + this.__setTransform(value.rawData.get(0),value.rawData.get(1),value.rawData.get(4),value.rawData.get(5),value.rawData.get(12),value.rawData.get(13)); + return value; + } + ,__setTransform: function(a,b,c,d,tx,ty) { + if(this.__displayObject != null) { + var transform = this.__displayObject.__transform; + if(transform.a == a && transform.b == b && transform.c == c && transform.d == d && transform.tx == tx && transform.ty == ty) { + return; + } + var scaleX = 0.0; + var scaleY = 0.0; + if(b == 0) { + scaleX = a; + } else { + scaleX = Math.sqrt(a * a + b * b); + } + if(c == 0) { + scaleY = d; + } else { + scaleY = Math.sqrt(c * c + d * d); + } + this.__displayObject.__scaleX = scaleX; + this.__displayObject.__scaleY = scaleY; + var rotation = 180 / Math.PI * Math.atan2(d,c) - 90; + if(rotation != this.__displayObject.__rotation) { + this.__displayObject.__rotation = rotation; + var radians = rotation * (Math.PI / 180); + this.__displayObject.__rotationSine = Math.sin(radians); + this.__displayObject.__rotationCosine = Math.cos(radians); + } + transform.a = a; + transform.b = b; + transform.c = c; + transform.d = d; + transform.tx = tx; + transform.ty = ty; + this.__displayObject.__setTransformDirty(); + } + } + ,__class__: openfl_geom_Transform + ,__properties__: {set_matrix3D:"set_matrix3D",get_matrix3D:"get_matrix3D",set_matrix:"set_matrix",get_matrix:"get_matrix",get_concatenatedMatrix:"get_concatenatedMatrix",set_colorTransform:"set_colorTransform",get_colorTransform:"get_colorTransform"} +}; +var openfl_geom_Vector3D = function(x,y,z,w) { + if(w == null) { + w = 0; + } + if(z == null) { + z = 0; + } + if(y == null) { + y = 0; + } + if(x == null) { + x = 0; + } + this.w = w; + this.x = x; + this.y = y; + this.z = z; +}; +$hxClasses["openfl.geom.Vector3D"] = openfl_geom_Vector3D; +openfl_geom_Vector3D.__name__ = "openfl.geom.Vector3D"; +openfl_geom_Vector3D.__properties__ = {get_Z_AXIS:"get_Z_AXIS",get_Y_AXIS:"get_Y_AXIS",get_X_AXIS:"get_X_AXIS"}; +openfl_geom_Vector3D.angleBetween = function(a,b) { + var la = a.get_length(); + var lb = b.get_length(); + var dot = a.dotProduct(b); + if(la != 0) { + dot /= la; + } + if(lb != 0) { + dot /= lb; + } + return Math.acos(dot); +}; +openfl_geom_Vector3D.distance = function(pt1,pt2) { + var x = pt2.x - pt1.x; + var y = pt2.y - pt1.y; + var z = pt2.z - pt1.z; + return Math.sqrt(x * x + y * y + z * z); +}; +openfl_geom_Vector3D.get_X_AXIS = function() { + return new openfl_geom_Vector3D(1,0,0); +}; +openfl_geom_Vector3D.get_Y_AXIS = function() { + return new openfl_geom_Vector3D(0,1,0); +}; +openfl_geom_Vector3D.get_Z_AXIS = function() { + return new openfl_geom_Vector3D(0,0,1); +}; +openfl_geom_Vector3D.prototype = { + add: function(a) { + return new openfl_geom_Vector3D(this.x + a.x,this.y + a.y,this.z + a.z); + } + ,addToOutput: function(a,output) { + if(output != null) { + output.setTo(this.x + a.x,this.y + a.y,this.z + a.z); + return output; + } + return new openfl_geom_Vector3D(this.x + a.x,this.y + a.y,this.z + a.z); + } + ,clone: function() { + return new openfl_geom_Vector3D(this.x,this.y,this.z,this.w); + } + ,copyFrom: function(sourceVector3D) { + this.x = sourceVector3D.x; + this.y = sourceVector3D.y; + this.z = sourceVector3D.z; + } + ,crossProduct: function(a) { + return new openfl_geom_Vector3D(this.y * a.z - this.z * a.y,this.z * a.x - this.x * a.z,this.x * a.y - this.y * a.x,1); + } + ,crossProductToOutput: function(a,output) { + if(output != null) { + output.setTo(this.y * a.z - this.z * a.y,this.z * a.x - this.x * a.z,this.x * a.y - this.y * a.x); + output.w = 1; + return output; + } + return new openfl_geom_Vector3D(this.y * a.z - this.z * a.y,this.z * a.x - this.x * a.z,this.x * a.y - this.y * a.x,1); + } + ,decrementBy: function(a) { + this.x -= a.x; + this.y -= a.y; + this.z -= a.z; + } + ,dotProduct: function(a) { + return this.x * a.x + this.y * a.y + this.z * a.z; + } + ,equals: function(toCompare,allFour) { + if(allFour == null) { + allFour = false; + } + if(this.x == toCompare.x && this.y == toCompare.y && this.z == toCompare.z) { + if(allFour) { + return this.w == toCompare.w; + } else { + return true; + } + } else { + return false; + } + } + ,incrementBy: function(a) { + this.x += a.x; + this.y += a.y; + this.z += a.z; + } + ,nearEquals: function(toCompare,tolerance,allFour) { + if(allFour == null) { + allFour = false; + } + if(Math.abs(this.x - toCompare.x) < tolerance && Math.abs(this.y - toCompare.y) < tolerance && Math.abs(this.z - toCompare.z) < tolerance) { + if(!(!allFour)) { + return Math.abs(this.w - toCompare.w) < tolerance; + } else { + return true; + } + } else { + return false; + } + } + ,negate: function() { + this.x *= -1; + this.y *= -1; + this.z *= -1; + } + ,normalize: function() { + var l = this.get_length(); + if(l != 0) { + this.x /= l; + this.y /= l; + this.z /= l; + } + return l; + } + ,project: function() { + this.x /= this.w; + this.y /= this.w; + this.z /= this.w; + } + ,scaleBy: function(s) { + this.x *= s; + this.y *= s; + this.z *= s; + } + ,setTo: function(xa,ya,za) { + this.x = xa; + this.y = ya; + this.z = za; + } + ,subtract: function(a) { + return new openfl_geom_Vector3D(this.x - a.x,this.y - a.y,this.z - a.z); + } + ,subtractToOutput: function(a,output) { + if(output != null) { + output.setTo(this.x - a.x,this.y - a.y,this.z - a.z); + return output; + } + return new openfl_geom_Vector3D(this.x - a.x,this.y - a.y,this.z - a.z); + } + ,toString: function() { + return "Vector3D(" + this.x + ", " + this.y + ", " + this.z + ")"; + } + ,get_length: function() { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + } + ,get_lengthSquared: function() { + return this.x * this.x + this.y * this.y + this.z * this.z; + } + ,__class__: openfl_geom_Vector3D + ,__properties__: {get_lengthSquared:"get_lengthSquared",get_length:"get_length"} +}; +var openfl_media_ID3Info = function() { +}; +$hxClasses["openfl.media.ID3Info"] = openfl_media_ID3Info; +openfl_media_ID3Info.__name__ = "openfl.media.ID3Info"; +openfl_media_ID3Info.prototype = { + __class__: openfl_media_ID3Info +}; +var openfl_media_Sound = function(stream,context) { + this.__webAudioContext = null; + this.__urlLoading = false; + openfl_events_EventDispatcher.call(this,this); + this.bytesLoaded = 0; + this.bytesTotal = 0; + this.isBuffering = false; + this.url = null; + if(stream != null) { + this.load(stream,context); + } + if(stream == null && lime_media_AudioManager.context != null) { + if(lime_media_AudioManager.context.type == "web") { + this.__webAudioContext = lime_media_AudioManager.context.web; + } + } +}; +$hxClasses["openfl.media.Sound"] = openfl_media_Sound; +openfl_media_Sound.__name__ = "openfl.media.Sound"; +openfl_media_Sound.fromAudioBuffer = function(buffer) { + var sound = new openfl_media_Sound(); + sound.__buffer = buffer; + return sound; +}; +openfl_media_Sound.fromFile = function(path) { + var buffer = lime_media_AudioBuffer.fromFile(path); + if(buffer == null) { + throw new openfl_errors_IOError("Error loading sound from file: " + path); + } + return openfl_media_Sound.fromAudioBuffer(buffer); +}; +openfl_media_Sound.loadFromFile = function(path) { + return lime_media_AudioBuffer.loadFromFile(path).then(function(audioBuffer) { + return lime_app_Future.withValue(openfl_media_Sound.fromAudioBuffer(audioBuffer)); + }); +}; +openfl_media_Sound.loadFromFiles = function(paths) { + return lime_media_AudioBuffer.loadFromFiles(paths).then(function(audioBuffer) { + return lime_app_Future.withValue(openfl_media_Sound.fromAudioBuffer(audioBuffer)); + }); +}; +openfl_media_Sound.__super__ = openfl_events_EventDispatcher; +openfl_media_Sound.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + close: function() { + if(this.__buffer != null) { + openfl_media_SoundMixer.__unregisterSoundChannelByBuffer(this.__buffer); + this.__buffer.dispose(); + this.__buffer = null; + } + } + ,load: function(stream,context) { + var _gthis = this; + this.url = stream.url; + this.__urlLoading = true; + this.dispatchEvent(new openfl_events_Event("open")); + var defaultLibrary = lime_utils_Assets.getLibrary("default"); + if(defaultLibrary != null && Object.prototype.hasOwnProperty.call(defaultLibrary.cachedAudioBuffers.h,this.url)) { + var audioBuffer = defaultLibrary.cachedAudioBuffers.h[this.url]; + var byteLength = audioBuffer != null && audioBuffer.data != null ? audioBuffer.data.byteLength : 0; + this.AudioBuffer_onURLProgress(byteLength,byteLength); + this.AudioBuffer_onURLLoad(audioBuffer); + } else { + lime_media_AudioBuffer.loadFromFile(this.url).onProgress($bind(this,this.AudioBuffer_onURLProgress)).onComplete($bind(this,this.AudioBuffer_onURLLoad)).onError(function(_) { + _gthis.AudioBuffer_onURLLoad(null); + }); + } + } + ,loadCompressedDataFromByteArray: function(bytes,bytesLength) { + if(bytes == null || bytesLength <= 0) { + this.dispatchEvent(new openfl_events_IOErrorEvent("ioError")); + return; + } + if(UInt.gt(bytes.position,0) || UInt.gt(openfl_utils_ByteArray.get_length(bytes),bytesLength)) { + var length = bytesLength; + if(length == null) { + length = 0; + } + var copy = new openfl_utils_ByteArrayData(length); + var offset = bytes.position; + var length = bytesLength; + if(length == null) { + length = 0; + } + if(offset == null) { + offset = 0; + } + copy.writeBytes(bytes,offset,length); + bytes = copy; + } + this.__buffer = lime_media_AudioBuffer.fromBytes(openfl_utils_ByteArray.toBytes(bytes)); + if(this.__buffer == null) { + this.dispatchEvent(new openfl_events_IOErrorEvent("ioError")); + } else { + this.dispatchEvent(new openfl_events_Event("open")); + this.dispatchEvent(new openfl_events_ProgressEvent("progress",false,false,UInt.toFloat(openfl_utils_ByteArray.get_length(bytes)),UInt.toFloat(openfl_utils_ByteArray.get_length(bytes)))); + this.dispatchEvent(new openfl_events_Event("complete")); + } + } + ,loadPCMFromByteArray: function(bytes,samples,format,stereo,sampleRate) { + if(sampleRate == null) { + sampleRate = 44100; + } + if(stereo == null) { + stereo = true; + } + if(format == null) { + format = "float"; + } + if(bytes == null) { + this.dispatchEvent(new openfl_events_IOErrorEvent("ioError")); + return; + } + var bitsPerSample = format == "float" ? 32 : 16; + var channels = stereo ? 2 : 1; + var bytesLength = samples * channels * (bitsPerSample / 8) | 0; + if(UInt.gt(bytes.position,0) || UInt.gt(openfl_utils_ByteArray.get_length(bytes),bytesLength)) { + var length = bytesLength; + if(length == null) { + length = 0; + } + var copy = new openfl_utils_ByteArrayData(length); + var offset = bytes.position; + var length = bytesLength; + if(length == null) { + length = 0; + } + if(offset == null) { + offset = 0; + } + copy.writeBytes(bytes,offset,length); + bytes = copy; + } + var audioBuffer = new lime_media_AudioBuffer(); + audioBuffer.bitsPerSample = bitsPerSample; + audioBuffer.channels = channels; + var elements = null; + var array = null; + var vector = null; + var view = null; + var buffer = openfl_utils_ByteArray.toArrayBuffer(bytes); + var len = null; + var this1; + if(elements != null) { + this1 = new Uint8Array(elements); + } else if(array != null) { + this1 = new Uint8Array(array); + } else if(vector != null) { + this1 = new Uint8Array(vector.__array); + } else if(view != null) { + this1 = new Uint8Array(view); + } else if(buffer != null) { + if(len == null) { + this1 = new Uint8Array(buffer,0); + } else { + this1 = new Uint8Array(buffer,0,len); + } + } else { + this1 = null; + } + audioBuffer.data = this1; + audioBuffer.sampleRate = sampleRate | 0; + this.__buffer = audioBuffer; + this.dispatchEvent(new openfl_events_Event("open")); + this.dispatchEvent(new openfl_events_ProgressEvent("progress",false,false,UInt.toFloat(openfl_utils_ByteArray.get_length(bytes)),UInt.toFloat(openfl_utils_ByteArray.get_length(bytes)))); + this.dispatchEvent(new openfl_events_Event("complete")); + } + ,play: function(startTime,loops,sndTransform) { + if(loops == null) { + loops = 0; + } + if(startTime == null) { + startTime = 0.0; + } + if(openfl_media_SoundMixer.__soundChannels.length >= 32) { + return null; + } + if(sndTransform == null) { + sndTransform = new openfl_media_SoundTransform(); + } else { + sndTransform = sndTransform.clone(); + } + var pan = openfl_media_SoundMixer.__soundTransform.pan + sndTransform.pan; + if(pan > 1) { + pan = 1; + } + if(pan < -1) { + pan = -1; + } + var volume = openfl_media_SoundMixer.__soundTransform.volume * sndTransform.volume; + var audioSource = new lime_media_AudioSource(this.__buffer); + audioSource.offset = startTime | 0; + if(loops > 1) { + audioSource.set_loops(loops - 1); + } + audioSource.set_gain(volume); + var position = audioSource.get_position(); + position.x = pan; + position.z = -1 * Math.sqrt(1 - Math.pow(pan,2)); + audioSource.set_position(position); + var soundChannel = new openfl_media_SoundChannel(this,this.__urlLoading ? null : audioSource,sndTransform); + if(this.__urlLoading) { + this.__pendingAudioSource = audioSource; + this.__pendingSoundChannel = soundChannel; + } else if(this.__buffer == null) { + if(this.__webAudioContext != null) { + soundChannel.__startSampleData(); + } + } + return soundChannel; + } + ,get_sampleRate: function() { + return this.__webAudioContext.sampleRate | 0; + } + ,get_id3: function() { + return new openfl_media_ID3Info(); + } + ,get_length: function() { + if(this.__buffer != null) { + return this.__buffer.get_src().duration() * 1000 | 0; + } + return 0; + } + ,AudioBuffer_onURLLoad: function(buffer) { + this.__urlLoading = false; + if(buffer == null) { + this.dispatchEvent(new openfl_events_IOErrorEvent("ioError")); + } else { + this.__buffer = buffer; + this.dispatchEvent(new openfl_events_Event("complete")); + if(this.__pendingSoundChannel != null) { + this.__pendingAudioSource.buffer = this.__buffer; + this.__pendingAudioSource.init(); + this.__pendingSoundChannel.__initAudioSource(this.__pendingAudioSource); + } + } + this.__pendingSoundChannel = null; + this.__pendingAudioSource = null; + } + ,AudioBuffer_onURLProgress: function(bytesLoaded,bytesTotal) { + var progressEvent = new openfl_events_ProgressEvent("progress"); + progressEvent.bytesLoaded = bytesLoaded; + progressEvent.bytesTotal = bytesTotal; + this.dispatchEvent(progressEvent); + } + ,__class__: openfl_media_Sound + ,__properties__: {get_sampleRate:"get_sampleRate",get_length:"get_length",get_id3:"get_id3"} +}); +var openfl_media_SoundChannel = function(sound,audioSource,soundTransform) { + this.__firstRun = true; + openfl_events_EventDispatcher.call(this,this); + this.__sound = sound; + this.leftPeak = 1; + this.rightPeak = 1; + if(soundTransform != null) { + this.__soundTransform = soundTransform; + } else { + this.__soundTransform = new openfl_media_SoundTransform(); + } + this.__initAudioSource(audioSource); + openfl_media_SoundMixer.__registerSoundChannel(this); +}; +$hxClasses["openfl.media.SoundChannel"] = openfl_media_SoundChannel; +openfl_media_SoundChannel.__name__ = "openfl.media.SoundChannel"; +openfl_media_SoundChannel.__super__ = openfl_events_EventDispatcher; +openfl_media_SoundChannel.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + stop: function() { + openfl_media_SoundMixer.__unregisterSoundChannel(this); + if(!this.__isValid) { + return; + } + if(this.__processor != null) { + this.__processor.disconnect(); + this.__processor.onaudioprocess = null; + this.__processor = null; + } + this.__audioSource.stop(); + this.__dispose(); + } + ,__dispose: function() { + if(!this.__isValid) { + return; + } + this.__audioSource.onComplete.remove($bind(this,this.audioSource_onComplete)); + this.__audioSource.dispose(); + this.__audioSource = null; + this.__isValid = false; + } + ,__startSampleData: function() { + var _gthis = this; + var webAudioContext = this.__sound.__webAudioContext; + if(webAudioContext != null) { + this.__sampleDataEvent = new openfl_events_SampleDataEvent("sampleData"); + this.__sound.dispatchEvent(this.__sampleDataEvent); + var bufferSize = this.__sampleDataEvent.getBufferSize(); + if(bufferSize == 0) { + openfl_Lib.setTimeout(function() { + _gthis.stop(); + _gthis.dispatchEvent(new openfl_events_Event("soundComplete")); + },1); + } else { + this.__processor = webAudioContext.createScriptProcessor(bufferSize,0,2); + this.__processor.connect(webAudioContext.destination); + this.__processor.onaudioprocess = $bind(this,this.onSample); + webAudioContext.resume(); + } + } + } + ,__updateTransform: function() { + this.set_soundTransform(this.get_soundTransform()); + } + ,__initAudioSource: function(audioSource) { + this.__audioSource = audioSource; + if(this.__audioSource == null) { + return; + } + this.__audioSource.onComplete.add($bind(this,this.audioSource_onComplete)); + this.__isValid = true; + this.__audioSource.play(); + } + ,get_position: function() { + if(!this.__isValid) { + return 0; + } + return this.__audioSource.get_currentTime() + this.__audioSource.offset; + } + ,set_position: function(value) { + if(!this.__isValid) { + return 0; + } + this.__audioSource.set_currentTime((value | 0) - this.__audioSource.offset); + return value; + } + ,get_soundTransform: function() { + return this.__soundTransform.clone(); + } + ,set_soundTransform: function(value) { + if(value != null) { + this.__soundTransform.pan = value.pan; + this.__soundTransform.volume = value.volume; + var pan = openfl_media_SoundMixer.__soundTransform.pan + this.__soundTransform.pan; + if(pan < -1) { + pan = -1; + } + if(pan > 1) { + pan = 1; + } + var volume = openfl_media_SoundMixer.__soundTransform.volume * this.__soundTransform.volume; + if(this.__isValid) { + this.__audioSource.set_gain(volume); + var position = this.__audioSource.get_position(); + position.x = pan; + position.z = -1 * Math.sqrt(1 - Math.pow(pan,2)); + this.__audioSource.set_position(position); + return value; + } + } + return value; + } + ,audioSource_onComplete: function() { + openfl_media_SoundMixer.__unregisterSoundChannel(this); + this.__dispose(); + this.dispatchEvent(new openfl_events_Event("soundComplete")); + } + ,onSample: function(event) { + var hasSampleData = false; + if(this.__firstRun) { + hasSampleData = true; + this.__firstRun = false; + } else { + openfl_utils_ByteArray.set_length(this.__sampleDataEvent.data,0); + this.__sound.dispatchEvent(this.__sampleDataEvent); + hasSampleData = UInt.gt(openfl_utils_ByteArray.get_length(this.__sampleDataEvent.data),0); + } + if(hasSampleData) { + this.__sampleDataEvent.getSamples(event); + } else { + this.stop(); + this.dispatchEvent(new openfl_events_Event("soundComplete")); + } + } + ,__class__: openfl_media_SoundChannel + ,__properties__: {set_soundTransform:"set_soundTransform",get_soundTransform:"get_soundTransform",set_position:"set_position",get_position:"get_position"} +}); +var openfl_media_SoundLoaderContext = function(bufferTime,checkPolicyFile) { + if(checkPolicyFile == null) { + checkPolicyFile = false; + } + if(bufferTime == null) { + bufferTime = 1000; + } + this.bufferTime = bufferTime; + this.checkPolicyFile = checkPolicyFile; +}; +$hxClasses["openfl.media.SoundLoaderContext"] = openfl_media_SoundLoaderContext; +openfl_media_SoundLoaderContext.__name__ = "openfl.media.SoundLoaderContext"; +openfl_media_SoundLoaderContext.prototype = { + __class__: openfl_media_SoundLoaderContext +}; +var openfl_media_SoundTransform = function(vol,panning) { + if(panning == null) { + panning = 0; + } + if(vol == null) { + vol = 1; + } + this.volume = vol; + this.pan = panning; + this.leftToLeft = 0; + this.leftToRight = 0; + this.rightToLeft = 0; + this.rightToRight = 0; +}; +$hxClasses["openfl.media.SoundTransform"] = openfl_media_SoundTransform; +openfl_media_SoundTransform.__name__ = "openfl.media.SoundTransform"; +openfl_media_SoundTransform.prototype = { + clone: function() { + return new openfl_media_SoundTransform(this.volume,this.pan); + } + ,__class__: openfl_media_SoundTransform +}; +var openfl_media_SoundMixer = function() { }; +$hxClasses["openfl.media.SoundMixer"] = openfl_media_SoundMixer; +openfl_media_SoundMixer.__name__ = "openfl.media.SoundMixer"; +openfl_media_SoundMixer.__properties__ = {set_soundTransform:"set_soundTransform",get_soundTransform:"get_soundTransform"}; +openfl_media_SoundMixer.areSoundsInaccessible = function() { + return false; +}; +openfl_media_SoundMixer.stopAll = function() { + var i = openfl_media_SoundMixer.__soundChannels.length; + while(i > 0) { + --i; + openfl_media_SoundMixer.__soundChannels[i].stop(); + } +}; +openfl_media_SoundMixer.__registerSoundChannel = function(soundChannel) { + openfl_media_SoundMixer.__soundChannels.push(soundChannel); +}; +openfl_media_SoundMixer.__unregisterSoundChannel = function(soundChannel) { + HxOverrides.remove(openfl_media_SoundMixer.__soundChannels,soundChannel); +}; +openfl_media_SoundMixer.get_soundTransform = function() { + return openfl_media_SoundMixer.__soundTransform; +}; +openfl_media_SoundMixer.__unregisterSoundChannelByBuffer = function(buffer) { + var i = openfl_media_SoundMixer.__soundChannels.length; + while(i > 0) { + --i; + var channel = openfl_media_SoundMixer.__soundChannels[i]; + if(channel.__audioSource.buffer == buffer) { + channel.stop(); + } + } +}; +openfl_media_SoundMixer.set_soundTransform = function(value) { + openfl_media_SoundMixer.__soundTransform = value.clone(); + var _g = 0; + var _g1 = openfl_media_SoundMixer.__soundChannels; + while(_g < _g1.length) { + var channel = _g1[_g]; + ++_g; + channel.__updateTransform(); + } + return value; +}; +var openfl_media_Video = function(width,height) { + if(height == null) { + height = 240; + } + if(width == null) { + width = 320; + } + openfl_display_DisplayObject.call(this); + this.__drawableType = 8; + this.__width = width; + this.__height = height; + this.__textureTime = -1; + this.smoothing = false; + this.deblocking = 0; +}; +$hxClasses["openfl.media.Video"] = openfl_media_Video; +openfl_media_Video.__name__ = "openfl.media.Video"; +openfl_media_Video.__super__ = openfl_display_DisplayObject; +openfl_media_Video.prototype = $extend(openfl_display_DisplayObject.prototype,{ + attachNetStream: function(netStream) { + this.__stream = netStream; + if(this.__stream != null && this.__stream.__video != null && !this.__stream.__closed) { + this.__stream.__video.play(); + } + } + ,clear: function() { + } + ,__enterFrame: function(deltaTime) { + if(this.__renderable && this.__stream != null) { + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + } + ,__getBounds: function(rect,matrix) { + var bounds = openfl_geom_Rectangle.__pool.get(); + bounds.setTo(0,0,this.__width,this.__height); + bounds.__transform(bounds,matrix); + rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height); + openfl_geom_Rectangle.__pool.release(bounds); + } + ,__getIndexBuffer: function(context) { + var gl = context.gl; + if(this.__indexBuffer == null || this.__indexBufferContext != context.__context) { + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__indexBufferData = new Uint16Array(6); + this.__indexBufferData[0] = 0; + this.__indexBufferData[1] = 1; + this.__indexBufferData[2] = 2; + this.__indexBufferData[3] = 2; + this.__indexBufferData[4] = 1; + this.__indexBufferData[5] = 3; + this.__indexBufferContext = context.__context; + this.__indexBuffer = context.createIndexBuffer(6); + this.__indexBuffer.uploadFromTypedArray(this.__indexBufferData); + } + return this.__indexBuffer; + } + ,__getTexture: function(context) { + if(this.__stream == null || this.__stream.__video == null) { + return null; + } + var gl = context.__context.webgl; + var internalFormat = gl.RGBA; + var format = gl.RGBA; + if(!this.__stream.__closed && this.__stream.__video.currentTime != this.__textureTime) { + if(this.__texture == null) { + this.__texture = context.createRectangleTexture(this.__stream.__video.videoWidth,this.__stream.__video.videoHeight,1,false); + } + context.__bindGLTexture2D(this.__texture.__textureID); + lime_graphics_WebGLRenderContext.texImage2D(gl,gl.TEXTURE_2D,0,internalFormat,format,gl.UNSIGNED_BYTE,this.__stream.__video); + this.__textureTime = this.__stream.__video.currentTime; + } + return this.__texture; + } + ,__getVertexBuffer: function(context) { + var gl = context.gl; + if(this.__vertexBuffer == null || this.__vertexBufferContext != context.__context || this.__currentWidth != this.get_width() || this.__currentHeight != this.get_height()) { + this.__currentWidth = this.get_width(); + this.__currentHeight = this.get_height(); + var uvWidth = 1; + var uvHeight = 1; + var array = null; + var vector = null; + var view = null; + var buffer = null; + var len = null; + this.__vertexBufferData = new Float32Array(20); + this.__vertexBufferData[0] = this.get_width(); + this.__vertexBufferData[1] = this.get_height(); + this.__vertexBufferData[3] = uvWidth; + this.__vertexBufferData[4] = uvHeight; + this.__vertexBufferData[6] = this.get_height(); + this.__vertexBufferData[9] = uvHeight; + this.__vertexBufferData[10] = this.get_width(); + this.__vertexBufferData[13] = uvWidth; + this.__vertexBufferContext = context.__context; + this.__vertexBuffer = context.createVertexBuffer(3,5); + this.__vertexBuffer.uploadFromTypedArray(lime_utils_Float32Array.toArrayBufferView(this.__vertexBufferData)); + } + return this.__vertexBuffer; + } + ,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { + if(!hitObject.get_visible() || this.__isMask) { + return false; + } + if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) { + return false; + } + this.__getRenderTransform(); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx)); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x)); + if(px > 0 && py > 0 && px <= this.__width && py <= this.__height) { + if(stack != null && !interactiveOnly) { + stack.push(hitObject); + } + return true; + } + return false; + } + ,__hitTestMask: function(x,y) { + var point = openfl_geom_Point.__pool.get(); + point.setTo(x,y); + this.__globalToLocal(point,point); + var hit = point.x > 0 && point.y > 0 && point.x <= this.__width && point.y <= this.__height; + openfl_geom_Point.__pool.release(point); + return hit; + } + ,get_height: function() { + return this.__height * this.get_scaleY(); + } + ,set_height: function(value) { + if(this.get_scaleY() != 1 || value != this.__height) { + this.__setTransformDirty(); + this.__dirty = true; + } + this.set_scaleY(1); + return this.__height = value; + } + ,get_videoHeight: function() { + if(this.__stream != null && this.__stream.__video != null) { + return this.__stream.__video.videoHeight | 0; + } + return 0; + } + ,get_videoWidth: function() { + if(this.__stream != null && this.__stream.__video != null) { + return this.__stream.__video.videoWidth | 0; + } + return 0; + } + ,get_width: function() { + return this.__width * this.__scaleX; + } + ,set_width: function(value) { + if(this.__scaleX != 1 || this.__width != value) { + this.__setTransformDirty(); + this.__dirty = true; + } + this.set_scaleX(1); + return this.__width = value; + } + ,__class__: openfl_media_Video + ,__properties__: $extend(openfl_display_DisplayObject.prototype.__properties__,{get_videoWidth:"get_videoWidth",get_videoHeight:"get_videoHeight"}) +}); +var openfl_net_IDynamicPropertyOutput = function() { }; +$hxClasses["openfl.net.IDynamicPropertyOutput"] = openfl_net_IDynamicPropertyOutput; +openfl_net_IDynamicPropertyOutput.__name__ = "openfl.net.IDynamicPropertyOutput"; +openfl_net_IDynamicPropertyOutput.__isInterface__ = true; +openfl_net_IDynamicPropertyOutput.prototype = { + __class__: openfl_net_IDynamicPropertyOutput +}; +var openfl_net_IDynamicPropertyWriter = function() { }; +$hxClasses["openfl.net.IDynamicPropertyWriter"] = openfl_net_IDynamicPropertyWriter; +openfl_net_IDynamicPropertyWriter.__name__ = "openfl.net.IDynamicPropertyWriter"; +openfl_net_IDynamicPropertyWriter.__isInterface__ = true; +openfl_net_IDynamicPropertyWriter.prototype = { + __class__: openfl_net_IDynamicPropertyWriter +}; +var openfl_net_NetConnection = function() { + openfl_events_EventDispatcher.call(this); +}; +$hxClasses["openfl.net.NetConnection"] = openfl_net_NetConnection; +openfl_net_NetConnection.__name__ = "openfl.net.NetConnection"; +openfl_net_NetConnection.__super__ = openfl_events_EventDispatcher; +openfl_net_NetConnection.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + connect: function(command,p1,p2,p3,p4,p5) { + if(command != null) { + throw haxe_Exception.thrown("Error: Can only connect in \"HTTP streaming\" mode"); + } + this.dispatchEvent(new openfl_events_NetStatusEvent("netStatus",false,true,{ code : "NetConnection.Connect.Success"})); + } + ,__class__: openfl_net_NetConnection +}); +var openfl_net_NetStream = function(connection,peerID) { + openfl_events_EventDispatcher.call(this); + this.__connection = connection; + this.__soundTransform = new openfl_media_SoundTransform(); + this.__video = window.document.createElement("video"); + this.__video.setAttribute("playsinline",""); + this.__video.setAttribute("webkit-playsinline",""); + this.__video.setAttribute("crossorigin","anonymous"); + this.__video.addEventListener("error",$bind(this,this.video_onError),false); + this.__video.addEventListener("waiting",$bind(this,this.video_onWaiting),false); + this.__video.addEventListener("ended",$bind(this,this.video_onEnd),false); + this.__video.addEventListener("pause",$bind(this,this.video_onPause),false); + this.__video.addEventListener("seeking",$bind(this,this.video_onSeeking),false); + this.__video.addEventListener("playing",$bind(this,this.video_onPlaying),false); + this.__video.addEventListener("timeupdate",$bind(this,this.video_onTimeUpdate),false); + this.__video.addEventListener("loadstart",$bind(this,this.video_onLoadStart),false); + this.__video.addEventListener("stalled",$bind(this,this.video_onStalled),false); + this.__video.addEventListener("durationchanged",$bind(this,this.video_onDurationChanged),false); + this.__video.addEventListener("canplay",$bind(this,this.video_onCanPlay),false); + this.__video.addEventListener("canplaythrough",$bind(this,this.video_onCanPlayThrough),false); + this.__video.addEventListener("loadedmetadata",$bind(this,this.video_onLoadMetaData),false); +}; +$hxClasses["openfl.net.NetStream"] = openfl_net_NetStream; +openfl_net_NetStream.__name__ = "openfl.net.NetStream"; +openfl_net_NetStream.__super__ = openfl_events_EventDispatcher; +openfl_net_NetStream.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + close: function() { + if(this.__video == null) { + return; + } + this.__closed = true; + this.__video.pause(); + this.__video.src = ""; + this.time = 0; + } + ,dispose: function() { + this.close(); + this.__video = null; + } + ,pause: function() { + if(this.__video != null) { + this.__video.pause(); + } + } + ,play: function(url,p1,p2,p3,p4,p5) { + if(this.__video == null) { + return; + } + this.__video.volume = openfl_media_SoundMixer.__soundTransform.volume * this.__soundTransform.volume; + if(typeof(url) == "string") { + this.__video.src = url; + } else { + this.__video.srcObject = url; + } + this.__video.play(); + } + ,requestVideoStatus: function() { + var _gthis = this; + if(this.__video == null) { + return; + } + if(this.__timer == null) { + this.__timer = new haxe_Timer(1); + } + this.__timer.run = function() { + if(_gthis.__video.paused) { + _gthis.__playStatus("NetStream.Play.pause"); + } else { + _gthis.__playStatus("NetStream.Play.playing"); + } + _gthis.__timer.stop(); + }; + } + ,resume: function() { + if(this.__video != null) { + this.__video.play(); + } + } + ,seek: function(time) { + if(this.__video == null) { + return; + } + if(time < 0) { + time = 0; + } else if(time > this.__video.duration) { + time = this.__video.duration; + } + this.__dispatchStatus("NetStream.SeekStart.Notify"); + this.__video.currentTime = time; + } + ,togglePause: function() { + if(this.__video == null) { + return; + } + if(this.__video.paused) { + this.__video.play(); + } else { + this.__video.pause(); + } + } + ,__dispatchStatus: function(code) { + var event = new openfl_events_NetStatusEvent("netStatus",false,false,{ code : code}); + this.__connection.dispatchEvent(event); + this.dispatchEvent(event); + } + ,__playStatus: function(code) { + if(this.__video == null) { + return; + } + if(this.client != null) { + try { + var handler = this.client.onPlayStatus; + handler({ code : code, duration : this.__video.duration, position : this.__video.currentTime, speed : this.__video.playbackRate, start : this.__video.startTime}); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + } + } + } + ,video_onCanPlay: function(event) { + this.__playStatus("NetStream.Play.canplay"); + } + ,video_onCanPlayThrough: function(event) { + this.__playStatus("NetStream.Play.canplaythrough"); + } + ,video_onDurationChanged: function(event) { + this.__playStatus("NetStream.Play.durationchanged"); + } + ,video_onEnd: function(event) { + this.__dispatchStatus("NetStream.Play.Stop"); + this.__dispatchStatus("NetStream.Play.Complete"); + this.__playStatus("NetStream.Play.Complete"); + } + ,video_onError: function(event) { + this.__dispatchStatus("NetStream.Play.Stop"); + this.__playStatus("NetStream.Play.error"); + } + ,video_onLoadMetaData: function(event) { + if(this.__video == null) { + return; + } + if(this.client != null) { + try { + var handler = this.client.onMetaData; + handler({ width : this.__video.videoWidth, height : this.__video.videoHeight, duration : this.__video.duration}); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + } + } + } + ,video_onLoadStart: function(event) { + this.__playStatus("NetStream.Play.loadstart"); + } + ,video_onPause: function(event) { + this.__playStatus("NetStream.Play.pause"); + } + ,video_onPlaying: function(event) { + this.__dispatchStatus("NetStream.Play.Start"); + this.__playStatus("NetStream.Play.playing"); + } + ,video_onSeeking: function(event) { + this.__playStatus("NetStream.Play.seeking"); + this.__dispatchStatus("NetStream.Seek.Complete"); + } + ,video_onStalled: function(event) { + this.__playStatus("NetStream.Play.stalled"); + } + ,video_onTimeUpdate: function(event) { + if(this.__video == null) { + return; + } + this.time = this.__video.currentTime; + this.__playStatus("NetStream.Play.timeupdate"); + } + ,video_onWaiting: function(event) { + this.__playStatus("NetStream.Play.waiting"); + } + ,get_soundTransform: function() { + return this.__soundTransform.clone(); + } + ,set_soundTransform: function(value) { + if(value != null) { + this.__soundTransform.pan = value.pan; + this.__soundTransform.volume = value.volume; + if(this.__video != null) { + this.__video.volume = openfl_media_SoundMixer.__soundTransform.volume * this.__soundTransform.volume; + } + } + return value; + } + ,get_speed: function() { + if(this.__video != null) { + return this.__video.playbackRate; + } else { + return 1; + } + } + ,set_speed: function(value) { + if(this.__video != null) { + return this.__video.playbackRate = value; + } else { + return value; + } + } + ,__class__: openfl_net_NetStream + ,__properties__: {set_speed:"set_speed",get_speed:"get_speed",set_soundTransform:"set_soundTransform",get_soundTransform:"get_soundTransform"} +}); +var openfl_net_ObjectEncoding = {}; +var openfl_net_URLLoader = function(request) { + openfl_events_EventDispatcher.call(this); + this.bytesLoaded = 0; + this.bytesTotal = 0; + this.dataFormat = 1; + if(request != null) { + this.load(request); + } +}; +$hxClasses["openfl.net.URLLoader"] = openfl_net_URLLoader; +openfl_net_URLLoader.__name__ = "openfl.net.URLLoader"; +openfl_net_URLLoader.__super__ = openfl_events_EventDispatcher; +openfl_net_URLLoader.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + close: function() { + if(this.__httpRequest != null) { + this.__httpRequest.cancel(); + } + } + ,load: function(request) { + var _gthis = this; + var openEvent = new openfl_events_Event("open"); + this.dispatchEvent(openEvent); + if(this.dataFormat == 0) { + var httpRequest = new lime_net__$HTTPRequest_$openfl_$utils_$ByteArray(); + this.__prepareRequest(httpRequest,request); + httpRequest.load().onProgress($bind(this,this.httpRequest_onProgress)).onError($bind(this,this.httpRequest_onError)).onComplete(function(data) { + _gthis.__dispatchResponseStatus(); + _gthis.__dispatchStatus(); + _gthis.data = data; + var event = new openfl_events_Event("complete"); + _gthis.dispatchEvent(event); + }); + } else { + var httpRequest = new lime_net__$HTTPRequest_$String(); + this.__prepareRequest(httpRequest,request); + httpRequest.load().onProgress($bind(this,this.httpRequest_onProgress)).onError($bind(this,this.httpRequest_onError)).onComplete(function(data) { + _gthis.__dispatchResponseStatus(); + _gthis.__dispatchStatus(); + if(_gthis.dataFormat == 2) { + _gthis.data = openfl_net_URLVariables._new(data); + } else { + _gthis.data = data; + } + var event = new openfl_events_Event("complete"); + _gthis.dispatchEvent(event); + }); + } + } + ,__dispatchResponseStatus: function() { + var responseStatusEvent = new openfl_events_HTTPStatusEvent("httpResponseStatus",false,false,this.__httpRequest.responseStatus); + responseStatusEvent.responseURL = this.__httpRequest.uri; + var headers = []; + if(this.__httpRequest.enableResponseHeaders && this.__httpRequest.responseHeaders != null) { + var _g = 0; + var _g1 = this.__httpRequest.responseHeaders; + while(_g < _g1.length) { + var header = _g1[_g]; + ++_g; + headers.push(new openfl_net_URLRequestHeader(header.name,header.value)); + } + } + responseStatusEvent.responseHeaders = headers; + this.dispatchEvent(responseStatusEvent); + } + ,__dispatchStatus: function() { + var statusEvent = new openfl_events_HTTPStatusEvent("httpStatus",false,false,this.__httpRequest.responseStatus); + this.dispatchEvent(statusEvent); + } + ,__prepareRequest: function(httpRequest,request) { + this.__httpRequest = httpRequest; + this.__httpRequest.uri = request.url; + this.__httpRequest.method = request.method; + if(request.data != null) { + if(Type.typeof(request.data) == ValueType.TObject) { + var fields = Reflect.fields(request.data); + var _g = 0; + while(_g < fields.length) { + var field = fields[_g]; + ++_g; + this.__httpRequest.formData.h[field] = Reflect.field(request.data,field); + } + } else if(((request.data) instanceof haxe_io_Bytes)) { + this.__httpRequest.data = request.data; + } else { + this.__httpRequest.data = haxe_io_Bytes.ofString(Std.string(request.data)); + } + } + this.__httpRequest.contentType = request.contentType; + if(request.requestHeaders != null) { + var _g = 0; + var _g1 = request.requestHeaders; + while(_g < _g1.length) { + var header = _g1[_g]; + ++_g; + this.__httpRequest.headers.push(new lime_net_HTTPRequestHeader(header.name,header.value)); + } + } + this.__httpRequest.followRedirects = request.followRedirects; + this.__httpRequest.timeout = request.idleTimeout | 0; + this.__httpRequest.manageCookies = request.manageCookies; + this.__httpRequest.withCredentials = request.withCredentials; + var userAgent = request.userAgent; + if(userAgent == null) { + userAgent = "Mozilla/5.0 (Windows; U; en) AppleWebKit/420+ (KHTML, like Gecko) OpenFL/1.0"; + } + this.__httpRequest.userAgent = request.userAgent; + this.__httpRequest.enableResponseHeaders = true; + } + ,httpRequest_onError: function(error) { + this.__dispatchResponseStatus(); + this.__dispatchStatus(); + if(((this.__httpRequest) instanceof lime_net__$HTTPRequest_$Bytes)) { + var bytesRequest = this.__httpRequest; + this.data = bytesRequest.responseData; + } else if(((this.__httpRequest) instanceof lime_net__$HTTPRequest_$String)) { + var stringRequest = this.__httpRequest; + this.data = stringRequest.responseData; + } + if(error == 403) { + var event = new openfl_events_SecurityErrorEvent("securityError"); + event.text = Std.string(error); + this.dispatchEvent(event); + } else { + var event = new openfl_events_IOErrorEvent("ioError"); + event.text = Std.string(error); + this.dispatchEvent(event); + } + } + ,httpRequest_onProgress: function(bytesLoaded,bytesTotal) { + var event = new openfl_events_ProgressEvent("progress"); + event.bytesLoaded = bytesLoaded; + event.bytesTotal = bytesTotal; + this.dispatchEvent(event); + } + ,__class__: openfl_net_URLLoader +}); +var openfl_net_URLLoaderDataFormat = {}; +openfl_net_URLLoaderDataFormat.fromString = function(value) { + switch(value) { + case "binary": + return 0; + case "text": + return 1; + case "variables": + return 2; + default: + return null; + } +}; +openfl_net_URLLoaderDataFormat.toString = function(this1) { + switch(this1) { + case 0: + return "binary"; + case 1: + return "text"; + case 2: + return "variables"; + default: + return null; + } +}; +var openfl_net_URLRequest = function(url) { + this.withCredentials = false; + if(url != null) { + this.url = url; + } + this.contentType = null; + this.followRedirects = openfl_net_URLRequestDefaults.followRedirects; + if(openfl_net_URLRequestDefaults.idleTimeout > 0) { + this.idleTimeout = openfl_net_URLRequestDefaults.idleTimeout; + } else { + this.idleTimeout = 30000; + } + this.manageCookies = openfl_net_URLRequestDefaults.manageCookies; + this.method = "GET"; + this.requestHeaders = []; + this.userAgent = openfl_net_URLRequestDefaults.userAgent; +}; +$hxClasses["openfl.net.URLRequest"] = openfl_net_URLRequest; +openfl_net_URLRequest.__name__ = "openfl.net.URLRequest"; +openfl_net_URLRequest.prototype = { + __class__: openfl_net_URLRequest +}; +var openfl_net_URLRequestDefaults = function() { }; +$hxClasses["openfl.net.URLRequestDefaults"] = openfl_net_URLRequestDefaults; +openfl_net_URLRequestDefaults.__name__ = "openfl.net.URLRequestDefaults"; +var openfl_net_URLRequestHeader = function(name,value) { + if(value == null) { + value = ""; + } + if(name == null) { + name = ""; + } + this.name = name; + this.value = value; +}; +$hxClasses["openfl.net.URLRequestHeader"] = openfl_net_URLRequestHeader; +openfl_net_URLRequestHeader.__name__ = "openfl.net.URLRequestHeader"; +openfl_net_URLRequestHeader.prototype = { + __class__: openfl_net_URLRequestHeader +}; +var openfl_net_URLVariables = {}; +openfl_net_URLVariables._new = function(source) { + var this1 = { }; + if(source != null) { + openfl_net_URLVariables.decode(this1,source); + } + return this1; +}; +openfl_net_URLVariables.decode = function(this1,source) { + var fields = Reflect.fields(this1); + var _g = 0; + while(_g < fields.length) { + var f = fields[_g]; + ++_g; + Reflect.deleteField(this1,f); + } + var fields = source.split(";").join("&").split("&"); + var _g = 0; + while(_g < fields.length) { + var f = fields[_g]; + ++_g; + var eq = f.indexOf("="); + if(eq > 0) { + var s = HxOverrides.substr(f,0,eq); + var field = decodeURIComponent(s.split("+").join(" ")); + var s1 = HxOverrides.substr(f,eq + 1,null); + this1[field] = decodeURIComponent(s1.split("+").join(" ")); + } else if(eq != 0) { + this1[decodeURIComponent(f.split("+").join(" "))] = ""; + } + } +}; +openfl_net_URLVariables.toString = function(this1) { + var result = []; + var fields = Reflect.fields(this1); + var _g = 0; + while(_g < fields.length) { + var f = fields[_g]; + ++_g; + var value = Reflect.field(this1,f); + if(f.indexOf("[]") > -1 && ((value) instanceof Array)) { + var _g1 = []; + var x = $getIterator(value); + while(x.hasNext()) { + var x1 = x.next(); + _g1.push(encodeURIComponent(x1)); + } + var arrayValue = _g1.join("&" + f + "="); + result.push(encodeURIComponent(f) + "=" + arrayValue); + } else { + var tmp = encodeURIComponent(f) + "="; + var s = Std.string(value); + result.push(tmp + encodeURIComponent(s)); + } + } + return result.join("&"); +}; +openfl_net_URLVariables.__get = function(this1,key) { + return Reflect.field(this1,key); +}; +openfl_net_URLVariables.__set = function(this1,key,value) { + this1[key] = value; +}; +var openfl_system_ApplicationDomain = function(parentDomain) { + if(parentDomain != null) { + this.parentDomain = parentDomain; + } else { + this.parentDomain = openfl_system_ApplicationDomain.currentDomain; + } +}; +$hxClasses["openfl.system.ApplicationDomain"] = openfl_system_ApplicationDomain; +openfl_system_ApplicationDomain.__name__ = "openfl.system.ApplicationDomain"; +openfl_system_ApplicationDomain.prototype = { + getDefinition: function(name) { + return $hxClasses[name]; + } + ,hasDefinition: function(name) { + return $hxClasses[name] != null; + } + ,__class__: openfl_system_ApplicationDomain +}; +var openfl_system_Capabilities = function() { }; +$hxClasses["openfl.system.Capabilities"] = openfl_system_Capabilities; +openfl_system_Capabilities.__name__ = "openfl.system.Capabilities"; +openfl_system_Capabilities.__properties__ = {get_version:"get_version",get_screenResolutionY:"get_screenResolutionY",get_screenResolutionX:"get_screenResolutionX",get_screenDPI:"get_screenDPI",get_pixelAspectRatio:"get_pixelAspectRatio",get_os:"get_os",get_manufacturer:"get_manufacturer",get_language:"get_language",get_cpuArchitecture:"get_cpuArchitecture"}; +openfl_system_Capabilities.hasMultiChannelAudio = function(type) { + return false; +}; +openfl_system_Capabilities.get_cpuArchitecture = function() { + return "x86"; +}; +openfl_system_Capabilities.get_language = function() { + var language = lime_system_Locale.get_language(lime_system_Locale.get_currentLocale()); + if(language != null) { + language = language.toLowerCase(); + switch(language) { + case "cs":case "da":case "de":case "en":case "es":case "fi":case "fr":case "hu":case "it":case "ja":case "ko":case "nb":case "nl":case "pl":case "pt":case "ru":case "sv":case "tr": + return language; + case "zh": + var region = lime_system_Locale.get_region(lime_system_Locale.get_currentLocale()); + if(region != null) { + switch(region.toUpperCase()) { + case "HANT":case "TW": + return "zh-TW"; + default: + } + } + return "zh-CN"; + default: + return "xu"; + } + } + return "en"; +}; +openfl_system_Capabilities.get_manufacturer = function() { + var name = lime_system_System.get_platformName(); + return "OpenFL" + (name != null ? " " + name : ""); +}; +openfl_system_Capabilities.get_os = function() { + var label = lime_system_System.get_platformLabel(); + if(label != null) { + return label; + } else { + return ""; + } +}; +openfl_system_Capabilities.get_pixelAspectRatio = function() { + return 1; +}; +openfl_system_Capabilities.get_screenDPI = function() { + var $window = openfl_utils__$internal_Lib.application != null ? openfl_utils__$internal_Lib.application.__window : null; + var screenDPI = 72; + if($window != null) { + screenDPI *= $window.__scale; + } + return screenDPI; +}; +openfl_system_Capabilities.get_screenResolutionX = function() { + var stage = openfl_utils__$internal_Lib.current.stage; + var resolutionX = 0; + if(stage == null) { + return 0; + } + if(stage.window != null) { + var display = stage.window.get_display(); + if(display != null) { + resolutionX = Math.ceil(display.currentMode.width * stage.window.__scale); + } + } + if(resolutionX > 0) { + return resolutionX; + } + return stage.stageWidth; +}; +openfl_system_Capabilities.get_screenResolutionY = function() { + var stage = openfl_utils__$internal_Lib.current.stage; + var resolutionY = 0; + if(stage == null) { + return 0; + } + if(stage.window != null) { + var display = stage.window.get_display(); + if(display != null) { + resolutionY = Math.ceil(display.currentMode.height * stage.window.__scale); + } + } + if(resolutionY > 0) { + return resolutionY; + } + return stage.stageHeight; +}; +openfl_system_Capabilities.get_version = function() { + var value = "WEB"; + value += " " + StringTools.replace("9.4.2",".",",") + ",0"; + return value; +}; +var openfl_system_LoaderContext = function(checkPolicyFile,applicationDomain,securityDomain) { + if(checkPolicyFile == null) { + checkPolicyFile = false; + } + this.checkPolicyFile = checkPolicyFile; + this.securityDomain = securityDomain; + this.applicationDomain = applicationDomain; + this.allowCodeImport = true; + this.allowLoadBytesCodeExecution = true; +}; +$hxClasses["openfl.system.LoaderContext"] = openfl_system_LoaderContext; +openfl_system_LoaderContext.__name__ = "openfl.system.LoaderContext"; +openfl_system_LoaderContext.prototype = { + __class__: openfl_system_LoaderContext +}; +var openfl_system_SecurityDomain = function() { +}; +$hxClasses["openfl.system.SecurityDomain"] = openfl_system_SecurityDomain; +openfl_system_SecurityDomain.__name__ = "openfl.system.SecurityDomain"; +openfl_system_SecurityDomain.prototype = { + __class__: openfl_system_SecurityDomain +}; +var openfl_system_TouchscreenType = {}; +openfl_system_TouchscreenType.fromString = function(value) { + switch(value) { + case "finger": + return 0; + case "none": + return 1; + case "stylus": + return 2; + default: + return null; + } +}; +openfl_system_TouchscreenType.toString = function(this1) { + switch(this1) { + case 0: + return "finger"; + case 1: + return "none"; + case 2: + return "stylus"; + default: + return null; + } +}; +var openfl_text_AntiAliasType = {}; +openfl_text_AntiAliasType.fromString = function(value) { + switch(value) { + case "advanced": + return 0; + case "normal": + return 1; + default: + return null; + } +}; +openfl_text_AntiAliasType.toString = function(this1) { + switch(this1) { + case 0: + return "advanced"; + case 1: + return "normal"; + default: + return null; + } +}; +var openfl_text_FontStyle = {}; +openfl_text_FontStyle.fromString = function(value) { + switch(value) { + case "bold": + return 0; + case "boldItalic": + return 1; + case "italic": + return 2; + case "regular": + return 3; + default: + return null; + } +}; +openfl_text_FontStyle.toString = function(this1) { + switch(this1) { + case 0: + return "bold"; + case 1: + return "boldItalic"; + case 2: + return "italic"; + case 3: + return "regular"; + default: + return null; + } +}; +var openfl_text_FontType = {}; +openfl_text_FontType.fromString = function(value) { + switch(value) { + case "device": + return 0; + case "embedded": + return 1; + case "embeddedCFF": + return 2; + default: + return null; + } +}; +openfl_text_FontType.toString = function(this1) { + switch(this1) { + case 0: + return "device"; + case 1: + return "embedded"; + case 2: + return "embeddedCFF"; + default: + return null; + } +}; +var openfl_text_GridFitType = {}; +openfl_text_GridFitType.fromString = function(value) { + switch(value) { + case "none": + return 0; + case "pixel": + return 1; + case "subpixel": + return 2; + default: + return null; + } +}; +openfl_text_GridFitType.toString = function(this1) { + switch(this1) { + case 0: + return "none"; + case 1: + return "pixel"; + case 2: + return "subpixel"; + default: + return null; + } +}; +var openfl_text_StyleSheet = function() { + openfl_events_EventDispatcher.call(this); + this.clear(); +}; +$hxClasses["openfl.text.StyleSheet"] = openfl_text_StyleSheet; +openfl_text_StyleSheet.__name__ = "openfl.text.StyleSheet"; +openfl_text_StyleSheet.__super__ = openfl_events_EventDispatcher; +openfl_text_StyleSheet.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + clear: function() { + this.__styleNamesDirty = false; + this.__styleNames = null; + this.__styles = new haxe_ds_StringMap(); + } + ,getStyle: function(styleName) { + styleName = styleName.toLowerCase(); + if(Object.prototype.hasOwnProperty.call(this.__styles.h,styleName)) { + return this.__styles.h[styleName]; + } else { + return null; + } + } + ,parseCSS: function(CSSText) { + var _g = new haxe_ds_StringMap(); + _g.h["silent"] = true; + var parser = new openfl_text__$internal_CSSParser(_g); + var ast = parser.parse(CSSText); + if(ast != null) { + var rules = ast.h["rules"]; + var _g = 0; + while(_g < rules.length) { + var rule = rules[_g]; + ++_g; + var styleName = Object.prototype.hasOwnProperty.call(rule.h,"selectors") ? rule.h["selectors"] : null; + if(styleName != null) { + styleName = styleName.toLowerCase(); + if(!Object.prototype.hasOwnProperty.call(this.__styles.h,styleName)) { + this.__styles.h[styleName] = { }; + this.__styleNamesDirty = true; + } + var object = this.__styles.h[styleName]; + var declarations = rule.h["declarations"]; + if(declarations != null) { + var _g1 = 0; + while(_g1 < declarations.length) { + var declaration = declarations[_g1]; + ++_g1; + var property = declaration.h["property"]; + var value = Std.string(declaration.h["value"]); + if(property != null) { + if(property == null) { + object[property] = value; + } else { + switch(property) { + case "font-family": + var value1 = StringTools.replace(value,"\"",""); + var this1 = object; + if(this1 != null) { + Reflect.setProperty(this1,"fontFamily",value1); + } + break; + case "font-size": + var this2 = object; + if(this2 != null) { + Reflect.setProperty(this2,"fontSize",value); + } + break; + case "font-style": + var this3 = object; + if(this3 != null) { + Reflect.setProperty(this3,"fontStyle",value); + } + break; + case "font-weight": + var this4 = object; + if(this4 != null) { + Reflect.setProperty(this4,"fontWeight",value); + } + break; + case "letter-spacing": + var this5 = object; + if(this5 != null) { + Reflect.setProperty(this5,"letterSpacing",value); + } + break; + case "margin-left": + var this6 = object; + if(this6 != null) { + Reflect.setProperty(this6,"marginLeft",value); + } + break; + case "text-align": + var this7 = object; + if(this7 != null) { + Reflect.setProperty(this7,"textAlign",value); + } + break; + case "text-decoration": + var this8 = object; + if(this8 != null) { + Reflect.setProperty(this8,"textDecoration",value); + } + break; + case "text-indent": + var this9 = object; + if(this9 != null) { + Reflect.setProperty(this9,"textIndent",value); + } + break; + default: + object[property] = value; + } + } + } + } + } + } + } + } + } + ,setStyle: function(styleName,styleObject) { + styleName = styleName.toLowerCase(); + if(styleObject == null) { + if(Object.prototype.hasOwnProperty.call(this.__styles.h,styleName)) { + var _this = this.__styles; + if(Object.prototype.hasOwnProperty.call(_this.h,styleName)) { + delete(_this.h[styleName]); + } + } + } else { + var object = { }; + var _g = 0; + var _g1 = Reflect.fields(styleObject); + while(_g < _g1.length) { + var field = _g1[_g]; + ++_g; + object[field] = Reflect.field(styleObject,field); + } + this.__styles.h[styleName] = object; + } + } + ,transform: function(formatObject) { + var format = new openfl_text_TextFormat(); + this.__applyStyleObject(formatObject,format); + return format; + } + ,__applyStyle: function(styleName,textFormat) { + styleName = styleName.toLowerCase(); + if(Object.prototype.hasOwnProperty.call(this.__styles.h,styleName)) { + var style = this.__styles.h[styleName]; + this.__applyStyleObject(style,textFormat); + } + } + ,__applyStyleObject: function(styleObject,textFormat) { + if(styleObject != null) { + var hex = new EReg("[0-9A-Fa-f]+",""); + var numeric = new EReg("[0-9]+",""); + var tmp; + var this1 = styleObject; + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"color")) { + var this1 = openfl_utils_Object.__get(styleObject,"color"); + tmp = hex.match(this1 == null ? null : Std.string(this1)); + } else { + tmp = false; + } + if(tmp) { + textFormat.color = Std.parseInt("0x" + hex.matched(0)); + } + var this1 = styleObject; + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"fontFamily")) { + var this1 = openfl_utils_Object.__get(styleObject,"fontFamily"); + textFormat.set_font(this.__parseFont(this1 == null ? null : Std.string(this1))); + } + var tmp; + var this1 = styleObject; + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"fontSize")) { + var this1 = openfl_utils_Object.__get(styleObject,"fontSize"); + tmp = numeric.match(this1 == null ? null : Std.string(this1)); + } else { + tmp = false; + } + if(tmp) { + textFormat.set_size(Std.parseInt(numeric.matched(0))); + } + var this1 = styleObject; + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"fontStyle")) { + switch(openfl_utils_Object.__get(styleObject,"fontStyle")) { + case "italic": + textFormat.set_italic(true); + break; + case "normal": + textFormat.set_italic(false); + break; + default: + } + } + var this1 = styleObject; + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"fontWeight")) { + switch(openfl_utils_Object.__get(styleObject,"fontWeight")) { + case "bold": + textFormat.set_bold(true); + break; + case "normal": + textFormat.set_bold(false); + break; + default: + } + } + var tmp; + var this1 = styleObject; + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"leading")) { + var this1 = openfl_utils_Object.__get(styleObject,"leading"); + tmp = numeric.match(this1 == null ? null : Std.string(this1)); + } else { + tmp = false; + } + if(tmp) { + textFormat.leading = Std.parseInt(numeric.matched(0)); + } + var tmp; + var this1 = styleObject; + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"letterSpacing")) { + var this1 = openfl_utils_Object.__get(styleObject,"letterSpacing"); + tmp = numeric.match(this1 == null ? null : Std.string(this1)); + } else { + tmp = false; + } + if(tmp) { + textFormat.letterSpacing = parseFloat(numeric.matched(0)); + } + var tmp; + var this1 = styleObject; + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"marginLeft")) { + var this1 = openfl_utils_Object.__get(styleObject,"marginLeft"); + tmp = numeric.match(this1 == null ? null : Std.string(this1)); + } else { + tmp = false; + } + if(tmp) { + textFormat.leftMargin = Std.parseInt(numeric.matched(0)); + } + var tmp; + var this1 = styleObject; + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"marginRight")) { + var this1 = openfl_utils_Object.__get(styleObject,"marginRight"); + tmp = numeric.match(this1 == null ? null : Std.string(this1)); + } else { + tmp = false; + } + if(tmp) { + textFormat.rightMargin = Std.parseInt(numeric.matched(0)); + } + var this1 = styleObject; + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"textAlign")) { + switch(openfl_utils_Object.__get(styleObject,"textAlign")) { + case "center": + textFormat.align = 0; + break; + case "justify": + textFormat.align = 2; + break; + case "left": + textFormat.align = 3; + break; + case "right": + textFormat.align = 4; + break; + default: + } + } + var this1 = styleObject; + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"textDecoration")) { + switch(openfl_utils_Object.__get(styleObject,"textDecoration")) { + case "none": + textFormat.underline = false; + break; + case "underline": + textFormat.underline = true; + break; + default: + } + } + var tmp; + var this1 = styleObject; + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,"textIndent")) { + var this1 = openfl_utils_Object.__get(styleObject,"textIndent"); + tmp = numeric.match(this1 == null ? null : Std.string(this1)); + } else { + tmp = false; + } + if(tmp) { + textFormat.blockIndent = Std.parseInt(numeric.matched(0)); + } + } + } + ,__parseFont: function(fontFamily) { + if(fontFamily == null) { + return null; + } + if(fontFamily.indexOf(",") > -1) { + fontFamily = HxOverrides.substr(fontFamily,0,fontFamily.indexOf(",")); + } + switch(fontFamily) { + case "mono": + return "_typewriter"; + case "sans-serif": + return "_sans"; + case "serif": + return "_serif"; + default: + return fontFamily; + } + } + ,get_styleNames: function() { + if(this.__styleNames == null || this.__styleNamesDirty) { + this.__styleNames = []; + var h = this.__styles.h; + var style_h = h; + var style_keys = Object.keys(h); + var style_length = style_keys.length; + var style_current = 0; + while(style_current < style_length) { + var style = style_keys[style_current++]; + this.__styleNames.push(style); + } + this.__styleNamesDirty = false; + } + return this.__styleNames; + } + ,__class__: openfl_text_StyleSheet + ,__properties__: {get_styleNames:"get_styleNames"} +}); +var openfl_text_TextField = function() { + this.__forceCachedBitmapUpdate = false; + this.__renderedOnCanvasWhileOnDOM = false; + this.__mouseScrollVCounter = 0; + this.condenseWhite = false; + openfl_display_InteractiveObject.call(this); + this.__wordSelection = false; + this.__drawableType = 7; + this.__caretIndex = -1; + this.__selectionIndex = -1; + this.__displayAsPassword = false; + this.__graphics = new openfl_display_Graphics(this); + this.__textEngine = new openfl_text__$internal_TextEngine(this); + this.__layoutDirty = true; + this.__offsetX = 0; + this.__offsetY = 0; + this.__mouseWheelEnabled = true; + this.__text = ""; + if(openfl_text_TextField.__defaultTextFormat == null) { + openfl_text_TextField.__defaultTextFormat = new openfl_text_TextFormat("Times New Roman",12,0,false,false,false,"","",3,0,0,0,0); + openfl_text_TextField.__defaultTextFormat.blockIndent = 0; + openfl_text_TextField.__defaultTextFormat.bullet = false; + openfl_text_TextField.__defaultTextFormat.letterSpacing = 0; + openfl_text_TextField.__defaultTextFormat.kerning = false; + } + this.__textFormat = openfl_text_TextField.__defaultTextFormat.clone(); + this.__textEngine.textFormatRanges.push(new openfl_text__$internal_TextFormatRange(this.__textFormat,0,0)); + this.addEventListener("mouseDown",$bind(this,this.this_onMouseDown)); + this.addEventListener("focusIn",$bind(this,this.this_onFocusIn)); + this.addEventListener("focusOut",$bind(this,this.this_onFocusOut)); + this.addEventListener("keyDown",$bind(this,this.this_onKeyDown)); + this.addEventListener("mouseWheel",$bind(this,this.this_onMouseWheel)); +}; +$hxClasses["openfl.text.TextField"] = openfl_text_TextField; +openfl_text_TextField.__name__ = "openfl.text.TextField"; +openfl_text_TextField.__super__ = openfl_display_InteractiveObject; +openfl_text_TextField.prototype = $extend(openfl_display_InteractiveObject.prototype,{ + appendText: function(text) { + if(text == null || text == "") { + return; + } + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + this.__updateText(this.__text + text); + this.__textEngine.textFormatRanges.get(this.__textEngine.textFormatRanges.get_length() - 1).end = this.__text.length; + this.__selectionIndex = this.__caretIndex = this.__text.length; + } + ,getCharBoundaries: function(charIndex) { + if(charIndex < 0 || charIndex > this.__text.length - 1) { + return null; + } + var rect = new openfl_geom_Rectangle(); + if(this.__getCharBoundaries(charIndex,rect)) { + return rect; + } else { + return null; + } + } + ,getCharIndexAtPoint: function(x,y) { + if(x <= 2 || x > this.get_width() + 4 || y <= 0 || y > this.get_height() + 4) { + return -1; + } + this.__updateLayout(); + x += this.get_scrollH(); + var _g = 0; + var _g1 = this.get_scrollV() - 1; + while(_g < _g1) { + var i = _g++; + y += this.__textEngine.lineHeights.get(i); + } + var group = this.__textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(y >= group1.offsetY && y <= group1.offsetY + group1.height) { + if(x >= group1.offsetX && x <= group1.offsetX + group1.width) { + var advance = 0.0; + var _g = 0; + var _g1 = group1.positions.length; + while(_g < _g1) { + var i = _g++; + advance += group1.positions[i]; + if(x <= group1.offsetX + advance) { + return group1.startIndex + i; + } + } + return group1.endIndex; + } + } + } + return -1; + } + ,getFirstCharInParagraph: function(charIndex) { + if(charIndex < 0 || charIndex > this.get_text().length) { + return -1; + } + if(this.__textEngine.lineBreaks.get_length() == 0) { + return 0; + } + var _g = 0; + var _g1 = this.__textEngine.lineBreaks.get_length(); + while(_g < _g1) { + var i = _g++; + if(charIndex <= this.__textEngine.lineBreaks.get(i)) { + if(i == 0) { + return 0; + } else { + return this.__textEngine.lineBreaks.get(i - 1) + 1; + } + } + } + return this.__textEngine.lineBreaks.get(this.__textEngine.lineBreaks.get_length() - 1) + 1; + } + ,getLineIndexAtPoint: function(x,y) { + this.__updateLayout(); + if(x <= 2 || x > this.get_width() + 4 || y <= 0 || y > this.get_height() + 4) { + return -1; + } + var _g = 0; + var _g1 = this.get_scrollV() - 1; + while(_g < _g1) { + var i = _g++; + y += this.__textEngine.lineHeights.get(i); + } + var group = this.__textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(y >= group1.offsetY && y <= group1.offsetY + group1.height) { + return group1.lineIndex; + } + } + return -1; + } + ,getLineIndexOfChar: function(charIndex) { + if(charIndex < 0 || charIndex > this.__text.length) { + return -1; + } + this.__updateLayout(); + var group = this.__textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(group1.startIndex <= charIndex && group1.endIndex >= charIndex) { + return group1.lineIndex; + } + } + return -1; + } + ,getLineLength: function(lineIndex) { + this.__updateLayout(); + if(lineIndex < 0 || lineIndex > this.__textEngine.numLines - 1) { + return 0; + } + var startIndex = -1; + var endIndex = -1; + var group = this.__textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(group1.lineIndex == lineIndex) { + if(startIndex == -1) { + startIndex = group1.startIndex; + } + } else if(group1.lineIndex == lineIndex + 1) { + endIndex = group1.startIndex; + break; + } + } + if(endIndex == -1) { + endIndex = this.__text.length; + } + return endIndex - startIndex; + } + ,getLineMetrics: function(lineIndex) { + this.__updateLayout(); + var ascender = this.__textEngine.lineAscents.get(lineIndex); + var descender = this.__textEngine.lineDescents.get(lineIndex); + var leading = this.__textEngine.lineLeadings.get(lineIndex); + var lineHeight = this.__textEngine.lineHeights.get(lineIndex); + var lineWidth = this.__textEngine.lineWidths.get(lineIndex); + var margin; + switch(this.__textFormat.align) { + case 0: + margin = (this.__textEngine.width - lineWidth) / 2; + break; + case 1:case 4: + margin = this.__textEngine.width - lineWidth - 2; + break; + case 2:case 3:case 5: + margin = 2; + break; + } + return new openfl_text_TextLineMetrics(margin,lineWidth,lineHeight,ascender,descender,leading); + } + ,getLineOffset: function(lineIndex) { + this.__updateLayout(); + if(lineIndex < 0 || lineIndex > this.__textEngine.numLines - 1) { + return -1; + } + var group = this.__textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(group1.lineIndex == lineIndex) { + return group1.startIndex; + } + } + return 0; + } + ,getLineText: function(lineIndex) { + this.__updateLayout(); + if(lineIndex < 0 || lineIndex > this.__textEngine.numLines - 1) { + return null; + } + var startIndex = -1; + var endIndex = -1; + var group = this.__textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(group1.lineIndex == lineIndex) { + if(startIndex == -1) { + startIndex = group1.startIndex; + } + } else if(group1.lineIndex == lineIndex + 1) { + endIndex = group1.startIndex; + break; + } + } + if(endIndex == -1) { + endIndex = this.__text.length; + } + return this.__textEngine.text.substring(startIndex,endIndex); + } + ,getParagraphLength: function(charIndex) { + if(charIndex < 0 || charIndex > this.get_text().length) { + return -1; + } + var startIndex = this.getFirstCharInParagraph(charIndex); + if(charIndex >= this.get_text().length) { + return this.get_text().length - startIndex + 1; + } + var endIndex = this.__textEngine.getLineBreakIndex(charIndex) + 1; + if(endIndex == 0) { + endIndex = this.__text.length; + } + return endIndex - startIndex; + } + ,getTextFormat: function(beginIndex,endIndex) { + if(endIndex == null) { + endIndex = -1; + } + if(beginIndex == null) { + beginIndex = -1; + } + var format = null; + if(beginIndex >= this.get_text().length || beginIndex < -1 || endIndex > this.get_text().length || endIndex < -1) { + throw new openfl_errors_RangeError("The supplied index is out of bounds"); + } + if(beginIndex == -1) { + beginIndex = 0; + } + if(endIndex == -1) { + endIndex = this.get_text().length; + } + if(beginIndex >= endIndex) { + return new openfl_text_TextFormat(); + } + var group = this.__textEngine.textFormatRanges.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(group1.start <= beginIndex && group1.end > beginIndex || group1.start < endIndex && group1.end >= endIndex) { + if(format == null) { + format = group1.format.clone(); + } else { + if(group1.format.font != format.font) { + format.set_font(null); + } + if(group1.format.size != format.size) { + format.set_size(null); + } + if(group1.format.color != format.color) { + format.color = null; + } + if(group1.format.bold != format.bold) { + format.set_bold(null); + } + if(group1.format.italic != format.italic) { + format.set_italic(null); + } + if(group1.format.underline != format.underline) { + format.underline = null; + } + if(group1.format.url != format.url) { + format.url = null; + } + if(group1.format.target != format.target) { + format.target = null; + } + if(group1.format.align != format.align) { + format.align = null; + } + if(group1.format.leftMargin != format.leftMargin) { + format.leftMargin = null; + } + if(group1.format.rightMargin != format.rightMargin) { + format.rightMargin = null; + } + if(group1.format.indent != format.indent) { + format.indent = null; + } + if(group1.format.leading != format.leading) { + format.leading = null; + } + if(group1.format.blockIndent != format.blockIndent) { + format.blockIndent = null; + } + if(group1.format.bullet != format.bullet) { + format.bullet = null; + } + if(group1.format.kerning != format.kerning) { + format.kerning = null; + } + if(group1.format.letterSpacing != format.letterSpacing) { + format.letterSpacing = null; + } + if(group1.format.tabStops != format.tabStops) { + format.tabStops = null; + } + } + } + } + if(format == null) { + format = new openfl_text_TextFormat(); + } + return format; + } + ,replaceSelectedText: function(value) { + this.__replaceSelectedText(value,false); + } + ,replaceText: function(beginIndex,endIndex,newText) { + this.__replaceText(beginIndex,endIndex,newText,false); + } + ,setSelection: function(beginIndex,endIndex) { + this.__selectionIndex = beginIndex; + this.__caretIndex = endIndex; + this.__updateScrollV(); + this.__updateScrollH(); + if(this.stage != null && this.stage.get_focus() == this) { + this.__stopCursorTimer(); + this.__startCursorTimer(); + } + } + ,setTextFormat: function(format,beginIndex,endIndex) { + if(endIndex == null) { + endIndex = -1; + } + if(beginIndex == null) { + beginIndex = -1; + } + var max = this.get_text().length; + var range; + if(beginIndex == -1) { + if(endIndex == -1) { + endIndex = max; + } + beginIndex = 0; + } else if(endIndex == -1) { + endIndex = beginIndex + 1; + } + if(beginIndex == endIndex) { + return; + } + if(beginIndex < 0 || endIndex <= 0 || endIndex < beginIndex || beginIndex >= max || endIndex > max) { + throw new openfl_errors_RangeError(); + } + if(beginIndex == 0 && endIndex == max) { + this.__textEngine.textFormatRanges.set_length(1); + range = this.__textEngine.textFormatRanges.get(0); + range.start = 0; + range.end = max; + range.format.__merge(format); + } else { + var index = 0; + var newRange; + while(index < this.__textEngine.textFormatRanges.get_length()) { + range = this.__textEngine.textFormatRanges.get(index); + if(range.end <= beginIndex) { + ++index; + } else if(range.start >= endIndex) { + break; + } else if(range.start <= beginIndex && range.end >= endIndex) { + if(range.start == beginIndex && range.end == endIndex) { + range.format = range.format.clone(); + range.format.__merge(format); + break; + } else if(range.start == beginIndex) { + newRange = new openfl_text__$internal_TextFormatRange(range.format.clone(),beginIndex,endIndex); + newRange.format.__merge(format); + this.__textEngine.textFormatRanges.insertAt(index,newRange); + range.start = endIndex; + index += 2; + } else if(range.end == endIndex) { + newRange = new openfl_text__$internal_TextFormatRange(range.format.clone(),beginIndex,endIndex); + newRange.format.__merge(format); + this.__textEngine.textFormatRanges.insertAt(index + 1,newRange); + range.end = beginIndex; + break; + } else { + newRange = new openfl_text__$internal_TextFormatRange(range.format.clone(),beginIndex,endIndex); + newRange.format.__merge(format); + this.__textEngine.textFormatRanges.insertAt(index + 1,newRange); + newRange = new openfl_text__$internal_TextFormatRange(range.format.clone(),endIndex,range.end); + this.__textEngine.textFormatRanges.insertAt(index + 2,newRange); + range.end = beginIndex; + break; + } + } else if(range.start >= beginIndex && range.end <= endIndex) { + if(range.start == beginIndex) { + range.format = range.format.clone(); + range.format.__merge(format); + range.end = endIndex; + } else { + this.__textEngine.textFormatRanges.removeAt(index); + } + } else if(range.start > beginIndex && range.end > beginIndex) { + range.start = endIndex; + break; + } else if(range.start < beginIndex && range.end <= endIndex) { + newRange = new openfl_text__$internal_TextFormatRange(range.format.clone(),beginIndex,endIndex); + newRange.format.__merge(format); + this.__textEngine.textFormatRanges.insertAt(index + 1,newRange); + range.end = beginIndex; + index += 2; + } else { + ++index; + lime_utils_Log.warn("You found a bug in OpenFL's text code! Please save a copy of your project and create an issue on GitHub so we can fix this.",{ fileName : "openfl/text/TextField.hx", lineNumber : 1609, className : "openfl.text.TextField", methodName : "setTextFormat"}); + } + } + } + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + ,__setStageReference: function(stage) { + this.__stopTextInput(); + openfl_display_InteractiveObject.prototype.__setStageReference.call(this,stage); + } + ,__allowMouseFocus: function() { + return this.mouseEnabled; + } + ,__caretBeginningOfLine: function() { + this.__caretIndex = this.getLineOffset(this.getLineIndexOfChar(this.__caretIndex)); + } + ,__caretBeginningOfNextLine: function() { + var lineIndex = this.getLineIndexOfChar(this.__caretIndex); + if(lineIndex < this.__textEngine.numLines - 1) { + this.__caretIndex = this.getLineOffset(lineIndex + 1); + } else { + this.__caretIndex = this.__text.length; + } + } + ,__caretBeginningOfPreviousLine: function() { + var lineIndex = this.getLineIndexOfChar(this.__caretIndex); + if(lineIndex > 0) { + var index = this.getLineOffset(this.getLineIndexOfChar(this.__caretIndex)); + if(this.__caretIndex == index) { + this.__caretIndex = this.getLineOffset(lineIndex - 1); + } else { + this.__caretIndex = index; + } + } + } + ,__caretEndOfLine: function() { + var lineIndex = this.getLineIndexOfChar(this.__caretIndex); + if(lineIndex < this.__textEngine.numLines - 1) { + this.__caretIndex = this.getLineOffset(lineIndex + 1) - 1; + } else { + this.__caretIndex = this.__text.length; + } + } + ,__caretNextCharacter: function() { + if(this.__caretIndex < this.__text.length) { + this.__caretIndex++; + } + } + ,__caretNextLine: function() { + var lineIndex = this.getLineIndexOfChar(this.__caretIndex); + if(lineIndex < this.__textEngine.numLines - 1) { + this.__caretIndex = this.__getCharIndexOnDifferentLine(this.get_caretIndex(),lineIndex + 1); + } + } + ,__caretPreviousCharacter: function() { + if(this.__caretIndex > 0) { + this.__caretIndex--; + } + } + ,__caretPreviousLine: function() { + var lineIndex = this.getLineIndexOfChar(this.__caretIndex); + if(lineIndex > 0) { + this.__caretIndex = this.__getCharIndexOnDifferentLine(this.get_caretIndex(),lineIndex - 1); + } + } + ,__disableInput: function() { + if(this.__inputEnabled && this.stage != null) { + this.stage.window.__backend.setTextInputEnabled(false); + this.stage.window.onTextInput.remove($bind(this,this.window_onTextInput)); + this.stage.window.onKeyDown.remove($bind(this,this.window_onKeyDown)); + this.__inputEnabled = false; + this.__stopCursorTimer(); + } + } + ,__dispatch: function(event) { + if(event.eventPhase == 2 && event.type == "mouseUp") { + var event1 = event; + var group = this.__getGroup(this.get_mouseX(),this.get_mouseY(),true); + if(group != null) { + var url = group.format.url; + if(url != null && url != "") { + if(StringTools.startsWith(url,"event:")) { + this.dispatchEvent(new openfl_events_TextEvent("link",true,false,HxOverrides.substr(url,6,null))); + } else { + openfl_Lib.getURL(new openfl_net_URLRequest(url)); + } + } + } + } + return openfl_display_InteractiveObject.prototype.__dispatch.call(this,event); + } + ,__enableInput: function() { + if(this.stage != null) { + this.stage.window.__backend.setTextInputEnabled(true); + var bounds = this.getBounds(this.stage); + var limeRect = new lime_math_Rectangle(bounds.x,bounds.y,bounds.width,bounds.height); + this.stage.window.setTextInputRect(limeRect); + if(!this.__inputEnabled) { + this.stage.window.__backend.setTextInputEnabled(true); + if(!this.stage.window.onTextInput.has($bind(this,this.window_onTextInput))) { + this.stage.window.onTextInput.add($bind(this,this.window_onTextInput)); + this.stage.window.onKeyDown.add($bind(this,this.window_onKeyDown)); + } + this.__inputEnabled = true; + this.__stopCursorTimer(); + this.__startCursorTimer(); + } + } + } + ,__getAdvance: function(position) { + return position; + } + ,__getBounds: function(rect,matrix) { + this.__updateLayout(); + var bounds = openfl_geom_Rectangle.__pool.get(); + bounds.copyFrom(this.__textEngine.bounds); + bounds.offset(this.__offsetX,this.__offsetY); + bounds.__transform(bounds,matrix); + rect.__expand(bounds.x,bounds.y,bounds.width,bounds.height); + openfl_geom_Rectangle.__pool.release(bounds); + } + ,__getCharBoundaries: function(charIndex,rect) { + if(charIndex < 0 || charIndex > this.__text.length - 1) { + return false; + } + this.__updateLayout(); + var group = this.__textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(charIndex >= group1.startIndex && charIndex < group1.endIndex) { + try { + var x = group1.offsetX; + var _g = 0; + var _g1 = charIndex - group1.startIndex; + while(_g < _g1) { + var i = _g++; + x += group1.positions[i]; + } + var lastPosition = group1.positions[charIndex - group1.startIndex]; + rect.setTo(x,group1.offsetY,lastPosition,group1.ascent + group1.descent); + return true; + } catch( _g2 ) { + haxe_NativeStackTrace.lastError = _g2; + } + } + } + return false; + } + ,__getCharIndexOnDifferentLine: function(charIndex,lineIndex) { + if(charIndex < 0 || charIndex > this.__text.length) { + return -1; + } + if(lineIndex < 0 || lineIndex > this.__textEngine.numLines - 1) { + return -1; + } + var x = null; + var y = null; + var group = this.__textEngine.layoutGroups.iterator(); + while(group.hasNext()) { + var group1 = group.next(); + if(charIndex >= group1.startIndex && charIndex <= group1.endIndex) { + x = group1.offsetX; + var _g = 0; + var _g1 = charIndex - group1.startIndex; + while(_g < _g1) { + var i = _g++; + x += group1.positions[i]; + } + if(y != null) { + return this.__getPosition(x,y); + } + } + if(group1.lineIndex == lineIndex) { + y = group1.offsetY + group1.height / 2; + var _g2 = 0; + var _g3 = this.get_scrollV() - 1; + while(_g2 < _g3) { + var i1 = _g2++; + y -= this.__textEngine.lineHeights.get(i1); + } + if(x != null) { + return this.__getPosition(x,y); + } + } + } + return -1; + } + ,__getCursor: function() { + var group = this.__getGroup(this.get_mouseX(),this.get_mouseY(),true); + if(group != null && group.format.url != "") { + return "button"; + } else if(this.__textEngine.selectable) { + return "ibeam"; + } + return null; + } + ,__getGroup: function(x,y,precise) { + if(precise == null) { + precise = false; + } + this.__updateLayout(); + x += this.get_scrollH(); + var _g = 0; + var _g1 = this.get_scrollV() - 1; + while(_g < _g1) { + var i = _g++; + y += this.__textEngine.lineHeights.get(i); + } + if(!precise && y > this.__textEngine.textHeight) { + y = this.__textEngine.textHeight; + } + var firstGroup = true; + var group; + var nextGroup; + var _g = 0; + var _g1 = this.__textEngine.layoutGroups.get_length(); + while(_g < _g1) { + var i = _g++; + group = this.__textEngine.layoutGroups.get(i); + if(i < this.__textEngine.layoutGroups.get_length() - 1) { + nextGroup = this.__textEngine.layoutGroups.get(i + 1); + } else { + nextGroup = null; + } + if(firstGroup) { + if(y < group.offsetY) { + y = group.offsetY; + } + if(x < group.offsetX) { + x = group.offsetX; + } + firstGroup = false; + } + if(y >= group.offsetY && y <= group.offsetY + group.height || !precise && nextGroup == null) { + if(x >= group.offsetX && x <= group.offsetX + group.width || !precise && (nextGroup == null || nextGroup.lineIndex != group.lineIndex)) { + return group; + } + } + } + return null; + } + ,__getPosition: function(x,y) { + var group = this.__getGroup(x,y); + if(group == null) { + return this.__text.length; + } + var advance = 0.0; + var _g = 0; + var _g1 = group.positions.length; + while(_g < _g1) { + var i = _g++; + advance += group.positions[i]; + if(x <= group.offsetX + advance) { + if(x <= group.offsetX + (advance - group.positions[i]) + group.positions[i] / 2) { + return group.startIndex + i; + } else if(group.startIndex + i < group.endIndex) { + return group.startIndex + i + 1; + } else { + return group.endIndex; + } + } + } + return group.endIndex; + } + ,__getPositionByIdentifier: function(x,y,line) { + var position = this.__getPosition(x,y); + var delimiters = line ? "\n" : " .,;:!?()[]{}<>/\\|-=+*&^%$#@~`'\"\n"; + var char = this.__text.charAt(position); + if(this.__specialSelectionInitialIndex <= position) { + while(delimiters.indexOf(char) == -1 && position < this.__text.length) { + ++position; + char = this.__text.charAt(position); + } + } else { + while(delimiters.indexOf(char) == -1 && position > 0) { + --position; + char = this.__text.charAt(position); + } + if(position == 0) { + return position; + } + ++position; + } + return position; + } + ,__getOppositeIdentifierBound: function(charIndex,line) { + var position = charIndex; + var delimiters = line ? "\n" : " .,;:!?()[]{}<>/\\|-=+*&^%$#@~`'\"\n"; + var char = this.__text.charAt(position); + if(position <= this.__caretIndex) { + if(position == 0) { + return position; + } + do { + --position; + char = this.__text.charAt(position); + } while(delimiters.indexOf(char) == -1 && position > 0); + if(position == 0) { + return position; + } + ++position; + } else { + while(delimiters.indexOf(char) == -1 && position < this.__text.length) { + ++position; + char = this.__text.charAt(position); + } + } + return position; + } + ,__hitTest: function(x,y,shapeFlag,stack,interactiveOnly,hitObject) { + if(!hitObject.get_visible() || this.__isMask || interactiveOnly && !this.mouseEnabled) { + return false; + } + if(this.get_mask() != null && !this.get_mask().__hitTestMask(x,y)) { + return false; + } + this.__getRenderTransform(); + this.__updateLayout(); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx)); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x)); + if(this.__textEngine.bounds.contains(px,py)) { + if(stack != null) { + stack.push(hitObject); + } + return true; + } + return false; + } + ,__hitTestMask: function(x,y) { + this.__getRenderTransform(); + this.__updateLayout(); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + var px = norm == 0 ? -_this.tx : 1.0 / norm * (_this.c * (_this.ty - y) + _this.d * (x - _this.tx)); + var _this = this.__renderTransform; + var norm = _this.a * _this.d - _this.b * _this.c; + var py = norm == 0 ? -_this.ty : 1.0 / norm * (_this.a * (y - _this.ty) + _this.b * (_this.tx - x)); + if(this.__textEngine.bounds.contains(px,py)) { + return true; + } + return false; + } + ,__replaceSelectedText: function(value,restrict) { + if(restrict == null) { + restrict = true; + } + if(value == null) { + value = ""; + } + if(value == "" && this.__selectionIndex == this.__caretIndex) { + return; + } + var startIndex = this.__caretIndex < this.__selectionIndex ? this.__caretIndex : this.__selectionIndex; + var endIndex = this.__caretIndex > this.__selectionIndex ? this.__caretIndex : this.__selectionIndex; + if(startIndex == endIndex && this.__textEngine.maxChars > 0 && this.__text.length == this.__textEngine.maxChars) { + return; + } + if(startIndex > this.__text.length) { + startIndex = this.__text.length; + } + if(endIndex > this.__text.length) { + endIndex = this.__text.length; + } + if(endIndex < startIndex) { + var cache = endIndex; + endIndex = startIndex; + startIndex = cache; + } + if(startIndex < 0) { + startIndex = 0; + } + this.__replaceText(startIndex,endIndex,value,restrict); + } + ,__replaceText: function(beginIndex,endIndex,newText,restrict) { + if(endIndex < beginIndex || beginIndex < 0 || endIndex > this.__text.length || newText == null) { + return; + } + if(restrict) { + newText = this.__textEngine.restrictText(newText); + if(this.__textEngine.maxChars > 0) { + var removeLength = endIndex - beginIndex; + var maxLength = this.__textEngine.maxChars - this.__text.length + removeLength; + if(maxLength <= 0) { + newText = ""; + } else if(maxLength < newText.length) { + newText = HxOverrides.substr(newText,0,maxLength); + } + } + } + this.__updateText(this.__text.substring(0,beginIndex) + newText + this.__text.substring(endIndex)); + var offset = newText.length - (endIndex - beginIndex); + var i = 0; + var range; + while(i < this.__textEngine.textFormatRanges.get_length()) { + range = this.__textEngine.textFormatRanges.get(i); + if(beginIndex == endIndex) { + if(range.start == range.end) { + if(range.start != 0) { + lime_utils_Log.warn("You found a bug in OpenFL's text code! Please save a copy of your project and create an issue on GitHub so we can fix this.",{ fileName : "openfl/text/TextField.hx", lineNumber : 2190, className : "openfl.text.TextField", methodName : "__replaceText"}); + } else { + range.end += offset; + } + } else if(range.end >= beginIndex) { + if(range.start >= beginIndex) { + range.start += offset; + range.end += offset; + } else if(range.start < beginIndex && range.end >= endIndex) { + range.end += offset; + } + } + } else if(range.end > beginIndex) { + if(range.start > endIndex) { + range.start += offset; + range.end += offset; + } else if(range.start <= beginIndex && range.end > endIndex) { + range.end += offset; + } else if(range.start >= beginIndex && range.end <= endIndex) { + var this1 = this.__textEngine.textFormatRanges; + this1.__tempIndex = i--; + var _g_current = 0; + var _g_args = []; + while(_g_current < _g_args.length) { + var item = _g_args[_g_current++]; + this1.insertAt(this1.__tempIndex,item); + this1.__tempIndex++; + } + this1.splice(this1.__tempIndex,1); + } else if(range.end > endIndex && range.start > beginIndex && range.start <= endIndex) { + range.start = beginIndex; + range.end += offset; + } else if(range.start < beginIndex && range.end > beginIndex && range.end <= endIndex) { + range.end = beginIndex; + } + } + ++i; + } + if(this.__textEngine.textFormatRanges.get_length() == 0) { + this.__textEngine.textFormatRanges.push(new openfl_text__$internal_TextFormatRange(this.get_defaultTextFormat().clone(),0,newText.length)); + } else if(beginIndex == endIndex && this.__textEngine.textFormatRanges.get(0).start > 0) { + this.__textEngine.textFormatRanges.unshift(new openfl_text__$internal_TextFormatRange(this.get_defaultTextFormat().clone(),0,this.__textEngine.textFormatRanges.get(0).start)); + } else if(beginIndex != endIndex && this.__textEngine.textFormatRanges.get(this.__textEngine.textFormatRanges.get_length() - 1).end < this.__text.length) { + this.__textEngine.textFormatRanges.push(new openfl_text__$internal_TextFormatRange(this.get_defaultTextFormat().clone(),this.__textEngine.textFormatRanges.get(this.__textEngine.textFormatRanges.get_length() - 1).end,this.__text.length)); + } + this.__selectionIndex = this.__caretIndex = beginIndex + newText.length; + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + ,__startCursorTimer: function() { + if(this.get_type() == 1) { + if(this.__inputEnabled) { + this.__cursorTimer = haxe_Timer.delay($bind(this,this.__startCursorTimer),600); + this.__showCursor = !this.__showCursor; + } + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } else if(this.get_selectable()) { + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + } + ,__startTextInput: function() { + if(this.__caretIndex < 0) { + this.__caretIndex = this.__text.length; + this.__selectionIndex = this.__caretIndex; + } + var enableInput = openfl_display_DisplayObject.__supportDOM ? this.__renderedOnCanvasWhileOnDOM : true; + if(enableInput) { + this.__enableInput(); + } + } + ,__stopCursorTimer: function() { + if(this.__cursorTimer != null) { + this.__cursorTimer.stop(); + this.__cursorTimer = null; + } + if(this.__showCursor) { + this.__showCursor = false; + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + } + ,__stopTextInput: function() { + var disableInput = openfl_display_DisplayObject.__supportDOM ? this.__renderedOnCanvasWhileOnDOM : true; + if(disableInput) { + this.__disableInput(); + } + } + ,__updateLayout: function() { + if(this.__layoutDirty) { + var cacheWidth = this.__textEngine.width; + this.__textEngine.update(); + if(this.__textEngine.autoSize != 2) { + if(this.__textEngine.width != cacheWidth) { + switch(this.__textEngine.autoSize) { + case 0: + this.set_x(this.get_x() + (cacheWidth - this.__textEngine.width) / 2); + break; + case 3: + this.set_x(this.get_x() + (cacheWidth - this.__textEngine.width)); + break; + default: + } + } + this.__textEngine.getBounds(); + } + this.__layoutDirty = false; + this.setSelection(this.__selectionIndex,this.__caretIndex); + } + } + ,__updateMouseDrag: function() { + if(this.stage == null) { + return; + } + var bounds = this.getBounds(this); + if(this.get_mouseX() > bounds.width - 1) { + this.set_scrollH(this.get_scrollH() + (Math.max(Math.min((this.get_mouseX() - bounds.width) * .1,10),1) | 0)); + } else if(this.get_mouseX() < 1) { + this.set_scrollH(this.get_scrollH() - (Math.max(Math.min(this.get_mouseX() * -.1,10),1) | 0)); + } + this.__mouseScrollVCounter++; + if(this.__mouseScrollVCounter > this.stage.get_frameRate() / 10) { + if(this.get_mouseY() > bounds.height - 2) { + this.set_scrollV(Math.min(this.get_scrollV() + Math.max(Math.min((this.get_mouseY() - bounds.height) * .03,5),1),this.get_maxScrollV()) | 0); + } else if(this.get_mouseY() < 2) { + this.set_scrollV(this.get_scrollV() - (Math.max(Math.min(this.get_mouseY() * -.03,5),1) | 0)); + } + this.__mouseScrollVCounter = 0; + } + this.stage_onMouseMove(null); + } + ,__updateScrollH: function() { + this.__updateLayout(); + var bounds = this.getBounds(this); + if(this.get_textWidth() <= bounds.width - 4) { + this.set_scrollH(0); + return; + } + var tempScrollH = this.get_scrollH(); + if(this.__caretIndex == 0 || this.getLineOffset(this.getLineIndexOfChar(this.__caretIndex)) == this.__caretIndex) { + tempScrollH = 0; + } else { + var caret = openfl_geom_Rectangle.__pool.get(); + var written = false; + if(this.__caretIndex < this.__text.length) { + written = this.__getCharBoundaries(this.__caretIndex,caret); + } + if(!written) { + this.__getCharBoundaries(this.__caretIndex - 1,caret); + caret.x += caret.width; + } + while(caret.x < tempScrollH && tempScrollH > 0) tempScrollH -= 24; + while(caret.x > tempScrollH + bounds.width - 4) tempScrollH += 24; + openfl_geom_Rectangle.__pool.release(caret); + } + if(tempScrollH > 0 && this.get_type() != 1) { + var lineLength = this.getLineLength(this.getLineIndexOfChar(this.__caretIndex)); + if(this.get_scrollH() + bounds.width - 4 > lineLength) { + this.set_scrollH(Math.ceil(lineLength - bounds.width + 4)); + } + } + if(tempScrollH < 0) { + this.set_scrollH(0); + } else if(tempScrollH > this.get_maxScrollH()) { + this.set_scrollH(this.get_maxScrollH()); + } else { + this.set_scrollH(tempScrollH); + } + } + ,__updateScrollV: function() { + this.__updateLayout(); + if(this.get_textHeight() <= this.get_height() - 4) { + this.set_scrollV(1); + return; + } + var lineIndex = this.getLineIndexOfChar(this.__caretIndex); + if(lineIndex == -1 && this.__caretIndex > 0) { + lineIndex = this.getLineIndexOfChar(this.__caretIndex - 1) + 1; + } + if(lineIndex + 1 < this.get_scrollV()) { + this.set_scrollV(lineIndex + 1); + } else if(lineIndex + 1 > this.get_bottomScrollV()) { + var i = lineIndex; + var tempHeight = 0.0; + if(i >= this.__textEngine.lineHeights.get_length()) { + i = this.__textEngine.lineHeights.get_length() - 1; + } + while(i >= 0) { + tempHeight += this.__textEngine.lineHeights.get(i); + if(tempHeight > this.get_height() - 4) { + i += tempHeight - this.get_height() < 0 ? 1 : 2; + break; + } + --i; + } + this.set_scrollV(i); + } else { + this.set_scrollV(this.get_scrollV()); + } + } + ,__updateText: function(value) { + if(openfl_display_DisplayObject.__supportDOM && this.__renderedOnCanvasWhileOnDOM) { + this.__forceCachedBitmapUpdate = this.__text != value; + } + this.__textEngine.set_text(value); + this.__text = this.__textEngine.text; + if(this.stage != null && this.stage.get_focus() == this) { + if(this.__text.length < this.__selectionIndex) { + this.__selectionIndex = this.__text.length; + } + if(this.__text.length < this.__caretIndex) { + this.__caretIndex = this.__text.length; + } + } else if(this.__isHTML) { + this.__selectionIndex = this.__caretIndex = this.__text.length; + } else { + this.__selectionIndex = 0; + this.__caretIndex = 0; + } + if(!this.__displayAsPassword || openfl_display_DisplayObject.__supportDOM && !this.__renderedOnCanvasWhileOnDOM) { + this.__textEngine.set_text(this.__text); + } else { + var length = this.get_text().length; + var mask = ""; + var _g = 0; + var _g1 = length; + while(_g < _g1) { + var i = _g++; + mask += "*"; + } + this.__textEngine.set_text(mask); + } + } + ,__updateTransforms: function(overrideTransform) { + openfl_display_InteractiveObject.prototype.__updateTransforms.call(this,overrideTransform); + var _this = this.__renderTransform; + var px = this.__offsetX; + var py = this.__offsetY; + _this.tx = px * _this.a + py * _this.c + _this.tx; + _this.ty = px * _this.b + py * _this.d + _this.ty; + } + ,get_antiAliasType: function() { + return this.__textEngine.antiAliasType; + } + ,set_antiAliasType: function(value) { + var tmp = value != this.__textEngine.antiAliasType; + return this.__textEngine.antiAliasType = value; + } + ,get_autoSize: function() { + return this.__textEngine.autoSize; + } + ,set_autoSize: function(value) { + if(value != this.__textEngine.autoSize) { + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__textEngine.autoSize = value; + } + ,get_background: function() { + return this.__textEngine.background; + } + ,set_background: function(value) { + if(value != this.__textEngine.background) { + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__textEngine.background = value; + } + ,get_backgroundColor: function() { + return this.__textEngine.backgroundColor; + } + ,set_backgroundColor: function(value) { + if(value != this.__textEngine.backgroundColor) { + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__textEngine.backgroundColor = value; + } + ,get_border: function() { + return this.__textEngine.border; + } + ,set_border: function(value) { + if(value != this.__textEngine.border) { + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__textEngine.border = value; + } + ,get_borderColor: function() { + return this.__textEngine.borderColor; + } + ,set_borderColor: function(value) { + if(value != this.__textEngine.borderColor) { + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__textEngine.borderColor = value; + } + ,get_bottomScrollV: function() { + this.__updateLayout(); + return this.__textEngine.get_bottomScrollV(); + } + ,get_caretIndex: function() { + return this.__caretIndex; + } + ,get_defaultTextFormat: function() { + return this.__textFormat.clone(); + } + ,set_defaultTextFormat: function(value) { + this.__textFormat.__merge(value); + this.__layoutDirty = true; + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + return value; + } + ,get_displayAsPassword: function() { + return this.__displayAsPassword; + } + ,set_displayAsPassword: function(value) { + if(value != this.__displayAsPassword) { + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + this.__displayAsPassword = value; + this.__updateText(this.__text); + } + return value; + } + ,get_embedFonts: function() { + return this.__textEngine.embedFonts; + } + ,set_embedFonts: function(value) { + return this.__textEngine.embedFonts = value; + } + ,get_gridFitType: function() { + return this.__textEngine.gridFitType; + } + ,set_gridFitType: function(value) { + return this.__textEngine.gridFitType = value; + } + ,get_height: function() { + this.__updateLayout(); + return this.__textEngine.height * Math.abs(this.get_scaleY()); + } + ,set_height: function(value) { + if(value != this.__textEngine.height) { + this.__setTransformDirty(); + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + this.__textEngine.height = value; + } + return this.__textEngine.height * Math.abs(this.get_scaleY()); + } + ,get_htmlText: function() { + if(this.__isHTML) { + return this.__htmlText; + } else { + return this.__text; + } + } + ,set_htmlText: function(value) { + if(value == null) { + var error = new openfl_errors_TypeError("Error #2007: Parameter text must be non-null."); + error.errorID = 2007; + throw error; + } + if(!this.__isHTML || this.__text != value) { + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + this.__isHTML = true; + if(this.condenseWhite) { + var _this_r = new RegExp("\\s+","g".split("u").join("")); + value = value.replace(_this_r," "); + } + this.__htmlText = value; + value = openfl_text__$internal_HTMLParser.parse(value,this.get_multiline(),this.__styleSheet,this.__textFormat,this.__textEngine.textFormatRanges); + this.__updateText(value); + return value; + } + ,get_length: function() { + if(this.__text != null) { + return this.__text.length; + } + return 0; + } + ,get_maxChars: function() { + return this.__textEngine.maxChars; + } + ,set_maxChars: function(value) { + if(value != this.__textEngine.maxChars) { + this.__textEngine.maxChars = value; + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return value; + } + ,get_maxScrollH: function() { + this.__updateLayout(); + return this.__textEngine.maxScrollH; + } + ,get_maxScrollV: function() { + this.__updateLayout(); + return this.__textEngine.get_maxScrollV(); + } + ,get_mouseWheelEnabled: function() { + return this.__mouseWheelEnabled; + } + ,set_mouseWheelEnabled: function(value) { + return this.__mouseWheelEnabled = value; + } + ,get_multiline: function() { + return this.__textEngine.multiline; + } + ,set_multiline: function(value) { + return this.__textEngine.multiline = value; + } + ,get_numLines: function() { + this.__updateLayout(); + return this.__textEngine.numLines; + } + ,get_restrict: function() { + return this.__textEngine.restrict; + } + ,set_restrict: function(value) { + if(this.__textEngine.restrict != value) { + this.__textEngine.set_restrict(value); + this.__updateText(this.__text); + } + return value; + } + ,get_scrollH: function() { + return this.__textEngine.scrollH; + } + ,set_scrollH: function(value) { + this.__updateLayout(); + if(value > this.__textEngine.maxScrollH) { + value = this.__textEngine.maxScrollH; + } + if(value < 0) { + value = 0; + } + if(value != this.__textEngine.scrollH) { + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + this.__textEngine.scrollH = value; + this.dispatchEvent(new openfl_events_Event("scroll")); + } + return this.__textEngine.scrollH; + } + ,get_scrollV: function() { + return this.__textEngine.get_scrollV(); + } + ,set_scrollV: function(value) { + this.__updateLayout(); + if(value > this.__textEngine.get_maxScrollV()) { + value = this.__textEngine.get_maxScrollV(); + } + if(value < 1) { + value = 1; + } + if(value != this.__textEngine.get_scrollV() || this.__textEngine.get_scrollV() == 0) { + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + this.__textEngine.set_scrollV(value); + this.dispatchEvent(new openfl_events_Event("scroll")); + } + return this.__textEngine.get_scrollV(); + } + ,get_selectable: function() { + return this.__textEngine.selectable; + } + ,set_selectable: function(value) { + if(value != this.__textEngine.selectable && this.get_type() == 1) { + if(this.stage != null && this.stage.get_focus() == this) { + this.__startTextInput(); + } else if(!value) { + this.__stopTextInput(); + } + } + return this.__textEngine.selectable = value; + } + ,get_selectionBeginIndex: function() { + return Math.min(this.__caretIndex,this.__selectionIndex) | 0; + } + ,get_selectionEndIndex: function() { + return Math.max(this.__caretIndex,this.__selectionIndex) | 0; + } + ,get_sharpness: function() { + return this.__textEngine.sharpness; + } + ,set_sharpness: function(value) { + if(value != this.__textEngine.sharpness) { + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__textEngine.sharpness = value; + } + ,get_styleSheet: function() { + return this.__styleSheet; + } + ,set_styleSheet: function(value) { + if(!(this.__styleSheet != null && value == null)) { + if(value != null) { + if(this.__isHTML && value != this.__styleSheet) { + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + this.set_htmlText(this.__htmlText); + } + this.set_type(0); + } + } + return this.__styleSheet = value; + } + ,get_tabEnabled: function() { + if(this.__tabEnabled == null) { + return this.__textEngine.type == 1; + } else { + return this.__tabEnabled; + } + } + ,get_text: function() { + return this.__text; + } + ,set_text: function(value) { + if(value == null) { + var error = new openfl_errors_TypeError("Error #2007: Parameter text must be non-null."); + error.errorID = 2007; + throw error; + } + if(this.__styleSheet != null) { + return this.set_htmlText(value); + } + if(this.__isHTML || this.__text != value) { + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } else { + return value; + } + if(this.__textEngine.textFormatRanges.get_length() > 1) { + var this1 = this.__textEngine.textFormatRanges; + var deleteCount = this.__textEngine.textFormatRanges.get_length() - 1; + this1.__tempIndex = 1; + var _g_current = 0; + var _g_args = []; + while(_g_current < _g_args.length) { + var item = _g_args[_g_current++]; + this1.insertAt(this1.__tempIndex,item); + this1.__tempIndex++; + } + this1.splice(this1.__tempIndex,deleteCount); + } + var utfValue = value; + var range = this.__textEngine.textFormatRanges.get(0); + range.format = this.__textFormat; + range.start = 0; + range.end = utfValue.length; + this.__isHTML = false; + this.__updateText(value); + return value; + } + ,get_textColor: function() { + return this.__textFormat.color; + } + ,set_textColor: function(value) { + if(value != this.__textFormat.color) { + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + var range = this.__textEngine.textFormatRanges.iterator(); + while(range.hasNext()) { + var range1 = range.next(); + range1.format.color = value; + } + return this.__textFormat.color = value; + } + ,get_textWidth: function() { + this.__updateLayout(); + return this.__textEngine.textWidth; + } + ,get_textHeight: function() { + this.__updateLayout(); + return this.__textEngine.textHeight; + } + ,get_type: function() { + return this.__textEngine.type; + } + ,set_type: function(value) { + if(this.__styleSheet != null) { + value = 0; + } + if(value != this.__textEngine.type) { + this.__textEngine.type = value; + if(value == 1) { + this.addEventListener("addedToStage",$bind(this,this.this_onAddedToStage)); + this.this_onFocusIn(null); + this.__textEngine.__useIntAdvances = true; + } else { + this.removeEventListener("addedToStage",$bind(this,this.this_onAddedToStage)); + this.__stopTextInput(); + this.__textEngine.__useIntAdvances = null; + } + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__textEngine.type; + } + ,get_width: function() { + this.__updateLayout(); + return this.__textEngine.width * Math.abs(this.__scaleX); + } + ,set_width: function(value) { + if(value != this.__textEngine.width) { + this.__setTransformDirty(); + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + this.__textEngine.width = value; + } + return this.__textEngine.width * Math.abs(this.__scaleX); + } + ,get_wordWrap: function() { + return this.__textEngine.wordWrap; + } + ,set_wordWrap: function(value) { + if(value != this.__textEngine.wordWrap) { + this.__dirty = true; + this.__layoutDirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + return this.__textEngine.wordWrap = value; + } + ,get_x: function() { + return this.__transform.tx + this.__offsetX; + } + ,set_x: function(value) { + if(value != this.__transform.tx + this.__offsetX) { + this.__setTransformDirty(); + } + this.__transform.tx = value - this.__offsetX; + return value; + } + ,get_y: function() { + return this.__transform.ty + this.__offsetY; + } + ,set_y: function(value) { + if(value != this.__transform.ty + this.__offsetY) { + this.__setTransformDirty(); + } + this.__transform.ty = value - this.__offsetY; + return value; + } + ,stage_onMouseMove: function(event) { + if(this.stage == null) { + return; + } + if(this.get_selectable() && this.__selectionIndex >= 0) { + this.__updateLayout(); + var position = this.__lineSelection ? this.__getPositionByIdentifier(this.get_mouseX() + this.get_scrollH(),this.get_mouseY(),true) : this.__wordSelection ? this.__getPositionByIdentifier(this.get_mouseX() + this.get_scrollH(),this.get_mouseY(),false) : this.__getPosition(this.get_mouseX() + this.get_scrollH(),this.get_mouseY()); + if(position != this.__caretIndex) { + this.__caretIndex = position; + if(this.__wordSelection || this.__lineSelection) { + this.__selectionIndex = this.__getOppositeIdentifierBound(this.__specialSelectionInitialIndex,this.__lineSelection); + } + var setDirty = true; + if(openfl_display_DisplayObject.__supportDOM) { + if(this.__renderedOnCanvasWhileOnDOM) { + this.__forceCachedBitmapUpdate = true; + } + setDirty = false; + } + if(setDirty) { + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + } + } + } + ,stage_onMouseUp: function(event) { + var stage = event.currentTarget; + stage.removeEventListener("enterFrame",$bind(this,this.this_onEnterFrame)); + stage.removeEventListener("mouseMove",$bind(this,this.stage_onMouseMove)); + stage.removeEventListener("mouseUp",$bind(this,this.stage_onMouseUp)); + if(this.stage != stage) { + return; + } + if(stage.get_focus() == this) { + this.__getWorldTransform(); + this.__updateLayout(); + var upPos = this.__lineSelection ? this.__getPositionByIdentifier(this.get_mouseX() + this.get_scrollH(),this.get_mouseY(),true) : this.__wordSelection ? this.__getPositionByIdentifier(this.get_mouseX() + this.get_scrollH(),this.get_mouseY(),false) : this.__getPosition(this.get_mouseX() + this.get_scrollH(),this.get_mouseY()); + var leftPos = Math.min(this.__selectionIndex,upPos) | 0; + var rightPos = Math.max(this.__selectionIndex,upPos) | 0; + this.__selectionIndex = leftPos; + this.__caretIndex = rightPos; + this.__wordSelection = this.__lineSelection = false; + if(this.__inputEnabled) { + this.this_onFocusIn(null); + this.__stopCursorTimer(); + this.__startCursorTimer(); + if(openfl_display_DisplayObject.__supportDOM && this.__renderedOnCanvasWhileOnDOM) { + this.__forceCachedBitmapUpdate = true; + } + } + } + } + ,this_onAddedToStage: function(event) { + this.this_onFocusIn(null); + } + ,this_onEnterFrame: function(e) { + this.__updateMouseDrag(); + } + ,this_onFocusIn: function(event) { + if(this.get_type() == 1 && this.stage != null && this.stage.get_focus() == this) { + this.__startTextInput(); + } else if(this.get_type() != 1 && this.get_selectable() && this.stage != null && this.stage.get_focus() == this) { + this.__startCursorTimer(); + } + } + ,this_onFocusOut: function(event) { + this.__stopCursorTimer(); + this.__stopTextInput(); + if(this.__selectionIndex != this.__caretIndex) { + this.__selectionIndex = this.__caretIndex; + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + } + ,this_onKeyDown: function(event) { + if(this.get_selectable() && this.get_type() != 1 && event.keyCode == 67 && (event.commandKey || event.ctrlKey)) { + if(this.__caretIndex != this.__selectionIndex && !this.get_displayAsPassword()) { + lime_system_Clipboard.set_text(this.__text.substring(this.__caretIndex,this.__selectionIndex)); + } + } + } + ,this_onMouseDown: function(event) { + if(!this.get_selectable() && this.get_type() != 1) { + return; + } + this.__lineSelection = event.clickCount == 3; + this.__wordSelection = event.clickCount == 2; + if(this.__lineSelection) { + var prevCaretIndex = this.__caretIndex; + this.__caretIndex = this.__getPositionByIdentifier(this.get_mouseX() + this.get_scrollH(),this.get_mouseY(),true); + this.__selectionIndex = this.__getOppositeIdentifierBound(prevCaretIndex,true); + this.setSelection(this.__caretIndex,this.__selectionIndex); + } else if(this.__wordSelection) { + var prevCaretIndex = this.__caretIndex; + this.__caretIndex = this.__getPositionByIdentifier(this.get_mouseX() + this.get_scrollH(),this.get_mouseY(),false); + this.__selectionIndex = this.__getOppositeIdentifierBound(prevCaretIndex,false); + this.__specialSelectionInitialIndex = prevCaretIndex; + this.setSelection(this.__caretIndex,this.__selectionIndex); + } else { + this.__caretIndex = this.__getPosition(this.get_mouseX() + this.get_scrollH(),this.get_mouseY()); + this.__selectionIndex = this.__caretIndex; + this.setSelection(this.__caretIndex,this.__selectionIndex); + } + this.__updateLayout(); + if(!openfl_display_DisplayObject.__supportDOM) { + this.__dirty = true; + if(!this.__renderDirty) { + this.__renderDirty = true; + this.__setParentRenderDirty(); + } + } + if(this.stage == null) { + return; + } + this.stage.addEventListener("enterFrame",$bind(this,this.this_onEnterFrame)); + this.stage.addEventListener("mouseMove",$bind(this,this.stage_onMouseMove)); + this.stage.addEventListener("mouseUp",$bind(this,this.stage_onMouseUp)); + } + ,this_onMouseWheel: function(event) { + if(this.get_mouseWheelEnabled()) { + this.set_scrollV(Math.min(this.get_scrollV() - event.delta,this.get_maxScrollV()) | 0); + } + } + ,window_onKeyDown: function(key,modifier) { + switch(key) { + case 8: + if(this.__selectionIndex == this.__caretIndex && this.__caretIndex > 0) { + this.__selectionIndex = this.__caretIndex - 1; + } + if(this.__selectionIndex != this.__caretIndex) { + this.replaceSelectedText(""); + this.__selectionIndex = this.__caretIndex; + this.dispatchEvent(new openfl_events_Event("change",true)); + } else { + this.__stopCursorTimer(); + this.__startCursorTimer(); + } + break; + case 97: + if(this.get_selectable()) { + if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) { + this.setSelection(0,this.__text.length); + } + } + break; + case 99: + if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) { + if(this.__caretIndex != this.__selectionIndex && !this.get_displayAsPassword()) { + lime_system_Clipboard.set_text(this.__text.substring(this.__caretIndex,this.__selectionIndex)); + } + } + break; + case 120: + if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) { + if(this.__caretIndex != this.__selectionIndex && !this.get_displayAsPassword()) { + lime_system_Clipboard.set_text(this.__text.substring(this.__caretIndex,this.__selectionIndex)); + this.replaceSelectedText(""); + this.dispatchEvent(new openfl_events_Event("change",true)); + } + } + break; + case 127: + if(this.__selectionIndex == this.__caretIndex && this.__caretIndex < this.__text.length) { + this.__selectionIndex = this.__caretIndex + 1; + } + if(this.__selectionIndex != this.__caretIndex) { + this.replaceSelectedText(""); + this.__selectionIndex = this.__caretIndex; + this.dispatchEvent(new openfl_events_Event("change",true)); + } else { + this.__stopCursorTimer(); + this.__startCursorTimer(); + } + break; + case 1073741898: + if(this.get_selectable()) { + if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) { + this.__caretIndex = 0; + } else { + this.__caretBeginningOfLine(); + } + if(!lime_ui_KeyModifier.get_shiftKey(modifier)) { + this.__selectionIndex = this.__caretIndex; + } + this.setSelection(this.__selectionIndex,this.__caretIndex); + } + break; + case 1073741901: + if(this.get_selectable()) { + if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) { + this.__caretIndex = this.__text.length; + } else { + this.__caretEndOfLine(); + } + if(!lime_ui_KeyModifier.get_shiftKey(modifier)) { + this.__selectionIndex = this.__caretIndex; + } + this.setSelection(this.__selectionIndex,this.__caretIndex); + } + break; + case 1073741903: + if(this.get_selectable()) { + if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) { + this.__caretBeginningOfNextLine(); + } else { + this.__caretNextCharacter(); + } + if(!lime_ui_KeyModifier.get_shiftKey(modifier)) { + this.__selectionIndex = this.__caretIndex; + } + this.setSelection(this.__selectionIndex,this.__caretIndex); + } + break; + case 1073741904: + if(this.get_selectable()) { + if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) { + this.__caretBeginningOfPreviousLine(); + } else { + this.__caretPreviousCharacter(); + } + if(!lime_ui_KeyModifier.get_shiftKey(modifier)) { + this.__selectionIndex = this.__caretIndex; + } + this.setSelection(this.__selectionIndex,this.__caretIndex); + } + break; + case 1073741905: + if(this.get_selectable()) { + if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) { + this.__caretIndex = this.__text.length; + } else { + this.__caretNextLine(); + } + if(!lime_ui_KeyModifier.get_shiftKey(modifier)) { + this.__selectionIndex = this.__caretIndex; + } + this.setSelection(this.__selectionIndex,this.__caretIndex); + } + break; + case 1073741906: + if(this.get_selectable()) { + if(lime_ui_KeyModifier.get_metaKey(modifier) || lime_ui_KeyModifier.get_ctrlKey(modifier)) { + this.__caretIndex = 0; + } else { + this.__caretPreviousLine(); + } + if(!lime_ui_KeyModifier.get_shiftKey(modifier)) { + this.__selectionIndex = this.__caretIndex; + } + this.setSelection(this.__selectionIndex,this.__caretIndex); + } + break; + case 13:case 1073741912: + if(this.__textEngine.multiline) { + var te = new openfl_events_TextEvent("textInput",true,true,"\n"); + this.dispatchEvent(te); + if(!te.isDefaultPrevented()) { + this.__replaceSelectedText("\n",true); + this.dispatchEvent(new openfl_events_Event("change",true)); + } + } else { + this.__stopCursorTimer(); + this.__startCursorTimer(); + } + break; + default: + } + } + ,window_onTextInput: function(value) { + this.__replaceSelectedText(value,true); + this.dispatchEvent(new openfl_events_Event("change",true)); + } + ,__class__: openfl_text_TextField + ,__properties__: $extend(openfl_display_InteractiveObject.prototype.__properties__,{set_wordWrap:"set_wordWrap",get_wordWrap:"get_wordWrap",set_type:"set_type",get_type:"get_type",get_textWidth:"get_textWidth",get_textHeight:"get_textHeight",set_textColor:"set_textColor",get_textColor:"get_textColor",set_text:"set_text",get_text:"get_text",set_styleSheet:"set_styleSheet",get_styleSheet:"get_styleSheet",set_sharpness:"set_sharpness",get_sharpness:"get_sharpness",get_selectionEndIndex:"get_selectionEndIndex",get_selectionBeginIndex:"get_selectionBeginIndex",set_selectable:"set_selectable",get_selectable:"get_selectable",set_scrollV:"set_scrollV",get_scrollV:"get_scrollV",set_scrollH:"set_scrollH",get_scrollH:"get_scrollH",set_restrict:"set_restrict",get_restrict:"get_restrict",get_numLines:"get_numLines",set_multiline:"set_multiline",get_multiline:"get_multiline",set_mouseWheelEnabled:"set_mouseWheelEnabled",get_mouseWheelEnabled:"get_mouseWheelEnabled",get_maxScrollV:"get_maxScrollV",get_maxScrollH:"get_maxScrollH",set_maxChars:"set_maxChars",get_maxChars:"get_maxChars",get_length:"get_length",set_htmlText:"set_htmlText",get_htmlText:"get_htmlText",set_gridFitType:"set_gridFitType",get_gridFitType:"get_gridFitType",set_embedFonts:"set_embedFonts",get_embedFonts:"get_embedFonts",set_displayAsPassword:"set_displayAsPassword",get_displayAsPassword:"get_displayAsPassword",set_defaultTextFormat:"set_defaultTextFormat",get_defaultTextFormat:"get_defaultTextFormat",get_caretIndex:"get_caretIndex",get_bottomScrollV:"get_bottomScrollV",set_borderColor:"set_borderColor",get_borderColor:"get_borderColor",set_border:"set_border",get_border:"get_border",set_backgroundColor:"set_backgroundColor",get_backgroundColor:"get_backgroundColor",set_background:"set_background",get_background:"get_background",set_autoSize:"set_autoSize",get_autoSize:"get_autoSize",set_antiAliasType:"set_antiAliasType",get_antiAliasType:"get_antiAliasType"}) +}); +var openfl_text_TextFieldAutoSize = {}; +openfl_text_TextFieldAutoSize.fromString = function(value) { + switch(value) { + case "center": + return 0; + case "left": + return 1; + case "none": + return 2; + case "right": + return 3; + default: + return null; + } +}; +openfl_text_TextFieldAutoSize.toString = function(this1) { + switch(this1) { + case 0: + return "center"; + case 1: + return "left"; + case 2: + return "none"; + case 3: + return "right"; + default: + return null; + } +}; +var openfl_text_TextFieldType = {}; +openfl_text_TextFieldType.fromString = function(value) { + switch(value) { + case "dynamic": + return 0; + case "input": + return 1; + default: + return null; + } +}; +openfl_text_TextFieldType.toString = function(this1) { + switch(this1) { + case 0: + return "dynamic"; + case 1: + return "input"; + default: + return null; + } +}; +var openfl_text_TextFormat = function(font,size,color,bold,italic,underline,url,target,align,leftMargin,rightMargin,indent,leading) { + this.set_font(font); + this.set_size(size); + this.color = color; + this.set_bold(bold); + this.set_italic(italic); + this.underline = underline; + this.url = url; + this.target = target; + this.align = align; + this.leftMargin = leftMargin; + this.rightMargin = rightMargin; + this.indent = indent; + this.leading = leading; +}; +$hxClasses["openfl.text.TextFormat"] = openfl_text_TextFormat; +openfl_text_TextFormat.__name__ = "openfl.text.TextFormat"; +openfl_text_TextFormat.prototype = { + clone: function() { + var newFormat = new openfl_text_TextFormat(this.font,this.size,this.color,this.bold,this.italic,this.underline,this.url,this.target); + newFormat.align = this.align; + newFormat.leftMargin = this.leftMargin; + newFormat.rightMargin = this.rightMargin; + newFormat.indent = this.indent; + newFormat.leading = this.leading; + newFormat.blockIndent = this.blockIndent; + newFormat.bullet = this.bullet; + newFormat.kerning = this.kerning; + newFormat.letterSpacing = this.letterSpacing; + newFormat.tabStops = this.tabStops; + newFormat.__ascent = this.__ascent; + newFormat.__descent = this.__descent; + newFormat.__cacheKey = this.__toCacheKey(); + return newFormat; + } + ,__merge: function(format) { + if(format.font != null) { + this.set_font(format.font); + } + if(format.size != null) { + this.set_size(format.size); + } + if(format.color != null) { + this.color = format.color; + } + if(format.bold != null) { + this.set_bold(format.bold); + } + if(format.italic != null) { + this.set_italic(format.italic); + } + if(format.underline != null) { + this.underline = format.underline; + } + if(format.url != null) { + this.url = format.url; + } + if(format.target != null) { + this.target = format.target; + } + if(format.align != null) { + this.align = format.align; + } + if(format.leftMargin != null) { + this.leftMargin = format.leftMargin; + } + if(format.rightMargin != null) { + this.rightMargin = format.rightMargin; + } + if(format.indent != null) { + this.indent = format.indent; + } + if(format.leading != null) { + this.leading = format.leading; + } + if(format.blockIndent != null) { + this.blockIndent = format.blockIndent; + } + if(format.bullet != null) { + this.bullet = format.bullet; + } + if(format.kerning != null) { + this.kerning = format.kerning; + } + if(format.letterSpacing != null) { + this.letterSpacing = format.letterSpacing; + } + if(format.tabStops != null) { + this.tabStops = format.tabStops; + } + if(format.__ascent != null) { + this.__ascent = format.__ascent; + } + if(format.__descent != null) { + this.__descent = format.__descent; + } + this.__toCacheKey(); + } + ,__toCacheKey: function() { + return this.__cacheKey = "" + this.font + this.size + Std.string(this.bold) + Std.string(this.italic); + } + ,set_font: function(value) { + if(this.font != value) { + this.font = value; + this.__toCacheKey(); + } + return this.font; + } + ,set_size: function(value) { + if(this.size != value) { + this.size = value; + this.__toCacheKey(); + } + return this.size; + } + ,set_bold: function(value) { + if(this.bold != value) { + this.bold = value; + this.__toCacheKey(); + } + return this.bold; + } + ,set_italic: function(value) { + if(this.italic != value) { + this.italic = value; + this.__toCacheKey(); + } + return this.italic; + } + ,__class__: openfl_text_TextFormat + ,__properties__: {set_size:"set_size",set_italic:"set_italic",set_font:"set_font",set_bold:"set_bold"} +}; +var openfl_text_TextFormatAlign = {}; +openfl_text_TextFormatAlign.fromString = function(value) { + switch(value) { + case "center": + return 0; + case "end": + return 1; + case "justify": + return 2; + case "left": + return 3; + case "right": + return 4; + case "start": + return 5; + default: + return null; + } +}; +openfl_text_TextFormatAlign.toString = function(this1) { + switch(this1) { + case 0: + return "center"; + case 1: + return "end"; + case 2: + return "justify"; + case 3: + return "left"; + case 4: + return "right"; + case 5: + return "start"; + default: + return null; + } +}; +var openfl_text_TextLineMetrics = function(x,width,height,ascent,descent,leading) { + this.x = x; + this.width = width; + this.height = height; + this.ascent = ascent; + this.descent = descent; + this.leading = leading; +}; +$hxClasses["openfl.text.TextLineMetrics"] = openfl_text_TextLineMetrics; +openfl_text_TextLineMetrics.__name__ = "openfl.text.TextLineMetrics"; +openfl_text_TextLineMetrics.prototype = { + __class__: openfl_text_TextLineMetrics +}; +var openfl_text__$internal_CSSParser = function(options) { + this.importRegex = new EReg("@import .*?;","ig"); + this.commentRegex = "(\\/\\*[\\s\\S]*?\\*\\/)"; + this.combinedCSSRegex = "((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)*?})"; + this.keyframeRegex = "((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})"; + this.mediaQueryRegex = "((@media [\\s\\S]*?){([\\s\\S]*?}\\s*?)})"; + this.cssRegex = new EReg("([\\s\\S]*?){([\\s\\S]*?)*}","ig"); + this.keyframeStatements = []; + this.importStatements = []; +}; +$hxClasses["openfl.text._internal.CSSParser"] = openfl_text__$internal_CSSParser; +openfl_text__$internal_CSSParser.__name__ = "openfl.text._internal.CSSParser"; +openfl_text__$internal_CSSParser.prototype = { + stripComments: function(css) { + var regex_r = new RegExp(this.commentRegex,"ig".split("u").join("")); + return css.replace(regex_r,""); + } + ,parseRules: function(rules) { + var rulesReg = new EReg("(\\*?[-#/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)+((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)","g"); + var arr = this.getMatches(rulesReg,rules); + var ret = []; + var _g = 0; + var _g1 = arr.length; + while(_g < _g1) { + var i = _g++; + if(!rulesReg.match(arr[i])) { + return null; + } + rules = rulesReg.matched(0).split("\r\n").join("\n"); + var line = rules; + line = StringTools.trim(line); + if(line.indexOf(":") != -1) { + var directive = StringTools.trim(line.split(":")[0]); + var value = StringTools.trim(line.split(":")[1]); + if(directive.length < 1 || value.length < 1) { + continue; + } + var _g2 = new haxe_ds_StringMap(); + _g2.h["type"] = "declaration"; + _g2.h["property"] = directive; + _g2.h["value"] = value; + ret.push(_g2); + } else if(HxOverrides.substr(StringTools.trim(line),0,7) == "base64,") { + var _line = line + StringTools.trim(line); + ret[ret.length - 1].h["value"] = _line; + } else if(line.length > 0) { + var _g3 = new haxe_ds_StringMap(); + _g3.h["type"] = "declaration"; + _g3.h["property"] = ""; + _g3.h["value"] = line; + _g3.h["defective"] = true; + ret.push(_g3); + } + } + return ret; + } + ,findCorrespondingRule: function(rules,directive,value) { + var ret = null; + var _g = 0; + var _g1 = rules.length; + while(_g < _g1) { + var i = _g++; + if(rules[i].h["directive"] == directive) { + ret = rules[i]; + if(value == rules[i].h["value"]) { + break; + } + } + } + return ret; + } + ,findBySelector: function(objectArray,selector,contains) { + if(contains == null) { + contains = false; + } + var found = []; + var _g = 0; + var _g1 = objectArray.length; + while(_g < _g1) { + var i = _g++; + if(contains == false) { + if(objectArray[i].h["selector"] == selector) { + found.push(objectArray[i]); + } + } else if((js_Boot.__cast(objectArray[i].h["selector"] , String)).indexOf(selector) != -1) { + found.push(objectArray[i]); + } + } + if(selector == "@imports" || found.length < 2) { + return found; + } else { + var base = found[0]; + var _g = 0; + var _g1 = found.length; + while(_g < _g1) { + var i = _g++; + this.intelligentCSSPush([base],found[i]); + } + return [base]; + } + } + ,deleteBySelector: function(objectArray,selector) { + var ret = []; + var _g = 0; + var _g1 = objectArray.length; + while(_g < _g1) { + var i = _g++; + if(objectArray[i].h["selector"] != selector) { + ret.push(objectArray[i]); + } + } + return ret; + } + ,compress: function(objectArray) { + var compressed = []; + var done_h = Object.create(null); + var _g = 0; + var _g1 = objectArray.length; + while(_g < _g1) { + var i = _g++; + var obj = objectArray[i]; + if(done_h[obj.h["selector"]] == true) { + continue; + } + var found = this.findBySelector(objectArray,obj.h["selector"]); + if(found.length != 0) { + compressed = compressed.concat(found); + done_h["selector"] = true; + } + } + return compressed; + } + ,diff: function(object1,object2) { + if(object1.h["selector"] == object2.h["selector"]) { + return null; + } + if(object1.h["type"] == "media" || object2.h["type"] == "media") { + return null; + } + var _g = new haxe_ds_StringMap(); + _g.h["selector"] = object1.h["selector"]; + var value = []; + _g.h["rules"] = value; + var diff = _g; + var rule1 = new haxe_ds_StringMap(); + var rule2 = new haxe_ds_StringMap(); + var _length = (js_Boot.__cast(object1.h["rules"] , Array)).length; + var _length2 = (js_Boot.__cast(object2.h["rules"] , Array)).length; + var _g = 0; + var _g1 = _length; + while(_g < _g1) { + var i = _g++; + rule1 = (js_Boot.__cast(object1.h["rules"] , Array))[1]; + rule2 = this.findCorrespondingRule(object2.h["rules"],object1.h["directive"],object1.h["value"]); + if(rule2 == null) { + (js_Boot.__cast(diff.h["rules"] , Array)).push(rule1); + } else if(rule1.h["value"] != rule2.h["value"]) { + (js_Boot.__cast(diff.h["rules"] , Array)).push(rule1); + } + } + var _g = 0; + var _g1 = _length2; + while(_g < _g1) { + var i = _g++; + rule2 = (js_Boot.__cast(object1.h["rules"] , Array))[1]; + rule1 = this.findCorrespondingRule(object1.h["rules"],object2.h["directive"]); + if(rule1 == null) { + rule2.h["type"] = "DELETED"; + (js_Boot.__cast(diff.h["rules"] , Array)).push(rule2); + } + } + if((js_Boot.__cast(diff.h["rules"] , Array)).length == 0) { + return null; + } + return diff; + } + ,intelligentMerge: function(objectArray,newArray,reverse) { + if(reverse == null) { + reverse = false; + } + var _g = 0; + var _g1 = newArray.length; + while(_g < _g1) { + var i = _g++; + this.intelligentCSSPush(objectArray,newArray[i],reverse); + } + var _g = 0; + var _g1 = objectArray.length; + while(_g < _g1) { + var i = _g++; + var cobj = objectArray[i]; + if(cobj.h["type"] == "media" || cobj.h["type"] == "keyframes") { + continue; + } + var value = this.compactRules(cobj.h["rules"]); + cobj.h["rules"] = value; + } + } + ,intelligentCSSPush: function(objectArray,minimalObject,reverse) { + if(reverse == null) { + reverse = false; + } + var pushSelector = minimalObject.h["selector"]; + var cssObject = null; + if(reverse == false) { + var _g = 0; + var _g1 = objectArray.length; + while(_g < _g1) { + var i = _g++; + if(objectArray[i].h["selector"] == minimalObject.h["selector"]) { + cssObject = objectArray[i]; + break; + } + } + } else { + var j = objectArray.length - 1; + while(j > -1) { + if(objectArray[j].h["selector"] == minimalObject.h["selector"]) { + cssObject = objectArray[j]; + break; + } + --j; + } + } + if(cssObject == null) { + objectArray.push(minimalObject); + } else if(minimalObject.h["type"] != "media") { + var mRules = minimalObject.h["rules"]; + var _g = 0; + var _g1 = mRules.length; + while(_g < _g1) { + var i = _g++; + var rule = mRules[i]; + var oldRule = this.findCorrespondingRule(cssObject.h["rules"],rule.h["directive"]); + if(oldRule == null) { + var cRules = cssObject.h["rules"]; + cRules.push(rule); + } else if(rule.h["type"] == "DELETED") { + oldRule.h["type"] = "DELETED"; + } else { + oldRule.h["value"] = rule.h["value"]; + } + } + } else { + var value = (js_Boot.__cast(cssObject.h["subStyles"] , Array)).concat(minimalObject.h["subStyles"]); + cssObject.h["value"] = value; + } + } + ,compactRules: function(rules) { + var newRules = []; + var _g = 0; + var _g1 = rules.length; + while(_g < _g1) { + var i = _g++; + if(rules[i].h["type"] != "DELETED") { + newRules.push(rules[i]); + } + } + return newRules; + } + ,getImports: function(objectArray) { + var imps = []; + var _g = 0; + var _g1 = objectArray.length; + while(_g < _g1) { + var i = _g++; + if(objectArray[i].h["type"] == "imports") { + imps.push(objectArray[i].h["styles"]); + } + } + return imps; + } + ,parse: function(source) { + if(source == null) { + return null; + } + var _this_r = new RegExp("^\\s+|\\s+$","g".split("u").join("")); + source = source.replace(_this_r,""); + var css = []; + var m = this.importRegex.match(source); + while(m) { + var imports = this.importRegex.matched(0); + if(imports != null) { + this.importStatements.push(imports); + var _g = new haxe_ds_StringMap(); + _g.h["selector"] = "@imports"; + _g.h["type"] = "imports"; + _g.h["styles"] = imports; + css.push(_g); + } else { + break; + } + } + source = source.replace(this.importRegex.r,""); + var keyframesRegex = new EReg(this.keyframeRegex,"gi"); + var arr = null; + while(keyframesRegex.match(source)) { + arr = this.getMatches(keyframesRegex,source); + if(arr == null) { + break; + } + var _g = new haxe_ds_StringMap(); + _g.h["selectors"] = "@keyframes"; + _g.h["type"] = "keyframes"; + var value = keyframesRegex.matchedRight(); + _g.h["styles"] = value; + css.push(_g); + } + source = source.replace(keyframesRegex.r,""); + var unified = new EReg(this.combinedCSSRegex,"gi"); + while(unified.match(source)) { + arr = this.getMatches(unified,source); + if(arr == null) { + break; + } + var selector = ""; + var _g = 0; + var _g1 = arr.length; + while(_g < _g1) { + var i = _g++; + var selReg = new EReg("^([^{]+)",""); + if(selReg.match(arr[i])) { + if(selReg.matched(0) != null) { + selector = StringTools.trim(selReg.matched(0).split("\r\n").join("\n")); + } + var commentsRegex = new EReg(this.commentRegex,"gi"); + var comments = this.getMatches(commentsRegex,selector); + if(comments != null) { + selector = StringTools.trim(selector.replace(commentsRegex.r,"")); + } + var _this_r = new RegExp("\n+","".split("u").join("")); + selector = selector.replace(_this_r,"\n"); + if(selector.indexOf("@media") != -1) { + var _g2 = new haxe_ds_StringMap(); + _g2.h["selectors"] = selector; + _g2.h["type"] = "media"; + var value = this.parse(selReg.matchedRight() + "\n}"); + _g2.h["subStyles"] = value; + var object = _g2; + if(comments != null) { + object.h["comments"] = comments[0]; + } + css.push(object); + } else if(selReg.matchedRight() != null) { + var rules = this.parseRules(selReg.matchedRight()); + var _g3 = new haxe_ds_StringMap(); + _g3.h["selectors"] = selector; + _g3.h["type"] = "rule"; + _g3.h["declarations"] = rules; + var styleObject = _g3; + if(selector == "@font-face") { + styleObject.h["type"] = "font-face"; + } + if(comments != null) { + styleObject.h["comments"] = comments[0]; + } + css.push(styleObject); + } + } else { + break; + } + } + break; + } + var _g = new haxe_ds_StringMap(); + _g.h["type"] = "stylesheet"; + _g.h["rules"] = css; + _g.h["parsingErrors"] = []; + var ret = _g; + return ret; + } + ,getMatches: function(ereg,input,index) { + if(index == null) { + index = 0; + } + var matches = []; + while(ereg.match(input)) { + var match = StringTools.trim(ereg.matched(index)); + matches.push(match); + input = StringTools.trim(ereg.matchedRight()); + } + if(matches.length == 0) { + return null; + } + return matches; + } + ,__class__: openfl_text__$internal_CSSParser +}; +var openfl_text__$internal_CacheMeasurement = function(wordKey,positions) { + this.__collisions = []; + this.__wordMap = new haxe_ds_IntMap(); + this.set(wordKey,positions); +}; +$hxClasses["openfl.text._internal.CacheMeasurement"] = openfl_text__$internal_CacheMeasurement; +openfl_text__$internal_CacheMeasurement.__name__ = "openfl.text._internal.CacheMeasurement"; +openfl_text__$internal_CacheMeasurement.prototype = { + set: function(wordKey,positions) { + this.__addCollision(wordKey,positions); + } + ,get: function(wordKey) { + if(this.__collisions.length > 1) { + return this.__wordMap.h[this.__collisions.indexOf(wordKey)]; + } + return this.__wordMap.h[0]; + } + ,__addCollision: function(wordKey,positions) { + if(!this.exists(wordKey)) { + var _this = this.__wordMap; + var key = this.__collisions.push(wordKey) - 1; + _this.h[key] = positions; + } + } + ,exists: function(wordKey) { + if(this.__collisions.length == 0) { + return false; + } + return this.__collisions.indexOf(wordKey) > -1; + } + ,__class__: openfl_text__$internal_CacheMeasurement +}; +var openfl_text__$internal_GlyphPosition = function(glyph,advance,offset) { + this.glyph = glyph; + this.advance = advance; + if(offset != null) { + this.offset = offset; + } else { + this.offset = new lime_math_Vector2(); + } +}; +$hxClasses["openfl.text._internal.GlyphPosition"] = openfl_text__$internal_GlyphPosition; +openfl_text__$internal_GlyphPosition.__name__ = "openfl.text._internal.GlyphPosition"; +openfl_text__$internal_GlyphPosition.prototype = { + __class__: openfl_text__$internal_GlyphPosition +}; +var openfl_text__$internal_HTMLParser = function() { }; +$hxClasses["openfl.text._internal.HTMLParser"] = openfl_text__$internal_HTMLParser; +openfl_text__$internal_HTMLParser.__name__ = "openfl.text._internal.HTMLParser"; +openfl_text__$internal_HTMLParser.parse = function(value,multiline,styleSheet,textFormat,textFormatRanges) { + if(multiline) { + value = value.replace(openfl_text__$internal_HTMLParser.__regexBreakTag.r,"\n"); + } else { + value = value.replace(openfl_text__$internal_HTMLParser.__regexBreakTag.r,""); + } + value = value.replace(openfl_text__$internal_HTMLParser.__regexEntityNbsp.r," "); + value = openfl_text__$internal_HTMLParser.__regexCharEntity.map(value,function(ereg) { + var decimalStr = ereg.matched(1); + var hexStr = ereg.matched(2); + if(decimalStr != null) { + var decimal = Std.parseInt(decimalStr); + if(decimal != null) { + return String.fromCodePoint(decimal); + } + } + if(hexStr != null) { + var hex = Std.parseInt("0" + hexStr); + if(hex != null) { + return String.fromCodePoint(hex); + } + } + return ereg.matched(0); + }); + var segments = value.split("<"); + if(segments.length == 1) { + value = openfl_text__$internal_HTMLParser.__htmlUnescape(value.replace(openfl_text__$internal_HTMLParser.__regexHTMLTag.r,"")); + if(textFormatRanges.get_length() > 1) { + var deleteCount = textFormatRanges.get_length() - 1; + textFormatRanges.__tempIndex = 1; + var _g_current = 0; + var _g_args = []; + while(_g_current < _g_args.length) { + var item = _g_args[_g_current++]; + textFormatRanges.insertAt(textFormatRanges.__tempIndex,item); + textFormatRanges.__tempIndex++; + } + textFormatRanges.splice(textFormatRanges.__tempIndex,deleteCount); + } + var range = textFormatRanges.get(0); + range.format = textFormat; + range.start = 0; + range.end = value.length; + return value; + } else { + var deleteCount = textFormatRanges.get_length(); + textFormatRanges.__tempIndex = 0; + var _g_current = 0; + var _g_args = []; + while(_g_current < _g_args.length) { + var item = _g_args[_g_current++]; + textFormatRanges.insertAt(textFormatRanges.__tempIndex,item); + textFormatRanges.__tempIndex++; + } + textFormatRanges.splice(textFormatRanges.__tempIndex,deleteCount); + value = ""; + var formatStack = [textFormat.clone()]; + var tagStack = []; + var sub; + var noLineBreak = false; + var _g = 0; + while(_g < segments.length) { + var segment = segments[_g]; + ++_g; + if(segment == "") { + continue; + } + var isClosingTag = HxOverrides.substr(segment,0,1) == "/"; + var tagEndIndex = segment.indexOf(">"); + var start = tagEndIndex + 1; + var spaceIndex = segment.indexOf(" "); + var tagName = segment.substring(isClosingTag ? 1 : 0,spaceIndex > -1 && spaceIndex < tagEndIndex ? spaceIndex : tagEndIndex).toLowerCase(); + var format; + if(isClosingTag) { + if(tagStack.length == 0 || tagName != tagStack[tagStack.length - 1]) { + continue; + } + tagStack.pop(); + formatStack.pop(); + format = formatStack[formatStack.length - 1].clone(); + if((tagName == "p" || tagName == "li") && textFormatRanges.get_length() > 0) { + if(multiline) { + value += "\n"; + } + noLineBreak = true; + } + if(start < segment.length) { + sub = openfl_text__$internal_HTMLParser.__htmlUnescape(HxOverrides.substr(segment,start,null)); + textFormatRanges.push(new openfl_text__$internal_TextFormatRange(format,value.length,value.length + sub.length)); + value += sub; + noLineBreak = false; + } + } else { + format = formatStack[formatStack.length - 1].clone(); + if(tagEndIndex > -1) { + if(styleSheet != null) { + styleSheet.__applyStyle(tagName,format); + if(openfl_text__$internal_HTMLParser.__regexClass.match(segment)) { + styleSheet.__applyStyle("." + openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexClass),format); + styleSheet.__applyStyle(tagName + "." + openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexClass),format); + } + } + switch(tagName) { + case "a": + if(styleSheet != null) { + styleSheet.__applyStyle("a:link",format); + } + if(openfl_text__$internal_HTMLParser.__regexHref.match(segment)) { + format.url = openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexHref); + } + break; + case "b": + format.set_bold(true); + break; + case "em":case "i": + format.set_italic(true); + break; + case "font": + if(openfl_text__$internal_HTMLParser.__regexFace.match(segment)) { + format.set_font(openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexFace)); + } + if(openfl_text__$internal_HTMLParser.__regexColor.match(segment)) { + format.color = Std.parseInt("0x" + openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexColor)); + } + if(openfl_text__$internal_HTMLParser.__regexSize.match(segment)) { + var sizeAttr = openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexSize); + var firstChar = HxOverrides.cca(sizeAttr,0); + if(firstChar == 43 || firstChar == 45) { + var parentFormat = formatStack.length >= 2 ? formatStack[formatStack.length - 2] : textFormat; + format.set_size(parentFormat.size + Std.parseInt(sizeAttr)); + } else { + format.set_size(Std.parseInt(sizeAttr)); + } + } + break; + case "li": + if(textFormatRanges.get_length() > 0 && !noLineBreak) { + value += "\n"; + } + var bullet = "• "; + var bulletFormat = format.clone(); + bulletFormat.underline = false; + textFormatRanges.push(new openfl_text__$internal_TextFormatRange(bulletFormat,value.length,value.length + bullet.length)); + value += bullet; + break; + case "p": + if(textFormatRanges.get_length() > 0 && !noLineBreak) { + value += "\n"; + } + if(openfl_text__$internal_HTMLParser.__regexAlign.match(segment)) { + var align = openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexAlign).toLowerCase(); + format.align = openfl_text_TextFormatAlign.fromString(align); + } + break; + case "textformat": + if(openfl_text__$internal_HTMLParser.__regexBlockIndent.match(segment)) { + format.blockIndent = Std.parseInt(openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexBlockIndent)); + } + if(openfl_text__$internal_HTMLParser.__regexIndent.match(segment)) { + format.indent = Std.parseInt(openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexIndent)); + } + if(openfl_text__$internal_HTMLParser.__regexLeading.match(segment)) { + format.leading = Std.parseInt(openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexLeading)); + } + if(openfl_text__$internal_HTMLParser.__regexLeftMargin.match(segment)) { + format.leftMargin = Std.parseInt(openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexLeftMargin)); + } + if(openfl_text__$internal_HTMLParser.__regexRightMargin.match(segment)) { + format.rightMargin = Std.parseInt(openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexRightMargin)); + } + if(openfl_text__$internal_HTMLParser.__regexTabStops.match(segment)) { + var values = openfl_text__$internal_HTMLParser.__getAttributeMatch(openfl_text__$internal_HTMLParser.__regexTabStops).split(" "); + var tabStops = []; + var _g1 = 0; + while(_g1 < values.length) { + var stop = values[_g1]; + ++_g1; + tabStops.push(Std.parseInt(stop)); + } + format.tabStops = tabStops; + } + break; + case "u": + format.underline = true; + break; + } + formatStack.push(format); + tagStack.push(tagName); + if(start < segment.length) { + sub = openfl_text__$internal_HTMLParser.__htmlUnescape(segment.substring(start)); + textFormatRanges.push(new openfl_text__$internal_TextFormatRange(format,value.length,value.length + sub.length)); + value += sub; + noLineBreak = false; + } + } else { + sub = openfl_text__$internal_HTMLParser.__htmlUnescape(segment); + textFormatRanges.push(new openfl_text__$internal_TextFormatRange(format,value.length,value.length + sub.length)); + value += sub; + noLineBreak = false; + } + } + } + if(textFormatRanges.get_length() == 0) { + textFormatRanges.push(new openfl_text__$internal_TextFormatRange(formatStack[0],0,0)); + } + } + return value; +}; +openfl_text__$internal_HTMLParser.__getAttributeMatch = function(regex) { + if(regex.matched(2) != null) { + return regex.matched(2); + } else { + return regex.matched(3); + } +}; +openfl_text__$internal_HTMLParser.__htmlUnescape = function(s) { + s = s.replace(openfl_text__$internal_HTMLParser.__regexEntityApos.r,"'"); + return StringTools.htmlUnescape(s); +}; +var openfl_text__$internal_ShapeCache = function() { + this.__shortWordMap = new haxe_ds_StringMap(); + this.__longWordMap = new haxe_ds_StringMap(); +}; +$hxClasses["openfl.text._internal.ShapeCache"] = openfl_text__$internal_ShapeCache; +openfl_text__$internal_ShapeCache.__name__ = "openfl.text._internal.ShapeCache"; +openfl_text__$internal_ShapeCache.hashFunction = function(key) { + var hash = 0; + var i; + var chr; + var _g = 0; + var _g1 = key.length; + while(_g < _g1) { + var i = _g++; + chr = HxOverrides.cca(key,i); + hash = (hash << 5) - hash + chr; + hash |= 0; + } + return hash; +}; +openfl_text__$internal_ShapeCache.prototype = { + cache: function(formatRange,getPositions,wordKey) { + var formatKey = formatRange.format.__cacheKey; + if(wordKey.length > 15) { + return this.__cacheLongWord(wordKey,formatKey,getPositions); + } else { + return this.__cacheShortWord(wordKey,formatKey,getPositions); + } + } + ,__cacheShortWord: function(wordKey,formatKey,getPositions) { + if(Object.prototype.hasOwnProperty.call(this.__shortWordMap.h,formatKey)) { + var formatMap = this.__shortWordMap.h[formatKey]; + if(Object.prototype.hasOwnProperty.call(formatMap.h,wordKey)) { + return formatMap.h[wordKey]; + } else { + var value = getPositions(); + formatMap.h[wordKey] = value; + } + } else { + var formatMap = new haxe_ds_StringMap(); + var value = getPositions(); + formatMap.h[wordKey] = value; + this.__shortWordMap.h[formatKey] = formatMap; + } + return getPositions(); + } + ,__cacheLongWord: function(wordKey,formatKey,getPositions) { + var hash = openfl_text__$internal_ShapeCache.hashFunction(wordKey); + if(Object.prototype.hasOwnProperty.call(this.__longWordMap.h,formatKey)) { + var formatMap = this.__longWordMap.h[formatKey]; + if(formatMap.h.hasOwnProperty(hash)) { + var measurement = formatMap.h[hash]; + if(measurement.exists(wordKey)) { + return measurement.get(wordKey); + } else { + measurement.set(wordKey,getPositions()); + } + } else { + var measurement = new openfl_text__$internal_CacheMeasurement(wordKey,getPositions()); + formatMap.h[hash] = measurement; + } + } else { + var formatMap = new haxe_ds_IntMap(); + var measurement = new openfl_text__$internal_CacheMeasurement(wordKey,getPositions()); + measurement.hash = hash; + formatMap.h[hash] = measurement; + this.__longWordMap.h[formatKey] = formatMap; + } + return getPositions(); + } + ,__class__: openfl_text__$internal_ShapeCache +}; +var openfl_text__$internal_TextEngine = function(textField) { + this.__shapeCache = new openfl_text__$internal_ShapeCache(); + this.textField = textField; + this.width = 100; + this.height = 100; + this.set_text(""); + this.bounds = new openfl_geom_Rectangle(0,0,0,0); + this.textBounds = new openfl_geom_Rectangle(0,0,0,0); + this.type = 0; + this.autoSize = 2; + this.embedFonts = false; + this.selectable = true; + this.borderColor = 0; + this.border = false; + this.backgroundColor = 16777215; + this.background = false; + this.gridFitType = 1; + this.maxChars = 0; + this.multiline = false; + this.numLines = 1; + this.sharpness = 0; + this.scrollH = 0; + this.set_scrollV(1); + this.wordWrap = false; + this.lineAscents = openfl_Vector.toFloatVector(null); + this.lineBreaks = openfl_Vector.toIntVector(null); + this.lineDescents = openfl_Vector.toFloatVector(null); + this.lineLeadings = openfl_Vector.toFloatVector(null); + this.lineHeights = openfl_Vector.toFloatVector(null); + this.lineWidths = openfl_Vector.toFloatVector(null); + this.layoutGroups = openfl_Vector.toObjectVector(null); + this.textFormatRanges = openfl_Vector.toObjectVector(null); + if(openfl_text__$internal_TextEngine.__context == null) { + openfl_text__$internal_TextEngine.__context = window.document.createElement("canvas").getContext("2d"); + } +}; +$hxClasses["openfl.text._internal.TextEngine"] = openfl_text__$internal_TextEngine; +openfl_text__$internal_TextEngine.__name__ = "openfl.text._internal.TextEngine"; +openfl_text__$internal_TextEngine.findFont = function(name) { + return openfl_text_Font.__fontByName.h[name]; +}; +openfl_text__$internal_TextEngine.findFontVariant = function(format) { + var fontName = format.font; + var bold = format.bold; + var italic = format.italic; + if(fontName == null) { + fontName = "_serif"; + } + var fontNamePrefix = StringTools.replace(StringTools.replace(fontName," Normal","")," Regular",""); + if(bold && italic && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Bold Italic")) { + return openfl_text__$internal_TextEngine.findFont(fontNamePrefix + " Bold Italic"); + } else if(bold && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Bold")) { + return openfl_text__$internal_TextEngine.findFont(fontNamePrefix + " Bold"); + } else if(italic && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Italic")) { + return openfl_text__$internal_TextEngine.findFont(fontNamePrefix + " Italic"); + } + return openfl_text__$internal_TextEngine.findFont(fontName); +}; +openfl_text__$internal_TextEngine.getDefaultFont = function(name,bold,italic) { + if(openfl_text__$internal_TextEngine.__defaultFonts == null) { + openfl_text__$internal_TextEngine.__defaultFonts = new haxe_ds_StringMap(); + } + var fontSet = openfl_text__$internal_TextEngine.__defaultFonts.h[name]; + if(fontSet == null) { + return null; + } + if(bold && italic && fontSet.boldItalic != null) { + return fontSet.boldItalic; + } else if(italic && fontSet.italic != null) { + return fontSet.italic; + } else if(bold && fontSet.bold != null) { + return fontSet.bold; + } else { + return fontSet.normal; + } +}; +openfl_text__$internal_TextEngine.getFormatHeight = function(format) { + var ascent; + var descent; + var font = openfl_text__$internal_TextEngine.getFont(format); + openfl_text__$internal_TextEngine.__context.font = font; + var font = openfl_text__$internal_TextEngine.getFontInstance(format); + if(format.__ascent != null) { + ascent = format.size * format.__ascent; + descent = format.size * format.__descent; + } else if(font != null && font.unitsPerEM != 0) { + ascent = font.ascender / font.unitsPerEM * format.size; + descent = Math.abs(font.descender / font.unitsPerEM * format.size); + } else { + ascent = format.size; + descent = format.size * 0.185; + } + var leading = format.leading; + return ascent + descent + leading; +}; +openfl_text__$internal_TextEngine.getFont = function(format) { + var fontName = format.font; + var bold = format.bold; + var italic = format.italic; + if(fontName == null) { + fontName = "_serif"; + } + var fontNamePrefix = StringTools.replace(StringTools.replace(fontName," Normal","")," Regular",""); + if(bold && italic && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Bold Italic")) { + fontName = fontNamePrefix + " Bold Italic"; + bold = false; + italic = false; + } else if(bold && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Bold")) { + fontName = fontNamePrefix + " Bold"; + bold = false; + } else if(italic && Object.prototype.hasOwnProperty.call(openfl_text_Font.__fontByName.h,fontNamePrefix + " Italic")) { + fontName = fontNamePrefix + " Italic"; + italic = false; + } else { + if(bold && (fontName.indexOf(" Bold ") > -1 || StringTools.endsWith(fontName," Bold"))) { + bold = false; + } + if(italic && (fontName.indexOf(" Italic ") > -1 || StringTools.endsWith(fontName," Italic"))) { + italic = false; + } + } + var font = italic ? "italic " : "normal "; + font += "normal "; + font += bold ? "bold " : "normal "; + font += format.size + "px"; + font += "/" + (format.size + 3) + "px "; + var font1; + switch(fontName) { + case "_sans": + font1 = "sans-serif"; + break; + case "_serif": + font1 = "serif"; + break; + case "_typewriter": + font1 = "monospace"; + break; + default: + var _this_r = new RegExp("^[\\s'\"]+(.*)[\\s'\"]+$","".split("u").join("")); + font1 = "'" + fontName.replace(_this_r,"$1") + "'"; + } + font += "" + font1; + return font; +}; +openfl_text__$internal_TextEngine.getFontInstance = function(format) { + return openfl_text__$internal_TextEngine.findFontVariant(format); +}; +openfl_text__$internal_TextEngine.prototype = { + createRestrictRegexp: function(restrict) { + var declinedRange = new EReg("\\^([^\\^]+)","gu"); + var declined = ""; + var accepting = false; + var accepted = declinedRange.map(restrict,function(ereg) { + if(accepting) { + accepting = !accepting; + return ereg.matched(1); + } + declined += ereg.matched(1); + accepting = !accepting; + return ""; + }); + var testRegexpParts = []; + if(accepted.length > 0) { + testRegexpParts.push("[^" + accepted + "]"); + } + if(declined.length > 0) { + testRegexpParts.push("[" + declined + "]"); + } + return new EReg("(" + testRegexpParts.join("|") + ")","g"); + } + ,getBounds: function() { + var padding = this.border ? 1 : 0; + this.bounds.width = this.width + padding; + this.bounds.height = this.height + padding; + var x = this.width; + var y = this.height; + var lastIndex = this.layoutGroups.get_length() - 1; + var _g = 0; + var _g1 = this.layoutGroups.get_length(); + while(_g < _g1) { + var i = _g++; + var group = this.layoutGroups.get(i); + if(i == lastIndex && group.startIndex == group.endIndex && this.type != 1) { + continue; + } + if(group.offsetX < x) { + x = group.offsetX; + } + if(group.offsetY < y) { + y = group.offsetY; + } + } + if(x >= this.width) { + x = 2; + } + if(y >= this.height) { + y = 2; + } + var textHeight = this.textHeight * 1.185; + this.textBounds.setTo(Math.max(x - 2,0),Math.max(y - 2,0),Math.min(this.textWidth + 4,this.bounds.width),Math.min(textHeight + 4,this.bounds.height)); + } + ,getLine: function(index) { + if(index < 0 || index > this.lineBreaks.get_length() + 1) { + return null; + } + if(this.lineBreaks.get_length() == 0) { + return this.text; + } else { + return this.text.substring(index > 0 ? this.lineBreaks.get(index - 1) : 0,this.lineBreaks.get(index)); + } + } + ,getLineBreaks: function() { + this.lineBreaks.set_length(0); + var index = -1; + var cr = -1; + var lf = -1; + while(index < this.text.length) { + lf = this.text.indexOf("\n",index + 1); + cr = this.text.indexOf("\r",index + 1); + index = cr == -1 ? lf : lf == -1 ? cr : cr < lf ? cr : lf; + if(index > -1) { + this.lineBreaks.push(index); + } else { + break; + } + } + } + ,getLineBreakIndex: function(startIndex) { + if(startIndex == null) { + startIndex = 0; + } + var lineBreak = this.lineBreaks.iterator(); + while(lineBreak.hasNext()) { + var lineBreak1 = lineBreak.next(); + if(lineBreak1 >= startIndex) { + return lineBreak1; + } + } + return -1; + } + ,getLineMeasurements: function() { + this.lineAscents.set_length(0); + this.lineDescents.set_length(0); + this.lineLeadings.set_length(0); + this.lineHeights.set_length(0); + this.lineWidths.set_length(0); + var currentLineAscent = 0.0; + var currentLineDescent = 0.0; + var currentLineLeading = null; + var currentLineHeight = 0.0; + var currentLineWidth = 0.0; + var currentTextHeight = 0.0; + this.textWidth = 0; + this.textHeight = 0; + this.numLines = 1; + this.maxScrollH = 0; + var lastIndex = this.layoutGroups.get_length() - 1; + var _g = 0; + var _g1 = this.layoutGroups.get_length(); + while(_g < _g1) { + var i = _g++; + var group = this.layoutGroups.get(i); + if(i == lastIndex && group.startIndex == group.endIndex && this.type != 1) { + continue; + } + while(group.lineIndex > this.numLines - 1) { + this.lineAscents.push(currentLineAscent); + this.lineDescents.push(currentLineDescent); + this.lineLeadings.push(currentLineLeading != null ? currentLineLeading : 0); + this.lineHeights.push(currentLineHeight); + this.lineWidths.push(currentLineWidth); + currentLineAscent = 0; + currentLineDescent = 0; + currentLineLeading = null; + currentLineHeight = 0; + currentLineWidth = 0; + this.numLines++; + } + currentLineAscent = Math.max(currentLineAscent,group.ascent); + currentLineDescent = Math.max(currentLineDescent,group.descent); + if(currentLineLeading == null) { + currentLineLeading = group.leading; + } else { + currentLineLeading = Math.max(currentLineLeading,group.leading) | 0; + } + currentLineHeight = Math.max(currentLineHeight,group.height); + currentLineWidth = group.offsetX - 2 + group.width; + if(currentLineWidth > this.textWidth) { + this.textWidth = currentLineWidth; + } + currentTextHeight = Math.ceil(group.offsetY - 2 + group.ascent + group.descent); + if(currentTextHeight > this.textHeight) { + this.textHeight = currentTextHeight; + } + } + if(this.textHeight == 0 && this.textField != null && this.type == 1) { + var currentFormat = this.textField.__textFormat; + var ascent; + var descent; + var font = openfl_text__$internal_TextEngine.getFontInstance(currentFormat); + if(currentFormat.__ascent != null) { + ascent = currentFormat.size * currentFormat.__ascent; + descent = currentFormat.size * currentFormat.__descent; + } else if(font != null && font.unitsPerEM != 0) { + ascent = font.ascender / font.unitsPerEM * currentFormat.size; + descent = Math.abs(font.descender / font.unitsPerEM * currentFormat.size); + } else { + ascent = currentFormat.size; + descent = currentFormat.size * 0.185; + } + var leading = currentFormat.leading; + var heightValue = Math.ceil(ascent + descent + leading); + currentLineAscent = ascent; + currentLineDescent = descent; + currentLineLeading = leading; + currentTextHeight = Math.ceil(ascent + descent); + this.textHeight = currentTextHeight; + } + this.lineAscents.push(currentLineAscent); + this.lineDescents.push(currentLineDescent); + this.lineLeadings.push(currentLineLeading != null ? currentLineLeading : 0); + this.lineHeights.push(currentLineHeight); + this.lineWidths.push(currentLineWidth); + if(this.numLines == 1) { + if(currentLineLeading > 0) { + this.textHeight += currentLineLeading; + } + } + if(this.autoSize != 2) { + switch(this.autoSize) { + case 0:case 1:case 3: + if(!this.wordWrap) { + this.width = this.textWidth + 4; + } + this.height = this.textHeight + 4; + this.bottomScrollV = this.numLines; + break; + default: + } + } + if(this.textWidth > this.width - 4) { + this.maxScrollH = this.textWidth - this.width + 4 | 0; + } else { + this.maxScrollH = 0; + } + if(this.scrollH > this.maxScrollH) { + this.scrollH = this.maxScrollH; + } + } + ,getLayoutGroups: function() { + var _gthis = this; + this.layoutGroups.set_length(0); + if(this.text == null || this.text == "") { + return; + } + var rangeIndex = -1; + var formatRange = null; + var font = null; + var currentFormat = openfl_text_TextField.__defaultTextFormat.clone(); + var leading = 0; + var ascent = 0.0; + var maxAscent = 0.0; + var descent = 0.0; + var align = 3; + var blockIndent = 0; + var bullet = false; + var indent = 0; + var leftMargin = 0; + var rightMargin = 0; + var firstLineOfParagraph = true; + var layoutGroup = null; + var positions = null; + var widthValue = 0.0; + var heightValue = 0; + var maxHeightValue = 0; + var previousSpaceIndex = -2; + var previousBreakIndex = -1; + var spaceIndex = this.text.indexOf(" "); + var breakCount = 0; + var breakIndex = breakCount < this.lineBreaks.get_length() ? this.lineBreaks.get(breakCount) : -1; + var offsetX = 0.0; + var offsetY = 0.0; + var textIndex = 0; + var lineIndex = 0; + var getPositions = function(text,startIndex,endIndex) { + var letterSpacing = 0.0; + if(formatRange.format.letterSpacing != null) { + letterSpacing = formatRange.format.letterSpacing; + } + var html5Positions = function() { + var positions = []; + if(_gthis.__useIntAdvances == null) { + var html5Positions = new EReg("Trident/7.0",""); + _gthis.__useIntAdvances = html5Positions.match($global.navigator.userAgent); + } + if(_gthis.__useIntAdvances) { + var previousWidth = 0.0; + var width; + var _g = startIndex; + var _g1 = endIndex; + while(_g < _g1) { + var i = _g++; + width = _gthis.measureText(text.substring(startIndex,i + 1)); + positions.push(width - previousWidth); + previousWidth = width; + } + } else { + var _g = startIndex; + var _g1 = endIndex; + while(_g < _g1) { + var i = _g++; + var advance; + if(i < text.length - 1) { + var nextWidth = _gthis.measureText(text.charAt(i + 1)); + var twoWidths = _gthis.measureText(HxOverrides.substr(text,i,2)); + advance = twoWidths - nextWidth; + } else { + advance = openfl_text__$internal_TextEngine.__context.measureText(text.charAt(i)).width; + } + positions.push(advance); + } + } + return positions; + }; + if(currentFormat.align == 2) { + return html5Positions(); + } + return _gthis.__shapeCache.cache(formatRange,html5Positions,text.substring(startIndex,endIndex)); + }; + var getPositionsWidth = function(positions) { + var width = 0.0; + var _g = 0; + while(_g < positions.length) { + var position = positions[_g]; + ++_g; + width += position; + } + return width; + }; + var getTextWidth = function(text) { + return _gthis.measureText(text); + }; + var getBaseX = function() { + return 2 + leftMargin + blockIndent + (firstLineOfParagraph ? indent : 0); + }; + var getWrapWidth = function() { + return _gthis.width - 2 - rightMargin - getBaseX(); + }; + var nextLayoutGroup = function(startIndex,endIndex) { + if(layoutGroup == null || layoutGroup.startIndex != layoutGroup.endIndex) { + layoutGroup = new openfl_text__$internal_TextLayoutGroup(formatRange.format,startIndex,endIndex); + _gthis.layoutGroups.push(layoutGroup); + } else { + layoutGroup.format = formatRange.format; + layoutGroup.startIndex = startIndex; + layoutGroup.endIndex = endIndex; + } + }; + var setLineMetrics = function() { + if(currentFormat.__ascent != null) { + ascent = currentFormat.size * currentFormat.__ascent; + descent = currentFormat.size * currentFormat.__descent; + } else if(font != null && font.unitsPerEM != 0) { + ascent = font.ascender / font.unitsPerEM * currentFormat.size; + descent = Math.abs(font.descender / font.unitsPerEM * currentFormat.size); + } else { + ascent = currentFormat.size; + descent = currentFormat.size * 0.185; + } + leading = currentFormat.leading; + heightValue = Math.ceil(ascent + descent + leading); + if(heightValue > maxHeightValue) { + maxHeightValue = heightValue; + } + if(ascent > maxAscent) { + maxAscent = ascent; + } + }; + var setParagraphMetrics = function() { + firstLineOfParagraph = true; + align = currentFormat.align != null ? currentFormat.align : 3; + blockIndent = currentFormat.blockIndent != null ? currentFormat.blockIndent : 0; + indent = currentFormat.indent != null ? currentFormat.indent : 0; + leftMargin = currentFormat.leftMargin != null ? currentFormat.leftMargin : 0; + rightMargin = currentFormat.rightMargin != null ? currentFormat.rightMargin : 0; + var setParagraphMetrics = currentFormat.bullet != null; + var setParagraphMetrics = currentFormat.tabStops != null; + }; + var nextFormatRange = function() { + if(rangeIndex < _gthis.textFormatRanges.get_length() - 1) { + rangeIndex += 1; + formatRange = _gthis.textFormatRanges.get(rangeIndex); + currentFormat.__merge(formatRange.format); + var fontString = openfl_text__$internal_TextEngine.getFont(currentFormat); + openfl_text__$internal_TextEngine.__context.font = fontString; + font = openfl_text__$internal_TextEngine.getFontInstance(currentFormat); + return true; + } + return false; + }; + var setFormattedPositions = function(startIndex,endIndex) { + if(startIndex >= endIndex) { + positions = []; + widthValue = 0; + } else if(endIndex <= formatRange.end) { + positions = getPositions(_gthis.text,startIndex,endIndex); + widthValue = getPositionsWidth(positions); + } else { + var tempIndex = startIndex; + var tempRangeEnd = formatRange.end; + var countRanges = 0; + positions = []; + widthValue = 0; + while(true) { + if(tempIndex != tempRangeEnd) { + var tempPositions = getPositions(_gthis.text,tempIndex,tempRangeEnd); + positions = positions.concat(tempPositions); + } + if(tempRangeEnd != endIndex) { + if(!nextFormatRange()) { + lime_utils_Log.warn("You found a bug in OpenFL's text code! Please save a copy of your project and create an issue on GitHub so we can fix this.",{ fileName : "openfl/text/_internal/TextEngine.hx", lineNumber : 1186, className : "openfl.text._internal.TextEngine", methodName : "getLayoutGroups"}); + break; + } + tempIndex = tempRangeEnd; + tempRangeEnd = endIndex < formatRange.end ? endIndex : formatRange.end; + ++countRanges; + } else { + widthValue = getPositionsWidth(positions); + break; + } + } + rangeIndex -= countRanges + 1; + nextFormatRange(); + } + }; + var placeFormattedText = function(endIndex) { + if(endIndex <= formatRange.end) { + positions = getPositions(_gthis.text,textIndex,endIndex); + widthValue = getPositionsWidth(positions); + nextLayoutGroup(textIndex,endIndex); + layoutGroup.positions = positions; + var offsetX1 = offsetX; + var placeFormattedText = getBaseX(); + layoutGroup.offsetX = offsetX1 + placeFormattedText; + layoutGroup.ascent = ascent; + layoutGroup.descent = descent; + layoutGroup.leading = leading; + layoutGroup.lineIndex = lineIndex; + layoutGroup.offsetY = offsetY + 2; + layoutGroup.width = widthValue; + layoutGroup.height = heightValue; + offsetX += widthValue; + if(endIndex == formatRange.end) { + layoutGroup = null; + nextFormatRange(); + setLineMetrics(); + } + } else { + while(true) { + var tempRangeEnd = endIndex < formatRange.end ? endIndex : formatRange.end; + if(textIndex != tempRangeEnd) { + positions = getPositions(_gthis.text,textIndex,tempRangeEnd); + widthValue = getPositionsWidth(positions); + nextLayoutGroup(textIndex,tempRangeEnd); + layoutGroup.positions = positions; + var offsetX1 = offsetX; + var placeFormattedText = getBaseX(); + layoutGroup.offsetX = offsetX1 + placeFormattedText; + layoutGroup.ascent = ascent; + layoutGroup.descent = descent; + layoutGroup.leading = leading; + layoutGroup.lineIndex = lineIndex; + layoutGroup.offsetY = offsetY + 2; + layoutGroup.width = widthValue; + layoutGroup.height = heightValue; + offsetX += widthValue; + textIndex = tempRangeEnd; + } + if(tempRangeEnd == formatRange.end) { + layoutGroup = null; + } + if(tempRangeEnd == endIndex) { + break; + } + if(!nextFormatRange()) { + lime_utils_Log.warn("You found a bug in OpenFL's text code! Please save a copy of your project and create an issue on GitHub so we can fix this.",{ fileName : "openfl/text/_internal/TextEngine.hx", lineNumber : 1274, className : "openfl.text._internal.TextEngine", methodName : "getLayoutGroups"}); + break; + } + setLineMetrics(); + } + } + textIndex = endIndex; + }; + var alignBaseline = function() { + setLineMetrics(); + var i = _gthis.layoutGroups.get_length(); + while(--i > -1) { + var lg = _gthis.layoutGroups.get(i); + if(lg.lineIndex < lineIndex) { + break; + } + if(lg.lineIndex > lineIndex) { + continue; + } + lg.ascent = maxAscent; + lg.height = maxHeightValue; + } + offsetY += maxHeightValue; + maxAscent = 0.0; + maxHeightValue = 0; + lineIndex += 1; + offsetX = 0; + firstLineOfParagraph = false; + }; + var breakLongWords = function(endIndex) { + var remainingPositions = positions; + var bufferCount; + var placeIndex; + var positionWidth; + var currentPosition; + var tempWidth = getPositionsWidth(remainingPositions); + var i = remainingPositions.length - 1; + while(i >= 0) { + var currentCharCode = HxOverrides.cca(_gthis.text,textIndex + i); + if(currentCharCode != 32 && currentCharCode != 9) { + break; + } + var position = remainingPositions[i]; + tempWidth -= position; + --i; + } + while(remainingPositions.length > 0 && offsetX + tempWidth > getWrapWidth()) { + bufferCount = 0; + i = bufferCount; + positionWidth = 0.0; + while(offsetX + positionWidth < getWrapWidth()) { + currentPosition = remainingPositions[i]; + if(currentPosition == 0.0) { + ++i; + ++bufferCount; + } else { + positionWidth += currentPosition; + ++i; + } + } + if(i == bufferCount) { + i = bufferCount + 1; + } else { + while(i > 1 && offsetX + positionWidth > getWrapWidth()) { + --i; + if(i - bufferCount > 0) { + setFormattedPositions(textIndex,textIndex + i - bufferCount); + positionWidth = widthValue; + } else { + i = 1; + bufferCount = 0; + setFormattedPositions(textIndex,textIndex + 1); + positionWidth = 0; + } + } + } + placeIndex = textIndex + i - bufferCount; + placeFormattedText(placeIndex); + alignBaseline(); + setFormattedPositions(placeIndex,endIndex); + remainingPositions = positions; + tempWidth = widthValue; + } + }; + var placeText = function(endIndex) { + if(_gthis.width >= 4 && _gthis.wordWrap) { + breakLongWords(endIndex); + } + placeFormattedText(endIndex); + }; + nextFormatRange(); + setParagraphMetrics(); + setLineMetrics(); + var wrap; + var maxLoops = this.text.length + 1; + while(textIndex < maxLoops) if(breakIndex > -1 && (spaceIndex == -1 || breakIndex < spaceIndex)) { + if(textIndex <= breakIndex) { + setFormattedPositions(textIndex,breakIndex); + placeText(breakIndex); + layoutGroup = null; + } else if(layoutGroup != null && layoutGroup.startIndex != layoutGroup.endIndex) { + if(layoutGroup.endIndex == spaceIndex) { + layoutGroup.width -= layoutGroup.positions[layoutGroup.positions.length - 1]; + } + layoutGroup = null; + } + alignBaseline(); + if(formatRange.end == breakIndex) { + nextFormatRange(); + setLineMetrics(); + } + textIndex = breakIndex + 1; + previousBreakIndex = breakIndex; + ++breakCount; + breakIndex = breakCount < this.lineBreaks.get_length() ? this.lineBreaks.get(breakCount) : -1; + setParagraphMetrics(); + } else if(spaceIndex > -1) { + if(layoutGroup != null && layoutGroup.startIndex != layoutGroup.endIndex) { + layoutGroup = null; + } + wrap = false; + while(textIndex < this.text.length) { + var endIndex = -1; + if(spaceIndex == -1) { + endIndex = breakIndex; + } else { + endIndex = spaceIndex + 1; + if(breakIndex > -1 && breakIndex < endIndex) { + endIndex = breakIndex; + } + } + if(endIndex == -1) { + endIndex = this.text.length; + } + setFormattedPositions(textIndex,endIndex); + if(align == 2) { + if(positions.length > 0 && textIndex == previousSpaceIndex) { + textIndex += 1; + var spaceWidth = positions.shift(); + widthValue -= spaceWidth; + offsetX += spaceWidth; + } + if(positions.length > 0 && endIndex == spaceIndex + 1) { + --endIndex; + var spaceWidth1 = positions.pop(); + widthValue -= spaceWidth1; + } + } + if(this.wordWrap) { + if(offsetX + widthValue > getWrapWidth()) { + wrap = true; + if(positions.length > 0 && endIndex == spaceIndex + 1) { + var lastPosition = positions[positions.length - 1]; + var spaceWidth2 = lastPosition; + if(offsetX + widthValue - spaceWidth2 <= getWrapWidth()) { + wrap = false; + } + } + } + } + if(wrap) { + if(align != 2 && (layoutGroup != null || this.layoutGroups.get_length() > 0)) { + var previous = layoutGroup; + if(previous == null) { + previous = this.layoutGroups.get(this.layoutGroups.get_length() - 1); + } + previous.width -= previous.positions[previous.positions.length - 1]; + previous.endIndex--; + } + var i = this.layoutGroups.get_length() - 1; + var offsetCount = 0; + while(i >= 0) { + layoutGroup = this.layoutGroups.get(i); + if(i > 0 && layoutGroup.startIndex > previousSpaceIndex) { + ++offsetCount; + } else { + break; + } + --i; + } + if(textIndex == previousSpaceIndex + 1) { + alignBaseline(); + } + offsetX = 0; + if(offsetCount > 0) { + var bumpX = this.layoutGroups.get(this.layoutGroups.get_length() - offsetCount).offsetX; + var _g = this.layoutGroups.get_length() - offsetCount; + var _g1 = this.layoutGroups.get_length(); + while(_g < _g1) { + var i1 = _g++; + layoutGroup = this.layoutGroups.get(i1); + layoutGroup.offsetX -= bumpX; + layoutGroup.offsetY = offsetY + 2; + layoutGroup.lineIndex = lineIndex; + offsetX += layoutGroup.width; + } + } + placeText(endIndex); + wrap = false; + } else if(layoutGroup != null && textIndex == spaceIndex && previousSpaceIndex != spaceIndex - 1) { + if(align != 2) { + layoutGroup.endIndex = spaceIndex; + layoutGroup.positions = layoutGroup.positions.concat(positions); + layoutGroup.width += widthValue; + } + offsetX += widthValue; + textIndex = endIndex; + } else if(layoutGroup == null || align == 2) { + placeText(endIndex); + if(endIndex == this.text.length) { + alignBaseline(); + } + } else { + var tempRangeEnd = endIndex < formatRange.end ? endIndex : formatRange.end; + if(tempRangeEnd < endIndex) { + positions = getPositions(this.text,textIndex,tempRangeEnd); + widthValue = getPositionsWidth(positions); + } + layoutGroup.endIndex = tempRangeEnd; + layoutGroup.positions = layoutGroup.positions.concat(positions); + layoutGroup.width += widthValue; + offsetX += widthValue; + if(tempRangeEnd == formatRange.end) { + layoutGroup = null; + nextFormatRange(); + setLineMetrics(); + textIndex = tempRangeEnd; + if(tempRangeEnd != endIndex) { + placeFormattedText(endIndex); + } + } + if(breakIndex == endIndex) { + ++endIndex; + } + textIndex = endIndex; + if(endIndex == this.text.length) { + alignBaseline(); + if(breakIndex != -1) { + previousBreakIndex = breakIndex; + ++breakCount; + breakIndex = breakCount < this.lineBreaks.get_length() ? this.lineBreaks.get(breakCount) : -1; + } + } + } + var nextSpaceIndex = this.text.indexOf(" ",textIndex); + if(breakIndex == previousSpaceIndex) { + layoutGroup.endIndex = breakIndex; + if(breakIndex - layoutGroup.startIndex - layoutGroup.positions.length < 0) { + layoutGroup.positions.push(0.0); + } + textIndex = breakIndex + 1; + } + previousSpaceIndex = spaceIndex; + spaceIndex = nextSpaceIndex; + if(breakIndex > -1 && breakIndex <= textIndex && (spaceIndex > breakIndex || spaceIndex == -1) || textIndex > this.text.length) { + break; + } + } + } else { + if(textIndex < this.text.length) { + setFormattedPositions(textIndex,this.text.length); + placeText(this.text.length); + alignBaseline(); + } + textIndex += 1; + } + if(previousBreakIndex == textIndex - 2 && previousBreakIndex > -1) { + nextLayoutGroup(textIndex - 1,textIndex - 1); + layoutGroup.positions = []; + layoutGroup.ascent = ascent; + layoutGroup.descent = descent; + layoutGroup.leading = leading; + layoutGroup.lineIndex = lineIndex; + layoutGroup.offsetX = getBaseX(); + layoutGroup.offsetY = offsetY + 2; + layoutGroup.width = 0; + layoutGroup.height = heightValue; + } + } + ,measureText: function(text) { + return openfl_text__$internal_TextEngine.__context.measureText(text).width; + } + ,restrictText: function(value) { + if(value == null) { + return value; + } + if(this.__restrictRegexp != null) { + value = this.__restrictRegexp.split(value).join(""); + } + return value; + } + ,setTextAlignment: function() { + var lineIndex = -1; + var offsetX = 0.0; + var totalWidth = this.width - 4; + var group; + var lineLength; + var lineMeasurementsDirty = false; + var _g = 0; + var _g1 = this.layoutGroups.get_length(); + while(_g < _g1) { + var i = _g++; + group = this.layoutGroups.get(i); + if(group.lineIndex != lineIndex) { + lineIndex = group.lineIndex; + totalWidth = this.width - 4 - group.format.rightMargin; + switch(group.format.align) { + case 0: + if(this.lineWidths.get(lineIndex) < totalWidth) { + offsetX = Math.round((totalWidth - this.lineWidths.get(lineIndex)) / 2); + } else { + offsetX = 0; + } + break; + case 2: + if(this.lineWidths.get(lineIndex) < totalWidth) { + lineLength = 1; + var _g2 = i + 1; + var _g3 = this.layoutGroups.get_length(); + while(_g2 < _g3) { + var j = _g2++; + if(this.layoutGroups.get(j).lineIndex == lineIndex) { + if(j == 0 || HxOverrides.cca(this.text,this.layoutGroups.get(j).startIndex - 1) == 32) { + ++lineLength; + } + } else { + break; + } + } + if(lineLength > 1) { + group = this.layoutGroups.get(i + lineLength - 1); + var endChar = HxOverrides.cca(this.text,group.endIndex); + if(group.endIndex < this.text.length && endChar != 10 && endChar != 13) { + offsetX = (totalWidth - this.lineWidths.get(lineIndex)) / (lineLength - 1); + lineMeasurementsDirty = true; + var j1 = 1; + do this.layoutGroups.get(i + j1).offsetX += offsetX * j1; while(++j1 < lineLength); + } + } + } + offsetX = 0; + break; + case 4: + if(this.lineWidths.get(lineIndex) < totalWidth) { + offsetX = Math.round(totalWidth - this.lineWidths.get(lineIndex)); + } else { + offsetX = 0; + } + break; + default: + offsetX = 0; + } + } + if(offsetX > 0) { + group.offsetX += offsetX; + } + } + if(lineMeasurementsDirty) { + this.getLineMeasurements(); + } + } + ,trimText: function(value) { + if(value == null) { + return value; + } + if(this.maxChars > 0 && value.length > this.maxChars) { + value = HxOverrides.substr(value,0,this.maxChars); + } + return value; + } + ,update: function() { + if(this.text == null || this.textFormatRanges.get_length() == 0) { + this.lineAscents.set_length(0); + this.lineBreaks.set_length(0); + this.lineDescents.set_length(0); + this.lineLeadings.set_length(0); + this.lineHeights.set_length(0); + this.lineWidths.set_length(0); + this.layoutGroups.set_length(0); + this.textWidth = 0; + this.textHeight = 0; + this.numLines = 1; + this.maxScrollH = 0; + this.maxScrollV = 1; + this.bottomScrollV = 1; + } else { + this.getLineBreaks(); + this.getLayoutGroups(); + this.getLineMeasurements(); + this.setTextAlignment(); + } + this.getBounds(); + } + ,get_bottomScrollV: function() { + if(this.numLines == 1 || this.lineHeights == null) { + return 1; + } else { + var ret = this.lineHeights.get_length(); + var tempHeight = this.lineLeadings.get_length() == ret ? -this.lineLeadings.get(ret - 1) : 0.0; + var _g = (this.get_scrollV() > 0 ? this.get_scrollV() : 1) - 1; + var _g1 = this.lineHeights.get_length(); + while(_g < _g1) { + var i = _g++; + var lineHeight = this.lineHeights.get(i); + tempHeight += lineHeight; + if(tempHeight > this.height - 4) { + ret = i + (tempHeight - this.height >= 0 ? 0 : 1); + break; + } + } + if(ret < this.get_scrollV()) { + return this.get_scrollV(); + } + return ret; + } + } + ,get_maxScrollV: function() { + if(this.numLines == 1 || this.lineHeights == null) { + return 1; + } else { + var i = this.numLines - 1; + var tempHeight = 0.0; + var j = i; + while(i >= 0) { + tempHeight += this.lineHeights.get(i); + if(tempHeight > this.height - 4) { + i += tempHeight - this.height < 0 ? 1 : 2; + break; + } + --i; + } + if(i < 1) { + return 1; + } + return i; + } + } + ,set_restrict: function(value) { + if(this.restrict == value) { + return this.restrict; + } + this.restrict = value; + if(this.restrict == null || this.restrict.length == 0) { + this.__restrictRegexp = null; + } else { + this.__restrictRegexp = this.createRestrictRegexp(value); + } + return this.restrict; + } + ,get_scrollV: function() { + if(this.numLines == 1 || this.lineHeights == null) { + return 1; + } + var max = this.get_maxScrollV(); + if(this.scrollV > max) { + return max; + } + return this.scrollV; + } + ,set_scrollV: function(value) { + if(value < 1) { + value = 1; + } else if(value > this.get_maxScrollV()) { + value = this.get_maxScrollV(); + } + return this.scrollV = value; + } + ,set_text: function(value) { + return this.text = value; + } + ,__class__: openfl_text__$internal_TextEngine + ,__properties__: {set_text:"set_text",set_scrollV:"set_scrollV",get_scrollV:"get_scrollV",set_restrict:"set_restrict",get_maxScrollV:"get_maxScrollV",get_bottomScrollV:"get_bottomScrollV"} +}; +var openfl_text__$internal__$TextEngine_DefaultFontSet = function(normal,bold,italic,boldItalic) { + this.normal = normal; + this.bold = bold; + this.italic = italic; + this.boldItalic = boldItalic; +}; +$hxClasses["openfl.text._internal._TextEngine.DefaultFontSet"] = openfl_text__$internal__$TextEngine_DefaultFontSet; +openfl_text__$internal__$TextEngine_DefaultFontSet.__name__ = "openfl.text._internal._TextEngine.DefaultFontSet"; +openfl_text__$internal__$TextEngine_DefaultFontSet.prototype = { + getFont: function(isBold,isItalic) { + if(isBold && isItalic && this.boldItalic != null) { + return this.boldItalic; + } + if(isItalic && this.italic != null) { + return this.italic; + } + if(isBold && this.bold != null) { + return this.bold; + } + return this.normal; + } + ,__class__: openfl_text__$internal__$TextEngine_DefaultFontSet +}; +var openfl_text__$internal_TextFormatRange = function(format,start,end) { + this.format = format; + this.start = start; + this.end = end; +}; +$hxClasses["openfl.text._internal.TextFormatRange"] = openfl_text__$internal_TextFormatRange; +openfl_text__$internal_TextFormatRange.__name__ = "openfl.text._internal.TextFormatRange"; +openfl_text__$internal_TextFormatRange.prototype = { + __class__: openfl_text__$internal_TextFormatRange +}; +var openfl_text__$internal_TextLayout = function(text,font,size,direction,script,language) { + if(language == null) { + language = "en"; + } + if(script == null) { + script = "Zyyy"; + } + if(direction == null) { + direction = 4; + } + if(size == null) { + size = 12; + } + if(text == null) { + text = ""; + } + this.__hbFontSize = -1; + this.letterSpacing = 0; + this.set_text(text); + this.set_font(font); + this.set_size(size); + this.__direction = direction; + this.__script = script; + this.__language = language; + this.positions = []; + this.__dirty = true; + this.__create(this.__direction,this.__script,this.__language); +}; +$hxClasses["openfl.text._internal.TextLayout"] = openfl_text__$internal_TextLayout; +openfl_text__$internal_TextLayout.__name__ = "openfl.text._internal.TextLayout"; +openfl_text__$internal_TextLayout.prototype = { + __create: function(direction,script,language) { + if(language.length != 4) { + return; + } + this.__hbBuffer = lime_text_harfbuzz_HBBuffer._new(); + var direction1 = direction; + var this1 = this.__hbBuffer; + var value = lime_text_harfbuzz_HBLanguage._new(language); + } + ,__position: function() { + this.positions = []; + } + ,get_positions: function() { + if(this.__dirty) { + this.__dirty = false; + this.__position(); + } + return this.positions; + } + ,get_direction: function() { + return this.__direction; + } + ,set_direction: function(value) { + if(value == this.__direction) { + return value; + } + this.__direction = value; + this.__dirty = true; + return value; + } + ,set_font: function(value) { + if(value == this.font) { + return value; + } + this.font = value; + this.__dirty = true; + return value; + } + ,get_glyphs: function() { + var glyphs = []; + var _g = 0; + var _g1 = this.get_positions(); + while(_g < _g1.length) { + var position = _g1[_g]; + ++_g; + glyphs.push(position.glyph); + } + return glyphs; + } + ,get_language: function() { + return this.__language; + } + ,set_language: function(value) { + if(value == this.__language) { + return value; + } + this.__language = value; + this.__dirty = true; + return value; + } + ,get_script: function() { + return this.__script; + } + ,set_script: function(value) { + if(value == this.__script) { + return value; + } + this.__script = value; + this.__dirty = true; + return value; + } + ,set_size: function(value) { + if(value == this.size) { + return value; + } + this.size = value; + this.__dirty = true; + return value; + } + ,set_text: function(value) { + if(value == this.text) { + return value; + } + this.text = value; + this.__dirty = true; + return value; + } + ,__class__: openfl_text__$internal_TextLayout + ,__properties__: {set_text:"set_text",set_size:"set_size",set_script:"set_script",get_script:"get_script",get_positions:"get_positions",set_language:"set_language",get_language:"get_language",get_glyphs:"get_glyphs",set_font:"set_font",set_direction:"set_direction",get_direction:"get_direction"} +}; +var openfl_text__$internal_TextDirection = {}; +openfl_text__$internal_TextDirection.__properties__ = {get_vertical:"get_vertical",get_horizontal:"get_horizontal",get_forward:"get_forward",get_backward:"get_backward"}; +openfl_text__$internal_TextDirection.reverse = function(this1) { + this1 ^= 1; +}; +openfl_text__$internal_TextDirection.toString = function(this1) { + switch(this1) { + case 4: + return "leftToRight"; + case 5: + return "rightToLeft"; + case 6: + return "topToBottom"; + case 7: + return "bottomToTop"; + default: + return ""; + } +}; +openfl_text__$internal_TextDirection.toHBDirection = function(this1) { + switch(this1) { + case 4: + return 4; + case 5: + return 5; + case 6: + return 6; + case 7: + return 7; + default: + return 0; + } +}; +openfl_text__$internal_TextDirection.get_backward = function(this1) { + return (this1 & -3) == 5; +}; +openfl_text__$internal_TextDirection.get_forward = function(this1) { + return (this1 & -3) == 4; +}; +openfl_text__$internal_TextDirection.get_horizontal = function(this1) { + return (this1 & -2) == 4; +}; +openfl_text__$internal_TextDirection.get_vertical = function(this1) { + return (this1 & -2) == 6; +}; +var openfl_text__$internal_TextScript = {}; +openfl_text__$internal_TextScript.__properties__ = {get_rightToLeft:"get_rightToLeft"}; +openfl_text__$internal_TextScript.toHBScript = function(this1) { + return 1517910393; +}; +openfl_text__$internal_TextScript.get_rightToLeft = function(this1) { + switch(this1) { + case "Arab":case "Armi":case "Avst":case "Cprt":case "Hebr":case "Khar":case "Lydi":case "Mand":case "Nkoo":case "Orkh":case "Phli":case "Phlp":case "Phnx":case "Samr":case "Sarb":case "Syrc":case "Thaa": + return true; + default: + return false; + } +}; +var openfl_text__$internal_TextLayoutGroup = function(format,startIndex,endIndex) { + this.format = format; + this.startIndex = startIndex; + this.endIndex = endIndex; +}; +$hxClasses["openfl.text._internal.TextLayoutGroup"] = openfl_text__$internal_TextLayoutGroup; +openfl_text__$internal_TextLayoutGroup.__name__ = "openfl.text._internal.TextLayoutGroup"; +openfl_text__$internal_TextLayoutGroup.prototype = { + getAdvance: function(index) { + return this.positions[index]; + } + ,__class__: openfl_text__$internal_TextLayoutGroup +}; +var openfl_ui_GameInput = function() { + openfl_events_EventDispatcher.call(this); + openfl_ui_GameInput.__instances.push(this); +}; +$hxClasses["openfl.ui.GameInput"] = openfl_ui_GameInput; +openfl_ui_GameInput.__name__ = "openfl.ui.GameInput"; +openfl_ui_GameInput.getDeviceAt = function(index) { + if(index >= 0 && index < openfl_ui_GameInput.__deviceList.length) { + return openfl_ui_GameInput.__deviceList[index]; + } + return null; +}; +openfl_ui_GameInput.__getDevice = function(gamepad) { + if(gamepad == null) { + return null; + } + if(openfl_ui_GameInput.__devices.h.__keys__[gamepad.__id__] == null) { + var devices = lime_ui_Joystick.__getDeviceData(); + var device = devices[gamepad.id].id; + var devices = lime_ui_Joystick.__getDeviceData(); + var device1 = new openfl_ui_GameInputDevice(device,devices[gamepad.id].id); + openfl_ui_GameInput.__deviceList.push(device1); + openfl_ui_GameInput.__devices.set(gamepad,device1); + openfl_ui_GameInput.numDevices = openfl_ui_GameInput.__deviceList.length; + } + return openfl_ui_GameInput.__devices.h[gamepad.__id__]; +}; +openfl_ui_GameInput.__onGamepadAxisMove = function(gamepad,axis,value) { + var device = openfl_ui_GameInput.__getDevice(gamepad); + if(device == null) { + return; + } + if(device.enabled) { + if(!device.__axis.h.hasOwnProperty(axis)) { + var control; + if(axis == null) { + control = "null"; + } else { + switch(axis) { + case 0: + control = "LEFT_X"; + break; + case 1: + control = "LEFT_Y"; + break; + case 2: + control = "RIGHT_X"; + break; + case 3: + control = "RIGHT_Y"; + break; + case 4: + control = "TRIGGER_LEFT"; + break; + case 5: + control = "TRIGGER_RIGHT"; + break; + default: + control = "UNKNOWN (" + axis + ")"; + } + } + var control1 = new openfl_ui_GameInputControl(device,"AXIS_" + control,-1,1); + device.__axis.h[axis] = control1; + device.__controls.push(control1); + } + var control = device.__axis.h[axis]; + control.value = value; + control.dispatchEvent(new openfl_events_Event("change")); + } +}; +openfl_ui_GameInput.__onGamepadButtonDown = function(gamepad,button) { + var device = openfl_ui_GameInput.__getDevice(gamepad); + if(device == null) { + return; + } + if(device.enabled) { + if(!device.__button.h.hasOwnProperty(button)) { + var control; + if(button == null) { + control = "null"; + } else { + switch(button) { + case 0: + control = "A"; + break; + case 1: + control = "B"; + break; + case 2: + control = "X"; + break; + case 3: + control = "Y"; + break; + case 4: + control = "BACK"; + break; + case 5: + control = "GUIDE"; + break; + case 6: + control = "START"; + break; + case 7: + control = "LEFT_STICK"; + break; + case 8: + control = "RIGHT_STICK"; + break; + case 9: + control = "LEFT_SHOULDER"; + break; + case 10: + control = "RIGHT_SHOULDER"; + break; + case 11: + control = "DPAD_UP"; + break; + case 12: + control = "DPAD_DOWN"; + break; + case 13: + control = "DPAD_LEFT"; + break; + case 14: + control = "DPAD_RIGHT"; + break; + default: + control = "UNKNOWN (" + button + ")"; + } + } + var control1 = new openfl_ui_GameInputControl(device,"BUTTON_" + control,0,1); + device.__button.h[button] = control1; + device.__controls.push(control1); + } + var control = device.__button.h[button]; + control.value = 1; + control.dispatchEvent(new openfl_events_Event("change")); + } +}; +openfl_ui_GameInput.__onGamepadButtonUp = function(gamepad,button) { + var device = openfl_ui_GameInput.__getDevice(gamepad); + if(device == null) { + return; + } + if(device.enabled) { + if(!device.__button.h.hasOwnProperty(button)) { + var control; + if(button == null) { + control = "null"; + } else { + switch(button) { + case 0: + control = "A"; + break; + case 1: + control = "B"; + break; + case 2: + control = "X"; + break; + case 3: + control = "Y"; + break; + case 4: + control = "BACK"; + break; + case 5: + control = "GUIDE"; + break; + case 6: + control = "START"; + break; + case 7: + control = "LEFT_STICK"; + break; + case 8: + control = "RIGHT_STICK"; + break; + case 9: + control = "LEFT_SHOULDER"; + break; + case 10: + control = "RIGHT_SHOULDER"; + break; + case 11: + control = "DPAD_UP"; + break; + case 12: + control = "DPAD_DOWN"; + break; + case 13: + control = "DPAD_LEFT"; + break; + case 14: + control = "DPAD_RIGHT"; + break; + default: + control = "UNKNOWN (" + button + ")"; + } + } + var control1 = new openfl_ui_GameInputControl(device,"BUTTON_" + control,0,1); + device.__button.h[button] = control1; + device.__controls.push(control1); + } + var control = device.__button.h[button]; + control.value = 0; + control.dispatchEvent(new openfl_events_Event("change")); + } +}; +openfl_ui_GameInput.__onGamepadConnect = function(gamepad) { + var device = openfl_ui_GameInput.__getDevice(gamepad); + if(device == null) { + return; + } + var _g = 0; + var _g1 = openfl_ui_GameInput.__instances; + while(_g < _g1.length) { + var instance = _g1[_g]; + ++_g; + instance.dispatchEvent(new openfl_events_GameInputEvent("deviceAdded",true,false,device)); + } +}; +openfl_ui_GameInput.__onGamepadDisconnect = function(gamepad) { + var device = openfl_ui_GameInput.__devices.h[gamepad.__id__]; + if(device != null) { + if(openfl_ui_GameInput.__devices.h.__keys__[gamepad.__id__] != null) { + HxOverrides.remove(openfl_ui_GameInput.__deviceList,openfl_ui_GameInput.__devices.h[gamepad.__id__]); + openfl_ui_GameInput.__devices.remove(gamepad); + } + openfl_ui_GameInput.numDevices = openfl_ui_GameInput.__deviceList.length; + var _g = 0; + var _g1 = openfl_ui_GameInput.__instances; + while(_g < _g1.length) { + var instance = _g1[_g]; + ++_g; + instance.dispatchEvent(new openfl_events_GameInputEvent("deviceRemoved",true,false,device)); + } + } +}; +openfl_ui_GameInput.__super__ = openfl_events_EventDispatcher; +openfl_ui_GameInput.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + addEventListener: function(type,listener,useCapture,priority,useWeakReference) { + if(useWeakReference == null) { + useWeakReference = false; + } + if(priority == null) { + priority = 0; + } + if(useCapture == null) { + useCapture = false; + } + openfl_events_EventDispatcher.prototype.addEventListener.call(this,type,listener,useCapture,priority,useWeakReference); + if(type == "deviceAdded") { + var _g = 0; + var _g1 = openfl_ui_GameInput.__deviceList; + while(_g < _g1.length) { + var device = _g1[_g]; + ++_g; + this.dispatchEvent(new openfl_events_GameInputEvent("deviceAdded",true,false,device)); + } + } + } + ,__class__: openfl_ui_GameInput +}); +var openfl_ui_GameInputControl = function(device,id,minValue,maxValue,value) { + if(value == null) { + value = 0; + } + openfl_events_EventDispatcher.call(this); + this.device = device; + this.id = id; + this.minValue = minValue; + this.maxValue = maxValue; + this.value = value; +}; +$hxClasses["openfl.ui.GameInputControl"] = openfl_ui_GameInputControl; +openfl_ui_GameInputControl.__name__ = "openfl.ui.GameInputControl"; +openfl_ui_GameInputControl.__super__ = openfl_events_EventDispatcher; +openfl_ui_GameInputControl.prototype = $extend(openfl_events_EventDispatcher.prototype,{ + __class__: openfl_ui_GameInputControl +}); +var openfl_ui_GameInputDevice = function(id,name) { + this.__controls = []; + this.__button = new haxe_ds_IntMap(); + this.__axis = new haxe_ds_IntMap(); + this.id = id; + this.name = name; + var control; + control = new openfl_ui_GameInputControl(this,"AXIS_" + 0,-1,1); + this.__axis.h[0] = control; + this.__controls.push(control); + control = new openfl_ui_GameInputControl(this,"AXIS_" + 1,-1,1); + this.__axis.h[1] = control; + this.__controls.push(control); + control = new openfl_ui_GameInputControl(this,"AXIS_" + 2,-1,1); + this.__axis.h[2] = control; + this.__controls.push(control); + control = new openfl_ui_GameInputControl(this,"AXIS_" + 3,-1,1); + this.__axis.h[3] = control; + this.__controls.push(control); + control = new openfl_ui_GameInputControl(this,"AXIS_" + 4,-1,1); + this.__axis.h[4] = control; + this.__controls.push(control); + control = new openfl_ui_GameInputControl(this,"AXIS_" + 5,-1,1); + this.__axis.h[5] = control; + this.__controls.push(control); + var _g = 0; + while(_g < 15) { + var i = _g++; + control = new openfl_ui_GameInputControl(this,"BUTTON_" + i,0,1); + this.__button.h[i] = control; + this.__controls.push(control); + } +}; +$hxClasses["openfl.ui.GameInputDevice"] = openfl_ui_GameInputDevice; +openfl_ui_GameInputDevice.__name__ = "openfl.ui.GameInputDevice"; +openfl_ui_GameInputDevice.prototype = { + getCachedSamples: function(data,append) { + if(append == null) { + append = false; + } + return 0; + } + ,getControlAt: function(i) { + if(i >= 0 && i < this.__controls.length) { + return this.__controls[i]; + } + return null; + } + ,startCachingSamples: function(numSamples,controls) { + } + ,stopCachingSamples: function() { + } + ,get_numControls: function() { + return this.__controls.length; + } + ,__class__: openfl_ui_GameInputDevice + ,__properties__: {get_numControls:"get_numControls"} +}; +var openfl_ui_Keyboard = function() { }; +$hxClasses["openfl.ui.Keyboard"] = openfl_ui_Keyboard; +openfl_ui_Keyboard.__name__ = "openfl.ui.Keyboard"; +openfl_ui_Keyboard.isAccessible = function() { + return false; +}; +openfl_ui_Keyboard.__convertKeyCode = function(key) { + switch(key) { + case 8: + return 8; + case 9: + return 9; + case 13: + return 13; + case 27: + return 27; + case 32: + return 32; + case 33: + return 49; + case 34: + return 222; + case 35: + return 51; + case 36: + return 52; + case 37: + return 53; + case 38: + return 55; + case 39: + return 222; + case 40: + return 57; + case 41: + return 48; + case 42: + return 56; + case 44: + return 188; + case 45: + return 189; + case 46: + return 190; + case 47: + return 191; + case 48: + return 48; + case 49: + return 49; + case 50: + return 50; + case 51: + return 51; + case 52: + return 52; + case 53: + return 53; + case 54: + return 54; + case 55: + return 55; + case 56: + return 56; + case 57: + return 57; + case 58: + return 186; + case 59: + return 186; + case 60: + return 60; + case 61: + return 187; + case 62: + return 190; + case 63: + return 191; + case 64: + return 50; + case 91: + return 219; + case 92: + return 220; + case 93: + return 221; + case 94: + return 54; + case 95: + return 189; + case 96: + return 192; + case 97: + return 65; + case 98: + return 66; + case 99: + return 67; + case 100: + return 68; + case 101: + return 69; + case 102: + return 70; + case 103: + return 71; + case 104: + return 72; + case 105: + return 73; + case 106: + return 74; + case 107: + return 75; + case 108: + return 76; + case 109: + return 77; + case 110: + return 78; + case 111: + return 79; + case 112: + return 80; + case 113: + return 81; + case 114: + return 82; + case 115: + return 83; + case 116: + return 84; + case 117: + return 85; + case 118: + return 86; + case 119: + return 87; + case 120: + return 88; + case 121: + return 89; + case 122: + return 90; + case 127: + return 46; + case 1073741881: + return 20; + case 1073741882: + return 112; + case 1073741883: + return 113; + case 1073741884: + return 114; + case 1073741885: + return 115; + case 1073741886: + return 116; + case 1073741887: + return 117; + case 1073741888: + return 118; + case 1073741889: + return 119; + case 1073741890: + return 120; + case 1073741891: + return 121; + case 1073741892: + return 122; + case 1073741893: + return 123; + case 1073741894: + return 301; + case 1073741895: + return 145; + case 1073741896: + return 19; + case 1073741897: + return 45; + case 1073741898: + return 36; + case 1073741899: + return 33; + case 1073741901: + return 35; + case 1073741902: + return 34; + case 1073741903: + return 39; + case 1073741904: + return 37; + case 1073741905: + return 40; + case 1073741906: + return 38; + case 1073741907: + return 144; + case 1073741908: + return 111; + case 1073741909: + return 106; + case 1073741910: + return 109; + case 1073741911: + return 107; + case 1073741912: + return 13; + case 1073741913: + return 97; + case 1073741914: + return 98; + case 1073741915: + return 99; + case 1073741916: + return 100; + case 1073741917: + return 101; + case 1073741918: + return 102; + case 1073741919: + return 103; + case 1073741920: + return 104; + case 1073741921: + return 105; + case 1073741922: + return 96; + case 1073741923: + return 110; + case 1073741925: + return 302; + case 1073741928: + return 124; + case 1073741929: + return 125; + case 1073741930: + return 126; + case 1073741982: + return 13; + case 1073742044: + return 110; + case 1073742048: + return 17; + case 1073742049: + return 16; + case 1073742050: + return 18; + case 1073742051: + return 15; + case 1073742052: + return 17; + case 1073742053: + return 16; + case 1073742054: + return 18; + case 1073742055: + return 15; + default: + return key; + } +}; +openfl_ui_Keyboard.__getCharCode = function(key,shift,capsLock) { + if(capsLock == null) { + capsLock = false; + } + if(shift == null) { + shift = false; + } + var effectiveShift = shift; + if(key >= 65 && key <= 90) { + effectiveShift = shift != capsLock; + } + if(!effectiveShift) { + switch(key) { + case 8: + return 8; + case 9: + return 9; + case 13: + return 13; + case 27: + return 27; + case 32: + return 32; + case 186: + return 59; + case 187: + return 61; + case 188: + return 44; + case 189: + return 45; + case 190: + return 46; + case 191: + return 47; + case 192: + return 96; + case 219: + return 91; + case 220: + return 92; + case 221: + return 93; + case 222: + return 39; + } + if(key >= 48 && key <= 57) { + return key - 48 + 48; + } + if(key >= 65 && key <= 90) { + return key - 65 + 97; + } + } else { + switch(key) { + case 48: + return 41; + case 49: + return 33; + case 50: + return 64; + case 51: + return 35; + case 52: + return 36; + case 53: + return 37; + case 54: + return 94; + case 55: + return 38; + case 56: + return 42; + case 57: + return 40; + case 186: + return 58; + case 187: + return 43; + case 188: + return 60; + case 189: + return 95; + case 190: + return 62; + case 191: + return 63; + case 192: + return 126; + case 219: + return 123; + case 220: + return 124; + case 221: + return 125; + case 222: + return 34; + } + if(key >= 65 && key <= 90) { + return key - 65 + 65; + } + } + if(key >= 96 && key <= 105) { + return key - 96 + 48; + } + switch(key) { + case 8: + return 8; + case 13: + return 13; + case 46: + return 127; + case 106: + return 42; + case 107: + return 43; + case 108: + return 44; + case 110: + return 45; + case 111: + return 46; + } + return 0; +}; +openfl_ui_Keyboard.__getKeyLocation = function(key) { + switch(key) { + case 1073741908:case 1073741909:case 1073741910:case 1073741911:case 1073741912:case 1073741913:case 1073741914:case 1073741915:case 1073741916:case 1073741917:case 1073741918:case 1073741919:case 1073741920:case 1073741921:case 1073741922:case 1073741923:case 1073742044: + return 3; + case 1073742048:case 1073742049:case 1073742050:case 1073742051: + return 1; + case 1073742052:case 1073742053:case 1073742054:case 1073742055: + return 2; + default: + return 0; + } +}; +var openfl_ui_Mouse = function() { }; +$hxClasses["openfl.ui.Mouse"] = openfl_ui_Mouse; +openfl_ui_Mouse.__name__ = "openfl.ui.Mouse"; +openfl_ui_Mouse.__properties__ = {set_cursor:"set_cursor",get_cursor:"get_cursor"}; +openfl_ui_Mouse.hide = function() { + openfl_ui_Mouse.__hidden = true; + var _g = 0; + var _g1 = lime_app_Application.current.__windows; + while(_g < _g1.length) { + var $window = _g1[_g]; + ++_g; + $window.set_cursor(null); + } +}; +openfl_ui_Mouse.show = function() { + openfl_ui_Mouse.__hidden = false; + var cacheCursor = openfl_ui_Mouse.__cursor; + openfl_ui_Mouse.__cursor = null; + openfl_ui_Mouse.set_cursor(cacheCursor); +}; +openfl_ui_Mouse.get_cursor = function() { + return openfl_ui_Mouse.__cursor; +}; +openfl_ui_Mouse.set_cursor = function(value) { + if(value == null) { + value = "auto"; + } + var setCursor = null; + switch(value) { + case "arrow": + setCursor = lime_ui_MouseCursor.ARROW; + break; + case "button": + setCursor = lime_ui_MouseCursor.POINTER; + break; + case "crosshair": + setCursor = lime_ui_MouseCursor.CROSSHAIR; + break; + case "custom": + setCursor = lime_ui_MouseCursor.CUSTOM; + break; + case "hand": + setCursor = lime_ui_MouseCursor.MOVE; + break; + case "ibeam": + setCursor = lime_ui_MouseCursor.TEXT; + break; + case "resize_nesw": + setCursor = lime_ui_MouseCursor.RESIZE_NESW; + break; + case "resize_ns": + setCursor = lime_ui_MouseCursor.RESIZE_NS; + break; + case "resize_nwse": + setCursor = lime_ui_MouseCursor.RESIZE_NWSE; + break; + case "resize_we": + setCursor = lime_ui_MouseCursor.RESIZE_WE; + break; + case "wait": + setCursor = lime_ui_MouseCursor.WAIT; + break; + case "waitarrow": + setCursor = lime_ui_MouseCursor.WAIT_ARROW; + break; + default: + } + if(setCursor != null && !openfl_ui_Mouse.__hidden) { + var _g = 0; + var _g1 = lime_app_Application.current.__windows; + while(_g < _g1.length) { + var $window = _g1[_g]; + ++_g; + $window.set_cursor(setCursor); + } + } + return openfl_ui_Mouse.__cursor = value; +}; +var openfl_ui_MouseCursor = {}; +openfl_ui_MouseCursor.fromLimeCursor = function(cursor) { + switch(cursor._hx_index) { + case 0: + return "arrow"; + case 1: + return "crosshair"; + case 2: + return "auto"; + case 3: + return "hand"; + case 4: + return "button"; + case 5: + return "resize_nesw"; + case 6: + return "resize_ns"; + case 7: + return "resize_nwse"; + case 8: + return "resize_we"; + case 9: + return "ibeam"; + case 10: + return "wait"; + case 11: + return "waitarrow"; + case 12: + return "custom"; + } +}; +openfl_ui_MouseCursor.toLimeCursor = function(this1) { + switch(this1) { + case "arrow": + return lime_ui_MouseCursor.ARROW; + case "auto": + return lime_ui_MouseCursor.DEFAULT; + case "button": + return lime_ui_MouseCursor.POINTER; + case "crosshair": + return lime_ui_MouseCursor.CROSSHAIR; + case "custom": + return lime_ui_MouseCursor.CUSTOM; + case "hand": + return lime_ui_MouseCursor.MOVE; + case "ibeam": + return lime_ui_MouseCursor.TEXT; + case "resize_nesw": + return lime_ui_MouseCursor.RESIZE_NESW; + case "resize_ns": + return lime_ui_MouseCursor.RESIZE_NS; + case "resize_nwse": + return lime_ui_MouseCursor.RESIZE_NWSE; + case "resize_we": + return lime_ui_MouseCursor.RESIZE_WE; + case "wait": + return lime_ui_MouseCursor.WAIT; + case "waitarrow": + return lime_ui_MouseCursor.WAIT_ARROW; + default: + return lime_ui_MouseCursor.DEFAULT; + } +}; +var openfl_utils_AGALMiniAssembler = function(debugging) { + if(debugging == null) { + debugging = false; + } + this.debugEnabled = false; + this.debugEnabled = debugging; + if(!openfl_utils_AGALMiniAssembler.initialized) { + openfl_utils_AGALMiniAssembler.init(); + } +}; +$hxClasses["openfl.utils.AGALMiniAssembler"] = openfl_utils_AGALMiniAssembler; +openfl_utils_AGALMiniAssembler.__name__ = "openfl.utils.AGALMiniAssembler"; +openfl_utils_AGALMiniAssembler.init = function() { + openfl_utils_AGALMiniAssembler.initialized = true; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("mov",2,0,0); + this1.h["mov"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("add",3,1,0); + this1.h["add"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("sub",3,2,0); + this1.h["sub"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("mul",3,3,0); + this1.h["mul"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("div",3,4,0); + this1.h["div"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("rcp",2,5,0); + this1.h["rcp"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("min",3,6,0); + this1.h["min"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("max",3,7,0); + this1.h["max"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("frc",2,8,0); + this1.h["frc"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("sqt",2,9,0); + this1.h["sqt"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("rsq",2,10,0); + this1.h["rsq"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("pow",3,11,0); + this1.h["pow"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("log",2,12,0); + this1.h["log"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("exp",2,13,0); + this1.h["exp"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("nrm",2,14,0); + this1.h["nrm"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("sin",2,15,0); + this1.h["sin"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("cos",2,16,0); + this1.h["cos"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("crs",3,17,0); + this1.h["crs"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("dp3",3,18,0); + this1.h["dp3"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("dp4",3,19,0); + this1.h["dp4"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("abs",2,20,0); + this1.h["abs"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("neg",2,21,0); + this1.h["neg"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("sat",2,22,0); + this1.h["sat"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("m33",3,23,16); + this1.h["m33"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("m44",3,24,16); + this1.h["m44"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("m34",3,25,16); + this1.h["m34"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("ddx",2,26,288); + this1.h["ddx"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("ddy",2,27,288); + this1.h["ddy"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("ife",2,28,897); + this1.h["ife"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("ine",2,29,897); + this1.h["ine"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("ifg",2,30,897); + this1.h["ifg"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("ifl",2,31,897); + this1.h["ifl"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("els",0,32,1921); + this1.h["els"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("eif",0,33,1409); + this1.h["eif"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("kil",1,39,160); + this1.h["kil"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("tex",3,40,40); + this1.h["tex"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("sge",3,41,0); + this1.h["sge"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("slt",3,42,0); + this1.h["slt"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("sgn",2,43,0); + this1.h["sgn"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("seq",3,44,0); + this1.h["seq"] = v; + var this1 = openfl_utils_AGALMiniAssembler.OPMAP; + var v = new openfl_utils__$AGALMiniAssembler_OpCode("sne",3,45,0); + this1.h["sne"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("rgba",8,0); + this1.h["rgba"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("compressed",8,1); + this1.h["compressed"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("compressedalpha",8,2); + this1.h["compressedalpha"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("dxt1",8,1); + this1.h["dxt1"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("dxt5",8,2); + this1.h["dxt5"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("video",8,3); + this1.h["video"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("2d",12,0); + this1.h["2d"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("3d",12,2); + this1.h["3d"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("cube",12,1); + this1.h["cube"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("mipnearest",24,1); + this1.h["mipnearest"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("miplinear",24,2); + this1.h["miplinear"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("mipnone",24,0); + this1.h["mipnone"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("nomip",24,0); + this1.h["nomip"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("nearest",28,0); + this1.h["nearest"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("linear",28,1); + this1.h["linear"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("anisotropic2x",28,2); + this1.h["anisotropic2x"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("anisotropic4x",28,3); + this1.h["anisotropic4x"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("anisotropic8x",28,4); + this1.h["anisotropic8x"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("anisotropic16x",28,5); + this1.h["anisotropic16x"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("centroid",16,1); + this1.h["centroid"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("single",16,2); + this1.h["single"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("ignoresampler",16,4); + this1.h["ignoresampler"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("repeat",20,1); + this1.h["repeat"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("wrap",20,1); + this1.h["wrap"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("clamp",20,0); + this1.h["clamp"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("clamp_u_repeat_v",20,2); + this1.h["clamp_u_repeat_v"] = v; + var this1 = openfl_utils_AGALMiniAssembler.SAMPLEMAP; + var v = new openfl_utils__$AGALMiniAssembler_Sampler("repeat_u_clamp_v",20,3); + this1.h["repeat_u_clamp_v"] = v; +}; +openfl_utils_AGALMiniAssembler.prototype = { + assemble2: function(context3D,version,vertexSource,fragmentSource) { + var agalVertex = this.assemble("vertex",vertexSource,version); + var agalFragment = this.assemble("fragment",fragmentSource,version); + var program = context3D.createProgram(); + program.upload(agalVertex,agalFragment); + return program; + } + ,assemble: function(mode,source,version,ignoreLimits) { + if(ignoreLimits == null) { + ignoreLimits = false; + } + if(version == null) { + version = 1; + } + var start = openfl_Lib.getTimer(); + this.agalcode = new openfl_utils_ByteArrayData(0); + this.error = ""; + var isFrag = false; + if(mode == "fragment") { + isFrag = true; + } else if(mode != "vertex") { + this.error = "ERROR: mode needs to be \"" + "fragment" + "\" or \"" + "vertex" + "\" but is \"" + mode + "\"."; + } + this.agalcode.__endian = 1; + this.agalcode.writeByte(160); + this.agalcode.writeUnsignedInt(version); + this.agalcode.writeByte(161); + this.agalcode.writeByte(isFrag ? 1 : 0); + this.initregmap(version,ignoreLimits); + var lines = StringTools.replace(source,"\r","\n").split("\n"); + var nops = 0; + var lng = lines.length; + var reg1 = new EReg("<.*>","g"); + var reg2 = new EReg("([\\w\\.\\-\\+]+)","gi"); + var reg3 = new EReg("^\\w{3}","ig"); + var reg4 = new EReg("vc\\[([vofi][acostdip]?[d]?)(\\d*)?(\\.[xyzw](\\+\\d{1,3})?)?\\](\\.[xyzw]{1,4})?|([vofi][acostdip]?[d]?)(\\d*)?(\\.[xyzw]{1,4})?","gi"); + var reg5 = new EReg("\\[.*\\]","ig"); + var reg6 = new EReg("^\\b[A-Za-z]{1,3}","ig"); + var reg7 = new EReg("\\d+",""); + var reg8 = new EReg("(\\.[xyzw]{1,4})",""); + var reg9 = new EReg("[A-Za-z]{1,3}","ig"); + var reg10 = new EReg("(\\.[xyzw]{1,1})",""); + var reg11 = new EReg("\\+\\d{1,3}","ig"); + var i = 0; + while(i < lng && this.error == "") { + var line = StringTools.trim(lines[i]); + var startcomment = line.indexOf("//"); + if(startcomment != -1) { + line = HxOverrides.substr(line,0,startcomment); + } + var optsi = reg1.match(line) ? reg1.matchedPos().pos : -1; + var opts = null; + if(optsi != -1) { + opts = this.match(HxOverrides.substr(line,optsi,null),reg2); + line = HxOverrides.substr(line,0,optsi); + } + var opCode = null; + var opFound = null; + if(reg3.match(line)) { + opCode = reg3.matched(0); + opFound = openfl_utils_AGALMiniAssembler.OPMAP.h[opCode]; + } + if(opFound == null) { + if(line.length >= 3) { + lime_utils_Log.warn("warning: bad line " + i + ": " + lines[i],{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 262, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + ++i; + continue; + } + if(this.debugEnabled) { + lime_utils_Log.info(opFound,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 272, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + if(opFound == null) { + if(line.length >= 3) { + lime_utils_Log.warn("warning: bad line " + i + ": " + lines[i],{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 279, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + ++i; + continue; + } + line = HxOverrides.substr(line,line.indexOf(opFound.name) + opFound.name.length,null); + if((opFound.flags & 256) != 0 && version < 2) { + this.error = "error: opcode requires version 2."; + break; + } + if((opFound.flags & 64) != 0 && isFrag) { + this.error = "error: opcode is only allowed in vertex programs."; + break; + } + if((opFound.flags & 32) != 0 && !isFrag) { + this.error = "error: opcode is only allowed in fragment programs."; + break; + } + if(this.verbose) { + lime_utils_Log.info("emit opcode=" + Std.string(opFound),{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 308, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + this.agalcode.writeUnsignedInt(opFound.emitCode); + ++nops; + if(nops > 4096) { + this.error = "error: too many opcodes. maximum is " + 4096 + "."; + break; + } + var regs = this.match(line,reg4); + if(regs.length != opFound.numRegister) { + this.error = "error: wrong number of operands. found " + regs.length + " but expected " + opFound.numRegister + "."; + break; + } + var badreg = false; + var pad = 160; + var regLength = regs.length; + var _g = 0; + var _g1 = regLength; + while(_g < _g1) { + var j = _g++; + var isRelative = false; + var relreg = this.match(regs[j],reg5); + if(relreg.length > 0) { + regs[j] = StringTools.replace(regs[j],relreg[0],"0"); + if(this.verbose) { + lime_utils_Log.info("IS REL",{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 344, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + isRelative = true; + } + var res = this.match(regs[j],reg6); + if(res.length == 0) { + this.error = "error: could not parse operand " + j + " (" + regs[j] + ")."; + badreg = true; + break; + } + var regFound = openfl_utils_AGALMiniAssembler.REGMAP.h[res[0]]; + if(this.debugEnabled) { + lime_utils_Log.info(regFound,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 363, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + if(regFound == null) { + this.error = "error: could not find register name for operand " + j + " (" + regs[j] + ")."; + badreg = true; + break; + } + if(isFrag) { + if((regFound.flags & 32) == 0) { + this.error = "error: register operand " + j + " (" + regs[j] + ") only allowed in vertex programs."; + badreg = true; + break; + } + if(isRelative) { + this.error = "error: register operand " + j + " (" + regs[j] + ") relative adressing not allowed in fragment programs."; + badreg = true; + break; + } + } else if((regFound.flags & 64) == 0) { + this.error = "error: register operand " + j + " (" + regs[j] + ") only allowed in fragment programs."; + badreg = true; + break; + } + regs[j] = HxOverrides.substr(regs[j],regs[j].indexOf(regFound.name) + regFound.name.length,null); + var idxmatch = isRelative ? this.match(relreg[0],reg7) : this.match(regs[j],reg7); + var regidx = 0; + if(idxmatch.length > 0) { + regidx = Std.parseInt(idxmatch[0]); + } + if(UInt.gt(regidx,regFound.range)) { + var tmp = regFound.range + 1; + this.error = "error: register operand " + j + " (" + regs[j] + ") index exceeds limit of " + (tmp == null ? "null" : Std.string(UInt.toFloat(tmp))) + "."; + badreg = true; + break; + } + var regmask = 0; + var maskmatch = this.match(regs[j],reg8); + var isDest = j == 0 && (opFound.flags & 128) == 0; + var isSampler = j == 2 && (opFound.flags & 8) != 0; + var reltype = 0; + var relsel = 0; + var reloffset = 0; + if(isDest && isRelative) { + this.error = "error: relative can not be destination"; + badreg = true; + break; + } + if(maskmatch.length > 0) { + regmask = 0; + var cv = 0; + var maskLength = maskmatch[0].length; + var k = 1; + while(k < maskLength) { + cv = HxOverrides.cca(maskmatch[0],k) - 120; + if(UInt.gt(cv,2)) { + cv = 3; + } + if(isDest) { + regmask |= 1 << cv; + } else { + regmask = regmask | cv << (k - 1 << 1); + } + ++k; + } + if(!isDest) { + while(k <= 4) { + regmask = regmask | cv << (k - 1 << 1); + ++k; + } + } + } else { + regmask = isDest ? 15 : 228; + } + if(isRelative) { + var relname = this.match(relreg[0],reg9); + var regFoundRel = openfl_utils_AGALMiniAssembler.REGMAP.h[relname[0]]; + if(regFoundRel == null) { + this.error = "error: bad index register"; + badreg = true; + break; + } + reltype = regFoundRel.emitCode; + var selmatch = this.match(relreg[0],reg10); + if(selmatch.length == 0) { + this.error = "error: bad index register select"; + badreg = true; + break; + } + relsel = HxOverrides.cca(selmatch[0],1) - 120; + if(UInt.gt(relsel,2)) { + relsel = 3; + } + var relofs = this.match(relreg[0],reg11); + if(relofs.length > 0) { + reloffset = Std.parseInt(relofs[0]); + } + if(reloffset < 0 || reloffset > 255) { + this.error = "error: index offset " + reloffset + " out of bounds. [0..255]"; + badreg = true; + break; + } + if(this.verbose) { + lime_utils_Log.info("RELATIVE: type=" + reltype + "==" + relname[0] + " sel=" + (relsel == null ? "null" : Std.string(UInt.toFloat(relsel))) + "==" + selmatch[0] + " idx=" + (regidx == null ? "null" : Std.string(UInt.toFloat(regidx))) + " offset=" + reloffset,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 518, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + } + if(this.verbose) { + lime_utils_Log.info(" emit argcode=" + Std.string(regFound) + "[" + (regidx == null ? "null" : Std.string(UInt.toFloat(regidx))) + "][" + regmask + "]",{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 525, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + if(isDest) { + this.agalcode.writeShort(regidx); + this.agalcode.writeByte(regmask); + this.agalcode.writeByte(regFound.emitCode); + pad -= 32; + } else if(isSampler) { + if(this.verbose) { + lime_utils_Log.info(" emit sampler",{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 541, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + var samplerbits = 5; + var optsLength = opts == null ? 0 : opts.length; + var bias = 0.0; + var _g2 = 0; + var _g3 = optsLength; + while(_g2 < _g3) { + var k1 = _g2++; + if(this.verbose) { + lime_utils_Log.info(" opt: " + opts[k1],{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 552, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + var optfound = openfl_utils_AGALMiniAssembler.SAMPLEMAP.h[opts[k1]]; + if(optfound == null) { + bias = parseFloat(opts[k1]); + if(this.verbose) { + lime_utils_Log.info(" bias: " + bias,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 565, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + } else { + if(optfound.flag != 16) { + samplerbits &= ~(15 << optfound.flag); + } + samplerbits = samplerbits | optfound.mask << optfound.flag; + } + } + this.agalcode.writeShort(regidx); + this.agalcode.writeByte(bias * 8.0 | 0); + this.agalcode.writeByte(0); + this.agalcode.writeUnsignedInt(samplerbits); + if(this.verbose) { + lime_utils_Log.info(" bits: " + (samplerbits - 5),{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 586, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + pad -= 64; + } else { + if(j == 0) { + this.agalcode.writeUnsignedInt(0); + pad -= 32; + } + this.agalcode.writeShort(regidx); + this.agalcode.writeByte(reloffset); + this.agalcode.writeByte(regmask); + this.agalcode.writeByte(regFound.emitCode); + this.agalcode.writeByte(reltype); + this.agalcode.writeShort(isRelative ? relsel | 32768 : 0); + pad -= 64; + } + } + var j1 = 0; + while(j1 < pad) { + this.agalcode.writeByte(0); + j1 += 8; + } + if(badreg) { + break; + } + ++i; + } + if(this.error != "") { + this.error += "\n at line " + i + " " + lines[i]; + openfl_utils_ByteArray.set_length(this.agalcode,0); + lime_utils_Log.info(this.error,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 631, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + if(this.debugEnabled) { + var dbgLine = "generated bytecode:"; + var agalLength = openfl_utils_ByteArray.get_length(this.agalcode); + var _g = 0; + var _g1 = agalLength; + while(_g < _g1) { + var index = _g++; + if(index % 16 == 0) { + dbgLine += "\n"; + } + if(index % 4 == 0) { + dbgLine += " "; + } + var byteStr = StringTools.hex(this.agalcode.b[index],2); + if(byteStr.length < 2) { + byteStr = "0" + byteStr; + } + dbgLine += byteStr; + } + lime_utils_Log.info(dbgLine,{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 662, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + if(this.verbose) { + lime_utils_Log.info("AGALMiniAssembler.assemble time: " + (openfl_Lib.getTimer() - start) / 1000 + "s",{ fileName : "openfl/utils/AGALMiniAssembler.hx", lineNumber : 667, className : "openfl.utils.AGALMiniAssembler", methodName : "assemble"}); + } + return this.agalcode; + } + ,initregmap: function(version,ignorelimits) { + var this1 = openfl_utils_AGALMiniAssembler.REGMAP; + var v = new openfl_utils__$AGALMiniAssembler_Register("va","vertex attribute",0,ignorelimits ? 1024 : version == 1 || version == 2 ? 7 : 15,66); + this1.h["va"] = v; + var this1 = openfl_utils_AGALMiniAssembler.REGMAP; + var v = new openfl_utils__$AGALMiniAssembler_Register("vc","vertex constant",1,ignorelimits ? 1024 : version == 1 ? 127 : 249,66); + this1.h["vc"] = v; + var this1 = openfl_utils_AGALMiniAssembler.REGMAP; + var v = new openfl_utils__$AGALMiniAssembler_Register("vt","vertex temporary",2,ignorelimits ? 1024 : version == 1 ? 7 : 25,67); + this1.h["vt"] = v; + var this1 = openfl_utils_AGALMiniAssembler.REGMAP; + var v = new openfl_utils__$AGALMiniAssembler_Register("vo","vertex output",3,ignorelimits ? 1024 : 0,65); + this1.h["vo"] = v; + var this1 = openfl_utils_AGALMiniAssembler.REGMAP; + var v = new openfl_utils__$AGALMiniAssembler_Register("vi","varying",4,ignorelimits ? 1024 : version == 1 ? 7 : 9,99); + this1.h["vi"] = v; + var this1 = openfl_utils_AGALMiniAssembler.REGMAP; + var v = new openfl_utils__$AGALMiniAssembler_Register("fc","fragment constant",1,ignorelimits ? 1024 : version == 1 ? 27 : version == 2 ? 63 : 199,34); + this1.h["fc"] = v; + var this1 = openfl_utils_AGALMiniAssembler.REGMAP; + var v = new openfl_utils__$AGALMiniAssembler_Register("ft","fragment temporary",2,ignorelimits ? 1024 : version == 1 ? 7 : 25,35); + this1.h["ft"] = v; + var this1 = openfl_utils_AGALMiniAssembler.REGMAP; + var v = new openfl_utils__$AGALMiniAssembler_Register("fs","texture sampler",5,ignorelimits ? 1024 : 7,34); + this1.h["fs"] = v; + var this1 = openfl_utils_AGALMiniAssembler.REGMAP; + var v = new openfl_utils__$AGALMiniAssembler_Register("fo","fragment output",3,ignorelimits ? 1024 : version == 1 ? 0 : 3,33); + this1.h["fo"] = v; + var this1 = openfl_utils_AGALMiniAssembler.REGMAP; + var v = new openfl_utils__$AGALMiniAssembler_Register("fd","fragment depth output",6,ignorelimits ? 1024 : version == 1 ? -1 : 0,33); + this1.h["fd"] = v; + var this1 = openfl_utils_AGALMiniAssembler.REGMAP; + var v = new openfl_utils__$AGALMiniAssembler_Register("iid","instance id",7,ignorelimits ? 1024 : 0,66); + this1.h["iid"] = v; + var v = openfl_utils_AGALMiniAssembler.REGMAP.h["vo"]; + openfl_utils_AGALMiniAssembler.REGMAP.h["op"] = v; + var v = openfl_utils_AGALMiniAssembler.REGMAP.h["vi"]; + openfl_utils_AGALMiniAssembler.REGMAP.h["i"] = v; + var v = openfl_utils_AGALMiniAssembler.REGMAP.h["vi"]; + openfl_utils_AGALMiniAssembler.REGMAP.h["v"] = v; + var v = openfl_utils_AGALMiniAssembler.REGMAP.h["fo"]; + openfl_utils_AGALMiniAssembler.REGMAP.h["oc"] = v; + var v = openfl_utils_AGALMiniAssembler.REGMAP.h["fd"]; + openfl_utils_AGALMiniAssembler.REGMAP.h["od"] = v; + var v = openfl_utils_AGALMiniAssembler.REGMAP.h["vi"]; + openfl_utils_AGALMiniAssembler.REGMAP.h["fi"] = v; + } + ,match: function(value,reg) { + var matches = []; + var index = 0; + var match; + while(reg.matchSub(value,index)) { + match = reg.matched(0); + matches.push(match); + index = reg.matchedPos().pos + match.length; + } + return matches; + } + ,__class__: openfl_utils_AGALMiniAssembler +}; +var openfl_utils__$AGALMiniAssembler_OpCode = function(name,numRegister,emitCode,flags) { + this.name = name; + this.numRegister = numRegister; + this.emitCode = emitCode; + this.flags = flags; +}; +$hxClasses["openfl.utils._AGALMiniAssembler.OpCode"] = openfl_utils__$AGALMiniAssembler_OpCode; +openfl_utils__$AGALMiniAssembler_OpCode.__name__ = "openfl.utils._AGALMiniAssembler.OpCode"; +openfl_utils__$AGALMiniAssembler_OpCode.prototype = { + toString: function() { + return "[OpCode name=\"" + this.name + "\", numRegister=" + this.numRegister + ", emitCode=" + this.emitCode + ", flags=" + this.flags + "]"; + } + ,__class__: openfl_utils__$AGALMiniAssembler_OpCode +}; +var openfl_utils__$AGALMiniAssembler_Register = function(name,longName,emitCode,range,flags) { + this.name = name; + this.longName = longName; + this.emitCode = emitCode; + this.range = range; + this.flags = flags; +}; +$hxClasses["openfl.utils._AGALMiniAssembler.Register"] = openfl_utils__$AGALMiniAssembler_Register; +openfl_utils__$AGALMiniAssembler_Register.__name__ = "openfl.utils._AGALMiniAssembler.Register"; +openfl_utils__$AGALMiniAssembler_Register.prototype = { + toString: function() { + return "[Register name=\"" + this.name + "\", longName=\"" + this.longName + "\", emitCode=" + (this.emitCode == null ? "null" : Std.string(UInt.toFloat(this.emitCode))) + ", range=" + (this.range == null ? "null" : Std.string(UInt.toFloat(this.range))) + ", flags=" + (this.flags == null ? "null" : Std.string(UInt.toFloat(this.flags))) + "]"; + } + ,__class__: openfl_utils__$AGALMiniAssembler_Register +}; +var openfl_utils__$AGALMiniAssembler_Sampler = function(name,flag,mask) { + this.name = name; + this.flag = flag; + this.mask = mask; +}; +$hxClasses["openfl.utils._AGALMiniAssembler.Sampler"] = openfl_utils__$AGALMiniAssembler_Sampler; +openfl_utils__$AGALMiniAssembler_Sampler.__name__ = "openfl.utils._AGALMiniAssembler.Sampler"; +openfl_utils__$AGALMiniAssembler_Sampler.prototype = { + toString: function() { + return "[Sampler name=\"" + this.name + "\", flag=\"" + (this.flag == null ? "null" : Std.string(UInt.toFloat(this.flag))) + "\", mask=" + (this.mask == null ? "null" : Std.string(UInt.toFloat(this.mask))) + "]"; + } + ,__class__: openfl_utils__$AGALMiniAssembler_Sampler +}; +var openfl_utils_IAssetCache = function() { }; +$hxClasses["openfl.utils.IAssetCache"] = openfl_utils_IAssetCache; +openfl_utils_IAssetCache.__name__ = "openfl.utils.IAssetCache"; +openfl_utils_IAssetCache.__isInterface__ = true; +openfl_utils_IAssetCache.prototype = { + __class__: openfl_utils_IAssetCache + ,__properties__: {set_enabled:"set_enabled",get_enabled:"get_enabled"} +}; +var openfl_utils_AssetCache = function() { + this.__enabled = true; + this.bitmapData = new haxe_ds_StringMap(); + this.font = new haxe_ds_StringMap(); + this.sound = new haxe_ds_StringMap(); +}; +$hxClasses["openfl.utils.AssetCache"] = openfl_utils_AssetCache; +openfl_utils_AssetCache.__name__ = "openfl.utils.AssetCache"; +openfl_utils_AssetCache.__interfaces__ = [openfl_utils_IAssetCache]; +openfl_utils_AssetCache.prototype = { + clear: function(prefix) { + if(prefix == null) { + this.bitmapData = new haxe_ds_StringMap(); + this.font = new haxe_ds_StringMap(); + this.sound = new haxe_ds_StringMap(); + } else { + var h = this.bitmapData.h; + var key_h = h; + var key_keys = Object.keys(h); + var key_length = key_keys.length; + var key_current = 0; + while(key_current < key_length) { + var key = key_keys[key_current++]; + if(StringTools.startsWith(key,prefix)) { + this.removeBitmapData(key); + } + } + var h = this.font.h; + var key_h = h; + var key_keys = Object.keys(h); + var key_length = key_keys.length; + var key_current = 0; + while(key_current < key_length) { + var key = key_keys[key_current++]; + if(StringTools.startsWith(key,prefix)) { + this.removeFont(key); + } + } + var h = this.sound.h; + var key_h = h; + var key_keys = Object.keys(h); + var key_length = key_keys.length; + var key_current = 0; + while(key_current < key_length) { + var key = key_keys[key_current++]; + if(StringTools.startsWith(key,prefix)) { + this.removeSound(key); + } + } + } + } + ,getBitmapData: function(id) { + return this.bitmapData.h[id]; + } + ,getFont: function(id) { + return this.font.h[id]; + } + ,getSound: function(id) { + return this.sound.h[id]; + } + ,hasBitmapData: function(id) { + return Object.prototype.hasOwnProperty.call(this.bitmapData.h,id); + } + ,hasFont: function(id) { + return Object.prototype.hasOwnProperty.call(this.font.h,id); + } + ,hasSound: function(id) { + return Object.prototype.hasOwnProperty.call(this.sound.h,id); + } + ,removeBitmapData: function(id) { + var _this = lime_utils_Assets.cache.image; + if(Object.prototype.hasOwnProperty.call(_this.h,id)) { + delete(_this.h[id]); + } + var _this = this.bitmapData; + if(Object.prototype.hasOwnProperty.call(_this.h,id)) { + delete(_this.h[id]); + return true; + } else { + return false; + } + } + ,removeFont: function(id) { + var _this = lime_utils_Assets.cache.font; + if(Object.prototype.hasOwnProperty.call(_this.h,id)) { + delete(_this.h[id]); + } + var _this = this.font; + if(Object.prototype.hasOwnProperty.call(_this.h,id)) { + delete(_this.h[id]); + return true; + } else { + return false; + } + } + ,removeSound: function(id) { + var _this = lime_utils_Assets.cache.audio; + if(Object.prototype.hasOwnProperty.call(_this.h,id)) { + delete(_this.h[id]); + } + var _this = this.sound; + if(Object.prototype.hasOwnProperty.call(_this.h,id)) { + delete(_this.h[id]); + return true; + } else { + return false; + } + } + ,setBitmapData: function(id,bitmapData) { + this.bitmapData.h[id] = bitmapData; + } + ,setFont: function(id,font) { + this.font.h[id] = font; + } + ,setSound: function(id,sound) { + this.sound.h[id] = sound; + } + ,get_enabled: function() { + return this.__enabled; + } + ,set_enabled: function(value) { + return this.__enabled = value; + } + ,__class__: openfl_utils_AssetCache + ,__properties__: {set_enabled:"set_enabled",get_enabled:"get_enabled"} +}; +var openfl_utils_AssetLibrary = function() { + lime_utils_AssetLibrary.call(this); +}; +$hxClasses["openfl.utils.AssetLibrary"] = openfl_utils_AssetLibrary; +openfl_utils_AssetLibrary.__name__ = "openfl.utils.AssetLibrary"; +openfl_utils_AssetLibrary.fromBundle = function(bundle) { + var library = lime_utils_AssetLibrary.fromBundle(bundle); + if(library != null) { + if(((library) instanceof openfl_utils_AssetLibrary)) { + return library; + } else { + var _library = new openfl_utils_AssetLibrary(); + _library.__proxy = library; + return _library; + } + } else { + return null; + } +}; +openfl_utils_AssetLibrary.fromBytes = function(bytes,rootPath) { + return openfl_utils_AssetLibrary.fromManifest(lime_utils_AssetManifest.fromBytes(openfl_utils_ByteArray.toLimeBytes(bytes),rootPath)); +}; +openfl_utils_AssetLibrary.fromFile = function(path,rootPath) { + return openfl_utils_AssetLibrary.fromManifest(lime_utils_AssetManifest.fromFile(path,rootPath)); +}; +openfl_utils_AssetLibrary.fromManifest = function(manifest) { + var library = lime_utils_AssetLibrary.fromManifest(manifest); + if(library != null) { + if(((library) instanceof openfl_utils_AssetLibrary)) { + return library; + } else { + var _library = new openfl_utils_AssetLibrary(); + _library.__proxy = library; + return _library; + } + } else { + return null; + } +}; +openfl_utils_AssetLibrary.loadFromBytes = function(bytes,rootPath) { + return lime_utils_AssetManifest.loadFromBytes(openfl_utils_ByteArray.toLimeBytes(bytes),rootPath).then(function(manifest) { + return openfl_utils_AssetLibrary.loadFromManifest(manifest); + }); +}; +openfl_utils_AssetLibrary.loadFromFile = function(path,rootPath) { + return lime_utils_AssetManifest.loadFromFile(path,rootPath).then(function(manifest) { + return openfl_utils_AssetLibrary.loadFromManifest(manifest); + }); +}; +openfl_utils_AssetLibrary.loadFromManifest = function(manifest) { + var library = openfl_utils_AssetLibrary.fromManifest(manifest); + if(library != null) { + return library.load().then(function(library) { + return lime_app_Future.withValue(library); + }); + } else { + return lime_app_Future.withError("Could not load asset manifest"); + } +}; +openfl_utils_AssetLibrary.__super__ = lime_utils_AssetLibrary; +openfl_utils_AssetLibrary.prototype = $extend(lime_utils_AssetLibrary.prototype,{ + bind: function(className,instance) { + return false; + } + ,exists: function(id,type) { + if(this.__proxy != null) { + return this.__proxy.exists(id,type); + } else { + return lime_utils_AssetLibrary.prototype.exists.call(this,id,type); + } + } + ,getAsset: function(id,type) { + if(this.__proxy != null) { + return this.__proxy.getAsset(id,type); + } else { + return lime_utils_AssetLibrary.prototype.getAsset.call(this,id,type); + } + } + ,getAudioBuffer: function(id) { + if(this.__proxy != null) { + return this.__proxy.getAudioBuffer(id); + } else { + return lime_utils_AssetLibrary.prototype.getAudioBuffer.call(this,id); + } + } + ,getBytes: function(id) { + if(this.__proxy != null) { + return this.__proxy.getBytes(id); + } else { + return lime_utils_AssetLibrary.prototype.getBytes.call(this,id); + } + } + ,getFont: function(id) { + if(this.__proxy != null) { + return this.__proxy.getFont(id); + } else { + return lime_utils_AssetLibrary.prototype.getFont.call(this,id); + } + } + ,getImage: function(id) { + if(this.__proxy != null) { + return this.__proxy.getImage(id); + } else { + return lime_utils_AssetLibrary.prototype.getImage.call(this,id); + } + } + ,getMovieClip: function(id) { + return null; + } + ,getPath: function(id) { + if(this.__proxy != null) { + return this.__proxy.getPath(id); + } else { + return lime_utils_AssetLibrary.prototype.getPath.call(this,id); + } + } + ,getText: function(id) { + if(this.__proxy != null) { + return this.__proxy.getText(id); + } else { + return lime_utils_AssetLibrary.prototype.getText.call(this,id); + } + } + ,isLocal: function(id,type) { + if(this.__proxy != null) { + return this.__proxy.isLocal(id,type); + } else { + return lime_utils_AssetLibrary.prototype.isLocal.call(this,id,type); + } + } + ,list: function(type) { + if(this.__proxy != null) { + return this.__proxy.list(type); + } else { + return lime_utils_AssetLibrary.prototype.list.call(this,type); + } + } + ,loadAsset: function(id,type) { + if(this.__proxy != null) { + return this.__proxy.loadAsset(id,type); + } else { + return lime_utils_AssetLibrary.prototype.loadAsset.call(this,id,type); + } + } + ,load: function() { + if(this.__proxy != null) { + return this.__proxy.load(); + } else { + return lime_utils_AssetLibrary.prototype.load.call(this); + } + } + ,loadAudioBuffer: function(id) { + if(this.__proxy != null) { + return this.__proxy.loadAudioBuffer(id); + } else { + return lime_utils_AssetLibrary.prototype.loadAudioBuffer.call(this,id); + } + } + ,loadBytes: function(id) { + if(this.__proxy != null) { + return this.__proxy.loadBytes(id); + } else { + return lime_utils_AssetLibrary.prototype.loadBytes.call(this,id); + } + } + ,loadFont: function(id) { + if(this.__proxy != null) { + return this.__proxy.loadFont(id); + } else { + return lime_utils_AssetLibrary.prototype.loadFont.call(this,id); + } + } + ,loadImage: function(id) { + if(this.__proxy != null) { + return this.__proxy.loadImage(id); + } else { + return lime_utils_AssetLibrary.prototype.loadImage.call(this,id); + } + } + ,loadMovieClip: function(id) { + return lime_app_Future.withValue(this.getMovieClip(id)); + } + ,loadText: function(id) { + if(this.__proxy != null) { + return this.__proxy.loadText(id); + } else { + return lime_utils_AssetLibrary.prototype.loadText.call(this,id); + } + } + ,unload: function() { + if(this.__proxy != null) { + this.__proxy.unload(); + return; + } else { + lime_utils_AssetLibrary.prototype.unload.call(this); + return; + } + } + ,__class__: openfl_utils_AssetLibrary +}); +var openfl_utils_Assets = function() { }; +$hxClasses["openfl.utils.Assets"] = openfl_utils_Assets; +openfl_utils_Assets.__name__ = "openfl.utils.Assets"; +openfl_utils_Assets.addEventListener = function(type,listener,useCapture,priority,useWeakReference) { + if(useWeakReference == null) { + useWeakReference = false; + } + if(priority == null) { + priority = 0; + } + if(useCapture == null) { + useCapture = false; + } + if(!lime_utils_Assets.onChange.has(openfl_utils_Assets.LimeAssets_onChange)) { + lime_utils_Assets.onChange.add(openfl_utils_Assets.LimeAssets_onChange); + } + openfl_utils_Assets.dispatcher.addEventListener(type,listener,useCapture,priority,useWeakReference); +}; +openfl_utils_Assets.dispatchEvent = function(event) { + return openfl_utils_Assets.dispatcher.dispatchEvent(event); +}; +openfl_utils_Assets.exists = function(id,type) { + return lime_utils_Assets.exists(id,type); +}; +openfl_utils_Assets.getBitmapData = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasBitmapData(id)) { + var bitmapData = openfl_utils_Assets.cache.getBitmapData(id); + if(openfl_utils_Assets.isValidBitmapData(bitmapData)) { + return bitmapData; + } + } + var image = lime_utils_Assets.getImage(id,false); + if(image != null) { + var bitmapData = openfl_display_BitmapData.fromImage(image); + bitmapData.__asset = true; + if(useCache && openfl_utils_Assets.cache.get_enabled()) { + openfl_utils_Assets.cache.setBitmapData(id,bitmapData); + } + return bitmapData; + } + return null; +}; +openfl_utils_Assets.getBytes = function(id) { + return openfl_utils_ByteArray.fromLimeBytes(lime_utils_Assets.getBytes(id)); +}; +openfl_utils_Assets.getFont = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasFont(id)) { + return openfl_utils_Assets.cache.getFont(id); + } + var limeFont = lime_utils_Assets.getFont(id,false); + if(limeFont != null) { + var font = new openfl_text_Font(); + font.__fromLimeFont(limeFont); + if(useCache && openfl_utils_Assets.cache.get_enabled()) { + openfl_utils_Assets.cache.setFont(id,font); + } + return font; + } + return new openfl_text_Font(); +}; +openfl_utils_Assets.getLibrary = function(name) { + return lime_utils_Assets.getLibrary(name); +}; +openfl_utils_Assets.getMovieClip = function(id) { + var libraryName = id.substring(0,id.indexOf(":")); + var symbolName = HxOverrides.substr(id,id.indexOf(":") + 1,null); + var limeLibrary = openfl_utils_Assets.getLibrary(libraryName); + if(limeLibrary != null) { + if(((limeLibrary) instanceof openfl_utils_AssetLibrary)) { + var library = limeLibrary; + if(library.exists(symbolName,"MOVIE_CLIP")) { + if(library.isLocal(symbolName,"MOVIE_CLIP")) { + return library.getMovieClip(symbolName); + } else { + lime_utils_Log.error("MovieClip asset \"" + id + "\" exists, but only asynchronously",{ fileName : "openfl/utils/Assets.hx", lineNumber : 261, className : "openfl.utils.Assets", methodName : "getMovieClip"}); + return null; + } + } + } + lime_utils_Log.error("There is no MovieClip asset with an ID of \"" + id + "\"",{ fileName : "openfl/utils/Assets.hx", lineNumber : 267, className : "openfl.utils.Assets", methodName : "getMovieClip"}); + } else { + lime_utils_Log.error("There is no asset library named \"" + libraryName + "\"",{ fileName : "openfl/utils/Assets.hx", lineNumber : 271, className : "openfl.utils.Assets", methodName : "getMovieClip"}); + } + return null; +}; +openfl_utils_Assets.getMusic = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + return openfl_utils_Assets.getSound(id,useCache); +}; +openfl_utils_Assets.getPath = function(id) { + return lime_utils_Assets.getPath(id); +}; +openfl_utils_Assets.getSound = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasSound(id)) { + var sound = openfl_utils_Assets.cache.getSound(id); + if(openfl_utils_Assets.isValidSound(sound)) { + return sound; + } + } + var buffer = lime_utils_Assets.getAudioBuffer(id,false); + if(buffer != null) { + var sound = openfl_media_Sound.fromAudioBuffer(buffer); + if(useCache && openfl_utils_Assets.cache.get_enabled()) { + openfl_utils_Assets.cache.setSound(id,sound); + } + return sound; + } + return null; +}; +openfl_utils_Assets.getText = function(id) { + return lime_utils_Assets.getText(id); +}; +openfl_utils_Assets.hasEventListener = function(type) { + return openfl_utils_Assets.dispatcher.hasEventListener(type); +}; +openfl_utils_Assets.hasLibrary = function(name) { + return lime_utils_Assets.hasLibrary(name); +}; +openfl_utils_Assets.initBinding = function(className,instance) { + if(Object.prototype.hasOwnProperty.call(openfl_utils_Assets.libraryBindings.h,className)) { + var library = openfl_utils_Assets.libraryBindings.h[className]; + if(instance == null) { + openfl_display_Sprite.__constructor = function(instance) { + instance.__bind(library,className); + }; + } else { + openfl_display_Sprite.__constructor = null; + instance.__bind(library,className); + } + } else { + lime_utils_Log.warn("No asset is registered as \"" + className + "\"",{ fileName : "openfl/utils/Assets.hx", lineNumber : 427, className : "openfl.utils.Assets", methodName : "initBinding"}); + } +}; +openfl_utils_Assets.isLocal = function(id,type,useCache) { + if(useCache == null) { + useCache = true; + } + if(useCache && openfl_utils_Assets.cache.get_enabled()) { + if(type == "IMAGE" || type == null) { + if(openfl_utils_Assets.cache.hasBitmapData(id)) { + return true; + } + } + if(type == "FONT" || type == null) { + if(openfl_utils_Assets.cache.hasFont(id)) { + return true; + } + } + if(type == "SOUND" || type == "MUSIC" || type == null) { + if(openfl_utils_Assets.cache.hasSound(id)) { + return true; + } + } + } + var libraryName = id.substring(0,id.indexOf(":")); + var symbolName = HxOverrides.substr(id,id.indexOf(":") + 1,null); + var library = openfl_utils_Assets.getLibrary(libraryName); + if(library != null) { + return library.isLocal(symbolName,type); + } + return false; +}; +openfl_utils_Assets.isValidBitmapData = function(bitmapData) { + return bitmapData != null && bitmapData.image != null; +}; +openfl_utils_Assets.isValidSound = function(sound) { + return true; +}; +openfl_utils_Assets.list = function(type) { + return lime_utils_Assets.list(type); +}; +openfl_utils_Assets.loadBitmapData = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + if(useCache == null) { + useCache = true; + } + var promise = new lime_app_Promise(); + if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasBitmapData(id)) { + var bitmapData = openfl_utils_Assets.cache.getBitmapData(id); + if(openfl_utils_Assets.isValidBitmapData(bitmapData)) { + promise.complete(bitmapData); + return promise.future; + } + } + lime_utils_Assets.loadImage(id,false).onComplete(function(image) { + if(image != null) { + var bitmapData = openfl_display_BitmapData.fromImage(image); + bitmapData.__asset = true; + if(useCache && openfl_utils_Assets.cache.get_enabled()) { + openfl_utils_Assets.cache.setBitmapData(id,bitmapData); + } + promise.complete(bitmapData); + } else { + promise.error("[Assets] Could not load Image \"" + id + "\""); + } + }).onError($bind(promise,promise.error)).onProgress($bind(promise,promise.progress)); + return promise.future; +}; +openfl_utils_Assets.loadBytes = function(id) { + var promise = new lime_app_Promise(); + var future = lime_utils_Assets.loadBytes(id); + future.onComplete(function(bytes) { + promise.complete(openfl_utils_ByteArray.fromLimeBytes(bytes)); + }); + future.onProgress(function(progress,total) { + promise.progress(progress,total); + }); + future.onError(function(msg) { + promise.error(msg); + }); + return promise.future; +}; +openfl_utils_Assets.loadFont = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + if(useCache == null) { + useCache = true; + } + var promise = new lime_app_Promise(); + if(useCache && openfl_utils_Assets.cache.get_enabled() && openfl_utils_Assets.cache.hasFont(id)) { + promise.complete(openfl_utils_Assets.cache.getFont(id)); + return promise.future; + } + lime_utils_Assets.loadFont(id).onComplete(function(limeFont) { + var font = new openfl_text_Font(); + font.__fromLimeFont(limeFont); + if(useCache && openfl_utils_Assets.cache.get_enabled()) { + openfl_utils_Assets.cache.setFont(id,font); + } + promise.complete(font); + }).onError($bind(promise,promise.error)).onProgress($bind(promise,promise.progress)); + return promise.future; +}; +openfl_utils_Assets.loadLibrary = function(name) { + return lime_utils_Assets.loadLibrary(name).then(function(library) { + var _library = null; + if(library != null) { + if(((library) instanceof openfl_utils_AssetLibrary)) { + _library = library; + } else { + var _this = lime_utils_Assets.libraries; + if(Object.prototype.hasOwnProperty.call(_this.h,name)) { + delete(_this.h[name]); + } + _library = new openfl_utils_AssetLibrary(); + _library.__proxy = library; + lime_utils_Assets.registerLibrary(name,_library); + } + } + return lime_app_Future.withValue(_library); + }); +}; +openfl_utils_Assets.loadMusic = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + if(useCache == null) { + useCache = true; + } + var future = new lime_app_Future(function() { + return openfl_utils_Assets.getMusic(id,useCache); + }); + return future; +}; +openfl_utils_Assets.loadMovieClip = function(id) { + var promise = new lime_app_Promise(); + var libraryName = id.substring(0,id.indexOf(":")); + var symbolName = HxOverrides.substr(id,id.indexOf(":") + 1,null); + var limeLibrary = openfl_utils_Assets.getLibrary(libraryName); + if(limeLibrary != null) { + if(((limeLibrary) instanceof openfl_utils_AssetLibrary)) { + var library = limeLibrary; + if(library.exists(symbolName,"MOVIE_CLIP")) { + promise.completeWith(library.loadMovieClip(symbolName)); + return promise.future; + } + } + promise.error("[Assets] There is no MovieClip asset with an ID of \"" + id + "\""); + } else { + promise.error("[Assets] There is no asset library named \"" + libraryName + "\""); + } + return promise.future; +}; +openfl_utils_Assets.loadSound = function(id,useCache) { + if(useCache == null) { + useCache = true; + } + if(useCache == null) { + useCache = true; + } + var promise = new lime_app_Promise(); + lime_utils_Assets.loadAudioBuffer(id,useCache).onComplete(function(buffer) { + if(buffer != null) { + var sound = openfl_media_Sound.fromAudioBuffer(buffer); + if(useCache && openfl_utils_Assets.cache.get_enabled()) { + openfl_utils_Assets.cache.setSound(id,sound); + } + promise.complete(sound); + } else { + promise.error("[Assets] Could not load Sound \"" + id + "\""); + } + }).onError($bind(promise,promise.error)).onProgress($bind(promise,promise.progress)); + return promise.future; +}; +openfl_utils_Assets.loadText = function(id) { + var future = lime_utils_Assets.loadText(id); + return future; +}; +openfl_utils_Assets.registerBinding = function(className,library) { + openfl_utils_Assets.libraryBindings.h[className] = library; +}; +openfl_utils_Assets.registerLibrary = function(name,library) { + lime_utils_Assets.registerLibrary(name,library); +}; +openfl_utils_Assets.removeEventListener = function(type,listener,capture) { + if(capture == null) { + capture = false; + } + openfl_utils_Assets.dispatcher.removeEventListener(type,listener,capture); +}; +openfl_utils_Assets.resolveClass = function(name) { + return $hxClasses[name]; +}; +openfl_utils_Assets.resolveEnum = function(name) { + var value = $hxEnums[name]; + return value; +}; +openfl_utils_Assets.unloadLibrary = function(name) { + lime_utils_Assets.unloadLibrary(name); +}; +openfl_utils_Assets.unregisterBinding = function(className,library) { + if(Object.prototype.hasOwnProperty.call(openfl_utils_Assets.libraryBindings.h,className) && openfl_utils_Assets.libraryBindings.h[className] == library) { + var _this = openfl_utils_Assets.libraryBindings; + if(Object.prototype.hasOwnProperty.call(_this.h,className)) { + delete(_this.h[className]); + } + } +}; +openfl_utils_Assets.LimeAssets_onChange = function() { + openfl_utils_Assets.dispatchEvent(new openfl_events_Event("change")); +}; +var openfl_utils_ByteArray = {}; +openfl_utils_ByteArray.__properties__ = {set_position:"set_position",get_position:"get_position",set_length:"set_length",get_length:"get_length",get_bytesAvailable:"get_bytesAvailable",set_defaultObjectEncoding:"set_defaultObjectEncoding",get_defaultObjectEncoding:"get_defaultObjectEncoding",set_defaultEndian:"set_defaultEndian",get_defaultEndian:"get_defaultEndian"}; +openfl_utils_ByteArray._new = function(length) { + if(length == null) { + length = 0; + } + return new openfl_utils_ByteArrayData(length); +}; +openfl_utils_ByteArray.clear = function(this1) { + this1.clear(); +}; +openfl_utils_ByteArray.compress = function(this1,algorithm) { + this1.compress(algorithm); +}; +openfl_utils_ByteArray.deflate = function(this1) { + this1.deflate(); +}; +openfl_utils_ByteArray.fromArrayBuffer = function(buffer) { + if(buffer == null) { + return null; + } + return openfl_utils_ByteArrayData.fromBytes(haxe_io_Bytes.ofData(buffer)); +}; +openfl_utils_ByteArray.fromBytes = function(bytes) { + if(bytes == null) { + return null; + } + if(((bytes) instanceof openfl_utils_ByteArrayData)) { + return bytes; + } else { + return openfl_utils_ByteArrayData.fromBytes(bytes); + } +}; +openfl_utils_ByteArray.fromBytesData = function(bytesData) { + if(bytesData == null) { + return null; + } + return openfl_utils_ByteArrayData.fromBytes(haxe_io_Bytes.ofData(bytesData)); +}; +openfl_utils_ByteArray.fromFile = function(path) { + return openfl_utils_ByteArray.fromLimeBytes(lime_utils_Bytes.fromFile(path)); +}; +openfl_utils_ByteArray.fromLimeBytes = function(bytes) { + return openfl_utils_ByteArray.fromBytes(bytes); +}; +openfl_utils_ByteArray.get = function(this1,index) { + return this1.b[index]; +}; +openfl_utils_ByteArray.inflate = function(this1) { + this1.inflate(); +}; +openfl_utils_ByteArray.loadFromBytes = function(bytes) { + return lime_utils_Bytes.loadFromBytes(bytes).then(function(limeBytes) { + var byteArray = openfl_utils_ByteArray.fromLimeBytes(limeBytes); + return lime_app_Future.withValue(byteArray); + }); +}; +openfl_utils_ByteArray.loadFromFile = function(path) { + return lime_utils_Bytes.loadFromFile(path).then(function(limeBytes) { + var byteArray = openfl_utils_ByteArray.fromLimeBytes(limeBytes); + return lime_app_Future.withValue(byteArray); + }); +}; +openfl_utils_ByteArray.readBoolean = function(this1) { + return this1.readBoolean(); +}; +openfl_utils_ByteArray.readByte = function(this1) { + return this1.readByte(); +}; +openfl_utils_ByteArray.readBytes = function(this1,bytes,offset,length) { + if(length == null) { + length = 0; + } + if(offset == null) { + offset = 0; + } + this1.readBytes(bytes,offset,length); +}; +openfl_utils_ByteArray.readDouble = function(this1) { + return this1.readDouble(); +}; +openfl_utils_ByteArray.readFloat = function(this1) { + return this1.readFloat(); +}; +openfl_utils_ByteArray.readInt = function(this1) { + return this1.readInt(); +}; +openfl_utils_ByteArray.readInt64 = function(this1) { + return this1.readInt64(); +}; +openfl_utils_ByteArray.readMultiByte = function(this1,length,charSet) { + return this1.readMultiByte(length,charSet); +}; +openfl_utils_ByteArray.readObject = function(this1) { + return this1.readObject(); +}; +openfl_utils_ByteArray.readShort = function(this1) { + return this1.readShort(); +}; +openfl_utils_ByteArray.readUTF = function(this1) { + return this1.readUTF(); +}; +openfl_utils_ByteArray.readUTFBytes = function(this1,length) { + return this1.readUTFBytes(length); +}; +openfl_utils_ByteArray.readUnsignedByte = function(this1) { + return this1.readUnsignedByte(); +}; +openfl_utils_ByteArray.readUnsignedInt = function(this1) { + return this1.readUnsignedInt(); +}; +openfl_utils_ByteArray.readUnsignedShort = function(this1) { + return this1.readUnsignedShort(); +}; +openfl_utils_ByteArray.set = function(this1,index,value) { + this1.__resize(index + 1); + this1.b[index] = value & 255; + return value; +}; +openfl_utils_ByteArray.toArrayBuffer = function(byteArray) { + return byteArray.b.bufferValue; +}; +openfl_utils_ByteArray.toBytePointer = function(byteArray) { + lime_utils_BytePointer.set(openfl_utils_ByteArray.__bytePointer,byteArray,null,null,byteArray.position); + return openfl_utils_ByteArray.__bytePointer; +}; +openfl_utils_ByteArray.toBytes = function(byteArray) { + return byteArray; +}; +openfl_utils_ByteArray.toBytesData = function(byteArray) { + return byteArray.b.bufferValue; +}; +openfl_utils_ByteArray.toLimeBytes = function(byteArray) { + return byteArray; +}; +openfl_utils_ByteArray.toString = function(this1) { + return this1.toString(); +}; +openfl_utils_ByteArray.uncompress = function(this1,algorithm) { + this1.uncompress(algorithm); +}; +openfl_utils_ByteArray.writeBoolean = function(this1,value) { + this1.writeBoolean(value); +}; +openfl_utils_ByteArray.writeByte = function(this1,value) { + this1.writeByte(value); +}; +openfl_utils_ByteArray.writeBytes = function(this1,bytes,offset,length) { + if(length == null) { + length = 0; + } + if(offset == null) { + offset = 0; + } + this1.writeBytes(bytes,offset,length); +}; +openfl_utils_ByteArray.writeDouble = function(this1,value) { + this1.writeDouble(value); +}; +openfl_utils_ByteArray.writeFloat = function(this1,value) { + this1.writeFloat(value); +}; +openfl_utils_ByteArray.writeInt = function(this1,value) { + this1.writeInt(value); +}; +openfl_utils_ByteArray.writeInt64 = function(this1,value) { + this1.writeInt64(value); +}; +openfl_utils_ByteArray.writeMultiByte = function(this1,value,charSet) { + this1.writeMultiByte(value,charSet); +}; +openfl_utils_ByteArray.writeObject = function(this1,object) { + this1.writeObject(object); +}; +openfl_utils_ByteArray.writeShort = function(this1,value) { + this1.writeShort(value); +}; +openfl_utils_ByteArray.writeUTF = function(this1,value) { + this1.writeUTF(value); +}; +openfl_utils_ByteArray.writeUTFBytes = function(this1,value) { + this1.writeUTFBytes(value); +}; +openfl_utils_ByteArray.writeUnsignedInt = function(this1,value) { + this1.writeUnsignedInt(value); +}; +openfl_utils_ByteArray.get_bytesAvailable = function(this1) { + return this1.length - this1.position; +}; +openfl_utils_ByteArray.get_defaultEndian = function() { + if(openfl_utils_ByteArrayData.__defaultEndian == null) { + if(lime_system_System.get_endianness() == lime_system_Endian.LITTLE_ENDIAN) { + openfl_utils_ByteArrayData.__defaultEndian = 1; + } else { + openfl_utils_ByteArrayData.__defaultEndian = 0; + } + } + return openfl_utils_ByteArrayData.__defaultEndian; +}; +openfl_utils_ByteArray.set_defaultEndian = function(value) { + return openfl_utils_ByteArrayData.__defaultEndian = value; +}; +openfl_utils_ByteArray.get_defaultObjectEncoding = function() { + return openfl_utils_ByteArrayData.defaultObjectEncoding; +}; +openfl_utils_ByteArray.set_defaultObjectEncoding = function(value) { + return openfl_utils_ByteArrayData.defaultObjectEncoding = value; +}; +openfl_utils_ByteArray.get_endian = function(this1) { + return this1.__endian; +}; +openfl_utils_ByteArray.set_endian = function(this1,value) { + return this1.__endian = value; +}; +openfl_utils_ByteArray.get_length = function(this1) { + if(this1 == null) { + return 0; + } else { + return this1.length; + } +}; +openfl_utils_ByteArray.set_length = function(this1,value) { + if(value >= 0) { + this1.__resize(value); + if(value < this1.position) { + this1.position = value; + } + } + this1.length = value; + return value; +}; +openfl_utils_ByteArray.get_objectEncoding = function(this1) { + return this1.objectEncoding; +}; +openfl_utils_ByteArray.set_objectEncoding = function(this1,value) { + return this1.objectEncoding = value; +}; +openfl_utils_ByteArray.get_position = function(this1) { + return this1.position; +}; +openfl_utils_ByteArray.set_position = function(this1,value) { + return this1.position = value; +}; +var openfl_utils_IDataOutput = function() { }; +$hxClasses["openfl.utils.IDataOutput"] = openfl_utils_IDataOutput; +openfl_utils_IDataOutput.__name__ = "openfl.utils.IDataOutput"; +openfl_utils_IDataOutput.__isInterface__ = true; +openfl_utils_IDataOutput.prototype = { + __class__: openfl_utils_IDataOutput + ,__properties__: {set_endian:"set_endian",get_endian:"get_endian"} +}; +var openfl_utils_IDataInput = function() { }; +$hxClasses["openfl.utils.IDataInput"] = openfl_utils_IDataInput; +openfl_utils_IDataInput.__name__ = "openfl.utils.IDataInput"; +openfl_utils_IDataInput.__isInterface__ = true; +openfl_utils_IDataInput.prototype = { + __class__: openfl_utils_IDataInput + ,__properties__: {set_endian:"set_endian",get_endian:"get_endian",get_bytesAvailable:"get_bytesAvailable"} +}; +var openfl_utils_ByteArrayData = function(length) { + if(length == null) { + length = 0; + } + var bytes = new haxe_io_Bytes(new ArrayBuffer(length)); + haxe_io_Bytes.call(this,bytes.b.buffer); + this.__allocated = length; + if(openfl_utils_ByteArrayData.__defaultEndian == null) { + if(lime_system_System.get_endianness() == lime_system_Endian.LITTLE_ENDIAN) { + openfl_utils_ByteArrayData.__defaultEndian = 1; + } else { + openfl_utils_ByteArrayData.__defaultEndian = 0; + } + } + this.__endian = openfl_utils_ByteArrayData.__defaultEndian; + this.objectEncoding = openfl_utils_ByteArrayData.defaultObjectEncoding; + this.position = 0; +}; +$hxClasses["openfl.utils.ByteArrayData"] = openfl_utils_ByteArrayData; +openfl_utils_ByteArrayData.__name__ = "openfl.utils.ByteArrayData"; +openfl_utils_ByteArrayData.__interfaces__ = [openfl_utils_IDataOutput,openfl_utils_IDataInput]; +openfl_utils_ByteArrayData.__properties__ = {set_defaultEndian:"set_defaultEndian",get_defaultEndian:"get_defaultEndian"}; +openfl_utils_ByteArrayData.fromBytes = function(bytes) { + var result = new openfl_utils_ByteArrayData(); + result.__fromBytes(bytes); + return result; +}; +openfl_utils_ByteArrayData.get_defaultEndian = function() { + if(openfl_utils_ByteArrayData.__defaultEndian == null) { + if(lime_system_System.get_endianness() == lime_system_Endian.LITTLE_ENDIAN) { + openfl_utils_ByteArrayData.__defaultEndian = 1; + } else { + openfl_utils_ByteArrayData.__defaultEndian = 0; + } + } + return openfl_utils_ByteArrayData.__defaultEndian; +}; +openfl_utils_ByteArrayData.set_defaultEndian = function(value) { + return openfl_utils_ByteArrayData.__defaultEndian = value; +}; +openfl_utils_ByteArrayData.__super__ = haxe_io_Bytes; +openfl_utils_ByteArrayData.prototype = $extend(haxe_io_Bytes.prototype,{ + clear: function() { + this.length = 0; + this.position = 0; + } + ,compress: function(algorithm) { + if(algorithm == null) { + algorithm = 2; + } + if(this.__allocated > this.length) { + var cacheLength = this.length; + this.length = this.__allocated; + var data = new haxe_io_Bytes(new ArrayBuffer(cacheLength)); + data.blit(0,this,0,cacheLength); + this.b = data.b; + this.__allocated = data.length; + this.data = data.data; + this.length = cacheLength; + } + var limeBytes = this; + var bytes; + switch(algorithm) { + case 0: + bytes = lime_utils_Bytes.compress(limeBytes,lime_utils_CompressionAlgorithm.DEFLATE); + break; + case 1: + bytes = lime_utils_Bytes.compress(limeBytes,lime_utils_CompressionAlgorithm.LZMA); + break; + default: + bytes = lime_utils_Bytes.compress(limeBytes,lime_utils_CompressionAlgorithm.ZLIB); + } + if(bytes != null) { + this.b = bytes.b; + this.__allocated = bytes.length; + this.data = bytes.data; + this.length = this.__allocated; + this.position = this.length; + } + } + ,deflate: function() { + this.compress(0); + } + ,inflate: function() { + this.uncompress(0); + } + ,readBoolean: function() { + if(this.position < this.length) { + return this.b[this.position++] != 0; + } else { + throw new openfl_errors_EOFError(); + } + } + ,readByte: function() { + var value = this.readUnsignedByte(); + if((value & 128) != 0) { + return value - 256; + } else { + return value; + } + } + ,readBytes: function(bytes,offset,length) { + if(length == null) { + length = 0; + } + if(offset == null) { + offset = 0; + } + if(length == 0) { + length = this.length - this.position; + } + if(this.position + length > this.length) { + throw new openfl_errors_EOFError(); + } + if(bytes.length < offset + length) { + bytes.__resize(offset + length); + } + bytes.blit(offset,this,this.position,length); + this.position += length; + } + ,readDouble: function() { + if(this.__endian == 1) { + if(this.position + 8 > this.length) { + throw new openfl_errors_EOFError(); + } + this.position += 8; + return this.getDouble(this.position - 8); + } else { + var ch1 = this.readInt(); + var ch2 = this.readInt(); + return haxe_io_FPHelper.i64ToDouble(ch2,ch1); + } + } + ,readFloat: function() { + if(this.__endian == 1) { + if(this.position + 4 > this.length) { + throw new openfl_errors_EOFError(); + } + this.position += 4; + return this.getFloat(this.position - 4); + } else { + return haxe_io_FPHelper.i32ToFloat(this.readInt()); + } + } + ,readInt: function() { + var ch1 = this.readUnsignedByte(); + var ch2 = this.readUnsignedByte(); + var ch3 = this.readUnsignedByte(); + var ch4 = this.readUnsignedByte(); + if(this.__endian == 1) { + return ch4 << 24 | ch3 << 16 | ch2 << 8 | ch1; + } else { + return ch1 << 24 | ch2 << 16 | ch3 << 8 | ch4; + } + } + ,readInt64: function() { + if(this.position + 8 > this.length) { + throw new openfl_errors_EOFError(); + } + var high; + var low; + if(this.__endian == 1) { + low = this.readUnsignedInt(); + high = this.readUnsignedInt(); + } else { + high = this.readUnsignedInt(); + low = this.readUnsignedInt(); + } + return new haxe__$Int64__$_$_$Int64(high,low); + } + ,readMultiByte: function(length,charSet) { + return this.readUTFBytes(length); + } + ,readObject: function() { + switch(this.objectEncoding) { + case 0: + var input = new haxe_io_BytesInput(this,this.position); + var reader = new openfl_utils__$internal_format_amf_AMFReader(input); + var data = openfl_utils__$internal_format_amf_AMFTools.unwrapValue(reader.read()); + this.position = input.pos; + return data; + case 3: + var input = new haxe_io_BytesInput(this,this.position); + var reader = new openfl_utils__$internal_format_amf3_AMF3Reader(input,this.__amf3Reader); + var data = openfl_utils__$internal_format_amf3_AMF3Tools.decode(reader.read()); + this.position = input.pos; + return data; + case 10: + var data = this.readUTF(); + return haxe_Unserializer.run(data); + case 12: + var data = this.readUTF(); + return JSON.parse(data); + default: + return null; + } + } + ,readShort: function() { + var ch1 = this.readUnsignedByte(); + var ch2 = this.readUnsignedByte(); + var value; + if(this.__endian == 1) { + value = ch2 << 8 | ch1; + } else { + value = ch1 << 8 | ch2; + } + if((value & 32768) != 0) { + return value - 65536; + } else { + return value; + } + } + ,readUnsignedByte: function() { + if(this.position < this.length) { + return this.b[this.position++]; + } else { + throw new openfl_errors_EOFError(); + } + } + ,readUnsignedInt: function() { + var ch1 = this.readUnsignedByte(); + var ch2 = this.readUnsignedByte(); + var ch3 = this.readUnsignedByte(); + var ch4 = this.readUnsignedByte(); + if(this.__endian == 1) { + return ch4 << 24 | ch3 << 16 | ch2 << 8 | ch1; + } else { + return ch1 << 24 | ch2 << 16 | ch3 << 8 | ch4; + } + } + ,readUnsignedShort: function() { + var ch1 = this.readUnsignedByte(); + var ch2 = this.readUnsignedByte(); + if(this.__endian == 1) { + return (ch2 << 8) + ch1; + } else { + return ch1 << 8 | ch2; + } + } + ,readUTF: function() { + var bytesCount = this.readUnsignedShort(); + return this.readUTFBytes(bytesCount); + } + ,readUTFBytes: function(length) { + if(this.position + length > this.length) { + throw new openfl_errors_EOFError(); + } + this.position += length; + return this.getString(this.position - length,length); + } + ,uncompress: function(algorithm) { + if(algorithm == null) { + algorithm = 2; + } + if(this.__allocated > this.length) { + var cacheLength = this.length; + this.length = this.__allocated; + var data = new haxe_io_Bytes(new ArrayBuffer(cacheLength)); + data.blit(0,this,0,cacheLength); + this.b = data.b; + this.__allocated = data.length; + this.data = data.data; + this.length = cacheLength; + } + var limeBytes = this; + var bytes; + switch(algorithm) { + case 0: + bytes = lime_utils_Bytes.decompress(limeBytes,lime_utils_CompressionAlgorithm.DEFLATE); + break; + case 1: + bytes = lime_utils_Bytes.decompress(limeBytes,lime_utils_CompressionAlgorithm.LZMA); + break; + default: + bytes = lime_utils_Bytes.decompress(limeBytes,lime_utils_CompressionAlgorithm.ZLIB); + } + if(bytes != null) { + this.b = bytes.b; + this.__allocated = bytes.length; + this.data = bytes.data; + this.length = this.__allocated; + } + this.position = 0; + } + ,writeBoolean: function(value) { + this.writeByte(value ? 1 : 0); + } + ,writeByte: function(value) { + this.__resize(this.position + 1); + this.b[this.position++] = value & 255 & 255; + } + ,writeBytes: function(bytes,offset,length) { + if(length == null) { + length = 0; + } + if(offset == null) { + offset = 0; + } + if(openfl_utils_ByteArray.get_length(bytes) == 0) { + return; + } + if(length == 0) { + length = openfl_utils_ByteArray.get_length(bytes) - offset; + } + this.__resize(this.position + length); + this.blit(this.position,bytes,offset,length); + this.position = this.position + length; + } + ,writeDouble: function(value) { + var int64 = haxe_io_FPHelper.doubleToI64(value); + if(this.__endian == 1) { + this.writeInt(int64.low); + this.writeInt(int64.high); + } else { + this.writeInt(int64.high); + this.writeInt(int64.low); + } + } + ,writeFloat: function(value) { + if(this.__endian == 1) { + this.__resize(this.position + 4); + this.setFloat(this.position,value); + this.position += 4; + } else { + var int = haxe_io_FPHelper.floatToI32(value); + this.writeInt(int); + } + } + ,writeInt: function(value) { + this.__resize(this.position + 4); + if(this.__endian == 1) { + this.b[this.position++] = value & 255 & 255; + this.b[this.position++] = value >> 8 & 255 & 255; + this.b[this.position++] = value >> 16 & 255 & 255; + this.b[this.position++] = value >> 24 & 255 & 255; + } else { + this.b[this.position++] = value >> 24 & 255 & 255; + this.b[this.position++] = value >> 16 & 255 & 255; + this.b[this.position++] = value >> 8 & 255 & 255; + this.b[this.position++] = value & 255 & 255; + } + } + ,writeInt64: function(value) { + if(this.__endian == 1) { + this.writeUnsignedInt(value.low); + this.writeUnsignedInt(value.high); + } else { + this.writeUnsignedInt(value.high); + this.writeUnsignedInt(value.low); + } + } + ,writeMultiByte: function(value,charSet) { + this.writeUTFBytes(value); + } + ,writeObject: function(object) { + switch(this.objectEncoding) { + case 0: + var value = openfl_utils__$internal_format_amf_AMFTools.encode(object); + var output = new haxe_io_BytesOutput(); + var writer = new openfl_utils__$internal_format_amf_AMFWriter(output); + writer.write(value); + this.writeBytes(openfl_utils_ByteArray.fromBytes(output.getBytes())); + break; + case 3: + var output = new haxe_io_BytesOutput(); + var writer = new openfl_utils__$internal_format_amf3_AMF3Writer(output); + if(((object) instanceof openfl_utils_ByteArrayData)) { + writer.write(openfl_utils__$internal_format_amf3_AMF3Value.AByteArray(object)); + } else { + var value = openfl_utils__$internal_format_amf3_AMF3Tools.encode(object); + writer.write(value); + } + this.writeBytes(openfl_utils_ByteArray.fromBytes(output.getBytes())); + break; + case 10: + var value = haxe_Serializer.run(object); + this.writeUTF(value); + break; + case 12: + var value = JSON.stringify(object); + this.writeUTF(value); + break; + default: + return; + } + } + ,writeShort: function(value) { + this.__resize(this.position + 2); + if(this.__endian == 1) { + this.b[this.position++] = value & 255; + this.b[this.position++] = value >> 8 & 255; + } else { + this.b[this.position++] = value >> 8 & 255; + this.b[this.position++] = value & 255; + } + } + ,writeUnsignedInt: function(value) { + this.writeInt(value); + } + ,writeUTF: function(value) { + var bytes = haxe_io_Bytes.ofString(value); + this.writeShort(bytes.length); + this.writeBytes(openfl_utils_ByteArray.fromBytes(bytes)); + } + ,writeUTFBytes: function(value) { + var bytes = haxe_io_Bytes.ofString(value); + this.writeBytes(openfl_utils_ByteArray.fromBytes(bytes)); + } + ,__fromBytes: function(bytes) { + this.b = bytes.b; + this.__allocated = bytes.length; + this.data = bytes.data; + this.length = bytes.length; + } + ,__resize: function(size) { + if(size > this.__allocated) { + var bytes = new haxe_io_Bytes(new ArrayBuffer((size + 1) * 3 >> 1)); + if(this.__allocated > 0) { + var cacheLength = this.length; + this.length = this.__allocated; + bytes.blit(0,this,0,this.__allocated); + this.length = cacheLength; + } + this.b = bytes.b; + this.__allocated = bytes.length; + this.data = bytes.data; + } + if(this.length < size) { + this.length = size; + } + } + ,__setData: function(bytes) { + this.b = bytes.b; + this.__allocated = bytes.length; + this.data = bytes.data; + } + ,get_bytesAvailable: function() { + return this.length - this.position; + } + ,get_endian: function() { + return this.__endian; + } + ,set_endian: function(value) { + return this.__endian = value; + } + ,get___length: function() { + return this.length; + } + ,set___length: function(value) { + return this.length = value; + } + ,__class__: openfl_utils_ByteArrayData + ,__properties__: {set___length:"set___length",get___length:"get___length",set_endian:"set_endian",get_endian:"get_endian",get_bytesAvailable:"get_bytesAvailable"} +}); +var openfl_utils_CompressionAlgorithm = {}; +openfl_utils_CompressionAlgorithm.fromString = function(value) { + switch(value) { + case "deflate": + return 0; + case "lzma": + return 1; + case "zlib": + return 2; + default: + return null; + } +}; +openfl_utils_CompressionAlgorithm.toString = function(this1) { + switch(this1) { + case 0: + return "deflate"; + case 1: + return "lzma"; + case 2: + return "zlib"; + default: + return null; + } +}; +var openfl_utils__$Dictionary_ClassMap = function() { + this.types = new haxe_ds_StringMap(); + this.values = new haxe_ds_StringMap(); +}; +$hxClasses["openfl.utils._Dictionary.ClassMap"] = openfl_utils__$Dictionary_ClassMap; +openfl_utils__$Dictionary_ClassMap.__name__ = "openfl.utils._Dictionary.ClassMap"; +openfl_utils__$Dictionary_ClassMap.__interfaces__ = [haxe_IMap]; +openfl_utils__$Dictionary_ClassMap.prototype = { + clear: function() { + this.types.h = Object.create(null); + this.values.h = Object.create(null); + } + ,copy: function() { + var copied = new openfl_utils__$Dictionary_ClassMap(); + var key = this.keys(); + while(key.hasNext()) { + var key1 = key.next(); + copied.set(key1,this.get(key1)); + } + return copied; + } + ,exists: function(key) { + var this1 = this.types; + var key1 = key.__name__; + return Object.prototype.hasOwnProperty.call(this1.h,key1); + } + ,get: function(key) { + var this1 = this.values; + var key1 = key.__name__; + return this1.h[key1]; + } + ,keyValueIterator: function() { + return new haxe_iterators_MapKeyValueIterator(this); + } + ,keys: function() { + return new haxe_ds__$StringMap_StringMapValueIterator(this.types.h); + } + ,iterator: function() { + return new haxe_ds__$StringMap_StringMapValueIterator(this.values.h); + } + ,remove: function(key) { + var name = key.__name__; + var _this = this.types; + var tmp; + if(Object.prototype.hasOwnProperty.call(_this.h,name)) { + delete(_this.h[name]); + tmp = true; + } else { + tmp = false; + } + if(!tmp) { + var _this = this.values; + if(Object.prototype.hasOwnProperty.call(_this.h,name)) { + delete(_this.h[name]); + return true; + } else { + return false; + } + } else { + return true; + } + } + ,set: function(key,value) { + var name = key.__name__; + this.types.h[name] = key; + this.values.h[name] = value; + } + ,toString: function() { + return haxe_ds_StringMap.stringify(this.values.h); + } + ,__class__: openfl_utils__$Dictionary_ClassMap +}; +var openfl_utils__$Dictionary_FloatMap = function() { + this.floatKeys = []; + this.values = []; +}; +$hxClasses["openfl.utils._Dictionary.FloatMap"] = openfl_utils__$Dictionary_FloatMap; +openfl_utils__$Dictionary_FloatMap.__name__ = "openfl.utils._Dictionary.FloatMap"; +openfl_utils__$Dictionary_FloatMap.__interfaces__ = [haxe_IMap]; +openfl_utils__$Dictionary_FloatMap.prototype = { + clear: function() { + this.floatKeys = []; + this.values = []; + } + ,copy: function() { + var copied = new openfl_utils__$Dictionary_FloatMap(); + var key = this.keys(); + while(key.hasNext()) { + var key1 = key.next(); + copied.set(key1,this.get(key1)); + } + return copied; + } + ,exists: function(key) { + return this.indexOf(key) > -1; + } + ,get: function(key) { + var ind = this.indexOf(key); + if(ind > -1) { + return this.values[ind]; + } else { + return null; + } + } + ,keyValueIterator: function() { + return new haxe_iterators_MapKeyValueIterator(this); + } + ,keys: function() { + return new haxe_iterators_ArrayIterator(this.floatKeys.slice()); + } + ,iterator: function() { + return new haxe_iterators_ArrayIterator(this.values.slice()); + } + ,remove: function(key) { + var ind = this.indexOf(key); + if(ind > -1) { + this.floatKeys.splice(ind,1); + this.values.splice(ind,1); + return true; + } + return false; + } + ,set: function(key,value) { + this.insertSorted(key,value); + } + ,indexOf: function(key) { + var len = this.floatKeys.length; + var startIndex = 0; + var endIndex = len - 1; + if(len == 0) { + return -1; + } + var midIndex = 0; + while(startIndex < endIndex) { + midIndex = Math.floor((startIndex + endIndex) / 2); + if(this.floatKeys[midIndex] == key) { + return midIndex; + } else if(this.floatKeys[midIndex] > key) { + endIndex = midIndex - 1; + } else { + startIndex = midIndex + 1; + } + } + if(this.floatKeys[startIndex] == key) { + return startIndex; + } else { + return -1; + } + } + ,insertSorted: function(key,value) { + var len = this.floatKeys.length; + var startIndex = 0; + var endIndex = len - 1; + if(len == 0) { + this.floatKeys.push(key); + this.values.push(value); + return; + } + var midIndex = 0; + while(startIndex < endIndex) { + midIndex = Math.floor((startIndex + endIndex) / 2); + if(this.floatKeys[midIndex] == key) { + this.values[midIndex] = value; + return; + } else if(this.floatKeys[midIndex] > key) { + endIndex = midIndex - 1; + } else { + startIndex = midIndex + 1; + } + } + if(this.floatKeys[startIndex] > key) { + this.floatKeys.splice(startIndex,0,key); + this.values.splice(startIndex,0,value); + } else if(this.floatKeys[startIndex] < key) { + this.floatKeys.splice(startIndex + 1,0,key); + this.values.splice(startIndex + 1,0,value); + } else { + this.values[startIndex] = value; + } + } + ,toString: function() { + return this.values.toString(); + } + ,__class__: openfl_utils__$Dictionary_FloatMap +}; +var openfl_utils__$Dictionary_UtilsObjectMap = function() { + this.map = new haxe_ds_ObjectMap(); +}; +$hxClasses["openfl.utils._Dictionary.UtilsObjectMap"] = openfl_utils__$Dictionary_UtilsObjectMap; +openfl_utils__$Dictionary_UtilsObjectMap.__name__ = "openfl.utils._Dictionary.UtilsObjectMap"; +openfl_utils__$Dictionary_UtilsObjectMap.__interfaces__ = [haxe_IMap]; +openfl_utils__$Dictionary_UtilsObjectMap.prototype = { + clear: function() { + this.map.h = { __keys__ : { }}; + } + ,copy: function() { + var copied = new openfl_utils__$Dictionary_UtilsObjectMap(); + var key = this.keys(); + while(key.hasNext()) { + var key1 = key.next(); + copied.set(key1,this.get(key1)); + } + return copied; + } + ,exists: function(key) { + return this.map.h.__keys__[key.__id__] != null; + } + ,get: function(key) { + return this.map.h[key.__id__]; + } + ,keyValueIterator: function() { + return new haxe_iterators_MapKeyValueIterator(this); + } + ,keys: function() { + return this.map.keys(); + } + ,iterator: function() { + return this.map.iterator(); + } + ,remove: function(key) { + return this.map.remove(key); + } + ,set: function(key,value) { + this.map.set(key,value); + } + ,toString: function() { + return this.map.toString(); + } + ,__class__: openfl_utils__$Dictionary_UtilsObjectMap +}; +var openfl_utils_Endian = {}; +openfl_utils_Endian.fromLimeEndian = function(value) { + switch(value._hx_index) { + case 0: + return 1; + case 1: + return 0; + } +}; +openfl_utils_Endian.fromString = function(value) { + switch(value) { + case "bigEndian": + return 0; + case "littleEndian": + return 1; + default: + return null; + } +}; +openfl_utils_Endian.toLimeEndian = function(this1) { + switch(this1) { + case 0: + return lime_system_Endian.BIG_ENDIAN; + case 1: + return lime_system_Endian.LITTLE_ENDIAN; + default: + return null; + } +}; +openfl_utils_Endian.toString = function(this1) { + switch(this1) { + case 0: + return "bigEndian"; + case 1: + return "littleEndian"; + default: + return null; + } +}; +var openfl_utils_IExternalizable = function() { }; +$hxClasses["openfl.utils.IExternalizable"] = openfl_utils_IExternalizable; +openfl_utils_IExternalizable.__name__ = "openfl.utils.IExternalizable"; +openfl_utils_IExternalizable.__isInterface__ = true; +openfl_utils_IExternalizable.prototype = { + __class__: openfl_utils_IExternalizable +}; +var openfl_utils_Object = {}; +openfl_utils_Object._new = function() { + return { }; +}; +openfl_utils_Object.hasOwnProperty = function(this1,name) { + if(this1 != null) { + return Object.prototype.hasOwnProperty.call(this1,name); + } else { + return false; + } +}; +openfl_utils_Object.isPrototypeOf = function(this1,theClass) { + if(this1 != null) { + var c = js_Boot.getClass(this1); + while(c != null) { + if(c == theClass) { + return true; + } + c = c.__super__; + } + } + return false; +}; +openfl_utils_Object.iterator = function(this1) { + if(((this1) instanceof Array)) { + var arr = this1; + return new haxe_iterators_ArrayIterator(arr); + } else { + var fields = Reflect.fields(this1); + if(fields == null) { + fields = []; + } + if(((this1) instanceof openfl_display_DisplayObjectContainer)) { + var container = this1; + var _g = 0; + var _g1 = container.get_numChildren(); + while(_g < _g1) { + var i = _g++; + var child = container.getChildAt(i); + var name = child.get_name(); + if(name != null && fields.indexOf(name) == -1) { + fields.push(name); + } + } + } + return new haxe_iterators_ArrayIterator(fields); + } +}; +openfl_utils_Object.propertyIsEnumerable = function(this1,name) { + if(this1 != null && Object.prototype.hasOwnProperty.call(this1,name)) { + return js_Boot.__implements(Reflect.field(this1,name),haxe_lang_Iterable); + } else { + return false; + } +}; +openfl_utils_Object.toLocaleString = function(this1) { + if(this1 == null) { + return null; + } else { + return Std.string(this1); + } +}; +openfl_utils_Object.toString = function(this1) { + if(this1 == null) { + return null; + } else { + return Std.string(this1); + } +}; +openfl_utils_Object.valueOf = function(this1) { + return this1; +}; +openfl_utils_Object.__fieldRead = function(this1,name) { + return openfl_utils_Object.__get(this1,name); +}; +openfl_utils_Object.__fieldWrite = function(this1,name,value) { + var this2 = this1; + if(this2 != null) { + Reflect.setProperty(this2,name,value); + } + return value; +}; +openfl_utils_Object.__get = function(this1,key) { + if(this1 == null || key == null) { + return null; + } + if(Object.prototype.hasOwnProperty.call(this1,key)) { + return Reflect.field(this1,key); + } else if(((this1) instanceof openfl_display_DisplayObjectContainer)) { + var container = this1; + var child = container.getChildByName(key); + if(child != null) { + return child; + } + } + return Reflect.getProperty(this1,key); +}; +openfl_utils_Object.__set = function(this1,key,value) { + if(this1 != null) { + Reflect.setProperty(this1,key,value); + } + return value; +}; +openfl_utils_Object.__getArray = function(this1,index) { + if(this1 == null) { + return null; + } + var arr = js_Boot.__cast(this1 , Array); + return arr[index]; +}; +openfl_utils_Object.__setArray = function(this1,index,value) { + if(this1 == null) { + return value; + } + var arr = js_Boot.__cast(this1 , Array); + return arr[index] = value; +}; +openfl_utils_Object.toFunction = function(this1) { + return this1; +}; +openfl_utils_Object.toFloat = function(this1) { + if(typeof(this1) == "number") { + return this1; + } else { + return NaN; + } +}; +openfl_utils_Object.toInt = function(this1) { + return this1; +}; +openfl_utils_Object.toBool = function(this1) { + if(typeof(this1) == "boolean") { + return this1; + } else if(typeof(this1) == "number") { + return this1 != 0; + } else { + return this1 != null; + } +}; +openfl_utils_Object.__negate = function(this1) { + var float = this1; + return -float; +}; +openfl_utils_Object.__preIncrement = function(this1) { + var float = this1; + return ++float; +}; +openfl_utils_Object.__postIncrement = function(this1) { + var float = this1; + return float++; +}; +openfl_utils_Object.__preDecrement = function(this1) { + var float = this1; + return --float; +}; +openfl_utils_Object.__postDecrement = function(this1) { + var float = this1; + return float--; +}; +openfl_utils_Object.__add = function(a,b) { + if(typeof(a) == "string" || typeof(b) == "string") { + var tmp; + if(a == null) { + tmp = "null"; + } else { + var this1 = a; + tmp = this1 == null ? null : Std.string(this1); + } + var tmp1; + if(b == null) { + tmp1 = "null"; + } else { + var this1 = b; + tmp1 = this1 == null ? null : Std.string(this1); + } + return tmp + tmp1; + } else { + var floatA = a; + var floatB = b; + return floatA + floatB; + } +}; +openfl_utils_Object.__addString = function(a,b) { + var stringA; + if(a == null) { + stringA = "null"; + } else { + var this1 = a; + stringA = this1 == null ? null : Std.string(this1); + } + return stringA + b; +}; +openfl_utils_Object.__addInt = function(a,b) { + var floatA = a; + return floatA + b; +}; +openfl_utils_Object.__addFloat = function(a,b) { + var floatA = a; + return floatA + b; +}; +openfl_utils_Object.__sub = function(a,b) { + var floatA = a; + var floatB = b; + return floatA - floatB; +}; +openfl_utils_Object.__subInt = function(a,b) { + var floatA = a; + return floatA - b; +}; +openfl_utils_Object.__intSub = function(a,b) { + var floatB = b; + return a - floatB; +}; +openfl_utils_Object.__subFloat = function(a,b) { + var floatA = a; + return floatA - b; +}; +openfl_utils_Object.__floatSub = function(a,b) { + var floatB = b; + return a - floatB; +}; +openfl_utils_Object.__mul = function(a,b) { + var floatA = a; + var floatB = b; + return floatA * floatB; +}; +openfl_utils_Object.__mulInt = function(a,b) { + var floatA = a; + return floatA * b; +}; +openfl_utils_Object.__mulFloat = function(a,b) { + var floatA = a; + return floatA * b; +}; +openfl_utils_Object.__div = function(a,b) { + var floatA = a; + var floatB = b; + return floatA / floatB; +}; +openfl_utils_Object.__divInt = function(a,b) { + var floatA = a; + return floatA / b; +}; +openfl_utils_Object.__intDiv = function(a,b) { + var floatB = b; + return a / floatB; +}; +openfl_utils_Object.__divFloat = function(a,b) { + var floatA = a; + return floatA / b; +}; +openfl_utils_Object.__floatDiv = function(a,b) { + var floatB = b; + return a / floatB; +}; +openfl_utils_Object.__mod = function(a,b) { + var floatA = a; + var floatB = b; + return floatA % floatB; +}; +openfl_utils_Object.__modInt = function(a,b) { + var floatA = a; + return floatA % b; +}; +openfl_utils_Object.__intMod = function(a,b) { + var floatB = b; + return a % floatB; +}; +openfl_utils_Object.__modFloat = function(a,b) { + var floatA = a; + return floatA % b; +}; +openfl_utils_Object.__floatMod = function(a,b) { + var floatB = b; + return a % floatB; +}; +openfl_utils_Object.__eq = function(a,b) { + var dynamicA = a; + var dynamicB = b; + return dynamicA == dynamicB; +}; +openfl_utils_Object.__eqDynamic = function(a,b) { + var dynamicA = a; + return dynamicA == b; +}; +openfl_utils_Object.__neq = function(a,b) { + var dynamicA = a; + var dynamicB = b; + return dynamicA != dynamicB; +}; +openfl_utils_Object.__neqDynamic = function(a,b) { + var dynamicA = a; + return dynamicA != b; +}; +openfl_utils_Object.__lt = function(a,b) { + var floatA = a; + var floatB = b; + return floatA < floatB; +}; +openfl_utils_Object.__ltInt = function(a,b) { + var floatA = a; + return floatA < b; +}; +openfl_utils_Object.__intLt = function(a,b) { + var floatB = b; + return a < floatB; +}; +openfl_utils_Object.__ltFloat = function(a,b) { + var floatA = a; + return floatA < b; +}; +openfl_utils_Object.__floatLt = function(a,b) { + var floatB = b; + return a < floatB; +}; +openfl_utils_Object.__lte = function(a,b) { + var floatA = a; + var floatB = b; + return floatA <= floatB; +}; +openfl_utils_Object.__lteInt = function(a,b) { + var floatB = b; + return openfl_utils_Object.__lte(a,floatB); +}; +openfl_utils_Object.__intLte = function(a,b) { + var floatA = a; + return openfl_utils_Object.__lte(floatA,b); +}; +openfl_utils_Object.__lteFloat = function(a,b) { + var floatB = b; + return openfl_utils_Object.__lte(a,floatB); +}; +openfl_utils_Object.__floatLte = function(a,b) { + var floatA = a; + return openfl_utils_Object.__lte(floatA,b); +}; +openfl_utils_Object.__gt = function(a,b) { + var floatA = a; + var floatB = b; + return floatA > floatB; +}; +openfl_utils_Object.__gtInt = function(a,b) { + var floatB = b; + return openfl_utils_Object.__gt(a,floatB); +}; +openfl_utils_Object.__intGt = function(a,b) { + var floatB = b; + return a > floatB; +}; +openfl_utils_Object.__gtFloat = function(a,b) { + var floatB = b; + return openfl_utils_Object.__gt(a,floatB); +}; +openfl_utils_Object.__floatGt = function(a,b) { + var floatB = b; + return a > floatB; +}; +openfl_utils_Object.__gte = function(a,b) { + var floatA = a; + var floatB = b; + return floatA >= floatB; +}; +openfl_utils_Object.__gteInt = function(a,b) { + var floatB = b; + return openfl_utils_Object.__gte(a,floatB); +}; +openfl_utils_Object.__intGte = function(a,b) { + var floatB = b; + return a >= floatB; +}; +openfl_utils_Object.__gteFloat = function(a,b) { + var floatB = b; + return openfl_utils_Object.__gte(a,floatB); +}; +openfl_utils_Object.__floatGte = function(a,b) { + var floatB = b; + return a >= floatB; +}; +openfl_utils_Object.__complement = function(this1) { + var int = this1; + return ~int; +}; +openfl_utils_Object.__and = function(a,b) { + var intA = a; + var intB = b; + return intA & intB; +}; +openfl_utils_Object.__andInt = function(a,b) { + var intA = a; + return intA & b; +}; +openfl_utils_Object.__or = function(a,b) { + var intA = a; + var intB = b; + return intA | intB; +}; +openfl_utils_Object.__orInt = function(a,b) { + var intA = a; + return intA | b; +}; +openfl_utils_Object.__xor = function(a,b) { + var intA = a; + var intB = b; + return intA ^ intB; +}; +openfl_utils_Object.__xorInt = function(a,b) { + var intA = a; + return intA ^ b; +}; +openfl_utils_Object.__shr = function(a,b) { + var intA = a; + var intB = b; + return intA >> intB; +}; +openfl_utils_Object.__shrInt = function(a,b) { + var intA = a; + return intA >> b; +}; +openfl_utils_Object.__intShr = function(a,b) { + var intB = b; + return a >> intB; +}; +openfl_utils_Object.__ushr = function(a,b) { + var intA = a; + var intB = b; + return intA >>> intB; +}; +openfl_utils_Object.__ushrInt = function(a,b) { + var intA = a; + return intA >>> b; +}; +openfl_utils_Object.__intUshr = function(a,b) { + var intB = b; + return a >>> intB; +}; +openfl_utils_Object.__shl = function(a,b) { + var intA = a; + var intB = b; + return intA << intB; +}; +openfl_utils_Object.__shlInt = function(a,b) { + var intA = a; + return intA << b; +}; +openfl_utils_Object.__intShl = function(a,b) { + var intB = b; + return a << intB; +}; +var haxe_lang_Iterator = function() { }; +$hxClasses["haxe.lang.Iterator"] = haxe_lang_Iterator; +haxe_lang_Iterator.__name__ = "haxe.lang.Iterator"; +haxe_lang_Iterator.__isInterface__ = true; +haxe_lang_Iterator.prototype = { + __class__: haxe_lang_Iterator +}; +var haxe_lang_Iterable = function() { }; +$hxClasses["haxe.lang.Iterable"] = haxe_lang_Iterable; +haxe_lang_Iterable.__name__ = "haxe.lang.Iterable"; +haxe_lang_Iterable.__isInterface__ = true; +haxe_lang_Iterable.prototype = { + __class__: haxe_lang_Iterable +}; +var openfl_utils__$internal_Lib = function() { }; +$hxClasses["openfl.utils._internal.Lib"] = openfl_utils__$internal_Lib; +openfl_utils__$internal_Lib.__name__ = "openfl.utils._internal.Lib"; +openfl_utils__$internal_Lib.notImplemented = function(posInfo) { + var api = posInfo.className + "." + posInfo.methodName; + if(!Object.prototype.hasOwnProperty.call(openfl_utils__$internal_Lib.__sentWarnings.h,api)) { + openfl_utils__$internal_Lib.__sentWarnings.h[api] = true; + lime_utils_Log.warn(posInfo.methodName + " is not implemented",posInfo); + } +}; +var openfl_utils__$internal_TouchData = function() { + this.rollOutStack = []; +}; +$hxClasses["openfl.utils._internal.TouchData"] = openfl_utils__$internal_TouchData; +openfl_utils__$internal_TouchData.__name__ = "openfl.utils._internal.TouchData"; +openfl_utils__$internal_TouchData.prototype = { + reset: function() { + this.touch = null; + this.touchDownTarget = null; + this.touchOverTarget = null; + this.rollOutStack.splice(0,this.rollOutStack.length); + } + ,__class__: openfl_utils__$internal_TouchData +}; +var openfl_utils__$internal_format_amf_AMFReader = function(i) { + this.i = i; + i.set_bigEndian(true); +}; +$hxClasses["openfl.utils._internal.format.amf.AMFReader"] = openfl_utils__$internal_format_amf_AMFReader; +openfl_utils__$internal_format_amf_AMFReader.__name__ = "openfl.utils._internal.format.amf.AMFReader"; +openfl_utils__$internal_format_amf_AMFReader.prototype = { + readObject: function() { + var h = new haxe_ds_StringMap(); + while(true) { + var c1 = this.i.readByte(); + var c2 = this.i.readByte(); + var name = this.i.readString(c1 << 8 | c2); + var k = this.i.readByte(); + if(k == 9) { + break; + } + var value = this.readWithCode(k); + h.h[name] = value; + } + return h; + } + ,readArray: function(n) { + var a = []; + var _g = 0; + var _g1 = n; + while(_g < _g1) { + var i = _g++; + a.push(this.read()); + } + return a; + } + ,readInt: function() { + return this.i.readInt32(); + } + ,readWithCode: function(id) { + var i = this.i; + switch(id) { + case 0: + return openfl_utils__$internal_format_amf_AMFValue.ANumber(i.readDouble()); + case 1: + var tmp; + switch(i.readByte()) { + case 0: + tmp = false; + break; + case 1: + tmp = true; + break; + default: + throw haxe_Exception.thrown("Invalid AMF"); + } + return openfl_utils__$internal_format_amf_AMFValue.ABool(tmp); + case 2: + return openfl_utils__$internal_format_amf_AMFValue.AString(i.readString(i.readUInt16())); + case 5: + return openfl_utils__$internal_format_amf_AMFValue.ANull; + case 6: + return openfl_utils__$internal_format_amf_AMFValue.AUndefined; + case 7: + throw haxe_Exception.thrown("Not supported : Reference"); + case 3:case 8: + var ismixed = id == 8; + var size = ismixed ? this.i.readInt32() : null; + return openfl_utils__$internal_format_amf_AMFValue.AObject(this.readObject(),size); + case 10: + return openfl_utils__$internal_format_amf_AMFValue.AArray(this.readArray(this.i.readInt32())); + case 11: + var time_ms = i.readDouble(); + var tz_min = i.readUInt16(); + return openfl_utils__$internal_format_amf_AMFValue.ADate(new Date(time_ms + tz_min * 60 * 1000.0)); + case 12: + return openfl_utils__$internal_format_amf_AMFValue.AString(i.readString(this.i.readInt32())); + default: + throw haxe_Exception.thrown("Unknown AMF " + id); + } + } + ,read: function() { + return this.readWithCode(this.i.readByte()); + } + ,__class__: openfl_utils__$internal_format_amf_AMFReader +}; +var openfl_utils__$internal_format_amf_AMFTools = function() { }; +$hxClasses["openfl.utils._internal.format.amf.AMFTools"] = openfl_utils__$internal_format_amf_AMFTools; +openfl_utils__$internal_format_amf_AMFTools.__name__ = "openfl.utils._internal.format.amf.AMFTools"; +openfl_utils__$internal_format_amf_AMFTools.encode = function(o) { + var _g = Type.typeof(o); + switch(_g._hx_index) { + case 0: + return openfl_utils__$internal_format_amf_AMFValue.ANull; + case 1: + return openfl_utils__$internal_format_amf_AMFValue.ANumber(o); + case 2: + return openfl_utils__$internal_format_amf_AMFValue.ANumber(o); + case 3: + return openfl_utils__$internal_format_amf_AMFValue.ABool(o); + case 4: + var h = new haxe_ds_StringMap(); + var _g1 = 0; + var _g2 = Reflect.fields(o); + while(_g1 < _g2.length) { + var f = _g2[_g1]; + ++_g1; + var value = openfl_utils__$internal_format_amf_AMFTools.encode(Reflect.field(o,f)); + h.h[f] = value; + } + return openfl_utils__$internal_format_amf_AMFValue.AObject(h); + case 6: + var c = _g.c; + switch(c) { + case Array: + var o1 = o; + var a = []; + var _g = 0; + while(_g < o1.length) { + var v = o1[_g]; + ++_g; + a.push(openfl_utils__$internal_format_amf_AMFTools.encode(v)); + } + return openfl_utils__$internal_format_amf_AMFValue.AArray(a); + case String: + return openfl_utils__$internal_format_amf_AMFValue.AString(o); + case haxe_ds_StringMap: + var o1 = o; + var h = new haxe_ds_StringMap(); + var h1 = o1.h; + var f_h = h1; + var f_keys = Object.keys(h1); + var f_length = f_keys.length; + var f_current = 0; + while(f_current < f_length) { + var f = f_keys[f_current++]; + var value = openfl_utils__$internal_format_amf_AMFTools.encode(o1.h[f]); + h.h[f] = value; + } + return openfl_utils__$internal_format_amf_AMFValue.AObject(h); + default: + throw haxe_Exception.thrown("Can't encode instance of " + c.__name__); + } + break; + default: + throw haxe_Exception.thrown("Can't encode " + Std.string(o)); + } +}; +openfl_utils__$internal_format_amf_AMFTools.number = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 0) { + var n = a.f; + return n; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf_AMFTools.string = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 2) { + var s = a.s; + return s; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf_AMFTools.object = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 3) { + var _g = a.size; + var o = a.fields; + return o; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf_AMFTools.abool = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 1) { + var b = a.b; + return b; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf_AMFTools.array = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 7) { + var a1 = a.values; + return a1; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf_AMFTools.unwrapValue = function(val) { + switch(val._hx_index) { + case 0: + var f = val.f; + return f; + case 1: + var b = val.b; + return b; + case 2: + var s = val.s; + return s; + case 3: + var _g = val.size; + var vmap = val.fields; + var obj = { }; + var h = vmap.h; + var name_h = h; + var name_keys = Object.keys(h); + var name_length = name_keys.length; + var name_current = 0; + while(name_current < name_length) { + var name = name_keys[name_current++]; + obj[name] = openfl_utils__$internal_format_amf_AMFTools.unwrapValue(vmap.h[name]); + } + return obj; + case 4: + var d = val.d; + return d; + case 5: + return null; + case 6: + return null; + case 7: + var vals = val.values; + var f = openfl_utils__$internal_format_amf_AMFTools.unwrapValue; + var result = new Array(vals.length); + var _g = 0; + var _g1 = vals.length; + while(_g < _g1) { + var i = _g++; + result[i] = f(vals[i]); + } + return result; + } +}; +var openfl_utils__$internal_format_amf_AMFValue = $hxEnums["openfl.utils._internal.format.amf.AMFValue"] = { __ename__:"openfl.utils._internal.format.amf.AMFValue",__constructs__:null + ,ANumber: ($_=function(f) { return {_hx_index:0,f:f,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}; },$_._hx_name="ANumber",$_.__params__ = ["f"],$_) + ,ABool: ($_=function(b) { return {_hx_index:1,b:b,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}; },$_._hx_name="ABool",$_.__params__ = ["b"],$_) + ,AString: ($_=function(s) { return {_hx_index:2,s:s,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}; },$_._hx_name="AString",$_.__params__ = ["s"],$_) + ,AObject: ($_=function(fields,size) { return {_hx_index:3,fields:fields,size:size,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}; },$_._hx_name="AObject",$_.__params__ = ["fields","size"],$_) + ,ADate: ($_=function(d) { return {_hx_index:4,d:d,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}; },$_._hx_name="ADate",$_.__params__ = ["d"],$_) + ,AUndefined: {_hx_name:"AUndefined",_hx_index:5,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr} + ,ANull: {_hx_name:"ANull",_hx_index:6,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr} + ,AArray: ($_=function(values) { return {_hx_index:7,values:values,__enum__:"openfl.utils._internal.format.amf.AMFValue",toString:$estr}; },$_._hx_name="AArray",$_.__params__ = ["values"],$_) +}; +openfl_utils__$internal_format_amf_AMFValue.__constructs__ = [openfl_utils__$internal_format_amf_AMFValue.ANumber,openfl_utils__$internal_format_amf_AMFValue.ABool,openfl_utils__$internal_format_amf_AMFValue.AString,openfl_utils__$internal_format_amf_AMFValue.AObject,openfl_utils__$internal_format_amf_AMFValue.ADate,openfl_utils__$internal_format_amf_AMFValue.AUndefined,openfl_utils__$internal_format_amf_AMFValue.ANull,openfl_utils__$internal_format_amf_AMFValue.AArray]; +var openfl_utils__$internal_format_amf_AMFWriter = function(o) { + this.o = o; + o.set_bigEndian(true); +}; +$hxClasses["openfl.utils._internal.format.amf.AMFWriter"] = openfl_utils__$internal_format_amf_AMFWriter; +openfl_utils__$internal_format_amf_AMFWriter.__name__ = "openfl.utils._internal.format.amf.AMFWriter"; +openfl_utils__$internal_format_amf_AMFWriter.prototype = { + write: function(v) { + var o = this.o; + switch(v._hx_index) { + case 0: + var n = v.f; + o.writeByte(0); + o.writeDouble(n); + break; + case 1: + var b = v.b; + o.writeByte(1); + o.writeByte(b ? 1 : 0); + break; + case 2: + var s = v.s; + if(s.length <= 65535) { + o.writeByte(2); + o.writeUInt16(s.length); + } else { + o.writeByte(12); + o.writeInt32(s.length); + } + o.writeString(s); + break; + case 3: + var h = v.fields; + var size = v.size; + if(size == null) { + o.writeByte(3); + } else { + o.writeByte(8); + o.writeInt32(size); + } + var h1 = h.h; + var f_h = h1; + var f_keys = Object.keys(h1); + var f_length = f_keys.length; + var f_current = 0; + while(f_current < f_length) { + var f = f_keys[f_current++]; + o.writeUInt16(f.length); + o.writeString(f); + this.write(h.h[f]); + } + o.writeByte(0); + o.writeByte(0); + o.writeByte(9); + break; + case 4: + var d = v.d; + o.writeByte(11); + o.writeDouble(d.getTime()); + o.writeUInt16(0); + break; + case 5: + o.writeByte(6); + break; + case 6: + o.writeByte(5); + break; + case 7: + var a = v.values; + o.writeByte(10); + o.writeInt32(a.length); + var _g = 0; + while(_g < a.length) { + var f = a[_g]; + ++_g; + this.write(f); + } + break; + } + } + ,__class__: openfl_utils__$internal_format_amf_AMFWriter +}; +var openfl_utils__$internal_format_amf3_AMF3Array = function(initA,initExtra) { + this.a = initA; + this.extra = initExtra; +}; +$hxClasses["openfl.utils._internal.format.amf3.AMF3Array"] = openfl_utils__$internal_format_amf3_AMF3Array; +openfl_utils__$internal_format_amf3_AMF3Array.__name__ = "openfl.utils._internal.format.amf3.AMF3Array"; +openfl_utils__$internal_format_amf3_AMF3Array.prototype = { + __class__: openfl_utils__$internal_format_amf3_AMF3Array +}; +var openfl_utils__$internal_format_amf3_AMF3Reader = function(i,parent) { + if(parent == null) { + this.complexObjectsTable = []; + this.objectTraitsTable = []; + this.stringTable = []; + } else { + this.complexObjectsTable = parent.complexObjectsTable; + this.objectTraitsTable = parent.objectTraitsTable; + this.stringTable = parent.stringTable; + } + this.i = i; + i.set_bigEndian(true); +}; +$hxClasses["openfl.utils._internal.format.amf3.AMF3Reader"] = openfl_utils__$internal_format_amf3_AMF3Reader; +openfl_utils__$internal_format_amf3_AMF3Reader.__name__ = "openfl.utils._internal.format.amf3.AMF3Reader"; +openfl_utils__$internal_format_amf3_AMF3Reader.prototype = { + readObject: function() { + var dyn = false; + var isExternalizable = false; + var className = null; + var sealedMemberNames = []; + var n = this.readInt(); + if((n & 1) == 0) { + return this.complexObjectsTable[n >> 1]; + } else if((n & 3) == 1) { + n >>= 2; + var refTraits = this.objectTraitsTable[n]; + dyn = refTraits.isDynamic; + isExternalizable = refTraits.isExternalizable; + className = refTraits.className; + sealedMemberNames = refTraits.sealedMemberNames; + } else if((n & 7) == 3) { + dyn = (n >> 3 & 1) == 1; + n >>= 4; + className = this.readString(); + var _g = 0; + var _g1 = n; + while(_g < _g1) { + var j = _g++; + sealedMemberNames.push(openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readString())); + } + this.objectTraitsTable.push({ isExternalizable : isExternalizable, isDynamic : dyn, className : className, sealedMemberNames : sealedMemberNames}); + } else if((n & 7) == 7) { + isExternalizable = true; + className = this.readString(); + } else { + throw haxe_Exception.thrown("Invalid object traits"); + } + var ret = null; + if(isExternalizable) { + var o = openfl_utils__$internal_format_amf3_AMF3Tools.object(openfl_utils__$internal_format_amf3_AMF3Value.AObject(null,null,openfl_utils__$internal_format_amf3_AMF3Tools.decode(className))); + if(o != null && js_Boot.__implements(o,openfl_utils_IExternalizable)) { + var external = o; + external.readExternal(new openfl_utils__$internal_format_amf3_AMF3ReaderInput(this)); + ret = openfl_utils__$internal_format_amf3_AMF3Value.AExternal(external); + } else { + ret = openfl_utils__$internal_format_amf3_AMF3Value.ANull; + } + } else { + var h = new haxe_ds_StringMap(); + ret = openfl_utils__$internal_format_amf3_AMF3Value.AObject(h,null,className != null ? openfl_utils__$internal_format_amf3_AMF3Tools.decode(className) : null); + var _g = 0; + var _g1 = sealedMemberNames.length; + while(_g < _g1) { + var j = _g++; + var value = this.read(); + h.h[sealedMemberNames[j]] = value; + } + if(dyn) { + var s; + while(true) { + s = openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readString()); + if(s == "") { + break; + } + var value = this.read(); + h.h[s] = value; + } + } + } + this.complexObjectsTable.push(ret); + return ret; + } + ,readMap: function() { + var n = this.readInt(); + if((n & 1) == 0) { + return this.complexObjectsTable[n >> 1]; + } + n >>= 1; + var h = new haxe_ds_EnumValueMap(); + var ret = openfl_utils__$internal_format_amf3_AMF3Value.AMap(h); + this.complexObjectsTable.push(ret); + this.i.readByte(); + var _g = 0; + var _g1 = n; + while(_g < _g1) { + var i = _g++; + h.set(this.read(),this.read()); + } + return ret; + } + ,readArray: function() { + var n = this.readInt(); + if((n & 1) == 0) { + return this.complexObjectsTable[n >> 1]; + } + n >>= 1; + var a = []; + var m = new haxe_ds_StringMap(); + var ret = openfl_utils__$internal_format_amf3_AMF3Value.AArray(a,m); + this.complexObjectsTable.push(ret); + var assocName = openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readString()); + while(assocName.length != 0) { + var v = this.read(); + m.h[assocName] = v; + assocName = openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readString()); + } + var _g = 0; + var _g1 = n; + while(_g < _g1) { + var i = _g++; + a.push(this.read()); + } + return ret; + } + ,readIntVector: function() { + var header = this.readInt(); + if((header & 1) == 0) { + return this.complexObjectsTable[header >> 1]; + } + var len = header >> 1; + var fixed = this.i.readByte() != 0; + var v = openfl_Vector.toIntVector(null,len); + v.fixed = fixed; + var _g = 0; + var _g1 = len; + while(_g < _g1) { + var r = _g++; + v.set(r,this.i.readInt32()); + } + var ret = openfl_utils__$internal_format_amf3_AMF3Value.AIntVector(v); + this.complexObjectsTable.push(ret); + return ret; + } + ,readFloatVector: function() { + var header = this.readInt(); + if((header & 1) == 0) { + return this.complexObjectsTable[header >> 1]; + } + var len = header >> 1; + var fixed = this.i.readByte() != 0; + var v = openfl_Vector.toFloatVector(null,len); + v.fixed = fixed; + var _g = 0; + var _g1 = len; + while(_g < _g1) { + var r = _g++; + v.set(r,this.i.readDouble()); + } + var ret = openfl_utils__$internal_format_amf3_AMF3Value.AFloatVector(v); + this.complexObjectsTable.push(ret); + return ret; + } + ,readObjectVector: function() { + var header = this.readInt(); + if((header & 1) == 0) { + return this.complexObjectsTable[header >> 1]; + } + var len = header >> 1; + var fixed = this.i.readByte() != 0; + var type = openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readString()); + var v = openfl_Vector.toNullVector(null,len); + v.fixed = fixed; + var ret = openfl_utils__$internal_format_amf3_AMF3Value.AObjectVector(v,type); + this.complexObjectsTable.push(ret); + var _g = 0; + var _g1 = len; + while(_g < _g1) { + var r = _g++; + v.set(r,this.read()); + } + return ret; + } + ,readByteArray: function() { + var n = this.readInt(); + if((n & 1) == 0) { + return this.complexObjectsTable[n >> 1]; + } + n >>= 1; + var b = new haxe_io_Bytes(new ArrayBuffer(n)); + var _g = 0; + var _g1 = n; + while(_g < _g1) { + var j = _g++; + var v = this.i.readByte(); + b.b[j] = v & 255; + } + var ba = openfl_utils_ByteArray.fromBytes(b); + ba.__endian = 0; + ba.__amf3Reader = this; + var ret = openfl_utils__$internal_format_amf3_AMF3Value.AByteArray(ba); + this.complexObjectsTable.push(ret); + return ret; + } + ,readInt: function(signExtend,preShift) { + if(preShift == null) { + preShift = 0; + } + if(signExtend == null) { + signExtend = false; + } + var c = this.i.readByte() & 255; + if(c < 128) { + return c >> preShift; + } + var ret = (c & 127) << 7; + c = this.i.readByte() & 255; + if(c < 128) { + return (ret | c) >> preShift; + } + ret |= c & 127; + ret <<= 7; + c = this.i.readByte() & 255; + if(c < 128) { + return (ret | c) >> preShift; + } + ret |= c & 127; + ret <<= 8; + c = this.i.readByte() & 255; + ret |= c; + if(signExtend && (ret & 268435456) != 0) { + ret |= -536870912; + } + return ret >> preShift; + } + ,readString: function() { + var header = this.readInt(); + if((header & 1) == 0) { + var strRefIdx = header >> 1; + return this.stringTable[strRefIdx]; + } + var len = header >> 1; + return this.readStringNoHeader(len); + } + ,readStringNoHeader: function(len) { + if(len == 0) { + return openfl_utils__$internal_format_amf3_AMF3Value.AString(""); + } + var ret = openfl_utils__$internal_format_amf3_AMF3Value.AString(this.i.readString(len,haxe_io_Encoding.UTF8)); + this.stringTable.push(ret); + return ret; + } + ,readDate: function() { + var n = this.readInt(); + if((n & 1) == 0) { + return this.complexObjectsTable[n >> 1]; + } + var date = new Date(this.i.readDouble()); + var ret = openfl_utils__$internal_format_amf3_AMF3Value.ADate(date); + this.complexObjectsTable.push(ret); + return ret; + } + ,readXml: function() { + var n = this.readInt(); + if((n & 1) == 0) { + return this.complexObjectsTable[n >> 1]; + } + n >>= 1; + var xml = Xml.parse(openfl_utils__$internal_format_amf3_AMF3Tools.decode(this.readStringNoHeader(n))); + var ret = openfl_utils__$internal_format_amf3_AMF3Value.AXml(xml); + this.complexObjectsTable.push(ret); + return ret; + } + ,readWithCode: function(id) { + var i = this.i; + switch(id) { + case 0: + return openfl_utils__$internal_format_amf3_AMF3Value.AUndefined; + case 1: + return openfl_utils__$internal_format_amf3_AMF3Value.ANull; + case 2: + return openfl_utils__$internal_format_amf3_AMF3Value.ABool(false); + case 3: + return openfl_utils__$internal_format_amf3_AMF3Value.ABool(true); + case 4: + return openfl_utils__$internal_format_amf3_AMF3Value.AInt(this.readInt(true)); + case 5: + return openfl_utils__$internal_format_amf3_AMF3Value.ANumber(i.readDouble()); + case 6: + return this.readString(); + case 7: + throw haxe_Exception.thrown("XMLDocument unsupported"); + case 8: + return this.readDate(); + case 9: + return this.readArray(); + case 10: + return this.readObject(); + case 11: + return this.readXml(); + case 12: + return this.readByteArray(); + case 13:case 14: + return this.readIntVector(); + case 15: + return this.readFloatVector(); + case 16: + return this.readObjectVector(); + case 17: + return this.readMap(); + default: + throw haxe_Exception.thrown("Unknown AMF " + id); + } + } + ,read: function() { + var byte = this.i.readByte(); + return this.readWithCode(byte); + } + ,__class__: openfl_utils__$internal_format_amf3_AMF3Reader +}; +var openfl_utils__$internal_format_amf3_AMF3ReaderInput = function(r) { + this.i = r.i; + this.r = r; + this.objectEncoding = 3; +}; +$hxClasses["openfl.utils._internal.format.amf3.AMF3ReaderInput"] = openfl_utils__$internal_format_amf3_AMF3ReaderInput; +openfl_utils__$internal_format_amf3_AMF3ReaderInput.__name__ = "openfl.utils._internal.format.amf3.AMF3ReaderInput"; +openfl_utils__$internal_format_amf3_AMF3ReaderInput.__interfaces__ = [openfl_utils_IDataInput]; +openfl_utils__$internal_format_amf3_AMF3ReaderInput.prototype = { + readBoolean: function() { + return this.i.readByte() != 0; + } + ,readByte: function() { + return this.i.readByte(); + } + ,readBytes: function(bytes,offset,length) { + if(length == null) { + length = 0; + } + if(offset == null) { + offset = 0; + } + this.i.readBytes(openfl_utils_ByteArray.toBytes(bytes),offset,length); + } + ,readDouble: function() { + return this.i.readDouble(); + } + ,readFloat: function() { + return this.i.readFloat(); + } + ,readInt: function() { + return this.i.readInt32(); + } + ,readMultiByte: function(length,charSet) { + return this.i.readString(length); + } + ,readObject: function() { + switch(this.objectEncoding) { + case 0: + var reader = new openfl_utils__$internal_format_amf_AMFReader(this.i); + var data = openfl_utils__$internal_format_amf_AMFTools.unwrapValue(reader.read()); + return data; + case 3: + var reader = new openfl_utils__$internal_format_amf3_AMF3Reader(this.i,this.r); + var data = openfl_utils__$internal_format_amf3_AMF3Tools.decode(reader.read()); + return data; + default: + return null; + } + } + ,readShort: function() { + return this.i.readInt16(); + } + ,readUnsignedByte: function() { + return this.i.readByte(); + } + ,readUnsignedInt: function() { + var ch1 = this.i.readByte(); + var ch2 = this.i.readByte(); + var ch3 = this.i.readByte(); + var ch4 = this.i.readByte(); + if(this.get_endian() == 1) { + return ch4 << 24 | ch3 << 16 | ch2 << 8 | ch1; + } else { + return ch1 << 24 | ch2 << 16 | ch3 << 8 | ch4; + } + } + ,readUnsignedShort: function() { + var ch1 = this.i.readByte(); + var ch2 = this.i.readByte(); + if(this.get_endian() == 1) { + return (ch2 << 8) + ch1; + } else { + return ch1 << 8 | ch2; + } + } + ,readUTF: function() { + var bytesCount = this.readUnsignedShort(); + return this.readUTFBytes(bytesCount); + } + ,readUTFBytes: function(length) { + return this.i.readString(length); + } + ,get_bytesAvailable: function() { + return -1; + } + ,get_endian: function() { + if(this.i.bigEndian) { + return 0; + } else { + return 1; + } + } + ,set_endian: function(value) { + return value; + } + ,__class__: openfl_utils__$internal_format_amf3_AMF3ReaderInput + ,__properties__: {set_endian:"set_endian",get_endian:"get_endian",get_bytesAvailable:"get_bytesAvailable"} +}; +var openfl_utils__$internal_format_amf3_AMF3Tools = function() { }; +$hxClasses["openfl.utils._internal.format.amf3.AMF3Tools"] = openfl_utils__$internal_format_amf3_AMF3Tools; +openfl_utils__$internal_format_amf3_AMF3Tools.__name__ = "openfl.utils._internal.format.amf3.AMF3Tools"; +openfl_utils__$internal_format_amf3_AMF3Tools.encode = function(o) { + var _g = Type.typeof(o); + switch(_g._hx_index) { + case 0: + return openfl_utils__$internal_format_amf3_AMF3Value.ANull; + case 1: + return openfl_utils__$internal_format_amf3_AMF3Value.AInt(o); + case 2: + return openfl_utils__$internal_format_amf3_AMF3Value.ANumber(o); + case 3: + return openfl_utils__$internal_format_amf3_AMF3Value.ABool(o); + case 4: + var h = new haxe_ds_StringMap(); + var _g1 = 0; + var _g2 = Reflect.fields(o); + while(_g1 < _g2.length) { + var f = _g2[_g1]; + ++_g1; + var value = openfl_utils__$internal_format_amf3_AMF3Tools.encode(Reflect.field(o,f)); + h.h[f] = value; + } + return openfl_utils__$internal_format_amf3_AMF3Value.AObject(h,null,null); + case 5: + return openfl_utils__$internal_format_amf3_AMF3Value.ANull; + case 6: + var c = _g.c; + switch(c) { + case Array: + var o1 = o; + var a = []; + var _g = 0; + while(_g < o1.length) { + var v = o1[_g]; + ++_g; + a.push(openfl_utils__$internal_format_amf3_AMF3Tools.encode(v)); + } + return openfl_utils__$internal_format_amf3_AMF3Value.AArray(a); + case Date: + return openfl_utils__$internal_format_amf3_AMF3Value.ADate(o); + case String: + return openfl_utils__$internal_format_amf3_AMF3Value.AString(o); + case Xml: + return openfl_utils__$internal_format_amf3_AMF3Value.AXml(o); + case haxe_ds_IntMap:case haxe_ds_ObjectMap:case haxe_ds_StringMap: + var o1 = o; + var h = new haxe_ds_EnumValueMap(); + var h1 = o1.h; + var f_h = h1; + var f_keys = Object.keys(h1); + var f_length = f_keys.length; + var f_current = 0; + while(f_current < f_length) { + var f = f_keys[f_current++]; + h.set(openfl_utils__$internal_format_amf3_AMF3Tools.encode(f),openfl_utils__$internal_format_amf3_AMF3Tools.encode(o1.h[f])); + } + return openfl_utils__$internal_format_amf3_AMF3Value.AMap(h); + case haxe_io_Bytes: + return openfl_utils__$internal_format_amf3_AMF3Value.AByteArray(openfl_utils_ByteArray.fromBytes(o)); + case openfl_utils_ByteArrayData: + return openfl_utils__$internal_format_amf3_AMF3Value.AByteArray(o); + case openfl_utils__$internal_format_amf3_AMF3Array: + var o1 = o; + var a = []; + var m = new haxe_ds_StringMap(); + var _g = 0; + var _g1 = o1.a; + while(_g < _g1.length) { + var v = _g1[_g]; + ++_g; + a.push(openfl_utils__$internal_format_amf3_AMF3Tools.encode(v)); + } + var h = o1.extra.h; + var k_h = h; + var k_keys = Object.keys(h); + var k_length = k_keys.length; + var k_current = 0; + while(k_current < k_length) { + var k = k_h[k_keys[k_current++]]; + var v = openfl_utils__$internal_format_amf3_AMF3Tools.encode(o1.extra.h[k]); + m.h[k] = v; + } + return openfl_utils__$internal_format_amf3_AMF3Value.AArray(a,m); + default: + if(js_Boot.__implements(o,openfl_utils_IExternalizable)) { + return openfl_utils__$internal_format_amf3_AMF3Value.AExternal(o); + } else { + return openfl_utils__$internal_format_amf3_AMF3Value.ANull; + } + } + break; + default: + throw haxe_Exception.thrown("Can't encode " + Std.string(o)); + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.decode = function(a) { + if(a == null) { + return null; + } + switch(a._hx_index) { + case 0: + return openfl_utils__$internal_format_amf3_AMF3Tools.undefined(a); + case 1: + return openfl_utils__$internal_format_amf3_AMF3Tools.anull(a); + case 2: + var _g = a.b; + return openfl_utils__$internal_format_amf3_AMF3Tools.bool(a); + case 3: + var _g = a.i; + return openfl_utils__$internal_format_amf3_AMF3Tools.int(a); + case 4: + var _g = a.f; + return openfl_utils__$internal_format_amf3_AMF3Tools.number(a); + case 5: + var _g = a.s; + return openfl_utils__$internal_format_amf3_AMF3Tools.string(a); + case 6: + var _g = a.d; + return openfl_utils__$internal_format_amf3_AMF3Tools.date(a); + case 7: + var _g = a.fields; + var _g = a.size; + var _g = a.className; + return openfl_utils__$internal_format_amf3_AMF3Tools.object(a); + case 8: + var _g = a.o; + return openfl_utils__$internal_format_amf3_AMF3Tools.external(a); + case 9: + var _g = a.values; + var _g = a.extra; + return openfl_utils__$internal_format_amf3_AMF3Tools.array(a); + case 10: + var _g = a.v; + return openfl_utils__$internal_format_amf3_AMF3Tools.intVector(a); + case 11: + var _g = a.v; + return openfl_utils__$internal_format_amf3_AMF3Tools.floatVector(a); + case 12: + var _g = a.v; + var _g = a.type; + return openfl_utils__$internal_format_amf3_AMF3Tools.objectVector(a); + case 13: + var _g = a.x; + return openfl_utils__$internal_format_amf3_AMF3Tools.xml(a); + case 14: + var _g = a.ba; + return openfl_utils__$internal_format_amf3_AMF3Tools.byteArray(a); + case 15: + var _g = a.m; + return openfl_utils__$internal_format_amf3_AMF3Tools.map(a); + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.undefined = function(a) { + return null; +}; +openfl_utils__$internal_format_amf3_AMF3Tools.anull = function(a) { + return null; +}; +openfl_utils__$internal_format_amf3_AMF3Tools.bool = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 2) { + var b = a.b; + return b; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.int = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 3) { + var n = a.i; + return n; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.number = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 4) { + var n = a.f; + return n; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.string = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 5) { + var s = a.s; + return s; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.date = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 6) { + var d = a.d; + return d; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.array = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 9) { + var a1 = a.values; + var m = a.extra; + var b = []; + var _g = 0; + while(_g < a1.length) { + var f = a1[_g]; + ++_g; + b.push(openfl_utils__$internal_format_amf3_AMF3Tools.decode(f)); + } + return b; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.intVector = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 10) { + var v = a.v; + return v; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.floatVector = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 11) { + var v = a.v; + return v; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.objectVector = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 12) { + var v = a.v; + var type = a.type; + var ret = openfl_Vector.toObjectVector(null,v.get_length(),v.fixed); + var _g = 0; + var _g1 = v.get_length(); + while(_g < _g1) { + var i = _g++; + ret.set(i,openfl_utils__$internal_format_amf3_AMF3Tools.decode(v.get(i))); + } + return ret; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.object = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 7) { + var _g = a.size; + var f = a.fields; + var className = a.className; + var o = null; + if(className != null && className != "") { + var cls = openfl_Lib.getClassByAlias(className); + if(cls == null) { + cls = $hxClasses[className]; + } + if(cls != null) { + o = Type.createInstance(cls,[]); + } + } else { + o = { }; + } + if(o != null && f != null) { + var h = f.h; + var name_h = h; + var name_keys = Object.keys(h); + var name_length = name_keys.length; + var name_current = 0; + while(name_current < name_length) { + var name = name_keys[name_current++]; + Reflect.setProperty(o,name,openfl_utils__$internal_format_amf3_AMF3Tools.decode(f.h[name])); + } + } + return o; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.external = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 8) { + var e = a.o; + return e; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.xml = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 13) { + var x = a.x; + return x; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.byteArray = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 14) { + var b = a.ba; + return b; + } else { + return null; + } +}; +openfl_utils__$internal_format_amf3_AMF3Tools.map = function(a) { + if(a == null) { + return null; + } + if(a._hx_index == 15) { + var m = a.m; + var f = m.keys(); + while(f.hasNext()) { + var f1 = f.next(); + if(typeof(f1) == "number" && ((f1 | 0) === f1)) { + var p = new haxe_ds_IntMap(); + var f2 = m.keys(); + while(f2.hasNext()) { + var f3 = f2.next(); + var key = openfl_utils__$internal_format_amf3_AMF3Tools.decode(f3); + var value = openfl_utils__$internal_format_amf3_AMF3Tools.decode(m.get(f3)); + p.h[key] = value; + } + } else if(typeof(f1) == "string") { + var p1 = new haxe_ds_StringMap(); + var f4 = m.keys(); + while(f4.hasNext()) { + var f5 = f4.next(); + var key1 = openfl_utils__$internal_format_amf3_AMF3Tools.decode(f5); + var value1 = openfl_utils__$internal_format_amf3_AMF3Tools.decode(m.get(f5)); + p1.h[key1] = value1; + } + } else { + var p2 = new haxe_ds_ObjectMap(); + var f6 = m.keys(); + while(f6.hasNext()) { + var f7 = f6.next(); + p2.set(openfl_utils__$internal_format_amf3_AMF3Tools.decode(f7),openfl_utils__$internal_format_amf3_AMF3Tools.decode(m.get(f7))); + } + } + break; + } + return new haxe_ds_ObjectMap(); + } else { + return null; + } +}; +var openfl_utils__$internal_format_amf3_AMF3Value = $hxEnums["openfl.utils._internal.format.amf3.AMF3Value"] = { __ename__:"openfl.utils._internal.format.amf3.AMF3Value",__constructs__:null + ,AUndefined: {_hx_name:"AUndefined",_hx_index:0,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr} + ,ANull: {_hx_name:"ANull",_hx_index:1,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr} + ,ABool: ($_=function(b) { return {_hx_index:2,b:b,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="ABool",$_.__params__ = ["b"],$_) + ,AInt: ($_=function(i) { return {_hx_index:3,i:i,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AInt",$_.__params__ = ["i"],$_) + ,ANumber: ($_=function(f) { return {_hx_index:4,f:f,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="ANumber",$_.__params__ = ["f"],$_) + ,AString: ($_=function(s) { return {_hx_index:5,s:s,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AString",$_.__params__ = ["s"],$_) + ,ADate: ($_=function(d) { return {_hx_index:6,d:d,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="ADate",$_.__params__ = ["d"],$_) + ,AObject: ($_=function(fields,size,className) { return {_hx_index:7,fields:fields,size:size,className:className,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AObject",$_.__params__ = ["fields","size","className"],$_) + ,AExternal: ($_=function(o) { return {_hx_index:8,o:o,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AExternal",$_.__params__ = ["o"],$_) + ,AArray: ($_=function(values,extra) { return {_hx_index:9,values:values,extra:extra,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AArray",$_.__params__ = ["values","extra"],$_) + ,AIntVector: ($_=function(v) { return {_hx_index:10,v:v,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AIntVector",$_.__params__ = ["v"],$_) + ,AFloatVector: ($_=function(v) { return {_hx_index:11,v:v,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AFloatVector",$_.__params__ = ["v"],$_) + ,AObjectVector: ($_=function(v,type) { return {_hx_index:12,v:v,type:type,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AObjectVector",$_.__params__ = ["v","type"],$_) + ,AXml: ($_=function(x) { return {_hx_index:13,x:x,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AXml",$_.__params__ = ["x"],$_) + ,AByteArray: ($_=function(ba) { return {_hx_index:14,ba:ba,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AByteArray",$_.__params__ = ["ba"],$_) + ,AMap: ($_=function(m) { return {_hx_index:15,m:m,__enum__:"openfl.utils._internal.format.amf3.AMF3Value",toString:$estr}; },$_._hx_name="AMap",$_.__params__ = ["m"],$_) +}; +openfl_utils__$internal_format_amf3_AMF3Value.__constructs__ = [openfl_utils__$internal_format_amf3_AMF3Value.AUndefined,openfl_utils__$internal_format_amf3_AMF3Value.ANull,openfl_utils__$internal_format_amf3_AMF3Value.ABool,openfl_utils__$internal_format_amf3_AMF3Value.AInt,openfl_utils__$internal_format_amf3_AMF3Value.ANumber,openfl_utils__$internal_format_amf3_AMF3Value.AString,openfl_utils__$internal_format_amf3_AMF3Value.ADate,openfl_utils__$internal_format_amf3_AMF3Value.AObject,openfl_utils__$internal_format_amf3_AMF3Value.AExternal,openfl_utils__$internal_format_amf3_AMF3Value.AArray,openfl_utils__$internal_format_amf3_AMF3Value.AIntVector,openfl_utils__$internal_format_amf3_AMF3Value.AFloatVector,openfl_utils__$internal_format_amf3_AMF3Value.AObjectVector,openfl_utils__$internal_format_amf3_AMF3Value.AXml,openfl_utils__$internal_format_amf3_AMF3Value.AByteArray,openfl_utils__$internal_format_amf3_AMF3Value.AMap]; +var openfl_utils__$internal_format_amf3_AMF3Writer = function(o) { + this.o = o; + o.set_bigEndian(true); +}; +$hxClasses["openfl.utils._internal.format.amf3.AMF3Writer"] = openfl_utils__$internal_format_amf3_AMF3Writer; +openfl_utils__$internal_format_amf3_AMF3Writer.__name__ = "openfl.utils._internal.format.amf3.AMF3Writer"; +openfl_utils__$internal_format_amf3_AMF3Writer.prototype = { + writeInt: function(i) { + if(i > 268435455 || i < -268435456) { + this.o.writeByte(5); + this.o.writeDouble(i); + } else { + this.o.writeByte(4); + this.writeUInt(i); + } + } + ,writeUInt: function(u,shiftLeft) { + if(shiftLeft == null) { + shiftLeft = false; + } + if(shiftLeft) { + u = u << 1 | 1; + } + if((u >>> 31 & 1) == 1) { + u = u & 536870911; + } + var bits = 22; + var started = false; + var chunk = u >>> bits - 1; + if(UInt.gt(chunk,0)) { + chunk = chunk >>> 1; + this.o.writeByte(chunk | 128); + u = u - (chunk << bits); + ++bits; + started = true; + } + bits -= 8; + chunk = u >>> bits; + if(started || UInt.gt(chunk,0)) { + this.o.writeByte(chunk | 128); + u = u - (chunk << bits); + started = true; + } + bits -= 7; + chunk = u >>> bits; + if(started || UInt.gt(chunk,0)) { + this.o.writeByte(chunk | 128); + u = u - (chunk << bits); + started = true; + } + this.o.writeByte(u); + } + ,writeString: function(s) { + var bytes = haxe_io_Bytes.ofString(s,haxe_io_Encoding.UTF8); + this.writeUInt(bytes.length,true); + this.o.writeBytes(bytes,0,bytes.length); + } + ,writeIntVector: function(v) { + this.writeUInt(v.get_length(),true); + this.o.writeByte(v.fixed ? 1 : 0); + var _g = 0; + var _g1 = v.get_length(); + while(_g < _g1) { + var r = _g++; + this.o.writeInt32(v.get(r)); + } + } + ,writeFloatVector: function(v) { + this.writeUInt(v.get_length(),true); + this.o.writeByte(v.fixed ? 1 : 0); + var _g = 0; + var _g1 = v.get_length(); + while(_g < _g1) { + var r = _g++; + this.o.writeDouble(v.get(r)); + } + } + ,writeObjectVector: function(v,type) { + this.writeUInt(v.get_length(),true); + this.o.writeByte(v.fixed ? 1 : 0); + this.o.writeString(type); + var _g = 0; + var _g1 = v.get_length(); + while(_g < _g1) { + var r = _g++; + this.write(v.get(r)); + } + } + ,writeObject: function(h,size,className) { + if(size == null) { + this.o.writeByte(11); + } else { + this.writeUInt(size << 4 | 3); + } + this.o.writeByte(1); + if(size == null) { + var h1 = h.h; + var f_h = h1; + var f_keys = Object.keys(h1); + var f_length = f_keys.length; + var f_current = 0; + while(f_current < f_length) { + var f = f_keys[f_current++]; + this.writeString(f); + this.write(h.h[f]); + } + this.o.writeByte(1); + } else { + var k = []; + var h1 = h.h; + var f_h = h1; + var f_keys = Object.keys(h1); + var f_length = f_keys.length; + var f_current = 0; + while(f_current < f_length) { + var f = f_keys[f_current++]; + k.push(f); + this.writeString(f); + } + var _g = 0; + var _g1 = k.length; + while(_g < _g1) { + var i = _g++; + this.write(h.h[k[i]]); + } + } + } + ,writeExternal: function(external) { + var isExternal = true; + var isDynamic = false; + var traitsCount = 0; + this.writeUInt(3 | (isExternal ? 4 : 0) | (isDynamic ? 8 : 0) | traitsCount << 4); + var cls = js_Boot.getClass(external); + var className = null; + if(openfl_Lib.__registeredClasses.exists(cls)) { + className = openfl_Lib.__registeredClasses.get(cls); + } + if(className == null) { + className = cls.__name__; + } + this.writeString(className); + var ba = new openfl_utils_ByteArrayData(0); + ba.__endian = 0; + external.writeExternal(ba); + this.o.writeBytes(openfl_utils_ByteArray.toBytes(ba),0,openfl_utils_ByteArray.get_length(ba)); + } + ,write: function(v) { + var o = this.o; + switch(v._hx_index) { + case 0: + o.writeByte(0); + break; + case 1: + o.writeByte(1); + break; + case 2: + var b = v.b; + o.writeByte(b ? 3 : 2); + break; + case 3: + var i = v.i; + this.writeInt(i); + break; + case 4: + var n = v.f; + o.writeByte(5); + o.writeDouble(n); + break; + case 5: + var s = v.s; + o.writeByte(6); + this.writeString(s); + break; + case 6: + var d = v.d; + o.writeByte(8); + o.writeByte(1); + o.writeDouble(d.getTime()); + break; + case 7: + var h = v.fields; + var n = v.size; + var className = v.className; + o.writeByte(10); + this.writeObject(h,n,className); + break; + case 8: + var e = v.o; + o.writeByte(10); + this.writeExternal(e); + break; + case 9: + var a = v.values; + var extra = v.extra; + o.writeByte(9); + this.writeUInt(a.length,true); + if(extra != null) { + var h = extra.h; + var mk_h = h; + var mk_keys = Object.keys(h); + var mk_length = mk_keys.length; + var mk_current = 0; + while(mk_current < mk_length) { + var mk = mk_keys[mk_current++]; + o.writeString(mk); + this.write(extra.h[mk]); + } + } + o.writeByte(1); + var _g = 0; + while(_g < a.length) { + var f = a[_g]; + ++_g; + this.write(f); + } + break; + case 10: + var v1 = v.v; + o.writeByte(13); + this.writeIntVector(v1); + break; + case 11: + var v1 = v.v; + o.writeByte(15); + this.writeFloatVector(v1); + break; + case 12: + var _g = v.type; + var v1 = v.v; + o.writeByte(16); + this.writeObjectVector(v1); + break; + case 13: + var x = v.x; + o.writeByte(11); + this.writeString(haxe_xml_Printer.print(x)); + break; + case 14: + var b = v.ba; + o.writeByte(12); + this.writeUInt(openfl_utils_ByteArray.get_length(b),true); + o.write(openfl_utils_ByteArray.toBytes(b)); + break; + case 15: + var m = v.m; + o.writeByte(17); + this.writeUInt(Lambda.count(m),true); + o.writeByte(0); + var f = m.keys(); + while(f.hasNext()) { + var f1 = f.next(); + this.write(f1); + this.write(m.get(f1)); + } + break; + } + } + ,__class__: openfl_utils__$internal_format_amf3_AMF3Writer +}; +function $getIterator(o) { if( o instanceof Array ) return new haxe_iterators_ArrayIterator(o); else return o.iterator(); } +function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $global.$haxeUID++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = m.bind(o); o.hx__closures__[m.__id__] = f; } return f; } +$global.$haxeUID |= 0; +var _init = lime__$internal_backend_html5_HTML5Application; +var init = lime_app_Application; +if(typeof(performance) != "undefined" ? typeof(performance.now) == "function" : false) { + HxOverrides.now = performance.now.bind(performance); +} +$hxClasses["Math"] = Math; +if( String.fromCodePoint == null ) String.fromCodePoint = function(c) { return c < 0x10000 ? String.fromCharCode(c) : String.fromCharCode((c>>10)+0xD7C0)+String.fromCharCode((c&0x3FF)+0xDC00); } +Object.defineProperty(String.prototype,"__class__",{ value : $hxClasses["String"] = String, enumerable : false, writable : true}); +String.__name__ = "String"; +$hxClasses["Array"] = Array; +Array.__name__ = "Array"; +Date.prototype.__class__ = $hxClasses["Date"] = Date; +Date.__name__ = "Date"; +var Int = { }; +var Dynamic = { }; +var Float = Number; +var Bool = Boolean; +var Class = { }; +var Enum = { }; +js_Boot.__toStr = ({ }).toString; +if(ArrayBuffer.prototype.slice == null) { + ArrayBuffer.prototype.slice = js_lib__$ArrayBuffer_ArrayBufferCompat.sliceImpl; +} +if(typeof window == "undefined") { + $global.onmessage = function(event) { + var job = event.data; + try { + $global.onmessage = ($_=lime__$internal_backend_html5_HTML5Thread.__current,$bind($_,$_.dispatchMessage)); + (lime__$internal_backend_html5_WorkFunction.toFunction(job))(); + } catch( _g ) { + haxe_NativeStackTrace.lastError = _g; + lime__$internal_backend_html5_HTML5Thread.__current.destroy(); + } + }; +} +var array = null; +var vector = null; +var view = null; +var buffer = null; +var len = null; +lime_math_RGBA.__alpha16 = new Uint32Array(256); +var _g = 0; +while(_g < 256) { + var i = _g++; + lime_math_RGBA.__alpha16[i] = Math.ceil(i * 257.003921568627447); +} +var array = null; +var vector = null; +var view = null; +var buffer = null; +var len = null; +lime_math_RGBA.__clamp = new Uint8Array(511); +var _g = 0; +while(_g < 255) { + var i = _g++; + lime_math_RGBA.__clamp[i] = i; +} +var _g = 255; +var _g1 = 511; +while(_g < _g1) { + var i = _g++; + lime_math_RGBA.__clamp[i] = 255; +} +lime_system_CFFI.available = false; +lime_system_CFFI.enabled = false; +lime_utils_Log.level = 3; +if(typeof console == "undefined") { + console = {} +} +if(console.log == null) { + console.log = function() { + }; +} +openfl_display__$internal_CanvasGraphics.hitTestCanvas = js_Browser.get_supported() ? window.document.createElement("canvas") : null; +openfl_display__$internal_CanvasGraphics.hitTestContext = js_Browser.get_supported() ? openfl_display__$internal_CanvasGraphics.hitTestCanvas.getContext("2d") : null; +openfl_Vector.__meta__ = { statics : { toNullVector : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_DisplayObject.__meta__ = { fields : { __cairo : { SuppressWarnings : ["checkstyle:Dynamic"]}, addEventListener : { SuppressWarnings : ["checkstyle:Dynamic"]}, removeEventListener : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_DisplayObject.__broadcastEvents = new haxe_ds_StringMap(); +openfl_display_DisplayObject.__instanceCount = 0; +openfl_display_DisplayObject.__tempStack = new lime_utils_ObjectPool(function() { + return openfl_Vector.toObjectVector(null); +},function(stack) { + stack.set_length(0); +}); +feathers_core_FeathersControl.__meta__ = { fields : { layoutData : { style : null}, disabledAlpha : { style : null}, focusRectSkin : { style : null}, focusPaddingTop : { style : null}, focusPaddingRight : { style : null}, focusPaddingBottom : { style : null}, focusPaddingLeft : { style : null}}}; +feathers_controls_LayoutGroup.__meta__ = { obj : { defaultXmlProperty : ["xmlContent"]}}; +feathers_controls_LayoutGroup.VARIANT_TOOL_BAR = "toolBar"; +openfl_text_Font.__fontByName = new haxe_ds_StringMap(); +openfl_text_Font.__registeredFonts = []; +Xml.Element = 0; +Xml.PCData = 1; +Xml.CData = 2; +Xml.Comment = 3; +Xml.DocType = 4; +Xml.ProcessingInstruction = 5; +Xml.Document = 6; +feathers_controls_BasicButton.__meta__ = { fields : { setSkinForState : { style : null}}}; +feathers_controls_Button.__meta__ = { obj : { defaultXmlProperty : ["text"]}, fields : { setTextFormatForState : { style : null}, setIconForState : { style : null}}}; +feathers_controls_Button.VARIANT_PRIMARY = "primary"; +feathers_controls_Button.VARIANT_DANGER = "danger"; +feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_DECREMENT_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("decrementButtonFactory"); +feathers_controls_supportClasses_BaseScrollBar.INVALIDATION_FLAG_INCREMENT_BUTTON_FACTORY = feathers_core_InvalidationFlag.CUSTOM("incrementButtonFactory"); +feathers_controls_supportClasses_BaseScrollBar.defaultDecrementButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button); +feathers_controls_supportClasses_BaseScrollBar.defaultIncrementButtonFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_Button); +feathers_controls_HScrollBar.CHILD_VARIANT_DECREMENT_BUTTON = "hScrollBar_decrementButton"; +feathers_controls_HScrollBar.CHILD_VARIANT_INCREMENT_BUTTON = "hScrollBar_incrementButton"; +feathers_controls_Label.__meta__ = { obj : { defaultXmlProperty : ["text"]}}; +feathers_controls_Label.VARIANT_HEADING = "heading"; +feathers_controls_Label.VARIANT_DETAIL = "detail"; +feathers_controls_Label.VARIANT_DANGER = "danger"; +feathers_controls_VScrollBar.CHILD_VARIANT_DECREMENT_BUTTON = "vScrollBar_decrementButton"; +feathers_controls_VScrollBar.CHILD_VARIANT_INCREMENT_BUTTON = "vScrollBar_incrementButton"; +feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLLER_FACTORY = feathers_core_InvalidationFlag.CUSTOM("scrollerFactory"); +feathers_controls_supportClasses_BaseScrollContainer.INVALIDATION_FLAG_SCROLL_BAR_FACTORY = feathers_core_InvalidationFlag.CUSTOM("scrollBarFactory"); +feathers_controls_supportClasses_BaseScrollContainer.defaultScrollBarXFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_HScrollBar); +feathers_controls_supportClasses_BaseScrollContainer.defaultScrollBarYFactory = feathers_utils_DisplayObjectFactory.withClass(feathers_controls_VScrollBar); +feathers_controls_ScrollContainer.__meta__ = { obj : { defaultXmlProperty : ["xmlContent"]}}; +feathers_core_DefaultFocusManager.WRAP_OBJECT_HIGH_TAB_INDEX = 2147483647; +feathers_core_DefaultToolTipManager.CHILD_VARIANT_TOOL_TIP = "toolTip"; +feathers_core_FocusManager.stageToManager = new haxe_ds_ObjectMap(); +feathers_core_FocusManager._focusManagerFactory = feathers_core_FocusManager.defaultFocusManagerFactory; +feathers_core_PopUpManager.stageToManager = new haxe_ds_ObjectMap(); +feathers_core_ToolTipManager._toolTipManagerFactory = feathers_core_ToolTipManager.defaultToolTipManagerFactory; +feathers_core_ToolTipManager.stageToManager = new haxe_ds_ObjectMap(); +feathers_core_ValidationQueue.STAGE_TO_VALIDATION_QUEUE = new haxe_ds_ObjectMap(); +openfl_events_Event.ACTIVATE = "activate"; +openfl_events_Event.ADDED = "added"; +openfl_events_Event.ADDED_TO_STAGE = "addedToStage"; +openfl_events_Event.CANCEL = "cancel"; +openfl_events_Event.CHANGE = "change"; +openfl_events_Event.CLEAR = "clear"; +openfl_events_Event.CLOSING = "closing"; +openfl_events_Event.CLOSE = "close"; +openfl_events_Event.COMPLETE = "complete"; +openfl_events_Event.CONNECT = "connect"; +openfl_events_Event.CONTEXT3D_CREATE = "context3DCreate"; +openfl_events_Event.COPY = "copy"; +openfl_events_Event.CUT = "cut"; +openfl_events_Event.DEACTIVATE = "deactivate"; +openfl_events_Event.ENTER_FRAME = "enterFrame"; +openfl_events_Event.EXIT_FRAME = "exitFrame"; +openfl_events_Event.EXITING = "exiting"; +openfl_events_Event.FRAME_CONSTRUCTED = "frameConstructed"; +openfl_events_Event.FRAME_LABEL = "frameLabel"; +openfl_events_Event.FULLSCREEN = "fullScreen"; +openfl_events_Event.ID3 = "id3"; +openfl_events_Event.INIT = "init"; +openfl_events_Event.MOUSE_LEAVE = "mouseLeave"; +openfl_events_Event.OPEN = "open"; +openfl_events_Event.PASTE = "paste"; +openfl_events_Event.REMOVED = "removed"; +openfl_events_Event.REMOVED_FROM_STAGE = "removedFromStage"; +openfl_events_Event.RENDER = "render"; +openfl_events_Event.RESIZE = "resize"; +openfl_events_Event.SCROLL = "scroll"; +openfl_events_Event.SELECT = "select"; +openfl_events_Event.SELECT_ALL = "selectAll"; +openfl_events_Event.SOUND_COMPLETE = "soundComplete"; +openfl_events_Event.TAB_CHILDREN_CHANGE = "tabChildrenChange"; +openfl_events_Event.TAB_ENABLED_CHANGE = "tabEnabledChange"; +openfl_events_Event.TAB_INDEX_CHANGE = "tabIndexChange"; +openfl_events_Event.TEXTURE_READY = "textureReady"; +openfl_events_Event.UNLOAD = "unload"; +feathers_events_FeathersEvent.INITIALIZE = "initialize"; +feathers_events_FeathersEvent.CREATION_COMPLETE = "creationComplete"; +feathers_events_FeathersEvent.LAYOUT_DATA_CHANGE = "layoutDataChange"; +feathers_events_FeathersEvent.STATE_CHANGE = "stateChange"; +feathers_events_FeathersEvent.OPENING = "opening"; +feathers_events_FeathersEvent.CLOSING = "closing"; +feathers_events_FeathersEvent.ENABLE = "enable"; +feathers_events_FeathersEvent.DISABLE = "disable"; +feathers_events_FeathersEvent._pool = new lime_utils_ObjectPool(function() { + return new feathers_events_FeathersEvent(null,false,false); +},function(event) { + event.target = null; + event.currentTarget = null; + event.__preventDefault = false; + event.__isCanceled = false; + event.__isCanceledNow = false; +}); +feathers_events_ScrollEvent.SCROLL_START = "scrollStart"; +feathers_events_ScrollEvent.SCROLL_COMPLETE = "scrollComplete"; +feathers_events_ScrollEvent.SCROLL = "scroll"; +feathers_events_ScrollEvent._pool = new lime_utils_ObjectPool(function() { + return new feathers_events_ScrollEvent(null,false,false); +},function(event) { + event.target = null; + event.currentTarget = null; + event.__preventDefault = false; + event.__isCanceled = false; + event.__isCanceledNow = false; +}); +feathers_events_StyleProviderEvent.STYLES_CHANGE = "stylesChange"; +feathers_events_StyleProviderEvent._pool = new lime_utils_ObjectPool(function() { + return new feathers_events_StyleProviderEvent(null,null); +},function(event) { + event.target = null; + event.currentTarget = null; + event.__preventDefault = false; + event.__isCanceled = false; + event.__isCanceledNow = false; + event.affectsTarget = null; +}); +feathers_events_TransitionEvent.TRANSITION_START = "transitionStart"; +feathers_events_TransitionEvent.TRANSITION_COMPLETE = "transitionComplete"; +feathers_events_TransitionEvent.TRANSITION_CANCEL = "transitionCancel"; +feathers_events_TransitionEvent._pool = new lime_utils_ObjectPool(function() { + return new feathers_events_TransitionEvent(null,null,null,null,null); +},function(event) { + event.previousViewID = null; + event.previousView = null; + event.nextViewID = null; + event.nextView = null; + event.target = null; + event.currentTarget = null; + event.__preventDefault = false; + event.__isCanceled = false; + event.__isCanceledNow = false; +}); +feathers_events_TriggerEvent.TRIGGER = "trigger"; +feathers_events_TriggerEvent._pool = new lime_utils_ObjectPool(function() { + return new feathers_events_TriggerEvent(null); +},function(event) { + event.target = null; + event.currentTarget = null; + event.__preventDefault = false; + event.__isCanceled = false; + event.__isCanceledNow = false; + event.relatedObject = null; +}); +motion_actuators_SimpleActuator.actuators = []; +motion_actuators_SimpleActuator.actuatorsLength = 0; +motion_actuators_SimpleActuator.addedEvent = false; +feathers_motion_transitions_SlideTransitionBuilder.VIEW_REQUIRED_ERROR = "Cannot transition if both old view and new view are null."; +feathers_utils_DeviceUtil.MEDIA_QUERY_DESKTOP = "screen and (hover: hover) and (pointer: fine)"; +feathers_utils_DeviceUtil.MEDIA_QUERY_MOBILE = "screen and (hover: none) and (pointer: coarse)"; +feathers_utils_EdgePuller.MINIMUM_VELOCITY = 0.02; +feathers_utils_EdgePuller.POINTER_ID_MOUSE = -1000; +feathers_utils_ExclusivePointer.stageToObject = new haxe_ds_ObjectMap(); +feathers_utils_Scroller.MINIMUM_VELOCITY = 0.02; +feathers_utils_Scroller.POINTER_ID_MOUSE = -1000; +haxe_Serializer.USE_CACHE = false; +haxe_Serializer.USE_ENUM_INDEX = false; +haxe_Serializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:"; +haxe_Unserializer.DEFAULT_RESOLVER = new haxe__$Unserializer_DefaultResolver(); +haxe_Unserializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:"; +haxe_crypto_Base64.CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +haxe_crypto_Base64.BYTES = haxe_io_Bytes.ofString(haxe_crypto_Base64.CHARS); +haxe_io_FPHelper.i64tmp = new haxe__$Int64__$_$_$Int64(0,0); +haxe_io_FPHelper.helper = new DataView(new ArrayBuffer(8)); +haxe_xml_Parser.escapes = (function($this) { + var $r; + var h = new haxe_ds_StringMap(); + h.h["lt"] = "<"; + h.h["gt"] = ">"; + h.h["amp"] = "&"; + h.h["quot"] = "\""; + h.h["apos"] = "'"; + $r = h; + return $r; +}(this)); +haxe_zip_InflateImpl.LEN_EXTRA_BITS_TBL = [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,-1,-1]; +haxe_zip_InflateImpl.LEN_BASE_VAL_TBL = [3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258]; +haxe_zip_InflateImpl.DIST_EXTRA_BITS_TBL = [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,-1,-1]; +haxe_zip_InflateImpl.DIST_BASE_VAL_TBL = [1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577]; +haxe_zip_InflateImpl.CODE_LENGTHS_POS = [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]; +lime__$internal_backend_html5_HTML5HTTPRequest.OPTION_REVOKE_URL = 1; +lime__$internal_backend_html5_HTML5HTTPRequest.activeRequests = 0; +lime__$internal_backend_html5_HTML5HTTPRequest.requestLimit = 17; +lime__$internal_backend_html5_HTML5HTTPRequest.requestQueue = new haxe_ds_List(); +lime__$internal_backend_html5_Message.PROTOTYPE_FIELD = "__prototype__"; +lime__$internal_backend_html5_Message.SKIP_FIELD = "__skipPrototype__"; +lime__$internal_backend_html5_Message.RESTORE_FIELD = "__restoreFlag__"; +lime__$internal_backend_html5_HTML5Thread.__current = new lime__$internal_backend_html5_HTML5Thread($global.location.href); +lime__$internal_backend_html5_HTML5Thread.__isWorker = typeof window == "undefined"; +lime__$internal_backend_html5_HTML5Thread.__messages = new haxe_ds_List(); +lime__$internal_backend_html5_HTML5Thread.__resolveMethods = new haxe_ds_List(); +lime__$internal_backend_html5_HTML5Thread.__workerCount = 0; +lime__$internal_backend_html5_HTML5Window.dummyCharacter = ""; +lime__$internal_backend_html5_HTML5Window.windowID = 0; +lime__$internal_format_Base64.DICTIONARY = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); +lime__$internal_format_Base64.EXTENDED_DICTIONARY = (function($this) { + var $r; + var result = []; + { + var _g = 0; + var _g1 = lime__$internal_format_Base64.DICTIONARY; + while(_g < _g1.length) { + var a = _g1[_g]; + ++_g; + var _g2 = 0; + var _g3 = lime__$internal_format_Base64.DICTIONARY; + while(_g2 < _g3.length) { + var b = _g3[_g2]; + ++_g2; + result.push(a + b); + } + } + } + $r = result; + return $r; +}(this)); +lime__$internal_graphics_StackBlur.MUL_TABLE = [1,171,205,293,57,373,79,137,241,27,391,357,41,19,283,265,497,469,443,421,25,191,365,349,335,161,155,149,9,278,269,261,505,245,475,231,449,437,213,415,405,395,193,377,369,361,353,345,169,331,325,319,313,307,301,37,145,285,281,69,271,267,263,259,509,501,493,243,479,118,465,459,113,446,55,435,429,423,209,413,51,403,199,393,97,3,379,375,371,367,363,359,355,351,347,43,85,337,333,165,327,323,5,317,157,311,77,305,303,75,297,294,73,289,287,71,141,279,277,275,68,135,67,133,33,262,260,129,511,507,503,499,495,491,61,121,481,477,237,235,467,232,115,457,227,451,7,445,221,439,218,433,215,427,425,211,419,417,207,411,409,203,202,401,399,396,197,49,389,387,385,383,95,189,47,187,93,185,23,183,91,181,45,179,89,177,11,175,87,173,345,343,341,339,337,21,167,83,331,329,327,163,81,323,321,319,159,79,315,313,39,155,309,307,153,305,303,151,75,299,149,37,295,147,73,291,145,289,287,143,285,71,141,281,35,279,139,69,275,137,273,17,271,135,269,267,133,265,33,263,131,261,130,259,129,257,1]; +lime__$internal_graphics_StackBlur.SHG_TABLE = [0,9,10,11,9,12,10,11,12,9,13,13,10,9,13,13,14,14,14,14,10,13,14,14,14,13,13,13,9,14,14,14,15,14,15,14,15,15,14,15,15,15,14,15,15,15,15,15,14,15,15,15,15,15,15,12,14,15,15,13,15,15,15,15,16,16,16,15,16,14,16,16,14,16,13,16,16,16,15,16,13,16,15,16,14,9,16,16,16,16,16,16,16,16,16,13,14,16,16,15,16,16,10,16,15,16,14,16,16,14,16,16,14,16,16,14,15,16,16,16,14,15,14,15,13,16,16,15,17,17,17,17,17,17,14,15,17,17,16,16,17,16,15,17,16,17,11,17,16,17,16,17,16,17,17,16,17,17,16,17,17,16,16,17,17,17,16,14,17,17,17,17,15,16,14,16,15,16,13,16,15,16,14,16,15,16,12,16,15,16,17,17,17,17,17,13,16,15,17,17,17,16,15,17,17,17,16,15,17,17,14,16,17,17,16,17,17,16,15,17,16,14,17,16,15,17,16,17,17,16,17,15,16,17,14,17,16,15,17,16,17,13,17,16,17,17,16,17,14,17,16,17,16,17,16,17,9]; +lime_graphics_cairo_CairoFTFontFace.FT_LOAD_FORCE_AUTOHINT = 32; +lime_graphics_opengl_GL.DEPTH_BUFFER_BIT = 256; +lime_graphics_opengl_GL.STENCIL_BUFFER_BIT = 1024; +lime_graphics_opengl_GL.COLOR_BUFFER_BIT = 16384; +lime_graphics_opengl_GL.POINTS = 0; +lime_graphics_opengl_GL.LINES = 1; +lime_graphics_opengl_GL.LINE_LOOP = 2; +lime_graphics_opengl_GL.LINE_STRIP = 3; +lime_graphics_opengl_GL.TRIANGLES = 4; +lime_graphics_opengl_GL.TRIANGLE_STRIP = 5; +lime_graphics_opengl_GL.TRIANGLE_FAN = 6; +lime_graphics_opengl_GL.ZERO = 0; +lime_graphics_opengl_GL.ONE = 1; +lime_graphics_opengl_GL.SRC_COLOR = 768; +lime_graphics_opengl_GL.ONE_MINUS_SRC_COLOR = 769; +lime_graphics_opengl_GL.SRC_ALPHA = 770; +lime_graphics_opengl_GL.ONE_MINUS_SRC_ALPHA = 771; +lime_graphics_opengl_GL.DST_ALPHA = 772; +lime_graphics_opengl_GL.ONE_MINUS_DST_ALPHA = 773; +lime_graphics_opengl_GL.DST_COLOR = 774; +lime_graphics_opengl_GL.ONE_MINUS_DST_COLOR = 775; +lime_graphics_opengl_GL.SRC_ALPHA_SATURATE = 776; +lime_graphics_opengl_GL.FUNC_ADD = 32774; +lime_graphics_opengl_GL.BLEND_EQUATION = 32777; +lime_graphics_opengl_GL.BLEND_EQUATION_RGB = 32777; +lime_graphics_opengl_GL.BLEND_EQUATION_ALPHA = 34877; +lime_graphics_opengl_GL.FUNC_SUBTRACT = 32778; +lime_graphics_opengl_GL.FUNC_REVERSE_SUBTRACT = 32779; +lime_graphics_opengl_GL.BLEND_DST_RGB = 32968; +lime_graphics_opengl_GL.BLEND_SRC_RGB = 32969; +lime_graphics_opengl_GL.BLEND_DST_ALPHA = 32970; +lime_graphics_opengl_GL.BLEND_SRC_ALPHA = 32971; +lime_graphics_opengl_GL.CONSTANT_COLOR = 32769; +lime_graphics_opengl_GL.ONE_MINUS_CONSTANT_COLOR = 32770; +lime_graphics_opengl_GL.CONSTANT_ALPHA = 32771; +lime_graphics_opengl_GL.ONE_MINUS_CONSTANT_ALPHA = 32772; +lime_graphics_opengl_GL.BLEND_COLOR = 32773; +lime_graphics_opengl_GL.ARRAY_BUFFER = 34962; +lime_graphics_opengl_GL.ELEMENT_ARRAY_BUFFER = 34963; +lime_graphics_opengl_GL.ARRAY_BUFFER_BINDING = 34964; +lime_graphics_opengl_GL.ELEMENT_ARRAY_BUFFER_BINDING = 34965; +lime_graphics_opengl_GL.STREAM_DRAW = 35040; +lime_graphics_opengl_GL.STATIC_DRAW = 35044; +lime_graphics_opengl_GL.DYNAMIC_DRAW = 35048; +lime_graphics_opengl_GL.BUFFER_SIZE = 34660; +lime_graphics_opengl_GL.BUFFER_USAGE = 34661; +lime_graphics_opengl_GL.CURRENT_VERTEX_ATTRIB = 34342; +lime_graphics_opengl_GL.FRONT = 1028; +lime_graphics_opengl_GL.BACK = 1029; +lime_graphics_opengl_GL.FRONT_AND_BACK = 1032; +lime_graphics_opengl_GL.CULL_FACE = 2884; +lime_graphics_opengl_GL.BLEND = 3042; +lime_graphics_opengl_GL.DITHER = 3024; +lime_graphics_opengl_GL.STENCIL_TEST = 2960; +lime_graphics_opengl_GL.DEPTH_TEST = 2929; +lime_graphics_opengl_GL.SCISSOR_TEST = 3089; +lime_graphics_opengl_GL.POLYGON_OFFSET_FILL = 32823; +lime_graphics_opengl_GL.SAMPLE_ALPHA_TO_COVERAGE = 32926; +lime_graphics_opengl_GL.SAMPLE_COVERAGE = 32928; +lime_graphics_opengl_GL.NO_ERROR = 0; +lime_graphics_opengl_GL.INVALID_ENUM = 1280; +lime_graphics_opengl_GL.INVALID_VALUE = 1281; +lime_graphics_opengl_GL.INVALID_OPERATION = 1282; +lime_graphics_opengl_GL.OUT_OF_MEMORY = 1285; +lime_graphics_opengl_GL.CW = 2304; +lime_graphics_opengl_GL.CCW = 2305; +lime_graphics_opengl_GL.LINE_WIDTH = 2849; +lime_graphics_opengl_GL.ALIASED_POINT_SIZE_RANGE = 33901; +lime_graphics_opengl_GL.ALIASED_LINE_WIDTH_RANGE = 33902; +lime_graphics_opengl_GL.CULL_FACE_MODE = 2885; +lime_graphics_opengl_GL.FRONT_FACE = 2886; +lime_graphics_opengl_GL.DEPTH_RANGE = 2928; +lime_graphics_opengl_GL.DEPTH_WRITEMASK = 2930; +lime_graphics_opengl_GL.DEPTH_CLEAR_VALUE = 2931; +lime_graphics_opengl_GL.DEPTH_FUNC = 2932; +lime_graphics_opengl_GL.STENCIL_CLEAR_VALUE = 2961; +lime_graphics_opengl_GL.STENCIL_FUNC = 2962; +lime_graphics_opengl_GL.STENCIL_FAIL = 2964; +lime_graphics_opengl_GL.STENCIL_PASS_DEPTH_FAIL = 2965; +lime_graphics_opengl_GL.STENCIL_PASS_DEPTH_PASS = 2966; +lime_graphics_opengl_GL.STENCIL_REF = 2967; +lime_graphics_opengl_GL.STENCIL_VALUE_MASK = 2963; +lime_graphics_opengl_GL.STENCIL_WRITEMASK = 2968; +lime_graphics_opengl_GL.STENCIL_BACK_FUNC = 34816; +lime_graphics_opengl_GL.STENCIL_BACK_FAIL = 34817; +lime_graphics_opengl_GL.STENCIL_BACK_PASS_DEPTH_FAIL = 34818; +lime_graphics_opengl_GL.STENCIL_BACK_PASS_DEPTH_PASS = 34819; +lime_graphics_opengl_GL.STENCIL_BACK_REF = 36003; +lime_graphics_opengl_GL.STENCIL_BACK_VALUE_MASK = 36004; +lime_graphics_opengl_GL.STENCIL_BACK_WRITEMASK = 36005; +lime_graphics_opengl_GL.VIEWPORT = 2978; +lime_graphics_opengl_GL.SCISSOR_BOX = 3088; +lime_graphics_opengl_GL.COLOR_CLEAR_VALUE = 3106; +lime_graphics_opengl_GL.COLOR_WRITEMASK = 3107; +lime_graphics_opengl_GL.UNPACK_ALIGNMENT = 3317; +lime_graphics_opengl_GL.PACK_ALIGNMENT = 3333; +lime_graphics_opengl_GL.MAX_TEXTURE_SIZE = 3379; +lime_graphics_opengl_GL.MAX_VIEWPORT_DIMS = 3386; +lime_graphics_opengl_GL.SUBPIXEL_BITS = 3408; +lime_graphics_opengl_GL.RED_BITS = 3410; +lime_graphics_opengl_GL.GREEN_BITS = 3411; +lime_graphics_opengl_GL.BLUE_BITS = 3412; +lime_graphics_opengl_GL.ALPHA_BITS = 3413; +lime_graphics_opengl_GL.DEPTH_BITS = 3414; +lime_graphics_opengl_GL.STENCIL_BITS = 3415; +lime_graphics_opengl_GL.POLYGON_OFFSET_UNITS = 10752; +lime_graphics_opengl_GL.POLYGON_OFFSET_FACTOR = 32824; +lime_graphics_opengl_GL.TEXTURE_BINDING_2D = 32873; +lime_graphics_opengl_GL.SAMPLE_BUFFERS = 32936; +lime_graphics_opengl_GL.SAMPLES = 32937; +lime_graphics_opengl_GL.SAMPLE_COVERAGE_VALUE = 32938; +lime_graphics_opengl_GL.SAMPLE_COVERAGE_INVERT = 32939; +lime_graphics_opengl_GL.NUM_COMPRESSED_TEXTURE_FORMATS = 34466; +lime_graphics_opengl_GL.COMPRESSED_TEXTURE_FORMATS = 34467; +lime_graphics_opengl_GL.DONT_CARE = 4352; +lime_graphics_opengl_GL.FASTEST = 4353; +lime_graphics_opengl_GL.NICEST = 4354; +lime_graphics_opengl_GL.GENERATE_MIPMAP_HINT = 33170; +lime_graphics_opengl_GL.BYTE = 5120; +lime_graphics_opengl_GL.UNSIGNED_BYTE = 5121; +lime_graphics_opengl_GL.SHORT = 5122; +lime_graphics_opengl_GL.UNSIGNED_SHORT = 5123; +lime_graphics_opengl_GL.INT = 5124; +lime_graphics_opengl_GL.UNSIGNED_INT = 5125; +lime_graphics_opengl_GL.FLOAT = 5126; +lime_graphics_opengl_GL.DEPTH_COMPONENT = 6402; +lime_graphics_opengl_GL.ALPHA = 6406; +lime_graphics_opengl_GL.RGB = 6407; +lime_graphics_opengl_GL.RGBA = 6408; +lime_graphics_opengl_GL.LUMINANCE = 6409; +lime_graphics_opengl_GL.LUMINANCE_ALPHA = 6410; +lime_graphics_opengl_GL.UNSIGNED_SHORT_4_4_4_4 = 32819; +lime_graphics_opengl_GL.UNSIGNED_SHORT_5_5_5_1 = 32820; +lime_graphics_opengl_GL.UNSIGNED_SHORT_5_6_5 = 33635; +lime_graphics_opengl_GL.FRAGMENT_SHADER = 35632; +lime_graphics_opengl_GL.VERTEX_SHADER = 35633; +lime_graphics_opengl_GL.MAX_VERTEX_ATTRIBS = 34921; +lime_graphics_opengl_GL.MAX_VERTEX_UNIFORM_VECTORS = 36347; +lime_graphics_opengl_GL.MAX_VARYING_VECTORS = 36348; +lime_graphics_opengl_GL.MAX_COMBINED_TEXTURE_IMAGE_UNITS = 35661; +lime_graphics_opengl_GL.MAX_VERTEX_TEXTURE_IMAGE_UNITS = 35660; +lime_graphics_opengl_GL.MAX_TEXTURE_IMAGE_UNITS = 34930; +lime_graphics_opengl_GL.MAX_FRAGMENT_UNIFORM_VECTORS = 36349; +lime_graphics_opengl_GL.SHADER_TYPE = 35663; +lime_graphics_opengl_GL.DELETE_STATUS = 35712; +lime_graphics_opengl_GL.LINK_STATUS = 35714; +lime_graphics_opengl_GL.VALIDATE_STATUS = 35715; +lime_graphics_opengl_GL.ATTACHED_SHADERS = 35717; +lime_graphics_opengl_GL.ACTIVE_UNIFORMS = 35718; +lime_graphics_opengl_GL.ACTIVE_ATTRIBUTES = 35721; +lime_graphics_opengl_GL.SHADING_LANGUAGE_VERSION = 35724; +lime_graphics_opengl_GL.CURRENT_PROGRAM = 35725; +lime_graphics_opengl_GL.NEVER = 512; +lime_graphics_opengl_GL.LESS = 513; +lime_graphics_opengl_GL.EQUAL = 514; +lime_graphics_opengl_GL.LEQUAL = 515; +lime_graphics_opengl_GL.GREATER = 516; +lime_graphics_opengl_GL.NOTEQUAL = 517; +lime_graphics_opengl_GL.GEQUAL = 518; +lime_graphics_opengl_GL.ALWAYS = 519; +lime_graphics_opengl_GL.KEEP = 7680; +lime_graphics_opengl_GL.REPLACE = 7681; +lime_graphics_opengl_GL.INCR = 7682; +lime_graphics_opengl_GL.DECR = 7683; +lime_graphics_opengl_GL.INVERT = 5386; +lime_graphics_opengl_GL.INCR_WRAP = 34055; +lime_graphics_opengl_GL.DECR_WRAP = 34056; +lime_graphics_opengl_GL.VENDOR = 7936; +lime_graphics_opengl_GL.RENDERER = 7937; +lime_graphics_opengl_GL.VERSION = 7938; +lime_graphics_opengl_GL.EXTENSIONS = 7939; +lime_graphics_opengl_GL.NEAREST = 9728; +lime_graphics_opengl_GL.LINEAR = 9729; +lime_graphics_opengl_GL.NEAREST_MIPMAP_NEAREST = 9984; +lime_graphics_opengl_GL.LINEAR_MIPMAP_NEAREST = 9985; +lime_graphics_opengl_GL.NEAREST_MIPMAP_LINEAR = 9986; +lime_graphics_opengl_GL.LINEAR_MIPMAP_LINEAR = 9987; +lime_graphics_opengl_GL.TEXTURE_MAG_FILTER = 10240; +lime_graphics_opengl_GL.TEXTURE_MIN_FILTER = 10241; +lime_graphics_opengl_GL.TEXTURE_WRAP_S = 10242; +lime_graphics_opengl_GL.TEXTURE_WRAP_T = 10243; +lime_graphics_opengl_GL.TEXTURE_2D = 3553; +lime_graphics_opengl_GL.TEXTURE = 5890; +lime_graphics_opengl_GL.TEXTURE_CUBE_MAP = 34067; +lime_graphics_opengl_GL.TEXTURE_BINDING_CUBE_MAP = 34068; +lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_POSITIVE_X = 34069; +lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070; +lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071; +lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072; +lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073; +lime_graphics_opengl_GL.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074; +lime_graphics_opengl_GL.MAX_CUBE_MAP_TEXTURE_SIZE = 34076; +lime_graphics_opengl_GL.TEXTURE0 = 33984; +lime_graphics_opengl_GL.TEXTURE1 = 33985; +lime_graphics_opengl_GL.TEXTURE2 = 33986; +lime_graphics_opengl_GL.TEXTURE3 = 33987; +lime_graphics_opengl_GL.TEXTURE4 = 33988; +lime_graphics_opengl_GL.TEXTURE5 = 33989; +lime_graphics_opengl_GL.TEXTURE6 = 33990; +lime_graphics_opengl_GL.TEXTURE7 = 33991; +lime_graphics_opengl_GL.TEXTURE8 = 33992; +lime_graphics_opengl_GL.TEXTURE9 = 33993; +lime_graphics_opengl_GL.TEXTURE10 = 33994; +lime_graphics_opengl_GL.TEXTURE11 = 33995; +lime_graphics_opengl_GL.TEXTURE12 = 33996; +lime_graphics_opengl_GL.TEXTURE13 = 33997; +lime_graphics_opengl_GL.TEXTURE14 = 33998; +lime_graphics_opengl_GL.TEXTURE15 = 33999; +lime_graphics_opengl_GL.TEXTURE16 = 34000; +lime_graphics_opengl_GL.TEXTURE17 = 34001; +lime_graphics_opengl_GL.TEXTURE18 = 34002; +lime_graphics_opengl_GL.TEXTURE19 = 34003; +lime_graphics_opengl_GL.TEXTURE20 = 34004; +lime_graphics_opengl_GL.TEXTURE21 = 34005; +lime_graphics_opengl_GL.TEXTURE22 = 34006; +lime_graphics_opengl_GL.TEXTURE23 = 34007; +lime_graphics_opengl_GL.TEXTURE24 = 34008; +lime_graphics_opengl_GL.TEXTURE25 = 34009; +lime_graphics_opengl_GL.TEXTURE26 = 34010; +lime_graphics_opengl_GL.TEXTURE27 = 34011; +lime_graphics_opengl_GL.TEXTURE28 = 34012; +lime_graphics_opengl_GL.TEXTURE29 = 34013; +lime_graphics_opengl_GL.TEXTURE30 = 34014; +lime_graphics_opengl_GL.TEXTURE31 = 34015; +lime_graphics_opengl_GL.ACTIVE_TEXTURE = 34016; +lime_graphics_opengl_GL.REPEAT = 10497; +lime_graphics_opengl_GL.CLAMP_TO_EDGE = 33071; +lime_graphics_opengl_GL.MIRRORED_REPEAT = 33648; +lime_graphics_opengl_GL.FLOAT_VEC2 = 35664; +lime_graphics_opengl_GL.FLOAT_VEC3 = 35665; +lime_graphics_opengl_GL.FLOAT_VEC4 = 35666; +lime_graphics_opengl_GL.INT_VEC2 = 35667; +lime_graphics_opengl_GL.INT_VEC3 = 35668; +lime_graphics_opengl_GL.INT_VEC4 = 35669; +lime_graphics_opengl_GL.BOOL = 35670; +lime_graphics_opengl_GL.BOOL_VEC2 = 35671; +lime_graphics_opengl_GL.BOOL_VEC3 = 35672; +lime_graphics_opengl_GL.BOOL_VEC4 = 35673; +lime_graphics_opengl_GL.FLOAT_MAT2 = 35674; +lime_graphics_opengl_GL.FLOAT_MAT3 = 35675; +lime_graphics_opengl_GL.FLOAT_MAT4 = 35676; +lime_graphics_opengl_GL.SAMPLER_2D = 35678; +lime_graphics_opengl_GL.SAMPLER_CUBE = 35680; +lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_ENABLED = 34338; +lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_SIZE = 34339; +lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_STRIDE = 34340; +lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_TYPE = 34341; +lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_NORMALIZED = 34922; +lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_POINTER = 34373; +lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 34975; +lime_graphics_opengl_GL.IMPLEMENTATION_COLOR_READ_TYPE = 35738; +lime_graphics_opengl_GL.IMPLEMENTATION_COLOR_READ_FORMAT = 35739; +lime_graphics_opengl_GL.VERTEX_PROGRAM_POINT_SIZE = 34370; +lime_graphics_opengl_GL.POINT_SPRITE = 34913; +lime_graphics_opengl_GL.COMPILE_STATUS = 35713; +lime_graphics_opengl_GL.LOW_FLOAT = 36336; +lime_graphics_opengl_GL.MEDIUM_FLOAT = 36337; +lime_graphics_opengl_GL.HIGH_FLOAT = 36338; +lime_graphics_opengl_GL.LOW_INT = 36339; +lime_graphics_opengl_GL.MEDIUM_INT = 36340; +lime_graphics_opengl_GL.HIGH_INT = 36341; +lime_graphics_opengl_GL.FRAMEBUFFER = 36160; +lime_graphics_opengl_GL.RENDERBUFFER = 36161; +lime_graphics_opengl_GL.RGBA4 = 32854; +lime_graphics_opengl_GL.RGB5_A1 = 32855; +lime_graphics_opengl_GL.RGB565 = 36194; +lime_graphics_opengl_GL.DEPTH_COMPONENT16 = 33189; +lime_graphics_opengl_GL.STENCIL_INDEX = 6401; +lime_graphics_opengl_GL.STENCIL_INDEX8 = 36168; +lime_graphics_opengl_GL.DEPTH_STENCIL = 34041; +lime_graphics_opengl_GL.RENDERBUFFER_WIDTH = 36162; +lime_graphics_opengl_GL.RENDERBUFFER_HEIGHT = 36163; +lime_graphics_opengl_GL.RENDERBUFFER_INTERNAL_FORMAT = 36164; +lime_graphics_opengl_GL.RENDERBUFFER_RED_SIZE = 36176; +lime_graphics_opengl_GL.RENDERBUFFER_GREEN_SIZE = 36177; +lime_graphics_opengl_GL.RENDERBUFFER_BLUE_SIZE = 36178; +lime_graphics_opengl_GL.RENDERBUFFER_ALPHA_SIZE = 36179; +lime_graphics_opengl_GL.RENDERBUFFER_DEPTH_SIZE = 36180; +lime_graphics_opengl_GL.RENDERBUFFER_STENCIL_SIZE = 36181; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 36048; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 36049; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 36050; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 36051; +lime_graphics_opengl_GL.COLOR_ATTACHMENT0 = 36064; +lime_graphics_opengl_GL.DEPTH_ATTACHMENT = 36096; +lime_graphics_opengl_GL.STENCIL_ATTACHMENT = 36128; +lime_graphics_opengl_GL.DEPTH_STENCIL_ATTACHMENT = 33306; +lime_graphics_opengl_GL.NONE = 0; +lime_graphics_opengl_GL.FRAMEBUFFER_COMPLETE = 36053; +lime_graphics_opengl_GL.FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 36054; +lime_graphics_opengl_GL.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 36055; +lime_graphics_opengl_GL.FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 36057; +lime_graphics_opengl_GL.FRAMEBUFFER_UNSUPPORTED = 36061; +lime_graphics_opengl_GL.FRAMEBUFFER_BINDING = 36006; +lime_graphics_opengl_GL.RENDERBUFFER_BINDING = 36007; +lime_graphics_opengl_GL.MAX_RENDERBUFFER_SIZE = 34024; +lime_graphics_opengl_GL.INVALID_FRAMEBUFFER_OPERATION = 1286; +lime_graphics_opengl_GL.UNPACK_FLIP_Y_WEBGL = 37440; +lime_graphics_opengl_GL.UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441; +lime_graphics_opengl_GL.CONTEXT_LOST_WEBGL = 37442; +lime_graphics_opengl_GL.UNPACK_COLORSPACE_CONVERSION_WEBGL = 37443; +lime_graphics_opengl_GL.BROWSER_DEFAULT_WEBGL = 37444; +lime_graphics_opengl_GL.READ_BUFFER = 3074; +lime_graphics_opengl_GL.UNPACK_ROW_LENGTH = 3314; +lime_graphics_opengl_GL.UNPACK_SKIP_ROWS = 3315; +lime_graphics_opengl_GL.UNPACK_SKIP_PIXELS = 3316; +lime_graphics_opengl_GL.PACK_ROW_LENGTH = 3330; +lime_graphics_opengl_GL.PACK_SKIP_ROWS = 3331; +lime_graphics_opengl_GL.PACK_SKIP_PIXELS = 3332; +lime_graphics_opengl_GL.TEXTURE_BINDING_3D = 32874; +lime_graphics_opengl_GL.UNPACK_SKIP_IMAGES = 32877; +lime_graphics_opengl_GL.UNPACK_IMAGE_HEIGHT = 32878; +lime_graphics_opengl_GL.MAX_3D_TEXTURE_SIZE = 32883; +lime_graphics_opengl_GL.MAX_ELEMENTS_VERTICES = 33000; +lime_graphics_opengl_GL.MAX_ELEMENTS_INDICES = 33001; +lime_graphics_opengl_GL.MAX_TEXTURE_LOD_BIAS = 34045; +lime_graphics_opengl_GL.MAX_FRAGMENT_UNIFORM_COMPONENTS = 35657; +lime_graphics_opengl_GL.MAX_VERTEX_UNIFORM_COMPONENTS = 35658; +lime_graphics_opengl_GL.MAX_ARRAY_TEXTURE_LAYERS = 35071; +lime_graphics_opengl_GL.MIN_PROGRAM_TEXEL_OFFSET = 35076; +lime_graphics_opengl_GL.MAX_PROGRAM_TEXEL_OFFSET = 35077; +lime_graphics_opengl_GL.MAX_VARYING_COMPONENTS = 35659; +lime_graphics_opengl_GL.FRAGMENT_SHADER_DERIVATIVE_HINT = 35723; +lime_graphics_opengl_GL.RASTERIZER_DISCARD = 35977; +lime_graphics_opengl_GL.VERTEX_ARRAY_BINDING = 34229; +lime_graphics_opengl_GL.MAX_VERTEX_OUTPUT_COMPONENTS = 37154; +lime_graphics_opengl_GL.MAX_FRAGMENT_INPUT_COMPONENTS = 37157; +lime_graphics_opengl_GL.MAX_SERVER_WAIT_TIMEOUT = 37137; +lime_graphics_opengl_GL.MAX_ELEMENT_INDEX = 36203; +lime_graphics_opengl_GL.RED = 6403; +lime_graphics_opengl_GL.RGB8 = 32849; +lime_graphics_opengl_GL.RGBA8 = 32856; +lime_graphics_opengl_GL.RGB10_A2 = 32857; +lime_graphics_opengl_GL.TEXTURE_3D = 32879; +lime_graphics_opengl_GL.TEXTURE_WRAP_R = 32882; +lime_graphics_opengl_GL.TEXTURE_MIN_LOD = 33082; +lime_graphics_opengl_GL.TEXTURE_MAX_LOD = 33083; +lime_graphics_opengl_GL.TEXTURE_BASE_LEVEL = 33084; +lime_graphics_opengl_GL.TEXTURE_MAX_LEVEL = 33085; +lime_graphics_opengl_GL.TEXTURE_COMPARE_MODE = 34892; +lime_graphics_opengl_GL.TEXTURE_COMPARE_FUNC = 34893; +lime_graphics_opengl_GL.SRGB = 35904; +lime_graphics_opengl_GL.SRGB8 = 35905; +lime_graphics_opengl_GL.SRGB8_ALPHA8 = 35907; +lime_graphics_opengl_GL.COMPARE_REF_TO_TEXTURE = 34894; +lime_graphics_opengl_GL.RGBA32F = 34836; +lime_graphics_opengl_GL.RGB32F = 34837; +lime_graphics_opengl_GL.RGBA16F = 34842; +lime_graphics_opengl_GL.RGB16F = 34843; +lime_graphics_opengl_GL.TEXTURE_2D_ARRAY = 35866; +lime_graphics_opengl_GL.TEXTURE_BINDING_2D_ARRAY = 35869; +lime_graphics_opengl_GL.R11F_G11F_B10F = 35898; +lime_graphics_opengl_GL.RGB9_E5 = 35901; +lime_graphics_opengl_GL.RGBA32UI = 36208; +lime_graphics_opengl_GL.RGB32UI = 36209; +lime_graphics_opengl_GL.RGBA16UI = 36214; +lime_graphics_opengl_GL.RGB16UI = 36215; +lime_graphics_opengl_GL.RGBA8UI = 36220; +lime_graphics_opengl_GL.RGB8UI = 36221; +lime_graphics_opengl_GL.RGBA32I = 36226; +lime_graphics_opengl_GL.RGB32I = 36227; +lime_graphics_opengl_GL.RGBA16I = 36232; +lime_graphics_opengl_GL.RGB16I = 36233; +lime_graphics_opengl_GL.RGBA8I = 36238; +lime_graphics_opengl_GL.RGB8I = 36239; +lime_graphics_opengl_GL.RED_INTEGER = 36244; +lime_graphics_opengl_GL.RGB_INTEGER = 36248; +lime_graphics_opengl_GL.RGBA_INTEGER = 36249; +lime_graphics_opengl_GL.R8 = 33321; +lime_graphics_opengl_GL.RG8 = 33323; +lime_graphics_opengl_GL.R16F = 33325; +lime_graphics_opengl_GL.R32F = 33326; +lime_graphics_opengl_GL.RG16F = 33327; +lime_graphics_opengl_GL.RG32F = 33328; +lime_graphics_opengl_GL.R8I = 33329; +lime_graphics_opengl_GL.R8UI = 33330; +lime_graphics_opengl_GL.R16I = 33331; +lime_graphics_opengl_GL.R16UI = 33332; +lime_graphics_opengl_GL.R32I = 33333; +lime_graphics_opengl_GL.R32UI = 33334; +lime_graphics_opengl_GL.RG8I = 33335; +lime_graphics_opengl_GL.RG8UI = 33336; +lime_graphics_opengl_GL.RG16I = 33337; +lime_graphics_opengl_GL.RG16UI = 33338; +lime_graphics_opengl_GL.RG32I = 33339; +lime_graphics_opengl_GL.RG32UI = 33340; +lime_graphics_opengl_GL.R8_SNORM = 36756; +lime_graphics_opengl_GL.RG8_SNORM = 36757; +lime_graphics_opengl_GL.RGB8_SNORM = 36758; +lime_graphics_opengl_GL.RGBA8_SNORM = 36759; +lime_graphics_opengl_GL.RGB10_A2UI = 36975; +lime_graphics_opengl_GL.TEXTURE_IMMUTABLE_FORMAT = 37167; +lime_graphics_opengl_GL.TEXTURE_IMMUTABLE_LEVELS = 33503; +lime_graphics_opengl_GL.UNSIGNED_INT_2_10_10_10_REV = 33640; +lime_graphics_opengl_GL.UNSIGNED_INT_10F_11F_11F_REV = 35899; +lime_graphics_opengl_GL.UNSIGNED_INT_5_9_9_9_REV = 35902; +lime_graphics_opengl_GL.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269; +lime_graphics_opengl_GL.UNSIGNED_INT_24_8 = 34042; +lime_graphics_opengl_GL.HALF_FLOAT = 5131; +lime_graphics_opengl_GL.RG = 33319; +lime_graphics_opengl_GL.RG_INTEGER = 33320; +lime_graphics_opengl_GL.INT_2_10_10_10_REV = 36255; +lime_graphics_opengl_GL.CURRENT_QUERY = 34917; +lime_graphics_opengl_GL.QUERY_RESULT = 34918; +lime_graphics_opengl_GL.QUERY_RESULT_AVAILABLE = 34919; +lime_graphics_opengl_GL.ANY_SAMPLES_PASSED = 35887; +lime_graphics_opengl_GL.ANY_SAMPLES_PASSED_CONSERVATIVE = 36202; +lime_graphics_opengl_GL.MAX_DRAW_BUFFERS = 34852; +lime_graphics_opengl_GL.DRAW_BUFFER0 = 34853; +lime_graphics_opengl_GL.DRAW_BUFFER1 = 34854; +lime_graphics_opengl_GL.DRAW_BUFFER2 = 34855; +lime_graphics_opengl_GL.DRAW_BUFFER3 = 34856; +lime_graphics_opengl_GL.DRAW_BUFFER4 = 34857; +lime_graphics_opengl_GL.DRAW_BUFFER5 = 34858; +lime_graphics_opengl_GL.DRAW_BUFFER6 = 34859; +lime_graphics_opengl_GL.DRAW_BUFFER7 = 34860; +lime_graphics_opengl_GL.DRAW_BUFFER8 = 34861; +lime_graphics_opengl_GL.DRAW_BUFFER9 = 34862; +lime_graphics_opengl_GL.DRAW_BUFFER10 = 34863; +lime_graphics_opengl_GL.DRAW_BUFFER11 = 34864; +lime_graphics_opengl_GL.DRAW_BUFFER12 = 34865; +lime_graphics_opengl_GL.DRAW_BUFFER13 = 34866; +lime_graphics_opengl_GL.DRAW_BUFFER14 = 34867; +lime_graphics_opengl_GL.DRAW_BUFFER15 = 34868; +lime_graphics_opengl_GL.MAX_COLOR_ATTACHMENTS = 36063; +lime_graphics_opengl_GL.COLOR_ATTACHMENT1 = 36065; +lime_graphics_opengl_GL.COLOR_ATTACHMENT2 = 36066; +lime_graphics_opengl_GL.COLOR_ATTACHMENT3 = 36067; +lime_graphics_opengl_GL.COLOR_ATTACHMENT4 = 36068; +lime_graphics_opengl_GL.COLOR_ATTACHMENT5 = 36069; +lime_graphics_opengl_GL.COLOR_ATTACHMENT6 = 36070; +lime_graphics_opengl_GL.COLOR_ATTACHMENT7 = 36071; +lime_graphics_opengl_GL.COLOR_ATTACHMENT8 = 36072; +lime_graphics_opengl_GL.COLOR_ATTACHMENT9 = 36073; +lime_graphics_opengl_GL.COLOR_ATTACHMENT10 = 36074; +lime_graphics_opengl_GL.COLOR_ATTACHMENT11 = 36075; +lime_graphics_opengl_GL.COLOR_ATTACHMENT12 = 36076; +lime_graphics_opengl_GL.COLOR_ATTACHMENT13 = 36077; +lime_graphics_opengl_GL.COLOR_ATTACHMENT14 = 36078; +lime_graphics_opengl_GL.COLOR_ATTACHMENT15 = 36079; +lime_graphics_opengl_GL.SAMPLER_3D = 35679; +lime_graphics_opengl_GL.SAMPLER_2D_SHADOW = 35682; +lime_graphics_opengl_GL.SAMPLER_2D_ARRAY = 36289; +lime_graphics_opengl_GL.SAMPLER_2D_ARRAY_SHADOW = 36292; +lime_graphics_opengl_GL.SAMPLER_CUBE_SHADOW = 36293; +lime_graphics_opengl_GL.INT_SAMPLER_2D = 36298; +lime_graphics_opengl_GL.INT_SAMPLER_3D = 36299; +lime_graphics_opengl_GL.INT_SAMPLER_CUBE = 36300; +lime_graphics_opengl_GL.INT_SAMPLER_2D_ARRAY = 36303; +lime_graphics_opengl_GL.UNSIGNED_INT_SAMPLER_2D = 36306; +lime_graphics_opengl_GL.UNSIGNED_INT_SAMPLER_3D = 36307; +lime_graphics_opengl_GL.UNSIGNED_INT_SAMPLER_CUBE = 36308; +lime_graphics_opengl_GL.UNSIGNED_INT_SAMPLER_2D_ARRAY = 36311; +lime_graphics_opengl_GL.MAX_SAMPLES = 36183; +lime_graphics_opengl_GL.SAMPLER_BINDING = 35097; +lime_graphics_opengl_GL.PIXEL_PACK_BUFFER = 35051; +lime_graphics_opengl_GL.PIXEL_UNPACK_BUFFER = 35052; +lime_graphics_opengl_GL.PIXEL_PACK_BUFFER_BINDING = 35053; +lime_graphics_opengl_GL.PIXEL_UNPACK_BUFFER_BINDING = 35055; +lime_graphics_opengl_GL.COPY_READ_BUFFER = 36662; +lime_graphics_opengl_GL.COPY_WRITE_BUFFER = 36663; +lime_graphics_opengl_GL.COPY_READ_BUFFER_BINDING = 36662; +lime_graphics_opengl_GL.COPY_WRITE_BUFFER_BINDING = 36663; +lime_graphics_opengl_GL.FLOAT_MAT2x3 = 35685; +lime_graphics_opengl_GL.FLOAT_MAT2x4 = 35686; +lime_graphics_opengl_GL.FLOAT_MAT3x2 = 35687; +lime_graphics_opengl_GL.FLOAT_MAT3x4 = 35688; +lime_graphics_opengl_GL.FLOAT_MAT4x2 = 35689; +lime_graphics_opengl_GL.FLOAT_MAT4x3 = 35690; +lime_graphics_opengl_GL.UNSIGNED_INT_VEC2 = 36294; +lime_graphics_opengl_GL.UNSIGNED_INT_VEC3 = 36295; +lime_graphics_opengl_GL.UNSIGNED_INT_VEC4 = 36296; +lime_graphics_opengl_GL.UNSIGNED_NORMALIZED = 35863; +lime_graphics_opengl_GL.SIGNED_NORMALIZED = 36764; +lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_INTEGER = 35069; +lime_graphics_opengl_GL.VERTEX_ATTRIB_ARRAY_DIVISOR = 35070; +lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER_MODE = 35967; +lime_graphics_opengl_GL.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 35968; +lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_VARYINGS = 35971; +lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER_START = 35972; +lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER_SIZE = 35973; +lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 35976; +lime_graphics_opengl_GL.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 35978; +lime_graphics_opengl_GL.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 35979; +lime_graphics_opengl_GL.INTERLEAVED_ATTRIBS = 35980; +lime_graphics_opengl_GL.SEPARATE_ATTRIBS = 35981; +lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER = 35982; +lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BUFFER_BINDING = 35983; +lime_graphics_opengl_GL.TRANSFORM_FEEDBACK = 36386; +lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_PAUSED = 36387; +lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_ACTIVE = 36388; +lime_graphics_opengl_GL.TRANSFORM_FEEDBACK_BINDING = 36389; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 33296; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 33297; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_RED_SIZE = 33298; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 33299; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 33300; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 33301; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 33302; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 33303; +lime_graphics_opengl_GL.FRAMEBUFFER_DEFAULT = 33304; +lime_graphics_opengl_GL.DEPTH24_STENCIL8 = 35056; +lime_graphics_opengl_GL.DRAW_FRAMEBUFFER_BINDING = 36006; +lime_graphics_opengl_GL.READ_FRAMEBUFFER = 36008; +lime_graphics_opengl_GL.DRAW_FRAMEBUFFER = 36009; +lime_graphics_opengl_GL.READ_FRAMEBUFFER_BINDING = 36010; +lime_graphics_opengl_GL.RENDERBUFFER_SAMPLES = 36011; +lime_graphics_opengl_GL.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 36052; +lime_graphics_opengl_GL.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 36182; +lime_graphics_opengl_GL.UNIFORM_BUFFER = 35345; +lime_graphics_opengl_GL.UNIFORM_BUFFER_BINDING = 35368; +lime_graphics_opengl_GL.UNIFORM_BUFFER_START = 35369; +lime_graphics_opengl_GL.UNIFORM_BUFFER_SIZE = 35370; +lime_graphics_opengl_GL.MAX_VERTEX_UNIFORM_BLOCKS = 35371; +lime_graphics_opengl_GL.MAX_FRAGMENT_UNIFORM_BLOCKS = 35373; +lime_graphics_opengl_GL.MAX_COMBINED_UNIFORM_BLOCKS = 35374; +lime_graphics_opengl_GL.MAX_UNIFORM_BUFFER_BINDINGS = 35375; +lime_graphics_opengl_GL.MAX_UNIFORM_BLOCK_SIZE = 35376; +lime_graphics_opengl_GL.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 35377; +lime_graphics_opengl_GL.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 35379; +lime_graphics_opengl_GL.UNIFORM_BUFFER_OFFSET_ALIGNMENT = 35380; +lime_graphics_opengl_GL.ACTIVE_UNIFORM_BLOCKS = 35382; +lime_graphics_opengl_GL.UNIFORM_TYPE = 35383; +lime_graphics_opengl_GL.UNIFORM_SIZE = 35384; +lime_graphics_opengl_GL.UNIFORM_BLOCK_INDEX = 35386; +lime_graphics_opengl_GL.UNIFORM_OFFSET = 35387; +lime_graphics_opengl_GL.UNIFORM_ARRAY_STRIDE = 35388; +lime_graphics_opengl_GL.UNIFORM_MATRIX_STRIDE = 35389; +lime_graphics_opengl_GL.UNIFORM_IS_ROW_MAJOR = 35390; +lime_graphics_opengl_GL.UNIFORM_BLOCK_BINDING = 35391; +lime_graphics_opengl_GL.UNIFORM_BLOCK_DATA_SIZE = 35392; +lime_graphics_opengl_GL.UNIFORM_BLOCK_ACTIVE_UNIFORMS = 35394; +lime_graphics_opengl_GL.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 35395; +lime_graphics_opengl_GL.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 35396; +lime_graphics_opengl_GL.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 35398; +lime_graphics_opengl_GL.OBJECT_TYPE = 37138; +lime_graphics_opengl_GL.SYNC_CONDITION = 37139; +lime_graphics_opengl_GL.SYNC_STATUS = 37140; +lime_graphics_opengl_GL.SYNC_FLAGS = 37141; +lime_graphics_opengl_GL.SYNC_FENCE = 37142; +lime_graphics_opengl_GL.SYNC_GPU_COMMANDS_COMPLETE = 37143; +lime_graphics_opengl_GL.UNSIGNALED = 37144; +lime_graphics_opengl_GL.SIGNALED = 37145; +lime_graphics_opengl_GL.ALREADY_SIGNALED = 37146; +lime_graphics_opengl_GL.TIMEOUT_EXPIRED = 37147; +lime_graphics_opengl_GL.CONDITION_SATISFIED = 37148; +lime_graphics_opengl_GL.WAIT_FAILED = 37149; +lime_graphics_opengl_GL.SYNC_FLUSH_COMMANDS_BIT = 1; +lime_graphics_opengl_GL.COLOR = 6144; +lime_graphics_opengl_GL.DEPTH = 6145; +lime_graphics_opengl_GL.STENCIL = 6146; +lime_graphics_opengl_GL.MIN = 32775; +lime_graphics_opengl_GL.MAX = 32776; +lime_graphics_opengl_GL.DEPTH_COMPONENT24 = 33190; +lime_graphics_opengl_GL.STREAM_READ = 35041; +lime_graphics_opengl_GL.STREAM_COPY = 35042; +lime_graphics_opengl_GL.STATIC_READ = 35045; +lime_graphics_opengl_GL.STATIC_COPY = 35046; +lime_graphics_opengl_GL.DYNAMIC_READ = 35049; +lime_graphics_opengl_GL.DYNAMIC_COPY = 35050; +lime_graphics_opengl_GL.DEPTH_COMPONENT32F = 36012; +lime_graphics_opengl_GL.DEPTH32F_STENCIL8 = 36013; +lime_graphics_opengl_GL.INVALID_INDEX = -1; +lime_graphics_opengl_GL.TIMEOUT_IGNORED = -1; +lime_graphics_opengl_GL.MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 37447; +lime_math_ColorMatrix.__identity = [1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0]; +lime_math_Matrix4.__identity = [1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0]; +lime_media_openal_AL.NONE = 0; +lime_media_openal_AL.FALSE = 0; +lime_media_openal_AL.TRUE = 1; +lime_media_openal_AL.SOURCE_RELATIVE = 514; +lime_media_openal_AL.CONE_INNER_ANGLE = 4097; +lime_media_openal_AL.CONE_OUTER_ANGLE = 4098; +lime_media_openal_AL.PITCH = 4099; +lime_media_openal_AL.POSITION = 4100; +lime_media_openal_AL.DIRECTION = 4101; +lime_media_openal_AL.VELOCITY = 4102; +lime_media_openal_AL.LOOPING = 4103; +lime_media_openal_AL.BUFFER = 4105; +lime_media_openal_AL.GAIN = 4106; +lime_media_openal_AL.MIN_GAIN = 4109; +lime_media_openal_AL.MAX_GAIN = 4110; +lime_media_openal_AL.ORIENTATION = 4111; +lime_media_openal_AL.SOURCE_STATE = 4112; +lime_media_openal_AL.INITIAL = 4113; +lime_media_openal_AL.PLAYING = 4114; +lime_media_openal_AL.PAUSED = 4115; +lime_media_openal_AL.STOPPED = 4116; +lime_media_openal_AL.BUFFERS_QUEUED = 4117; +lime_media_openal_AL.BUFFERS_PROCESSED = 4118; +lime_media_openal_AL.REFERENCE_DISTANCE = 4128; +lime_media_openal_AL.ROLLOFF_FACTOR = 4129; +lime_media_openal_AL.CONE_OUTER_GAIN = 4130; +lime_media_openal_AL.MAX_DISTANCE = 4131; +lime_media_openal_AL.SEC_OFFSET = 4132; +lime_media_openal_AL.SAMPLE_OFFSET = 4133; +lime_media_openal_AL.BYTE_OFFSET = 4134; +lime_media_openal_AL.SOURCE_TYPE = 4135; +lime_media_openal_AL.STATIC = 4136; +lime_media_openal_AL.STREAMING = 4137; +lime_media_openal_AL.UNDETERMINED = 4144; +lime_media_openal_AL.FORMAT_MONO8 = 4352; +lime_media_openal_AL.FORMAT_MONO16 = 4353; +lime_media_openal_AL.FORMAT_STEREO8 = 4354; +lime_media_openal_AL.FORMAT_STEREO16 = 4355; +lime_media_openal_AL.FREQUENCY = 8193; +lime_media_openal_AL.BITS = 8194; +lime_media_openal_AL.CHANNELS = 8195; +lime_media_openal_AL.SIZE = 8196; +lime_media_openal_AL.NO_ERROR = 0; +lime_media_openal_AL.INVALID_NAME = 40961; +lime_media_openal_AL.INVALID_ENUM = 40962; +lime_media_openal_AL.INVALID_VALUE = 40963; +lime_media_openal_AL.INVALID_OPERATION = 40964; +lime_media_openal_AL.OUT_OF_MEMORY = 40965; +lime_media_openal_AL.VENDOR = 45057; +lime_media_openal_AL.VERSION = 45058; +lime_media_openal_AL.RENDERER = 45059; +lime_media_openal_AL.EXTENSIONS = 45060; +lime_media_openal_AL.DOPPLER_FACTOR = 49152; +lime_media_openal_AL.SPEED_OF_SOUND = 49155; +lime_media_openal_AL.DOPPLER_VELOCITY = 49153; +lime_media_openal_AL.DISTANCE_MODEL = 53248; +lime_media_openal_AL.INVERSE_DISTANCE = 53249; +lime_media_openal_AL.INVERSE_DISTANCE_CLAMPED = 53250; +lime_media_openal_AL.LINEAR_DISTANCE = 53251; +lime_media_openal_AL.LINEAR_DISTANCE_CLAMPED = 53252; +lime_media_openal_AL.EXPONENT_DISTANCE = 53253; +lime_media_openal_AL.EXPONENT_DISTANCE_CLAMPED = 53254; +lime_media_openal_AL.METERS_PER_UNIT = 131076; +lime_media_openal_AL.DIRECT_FILTER = 131077; +lime_media_openal_AL.AUXILIARY_SEND_FILTER = 131078; +lime_media_openal_AL.AIR_ABSORPTION_FACTOR = 131079; +lime_media_openal_AL.ROOM_ROLLOFF_FACTOR = 131080; +lime_media_openal_AL.CONE_OUTER_GAINHF = 131081; +lime_media_openal_AL.DIRECT_FILTER_GAINHF_AUTO = 131082; +lime_media_openal_AL.AUXILIARY_SEND_FILTER_GAIN_AUTO = 131083; +lime_media_openal_AL.AUXILIARY_SEND_FILTER_GAINHF_AUTO = 131084; +lime_media_openal_AL.REVERB_DENSITY = 1; +lime_media_openal_AL.REVERB_DIFFUSION = 2; +lime_media_openal_AL.REVERB_GAIN = 3; +lime_media_openal_AL.REVERB_GAINHF = 4; +lime_media_openal_AL.REVERB_DECAY_TIME = 5; +lime_media_openal_AL.REVERB_DECAY_HFRATIO = 6; +lime_media_openal_AL.REVERB_REFLECTIONS_GAIN = 7; +lime_media_openal_AL.REVERB_REFLECTIONS_DELAY = 8; +lime_media_openal_AL.REVERB_LATE_REVERB_GAIN = 9; +lime_media_openal_AL.REVERB_LATE_REVERB_DELAY = 10; +lime_media_openal_AL.REVERB_AIR_ABSORPTION_GAINHF = 11; +lime_media_openal_AL.REVERB_ROOM_ROLLOFF_FACTOR = 12; +lime_media_openal_AL.REVERB_DECAY_HFLIMIT = 13; +lime_media_openal_AL.EAXREVERB_DENSITY = 1; +lime_media_openal_AL.EAXREVERB_DIFFUSION = 2; +lime_media_openal_AL.EAXREVERB_GAIN = 3; +lime_media_openal_AL.EAXREVERB_GAINHF = 4; +lime_media_openal_AL.EAXREVERB_GAINLF = 5; +lime_media_openal_AL.EAXREVERB_DECAY_TIME = 6; +lime_media_openal_AL.EAXREVERB_DECAY_HFRATIO = 7; +lime_media_openal_AL.EAXREVERB_DECAY_LFRATIO = 8; +lime_media_openal_AL.EAXREVERB_REFLECTIONS_GAIN = 9; +lime_media_openal_AL.EAXREVERB_REFLECTIONS_DELAY = 10; +lime_media_openal_AL.EAXREVERB_REFLECTIONS_PAN = 11; +lime_media_openal_AL.EAXREVERB_LATE_REVERB_GAIN = 12; +lime_media_openal_AL.EAXREVERB_LATE_REVERB_DELAY = 13; +lime_media_openal_AL.EAXREVERB_LATE_REVERB_PAN = 14; +lime_media_openal_AL.EAXREVERB_ECHO_TIME = 15; +lime_media_openal_AL.EAXREVERB_ECHO_DEPTH = 16; +lime_media_openal_AL.EAXREVERB_MODULATION_TIME = 17; +lime_media_openal_AL.EAXREVERB_MODULATION_DEPTH = 18; +lime_media_openal_AL.EAXREVERB_AIR_ABSORPTION_GAINHF = 19; +lime_media_openal_AL.EAXREVERB_HFREFERENCE = 20; +lime_media_openal_AL.EAXREVERB_LFREFERENCE = 21; +lime_media_openal_AL.EAXREVERB_ROOM_ROLLOFF_FACTOR = 22; +lime_media_openal_AL.EAXREVERB_DECAY_HFLIMIT = 23; +lime_media_openal_AL.CHORUS_WAVEFORM = 1; +lime_media_openal_AL.CHORUS_PHASE = 2; +lime_media_openal_AL.CHORUS_RATE = 3; +lime_media_openal_AL.CHORUS_DEPTH = 4; +lime_media_openal_AL.CHORUS_FEEDBACK = 5; +lime_media_openal_AL.CHORUS_DELAY = 6; +lime_media_openal_AL.DISTORTION_EDGE = 1; +lime_media_openal_AL.DISTORTION_GAIN = 2; +lime_media_openal_AL.DISTORTION_LOWPASS_CUTOFF = 3; +lime_media_openal_AL.DISTORTION_EQCENTER = 4; +lime_media_openal_AL.DISTORTION_EQBANDWIDTH = 5; +lime_media_openal_AL.ECHO_DELAY = 1; +lime_media_openal_AL.ECHO_LRDELAY = 2; +lime_media_openal_AL.ECHO_DAMPING = 3; +lime_media_openal_AL.ECHO_FEEDBACK = 4; +lime_media_openal_AL.ECHO_SPREAD = 5; +lime_media_openal_AL.FLANGER_WAVEFORM = 1; +lime_media_openal_AL.FLANGER_PHASE = 2; +lime_media_openal_AL.FLANGER_RATE = 3; +lime_media_openal_AL.FLANGER_DEPTH = 4; +lime_media_openal_AL.FLANGER_FEEDBACK = 5; +lime_media_openal_AL.FLANGER_DELAY = 6; +lime_media_openal_AL.FREQUENCY_SHIFTER_FREQUENCY = 1; +lime_media_openal_AL.FREQUENCY_SHIFTER_LEFT_DIRECTION = 2; +lime_media_openal_AL.FREQUENCY_SHIFTER_RIGHT_DIRECTION = 3; +lime_media_openal_AL.VOCAL_MORPHER_PHONEMEA = 1; +lime_media_openal_AL.VOCAL_MORPHER_PHONEMEA_COARSE_TUNING = 2; +lime_media_openal_AL.VOCAL_MORPHER_PHONEMEB = 3; +lime_media_openal_AL.VOCAL_MORPHER_PHONEMEB_COARSE_TUNING = 4; +lime_media_openal_AL.VOCAL_MORPHER_WAVEFORM = 5; +lime_media_openal_AL.VOCAL_MORPHER_RATE = 6; +lime_media_openal_AL.PITCH_SHIFTER_COARSE_TUNE = 1; +lime_media_openal_AL.PITCH_SHIFTER_FINE_TUNE = 2; +lime_media_openal_AL.RING_MODULATOR_FREQUENCY = 1; +lime_media_openal_AL.RING_MODULATOR_HIGHPASS_CUTOFF = 2; +lime_media_openal_AL.RING_MODULATOR_WAVEFORM = 3; +lime_media_openal_AL.AUTOWAH_ATTACK_TIME = 1; +lime_media_openal_AL.AUTOWAH_RELEASE_TIME = 2; +lime_media_openal_AL.AUTOWAH_RESONANCE = 3; +lime_media_openal_AL.AUTOWAH_PEAK_GAIN = 4; +lime_media_openal_AL.COMPRESSOR_ONOFF = 1; +lime_media_openal_AL.EQUALIZER_LOW_GAIN = 1; +lime_media_openal_AL.EQUALIZER_LOW_CUTOFF = 2; +lime_media_openal_AL.EQUALIZER_MID1_GAIN = 3; +lime_media_openal_AL.EQUALIZER_MID1_CENTER = 4; +lime_media_openal_AL.EQUALIZER_MID1_WIDTH = 5; +lime_media_openal_AL.EQUALIZER_MID2_GAIN = 6; +lime_media_openal_AL.EQUALIZER_MID2_CENTER = 7; +lime_media_openal_AL.EQUALIZER_MID2_WIDTH = 8; +lime_media_openal_AL.EQUALIZER_HIGH_GAIN = 9; +lime_media_openal_AL.EQUALIZER_HIGH_CUTOFF = 10; +lime_media_openal_AL.EFFECT_FIRST_PARAMETER = 0; +lime_media_openal_AL.EFFECT_LAST_PARAMETER = 32768; +lime_media_openal_AL.EFFECT_TYPE = 32769; +lime_media_openal_AL.EFFECT_NULL = 0; +lime_media_openal_AL.EFFECT_EAXREVERB = 32768; +lime_media_openal_AL.EFFECT_REVERB = 1; +lime_media_openal_AL.EFFECT_CHORUS = 2; +lime_media_openal_AL.EFFECT_DISTORTION = 3; +lime_media_openal_AL.EFFECT_ECHO = 4; +lime_media_openal_AL.EFFECT_FLANGER = 5; +lime_media_openal_AL.EFFECT_FREQUENCY_SHIFTER = 6; +lime_media_openal_AL.EFFECT_VOCAL_MORPHER = 7; +lime_media_openal_AL.EFFECT_PITCH_SHIFTER = 8; +lime_media_openal_AL.EFFECT_RING_MODULATOR = 9; +lime_media_openal_AL.FFECT_AUTOWAH = 10; +lime_media_openal_AL.EFFECT_AUTOWAH = 10; +lime_media_openal_AL.EFFECT_COMPRESSOR = 11; +lime_media_openal_AL.EFFECT_EQUALIZER = 12; +lime_media_openal_AL.EFFECTSLOT_EFFECT = 1; +lime_media_openal_AL.EFFECTSLOT_GAIN = 2; +lime_media_openal_AL.EFFECTSLOT_AUXILIARY_SEND_AUTO = 3; +lime_media_openal_AL.LOWPASS_GAIN = 1; +lime_media_openal_AL.LOWPASS_GAINHF = 2; +lime_media_openal_AL.HIGHPASS_GAIN = 1; +lime_media_openal_AL.HIGHPASS_GAINLF = 2; +lime_media_openal_AL.BANDPASS_GAIN = 1; +lime_media_openal_AL.BANDPASS_GAINLF = 2; +lime_media_openal_AL.BANDPASS_GAINHF = 3; +lime_media_openal_AL.FILTER_FIRST_PARAMETER = 0; +lime_media_openal_AL.FILTER_LAST_PARAMETER = 32768; +lime_media_openal_AL.FILTER_TYPE = 32769; +lime_media_openal_AL.FILTER_NULL = 0; +lime_media_openal_AL.FILTER_LOWPASS = 1; +lime_media_openal_AL.FILTER_HIGHPASS = 2; +lime_media_openal_AL.FILTER_BANDPASS = 3; +lime_media_openal_ALC.FALSE = 0; +lime_media_openal_ALC.TRUE = 1; +lime_media_openal_ALC.FREQUENCY = 4103; +lime_media_openal_ALC.REFRESH = 4104; +lime_media_openal_ALC.SYNC = 4105; +lime_media_openal_ALC.MONO_SOURCES = 4112; +lime_media_openal_ALC.STEREO_SOURCES = 4113; +lime_media_openal_ALC.NO_ERROR = 0; +lime_media_openal_ALC.INVALID_DEVICE = 40961; +lime_media_openal_ALC.INVALID_CONTEXT = 40962; +lime_media_openal_ALC.INVALID_ENUM = 40963; +lime_media_openal_ALC.INVALID_VALUE = 40964; +lime_media_openal_ALC.OUT_OF_MEMORY = 40965; +lime_media_openal_ALC.ATTRIBUTES_SIZE = 4098; +lime_media_openal_ALC.ALL_ATTRIBUTES = 4099; +lime_media_openal_ALC.DEFAULT_DEVICE_SPECIFIER = 4100; +lime_media_openal_ALC.DEVICE_SPECIFIER = 4101; +lime_media_openal_ALC.EXTENSIONS = 4102; +lime_media_openal_ALC.ENUMERATE_ALL_EXT = 1; +lime_media_openal_ALC.DEFAULT_ALL_DEVICES_SPECIFIER = 4114; +lime_media_openal_ALC.ALL_DEVICES_SPECIFIER = 4115; +lime_system_Clipboard.onUpdate = new lime_app__$Event_$Void_$Void(); +lime_system_Clipboard.__updated = false; +lime_system_JNI.alreadyCreated = new haxe_ds_StringMap(); +lime_system_JNI.initialized = false; +lime_system_Sensor.sensorByID = new haxe_ds_IntMap(); +lime_system_Sensor.sensors = []; +lime_system_System.__directories = new haxe_ds_IntMap(); +lime_system_ThreadPool.__mainThread = !(lime__$internal_backend_html5_HTML5Thread.__current.__worker != null || lime__$internal_backend_html5_HTML5Thread.__isWorker) ? lime__$internal_backend_html5_HTML5Thread.__current : null; +lime_system_ThreadPool.workLoad = 0.5; +lime_system_ThreadPool.__totalWorkPriority = 0; +lime_system_JobData.nextID = 0; +lime_ui_Gamepad.devices = new haxe_ds_IntMap(); +lime_ui_Gamepad.onConnect = new lime_app__$Event_$lime_$ui_$Gamepad_$Void(); +lime_ui_GamepadAxis.LEFT_X = 0; +lime_ui_GamepadAxis.LEFT_Y = 1; +lime_ui_GamepadAxis.RIGHT_X = 2; +lime_ui_GamepadAxis.RIGHT_Y = 3; +lime_ui_GamepadAxis.TRIGGER_LEFT = 4; +lime_ui_GamepadAxis.TRIGGER_RIGHT = 5; +lime_ui_GamepadButton.A = 0; +lime_ui_GamepadButton.B = 1; +lime_ui_GamepadButton.X = 2; +lime_ui_GamepadButton.Y = 3; +lime_ui_GamepadButton.BACK = 4; +lime_ui_GamepadButton.GUIDE = 5; +lime_ui_GamepadButton.START = 6; +lime_ui_GamepadButton.LEFT_STICK = 7; +lime_ui_GamepadButton.RIGHT_STICK = 8; +lime_ui_GamepadButton.LEFT_SHOULDER = 9; +lime_ui_GamepadButton.RIGHT_SHOULDER = 10; +lime_ui_GamepadButton.DPAD_UP = 11; +lime_ui_GamepadButton.DPAD_DOWN = 12; +lime_ui_GamepadButton.DPAD_LEFT = 13; +lime_ui_GamepadButton.DPAD_RIGHT = 14; +lime_ui_Joystick.devices = new haxe_ds_IntMap(); +lime_ui_Joystick.onConnect = new lime_app__$Event_$lime_$ui_$Joystick_$Void(); +lime_ui_JoystickHatPosition.CENTER = 0; +lime_ui_JoystickHatPosition.DOWN = 4; +lime_ui_JoystickHatPosition.LEFT = 8; +lime_ui_JoystickHatPosition.RIGHT = 2; +lime_ui_JoystickHatPosition.UP = 1; +lime_ui_JoystickHatPosition.DOWN_LEFT = 12; +lime_ui_JoystickHatPosition.DOWN_RIGHT = 6; +lime_ui_JoystickHatPosition.UP_LEFT = 9; +lime_ui_JoystickHatPosition.UP_RIGHT = 3; +lime_ui_KeyCode.UNKNOWN = 0; +lime_ui_KeyCode.BACKSPACE = 8; +lime_ui_KeyCode.TAB = 9; +lime_ui_KeyCode.RETURN = 13; +lime_ui_KeyCode.ESCAPE = 27; +lime_ui_KeyCode.SPACE = 32; +lime_ui_KeyCode.EXCLAMATION = 33; +lime_ui_KeyCode.QUOTE = 34; +lime_ui_KeyCode.HASH = 35; +lime_ui_KeyCode.DOLLAR = 36; +lime_ui_KeyCode.PERCENT = 37; +lime_ui_KeyCode.AMPERSAND = 38; +lime_ui_KeyCode.SINGLE_QUOTE = 39; +lime_ui_KeyCode.LEFT_PARENTHESIS = 40; +lime_ui_KeyCode.RIGHT_PARENTHESIS = 41; +lime_ui_KeyCode.ASTERISK = 42; +lime_ui_KeyCode.PLUS = 43; +lime_ui_KeyCode.COMMA = 44; +lime_ui_KeyCode.MINUS = 45; +lime_ui_KeyCode.PERIOD = 46; +lime_ui_KeyCode.SLASH = 47; +lime_ui_KeyCode.NUMBER_0 = 48; +lime_ui_KeyCode.NUMBER_1 = 49; +lime_ui_KeyCode.NUMBER_2 = 50; +lime_ui_KeyCode.NUMBER_3 = 51; +lime_ui_KeyCode.NUMBER_4 = 52; +lime_ui_KeyCode.NUMBER_5 = 53; +lime_ui_KeyCode.NUMBER_6 = 54; +lime_ui_KeyCode.NUMBER_7 = 55; +lime_ui_KeyCode.NUMBER_8 = 56; +lime_ui_KeyCode.NUMBER_9 = 57; +lime_ui_KeyCode.COLON = 58; +lime_ui_KeyCode.SEMICOLON = 59; +lime_ui_KeyCode.LESS_THAN = 60; +lime_ui_KeyCode.EQUALS = 61; +lime_ui_KeyCode.GREATER_THAN = 62; +lime_ui_KeyCode.QUESTION = 63; +lime_ui_KeyCode.AT = 64; +lime_ui_KeyCode.LEFT_BRACKET = 91; +lime_ui_KeyCode.BACKSLASH = 92; +lime_ui_KeyCode.RIGHT_BRACKET = 93; +lime_ui_KeyCode.CARET = 94; +lime_ui_KeyCode.UNDERSCORE = 95; +lime_ui_KeyCode.GRAVE = 96; +lime_ui_KeyCode.A = 97; +lime_ui_KeyCode.B = 98; +lime_ui_KeyCode.C = 99; +lime_ui_KeyCode.D = 100; +lime_ui_KeyCode.E = 101; +lime_ui_KeyCode.F = 102; +lime_ui_KeyCode.G = 103; +lime_ui_KeyCode.H = 104; +lime_ui_KeyCode.I = 105; +lime_ui_KeyCode.J = 106; +lime_ui_KeyCode.K = 107; +lime_ui_KeyCode.L = 108; +lime_ui_KeyCode.M = 109; +lime_ui_KeyCode.N = 110; +lime_ui_KeyCode.O = 111; +lime_ui_KeyCode.P = 112; +lime_ui_KeyCode.Q = 113; +lime_ui_KeyCode.R = 114; +lime_ui_KeyCode.S = 115; +lime_ui_KeyCode.T = 116; +lime_ui_KeyCode.U = 117; +lime_ui_KeyCode.V = 118; +lime_ui_KeyCode.W = 119; +lime_ui_KeyCode.X = 120; +lime_ui_KeyCode.Y = 121; +lime_ui_KeyCode.Z = 122; +lime_ui_KeyCode.DELETE = 127; +lime_ui_KeyCode.CAPS_LOCK = 1073741881; +lime_ui_KeyCode.F1 = 1073741882; +lime_ui_KeyCode.F2 = 1073741883; +lime_ui_KeyCode.F3 = 1073741884; +lime_ui_KeyCode.F4 = 1073741885; +lime_ui_KeyCode.F5 = 1073741886; +lime_ui_KeyCode.F6 = 1073741887; +lime_ui_KeyCode.F7 = 1073741888; +lime_ui_KeyCode.F8 = 1073741889; +lime_ui_KeyCode.F9 = 1073741890; +lime_ui_KeyCode.F10 = 1073741891; +lime_ui_KeyCode.F11 = 1073741892; +lime_ui_KeyCode.F12 = 1073741893; +lime_ui_KeyCode.PRINT_SCREEN = 1073741894; +lime_ui_KeyCode.SCROLL_LOCK = 1073741895; +lime_ui_KeyCode.PAUSE = 1073741896; +lime_ui_KeyCode.INSERT = 1073741897; +lime_ui_KeyCode.HOME = 1073741898; +lime_ui_KeyCode.PAGE_UP = 1073741899; +lime_ui_KeyCode.END = 1073741901; +lime_ui_KeyCode.PAGE_DOWN = 1073741902; +lime_ui_KeyCode.RIGHT = 1073741903; +lime_ui_KeyCode.LEFT = 1073741904; +lime_ui_KeyCode.DOWN = 1073741905; +lime_ui_KeyCode.UP = 1073741906; +lime_ui_KeyCode.NUM_LOCK = 1073741907; +lime_ui_KeyCode.NUMPAD_DIVIDE = 1073741908; +lime_ui_KeyCode.NUMPAD_MULTIPLY = 1073741909; +lime_ui_KeyCode.NUMPAD_MINUS = 1073741910; +lime_ui_KeyCode.NUMPAD_PLUS = 1073741911; +lime_ui_KeyCode.NUMPAD_ENTER = 1073741912; +lime_ui_KeyCode.NUMPAD_1 = 1073741913; +lime_ui_KeyCode.NUMPAD_2 = 1073741914; +lime_ui_KeyCode.NUMPAD_3 = 1073741915; +lime_ui_KeyCode.NUMPAD_4 = 1073741916; +lime_ui_KeyCode.NUMPAD_5 = 1073741917; +lime_ui_KeyCode.NUMPAD_6 = 1073741918; +lime_ui_KeyCode.NUMPAD_7 = 1073741919; +lime_ui_KeyCode.NUMPAD_8 = 1073741920; +lime_ui_KeyCode.NUMPAD_9 = 1073741921; +lime_ui_KeyCode.NUMPAD_0 = 1073741922; +lime_ui_KeyCode.NUMPAD_PERIOD = 1073741923; +lime_ui_KeyCode.APPLICATION = 1073741925; +lime_ui_KeyCode.POWER = 1073741926; +lime_ui_KeyCode.NUMPAD_EQUALS = 1073741927; +lime_ui_KeyCode.F13 = 1073741928; +lime_ui_KeyCode.F14 = 1073741929; +lime_ui_KeyCode.F15 = 1073741930; +lime_ui_KeyCode.F16 = 1073741931; +lime_ui_KeyCode.F17 = 1073741932; +lime_ui_KeyCode.F18 = 1073741933; +lime_ui_KeyCode.F19 = 1073741934; +lime_ui_KeyCode.F20 = 1073741935; +lime_ui_KeyCode.F21 = 1073741936; +lime_ui_KeyCode.F22 = 1073741937; +lime_ui_KeyCode.F23 = 1073741938; +lime_ui_KeyCode.F24 = 1073741939; +lime_ui_KeyCode.EXECUTE = 1073741940; +lime_ui_KeyCode.HELP = 1073741941; +lime_ui_KeyCode.MENU = 1073741942; +lime_ui_KeyCode.SELECT = 1073741943; +lime_ui_KeyCode.STOP = 1073741944; +lime_ui_KeyCode.AGAIN = 1073741945; +lime_ui_KeyCode.UNDO = 1073741946; +lime_ui_KeyCode.CUT = 1073741947; +lime_ui_KeyCode.COPY = 1073741948; +lime_ui_KeyCode.PASTE = 1073741949; +lime_ui_KeyCode.FIND = 1073741950; +lime_ui_KeyCode.MUTE = 1073741951; +lime_ui_KeyCode.VOLUME_UP = 1073741952; +lime_ui_KeyCode.VOLUME_DOWN = 1073741953; +lime_ui_KeyCode.NUMPAD_COMMA = 1073741957; +lime_ui_KeyCode.ALT_ERASE = 1073741977; +lime_ui_KeyCode.SYSTEM_REQUEST = 1073741978; +lime_ui_KeyCode.CANCEL = 1073741979; +lime_ui_KeyCode.CLEAR = 1073741980; +lime_ui_KeyCode.PRIOR = 1073741981; +lime_ui_KeyCode.RETURN2 = 1073741982; +lime_ui_KeyCode.SEPARATOR = 1073741983; +lime_ui_KeyCode.OUT = 1073741984; +lime_ui_KeyCode.OPER = 1073741985; +lime_ui_KeyCode.CLEAR_AGAIN = 1073741986; +lime_ui_KeyCode.CRSEL = 1073741987; +lime_ui_KeyCode.EXSEL = 1073741988; +lime_ui_KeyCode.NUMPAD_00 = 1073742000; +lime_ui_KeyCode.NUMPAD_000 = 1073742001; +lime_ui_KeyCode.THOUSAND_SEPARATOR = 1073742002; +lime_ui_KeyCode.DECIMAL_SEPARATOR = 1073742003; +lime_ui_KeyCode.CURRENCY_UNIT = 1073742004; +lime_ui_KeyCode.CURRENCY_SUBUNIT = 1073742005; +lime_ui_KeyCode.NUMPAD_LEFT_PARENTHESIS = 1073742006; +lime_ui_KeyCode.NUMPAD_RIGHT_PARENTHESIS = 1073742007; +lime_ui_KeyCode.NUMPAD_LEFT_BRACE = 1073742008; +lime_ui_KeyCode.NUMPAD_RIGHT_BRACE = 1073742009; +lime_ui_KeyCode.NUMPAD_TAB = 1073742010; +lime_ui_KeyCode.NUMPAD_BACKSPACE = 1073742011; +lime_ui_KeyCode.NUMPAD_A = 1073742012; +lime_ui_KeyCode.NUMPAD_B = 1073742013; +lime_ui_KeyCode.NUMPAD_C = 1073742014; +lime_ui_KeyCode.NUMPAD_D = 1073742015; +lime_ui_KeyCode.NUMPAD_E = 1073742016; +lime_ui_KeyCode.NUMPAD_F = 1073742017; +lime_ui_KeyCode.NUMPAD_XOR = 1073742018; +lime_ui_KeyCode.NUMPAD_POWER = 1073742019; +lime_ui_KeyCode.NUMPAD_PERCENT = 1073742020; +lime_ui_KeyCode.NUMPAD_LESS_THAN = 1073742021; +lime_ui_KeyCode.NUMPAD_GREATER_THAN = 1073742022; +lime_ui_KeyCode.NUMPAD_AMPERSAND = 1073742023; +lime_ui_KeyCode.NUMPAD_DOUBLE_AMPERSAND = 1073742024; +lime_ui_KeyCode.NUMPAD_VERTICAL_BAR = 1073742025; +lime_ui_KeyCode.NUMPAD_DOUBLE_VERTICAL_BAR = 1073742026; +lime_ui_KeyCode.NUMPAD_COLON = 1073742027; +lime_ui_KeyCode.NUMPAD_HASH = 1073742028; +lime_ui_KeyCode.NUMPAD_SPACE = 1073742029; +lime_ui_KeyCode.NUMPAD_AT = 1073742030; +lime_ui_KeyCode.NUMPAD_EXCLAMATION = 1073742031; +lime_ui_KeyCode.NUMPAD_MEM_STORE = 1073742032; +lime_ui_KeyCode.NUMPAD_MEM_RECALL = 1073742033; +lime_ui_KeyCode.NUMPAD_MEM_CLEAR = 1073742034; +lime_ui_KeyCode.NUMPAD_MEM_ADD = 1073742035; +lime_ui_KeyCode.NUMPAD_MEM_SUBTRACT = 1073742036; +lime_ui_KeyCode.NUMPAD_MEM_MULTIPLY = 1073742037; +lime_ui_KeyCode.NUMPAD_MEM_DIVIDE = 1073742038; +lime_ui_KeyCode.NUMPAD_PLUS_MINUS = 1073742039; +lime_ui_KeyCode.NUMPAD_CLEAR = 1073742040; +lime_ui_KeyCode.NUMPAD_CLEAR_ENTRY = 1073742041; +lime_ui_KeyCode.NUMPAD_BINARY = 1073742042; +lime_ui_KeyCode.NUMPAD_OCTAL = 1073742043; +lime_ui_KeyCode.NUMPAD_DECIMAL = 1073742044; +lime_ui_KeyCode.NUMPAD_HEXADECIMAL = 1073742045; +lime_ui_KeyCode.LEFT_CTRL = 1073742048; +lime_ui_KeyCode.LEFT_SHIFT = 1073742049; +lime_ui_KeyCode.LEFT_ALT = 1073742050; +lime_ui_KeyCode.LEFT_META = 1073742051; +lime_ui_KeyCode.RIGHT_CTRL = 1073742052; +lime_ui_KeyCode.RIGHT_SHIFT = 1073742053; +lime_ui_KeyCode.RIGHT_ALT = 1073742054; +lime_ui_KeyCode.RIGHT_META = 1073742055; +lime_ui_KeyCode.MODE = 1073742081; +lime_ui_KeyCode.AUDIO_NEXT = 1073742082; +lime_ui_KeyCode.AUDIO_PREVIOUS = 1073742083; +lime_ui_KeyCode.AUDIO_STOP = 1073742084; +lime_ui_KeyCode.AUDIO_PLAY = 1073742085; +lime_ui_KeyCode.AUDIO_MUTE = 1073742086; +lime_ui_KeyCode.MEDIA_SELECT = 1073742087; +lime_ui_KeyCode.WWW = 1073742088; +lime_ui_KeyCode.MAIL = 1073742089; +lime_ui_KeyCode.CALCULATOR = 1073742090; +lime_ui_KeyCode.COMPUTER = 1073742091; +lime_ui_KeyCode.APP_CONTROL_SEARCH = 1073742092; +lime_ui_KeyCode.APP_CONTROL_HOME = 1073742093; +lime_ui_KeyCode.APP_CONTROL_BACK = 1073742094; +lime_ui_KeyCode.APP_CONTROL_FORWARD = 1073742095; +lime_ui_KeyCode.APP_CONTROL_STOP = 1073742096; +lime_ui_KeyCode.APP_CONTROL_REFRESH = 1073742097; +lime_ui_KeyCode.APP_CONTROL_BOOKMARKS = 1073742098; +lime_ui_KeyCode.BRIGHTNESS_DOWN = 1073742099; +lime_ui_KeyCode.BRIGHTNESS_UP = 1073742100; +lime_ui_KeyCode.DISPLAY_SWITCH = 1073742101; +lime_ui_KeyCode.BACKLIGHT_TOGGLE = 1073742102; +lime_ui_KeyCode.BACKLIGHT_DOWN = 1073742103; +lime_ui_KeyCode.BACKLIGHT_UP = 1073742104; +lime_ui_KeyCode.EJECT = 1073742105; +lime_ui_KeyCode.SLEEP = 1073742106; +lime_ui_KeyModifier.NONE = 0; +lime_ui_KeyModifier.LEFT_SHIFT = 1; +lime_ui_KeyModifier.RIGHT_SHIFT = 2; +lime_ui_KeyModifier.LEFT_CTRL = 64; +lime_ui_KeyModifier.RIGHT_CTRL = 128; +lime_ui_KeyModifier.LEFT_ALT = 256; +lime_ui_KeyModifier.RIGHT_ALT = 512; +lime_ui_KeyModifier.LEFT_META = 1024; +lime_ui_KeyModifier.RIGHT_META = 2048; +lime_ui_KeyModifier.NUM_LOCK = 4096; +lime_ui_KeyModifier.CAPS_LOCK = 8192; +lime_ui_KeyModifier.MODE = 16384; +lime_ui_KeyModifier.CTRL = 192; +lime_ui_KeyModifier.SHIFT = 3; +lime_ui_KeyModifier.ALT = 768; +lime_ui_KeyModifier.META = 3072; +lime_ui_ScanCode.UNKNOWN = 0; +lime_ui_ScanCode.BACKSPACE = 42; +lime_ui_ScanCode.TAB = 43; +lime_ui_ScanCode.RETURN = 40; +lime_ui_ScanCode.ESCAPE = 41; +lime_ui_ScanCode.SPACE = 44; +lime_ui_ScanCode.SINGLE_QUOTE = 52; +lime_ui_ScanCode.COMMA = 54; +lime_ui_ScanCode.MINUS = 45; +lime_ui_ScanCode.PERIOD = 55; +lime_ui_ScanCode.SLASH = 56; +lime_ui_ScanCode.NUMBER_0 = 39; +lime_ui_ScanCode.NUMBER_1 = 30; +lime_ui_ScanCode.NUMBER_2 = 31; +lime_ui_ScanCode.NUMBER_3 = 32; +lime_ui_ScanCode.NUMBER_4 = 33; +lime_ui_ScanCode.NUMBER_5 = 34; +lime_ui_ScanCode.NUMBER_6 = 35; +lime_ui_ScanCode.NUMBER_7 = 36; +lime_ui_ScanCode.NUMBER_8 = 37; +lime_ui_ScanCode.NUMBER_9 = 38; +lime_ui_ScanCode.SEMICOLON = 51; +lime_ui_ScanCode.EQUALS = 46; +lime_ui_ScanCode.LEFT_BRACKET = 47; +lime_ui_ScanCode.BACKSLASH = 49; +lime_ui_ScanCode.RIGHT_BRACKET = 48; +lime_ui_ScanCode.GRAVE = 53; +lime_ui_ScanCode.A = 4; +lime_ui_ScanCode.B = 5; +lime_ui_ScanCode.C = 6; +lime_ui_ScanCode.D = 7; +lime_ui_ScanCode.E = 8; +lime_ui_ScanCode.F = 9; +lime_ui_ScanCode.G = 10; +lime_ui_ScanCode.H = 11; +lime_ui_ScanCode.I = 12; +lime_ui_ScanCode.J = 13; +lime_ui_ScanCode.K = 14; +lime_ui_ScanCode.L = 15; +lime_ui_ScanCode.M = 16; +lime_ui_ScanCode.N = 17; +lime_ui_ScanCode.O = 18; +lime_ui_ScanCode.P = 19; +lime_ui_ScanCode.Q = 20; +lime_ui_ScanCode.R = 21; +lime_ui_ScanCode.S = 22; +lime_ui_ScanCode.T = 23; +lime_ui_ScanCode.U = 24; +lime_ui_ScanCode.V = 25; +lime_ui_ScanCode.W = 26; +lime_ui_ScanCode.X = 27; +lime_ui_ScanCode.Y = 28; +lime_ui_ScanCode.Z = 29; +lime_ui_ScanCode.DELETE = 76; +lime_ui_ScanCode.CAPS_LOCK = 57; +lime_ui_ScanCode.F1 = 58; +lime_ui_ScanCode.F2 = 59; +lime_ui_ScanCode.F3 = 60; +lime_ui_ScanCode.F4 = 61; +lime_ui_ScanCode.F5 = 62; +lime_ui_ScanCode.F6 = 63; +lime_ui_ScanCode.F7 = 64; +lime_ui_ScanCode.F8 = 65; +lime_ui_ScanCode.F9 = 66; +lime_ui_ScanCode.F10 = 67; +lime_ui_ScanCode.F11 = 68; +lime_ui_ScanCode.F12 = 69; +lime_ui_ScanCode.PRINT_SCREEN = 70; +lime_ui_ScanCode.SCROLL_LOCK = 71; +lime_ui_ScanCode.PAUSE = 72; +lime_ui_ScanCode.INSERT = 73; +lime_ui_ScanCode.HOME = 74; +lime_ui_ScanCode.PAGE_UP = 75; +lime_ui_ScanCode.END = 77; +lime_ui_ScanCode.PAGE_DOWN = 78; +lime_ui_ScanCode.RIGHT = 79; +lime_ui_ScanCode.LEFT = 80; +lime_ui_ScanCode.DOWN = 81; +lime_ui_ScanCode.UP = 82; +lime_ui_ScanCode.NUM_LOCK = 83; +lime_ui_ScanCode.NUMPAD_DIVIDE = 84; +lime_ui_ScanCode.NUMPAD_MULTIPLY = 85; +lime_ui_ScanCode.NUMPAD_MINUS = 86; +lime_ui_ScanCode.NUMPAD_PLUS = 87; +lime_ui_ScanCode.NUMPAD_ENTER = 88; +lime_ui_ScanCode.NUMPAD_1 = 89; +lime_ui_ScanCode.NUMPAD_2 = 90; +lime_ui_ScanCode.NUMPAD_3 = 91; +lime_ui_ScanCode.NUMPAD_4 = 92; +lime_ui_ScanCode.NUMPAD_5 = 93; +lime_ui_ScanCode.NUMPAD_6 = 94; +lime_ui_ScanCode.NUMPAD_7 = 95; +lime_ui_ScanCode.NUMPAD_8 = 96; +lime_ui_ScanCode.NUMPAD_9 = 97; +lime_ui_ScanCode.NUMPAD_0 = 98; +lime_ui_ScanCode.NUMPAD_PERIOD = 99; +lime_ui_ScanCode.APPLICATION = 101; +lime_ui_ScanCode.POWER = 102; +lime_ui_ScanCode.NUMPAD_EQUALS = 103; +lime_ui_ScanCode.F13 = 104; +lime_ui_ScanCode.F14 = 105; +lime_ui_ScanCode.F15 = 106; +lime_ui_ScanCode.F16 = 107; +lime_ui_ScanCode.F17 = 108; +lime_ui_ScanCode.F18 = 109; +lime_ui_ScanCode.F19 = 110; +lime_ui_ScanCode.F20 = 111; +lime_ui_ScanCode.F21 = 112; +lime_ui_ScanCode.F22 = 113; +lime_ui_ScanCode.F23 = 114; +lime_ui_ScanCode.F24 = 115; +lime_ui_ScanCode.EXECUTE = 116; +lime_ui_ScanCode.HELP = 117; +lime_ui_ScanCode.MENU = 118; +lime_ui_ScanCode.SELECT = 119; +lime_ui_ScanCode.STOP = 120; +lime_ui_ScanCode.AGAIN = 121; +lime_ui_ScanCode.UNDO = 122; +lime_ui_ScanCode.CUT = 123; +lime_ui_ScanCode.COPY = 124; +lime_ui_ScanCode.PASTE = 125; +lime_ui_ScanCode.FIND = 126; +lime_ui_ScanCode.MUTE = 127; +lime_ui_ScanCode.VOLUME_UP = 128; +lime_ui_ScanCode.VOLUME_DOWN = 129; +lime_ui_ScanCode.NUMPAD_COMMA = 133; +lime_ui_ScanCode.ALT_ERASE = 153; +lime_ui_ScanCode.SYSTEM_REQUEST = 154; +lime_ui_ScanCode.CANCEL = 155; +lime_ui_ScanCode.CLEAR = 156; +lime_ui_ScanCode.PRIOR = 157; +lime_ui_ScanCode.RETURN2 = 158; +lime_ui_ScanCode.SEPARATOR = 159; +lime_ui_ScanCode.OUT = 160; +lime_ui_ScanCode.OPER = 161; +lime_ui_ScanCode.CLEAR_AGAIN = 162; +lime_ui_ScanCode.CRSEL = 163; +lime_ui_ScanCode.EXSEL = 164; +lime_ui_ScanCode.NUMPAD_00 = 176; +lime_ui_ScanCode.NUMPAD_000 = 177; +lime_ui_ScanCode.THOUSAND_SEPARATOR = 178; +lime_ui_ScanCode.DECIMAL_SEPARATOR = 179; +lime_ui_ScanCode.CURRENCY_UNIT = 180; +lime_ui_ScanCode.CURRENCY_SUBUNIT = 181; +lime_ui_ScanCode.NUMPAD_LEFT_PARENTHESIS = 182; +lime_ui_ScanCode.NUMPAD_RIGHT_PARENTHESIS = 183; +lime_ui_ScanCode.NUMPAD_LEFT_BRACE = 184; +lime_ui_ScanCode.NUMPAD_RIGHT_BRACE = 185; +lime_ui_ScanCode.NUMPAD_TAB = 186; +lime_ui_ScanCode.NUMPAD_BACKSPACE = 187; +lime_ui_ScanCode.NUMPAD_A = 188; +lime_ui_ScanCode.NUMPAD_B = 189; +lime_ui_ScanCode.NUMPAD_C = 190; +lime_ui_ScanCode.NUMPAD_D = 191; +lime_ui_ScanCode.NUMPAD_E = 192; +lime_ui_ScanCode.NUMPAD_F = 193; +lime_ui_ScanCode.NUMPAD_XOR = 194; +lime_ui_ScanCode.NUMPAD_POWER = 195; +lime_ui_ScanCode.NUMPAD_PERCENT = 196; +lime_ui_ScanCode.NUMPAD_LESS_THAN = 197; +lime_ui_ScanCode.NUMPAD_GREATER_THAN = 198; +lime_ui_ScanCode.NUMPAD_AMPERSAND = 199; +lime_ui_ScanCode.NUMPAD_DOUBLE_AMPERSAND = 200; +lime_ui_ScanCode.NUMPAD_VERTICAL_BAR = 201; +lime_ui_ScanCode.NUMPAD_DOUBLE_VERTICAL_BAR = 202; +lime_ui_ScanCode.NUMPAD_COLON = 203; +lime_ui_ScanCode.NUMPAD_HASH = 204; +lime_ui_ScanCode.NUMPAD_SPACE = 205; +lime_ui_ScanCode.NUMPAD_AT = 206; +lime_ui_ScanCode.NUMPAD_EXCLAMATION = 207; +lime_ui_ScanCode.NUMPAD_MEM_STORE = 208; +lime_ui_ScanCode.NUMPAD_MEM_RECALL = 209; +lime_ui_ScanCode.NUMPAD_MEM_CLEAR = 210; +lime_ui_ScanCode.NUMPAD_MEM_ADD = 211; +lime_ui_ScanCode.NUMPAD_MEM_SUBTRACT = 212; +lime_ui_ScanCode.NUMPAD_MEM_MULTIPLY = 213; +lime_ui_ScanCode.NUMPAD_MEM_DIVIDE = 214; +lime_ui_ScanCode.NUMPAD_PLUS_MINUS = 215; +lime_ui_ScanCode.NUMPAD_CLEAR = 216; +lime_ui_ScanCode.NUMPAD_CLEAR_ENTRY = 217; +lime_ui_ScanCode.NUMPAD_BINARY = 218; +lime_ui_ScanCode.NUMPAD_OCTAL = 219; +lime_ui_ScanCode.NUMPAD_DECIMAL = 220; +lime_ui_ScanCode.NUMPAD_HEXADECIMAL = 221; +lime_ui_ScanCode.LEFT_CTRL = 224; +lime_ui_ScanCode.LEFT_SHIFT = 225; +lime_ui_ScanCode.LEFT_ALT = 226; +lime_ui_ScanCode.LEFT_META = 227; +lime_ui_ScanCode.RIGHT_CTRL = 228; +lime_ui_ScanCode.RIGHT_SHIFT = 229; +lime_ui_ScanCode.RIGHT_ALT = 230; +lime_ui_ScanCode.RIGHT_META = 231; +lime_ui_ScanCode.MODE = 257; +lime_ui_ScanCode.AUDIO_NEXT = 258; +lime_ui_ScanCode.AUDIO_PREVIOUS = 259; +lime_ui_ScanCode.AUDIO_STOP = 260; +lime_ui_ScanCode.AUDIO_PLAY = 261; +lime_ui_ScanCode.AUDIO_MUTE = 262; +lime_ui_ScanCode.MEDIA_SELECT = 263; +lime_ui_ScanCode.WWW = 264; +lime_ui_ScanCode.MAIL = 265; +lime_ui_ScanCode.CALCULATOR = 266; +lime_ui_ScanCode.COMPUTER = 267; +lime_ui_ScanCode.APP_CONTROL_SEARCH = 268; +lime_ui_ScanCode.APP_CONTROL_HOME = 269; +lime_ui_ScanCode.APP_CONTROL_BACK = 270; +lime_ui_ScanCode.APP_CONTROL_FORWARD = 271; +lime_ui_ScanCode.APP_CONTROL_STOP = 272; +lime_ui_ScanCode.APP_CONTROL_REFRESH = 273; +lime_ui_ScanCode.APP_CONTROL_BOOKMARKS = 274; +lime_ui_ScanCode.BRIGHTNESS_DOWN = 275; +lime_ui_ScanCode.BRIGHTNESS_UP = 276; +lime_ui_ScanCode.DISPLAY_SWITCH = 277; +lime_ui_ScanCode.BACKLIGHT_TOGGLE = 278; +lime_ui_ScanCode.BACKLIGHT_DOWN = 279; +lime_ui_ScanCode.BACKLIGHT_UP = 280; +lime_ui_ScanCode.EJECT = 281; +lime_ui_ScanCode.SLEEP = 282; +lime_ui_Touch.onCancel = new lime_app__$Event_$lime_$ui_$Touch_$Void(); +lime_ui_Touch.onEnd = new lime_app__$Event_$lime_$ui_$Touch_$Void(); +lime_ui_Touch.onMove = new lime_app__$Event_$lime_$ui_$Touch_$Void(); +lime_ui_Touch.onStart = new lime_app__$Event_$lime_$ui_$Touch_$Void(); +lime_utils_Assets.cache = new lime_utils_AssetCache(); +lime_utils_Assets.onChange = new lime_app__$Event_$Void_$Void(); +lime_utils_Assets.bundlePaths = new haxe_ds_StringMap(); +lime_utils_Assets.libraries = new haxe_ds_StringMap(); +lime_utils_Assets.libraryPaths = new haxe_ds_StringMap(); +lime_utils_Float32Array.BYTES_PER_ELEMENT = 4; +lime_utils_Float64Array.BYTES_PER_ELEMENT = 8; +lime_utils_Int16Array.BYTES_PER_ELEMENT = 2; +lime_utils_Int32Array.BYTES_PER_ELEMENT = 4; +lime_utils_Int8Array.BYTES_PER_ELEMENT = 1; +lime_utils_Log.throwErrors = true; +lime_utils_LogLevel.NONE = 0; +lime_utils_LogLevel.ERROR = 1; +lime_utils_LogLevel.WARN = 2; +lime_utils_LogLevel.INFO = 3; +lime_utils_LogLevel.DEBUG = 4; +lime_utils_LogLevel.VERBOSE = 5; +lime_utils_UInt16Array.BYTES_PER_ELEMENT = 2; +lime_utils_UInt32Array.BYTES_PER_ELEMENT = 4; +lime_utils_UInt8Array.BYTES_PER_ELEMENT = 1; +lime_utils_UInt8ClampedArray.BYTES_PER_ELEMENT = 1; +model_Constants.HERO_COLOR = 331447; +model_Constants.ACCENT_COLOR1 = 16752412; +model_Constants.ACCENT_COLOR2 = 16736015; +model_Constants.MAIN_COLOR1 = 3292482; +model_Constants.MAIN_COLOR2 = 6914186; +model_Constants.MAIN_COLOR3 = 15527920; +model_Constants.MONTSERRAT_SEMIBOLD_600 = "MontserratSemiBold600"; +motion_easing_Expo.easeIn = new motion_easing__$Expo_ExpoEaseIn(); +motion_easing_Expo.easeInOut = new motion_easing__$Expo_ExpoEaseInOut(); +motion_easing_Expo.easeOut = new motion_easing__$Expo_ExpoEaseOut(); +motion_Actuate.defaultActuator = motion_actuators_SimpleActuator; +motion_Actuate.defaultEase = motion_easing_Expo.easeOut; +motion_Actuate.targetLibraries = new haxe_ds_ObjectMap(); +motion_easing_Quart.easeIn = new motion_easing__$Quart_QuartEaseIn(); +motion_easing_Quart.easeInOut = new motion_easing__$Quart_QuartEaseInOut(); +motion_easing_Quart.easeOut = new motion_easing__$Quart_QuartEaseOut(); +openfl_Lib.__lastTimerID = 0; +openfl_Lib.__sentWarnings = new haxe_ds_StringMap(); +openfl_Lib.__timers = new haxe_ds_IntMap(); +openfl_Lib.__registeredClassAliases = new haxe_ds_StringMap(); +openfl_Lib.__registeredClasses = openfl_utils_Dictionary.toUtilsObjectMap(null); +openfl__$Vector_IVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl__$Vector_BoolVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl__$Vector_FloatVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl__$Vector_FunctionVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl__$Vector_IntVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl__$Vector_ObjectVector.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { concat : { SuppressWarnings : ["checkstyle:Dynamic"]}, toJSON : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_Application.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display_BitmapData.__meta__ = { fields : { image : { SuppressWarnings : ["checkstyle:Dynamic"]}, __framebufferContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, __indexBufferContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, __surface : { SuppressWarnings : ["checkstyle:Dynamic"]}, __textureContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, __vertexBufferContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, compare : { SuppressWarnings : ["checkstyle:Dynamic"]}, getSurface : { SuppressWarnings : ["checkstyle:Dynamic"]}, __fromImage : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_BitmapData.VERTEX_BUFFER_STRIDE = 14; +openfl_display_BitmapData.__tempVector = new lime_math_Vector2(); +openfl_display_BlendMode.ADD = 0; +openfl_display_BlendMode.ALPHA = 1; +openfl_display_BlendMode.DARKEN = 2; +openfl_display_BlendMode.DIFFERENCE = 3; +openfl_display_BlendMode.ERASE = 4; +openfl_display_BlendMode.HARDLIGHT = 5; +openfl_display_BlendMode.INVERT = 6; +openfl_display_BlendMode.LAYER = 7; +openfl_display_BlendMode.LIGHTEN = 8; +openfl_display_BlendMode.MULTIPLY = 9; +openfl_display_BlendMode.NORMAL = 10; +openfl_display_BlendMode.OVERLAY = 11; +openfl_display_BlendMode.SCREEN = 12; +openfl_display_BlendMode.SHADER = 13; +openfl_display_BlendMode.SUBTRACT = 14; +openfl_display_DisplayObjectRenderer.__meta__ = { fields : { __context : { SuppressWarnings : ["checkstyle:Dynamic"]}, __type : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_CairoRenderer.__meta__ = { fields : { cairo : { SuppressWarnings : ["checkstyle:Dynamic"]}, __matrix3 : { SuppressWarnings : ["checkstyle:Dynamic"]}, applyMatrix : { SuppressWarnings : ["checkstyle:Dynamic"]}, __setBlendModeCairo : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_CanvasRenderer.__meta__ = { fields : { context : { SuppressWarnings : ["checkstyle:Dynamic"]}, applySmoothing : { SuppressWarnings : ["checkstyle:Dynamic"]}, setTransform : { SuppressWarnings : ["checkstyle:Dynamic"]}, __setBlendModeContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_CapsStyle.NONE = 0; +openfl_display_CapsStyle.ROUND = 1; +openfl_display_CapsStyle.SQUARE = 2; +openfl_display_DOMElement.__meta__ = { fields : { __element : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_DOMRenderer.__meta__ = { fields : { element : { SuppressWarnings : ["checkstyle:Dynamic"]}, applyStyle : { SuppressWarnings : ["checkstyle:Dynamic"]}, clearStyle : { SuppressWarnings : ["checkstyle:Dynamic"]}, _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_Shader.__meta__ = { fields : { glProgram : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_GradientType.LINEAR = 0; +openfl_display_GradientType.RADIAL = 1; +openfl_display_Graphics.__meta__ = { fields : { overrideBlendMode : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_display_GraphicsPath.SIN45 = 0.70710678118654752440084436210485; +openfl_display_GraphicsPath.TAN22 = 0.4142135623730950488016887242097; +openfl_display_GraphicsPathWinding.EVEN_ODD = 0; +openfl_display_GraphicsPathWinding.NON_ZERO = 1; +openfl_display_InterpolationMethod.LINEAR_RGB = 0; +openfl_display_InterpolationMethod.RGB = 1; +openfl_display_JointStyle.BEVEL = 0; +openfl_display_JointStyle.MITER = 1; +openfl_display_JointStyle.ROUND = 2; +openfl_display_LineScaleMode.HORIZONTAL = 0; +openfl_display_LineScaleMode.NONE = 1; +openfl_display_LineScaleMode.NORMAL = 2; +openfl_display_LineScaleMode.VERTICAL = 3; +openfl_display_Loader.__meta__ = { fields : { BitmapData_onError : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_LoaderInfo.__meta__ = { statics : { create : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}, fields : { parameters : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_LoaderInfo.__rootURL = js_Browser.get_supported() ? window.document.URL : ""; +openfl_geom_Rectangle.__pool = new lime_utils_ObjectPool(function() { + return new openfl_geom_Rectangle(); +},function(r) { + r.setTo(0,0,0,0); +}); +openfl_display_OpenGLRenderer.__meta__ = { fields : { gl : { SuppressWarnings : ["checkstyle:Dynamic"]}, __gl : { SuppressWarnings : ["checkstyle:Dynamic"]}, __matrix : { SuppressWarnings : ["checkstyle:Dynamic"]}, __projection : { SuppressWarnings : ["checkstyle:Dynamic"]}, __projectionFlipped : { SuppressWarnings : ["checkstyle:Dynamic"]}, getMatrix : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_OpenGLRenderer.__alphaValue = [1]; +openfl_display_OpenGLRenderer.__colorMultipliersValue = [0,0,0,0]; +openfl_display_OpenGLRenderer.__colorOffsetsValue = [0,0,0,0]; +openfl_display_OpenGLRenderer.__defaultColorMultipliersValue = [1,1,1,1]; +openfl_display_OpenGLRenderer.__emptyColorValue = [0,0,0,0]; +openfl_display_OpenGLRenderer.__emptyAlphaValue = [1]; +openfl_display_OpenGLRenderer.__hasColorTransformValue = [false]; +openfl_display_OpenGLRenderer.__scissorRectangle = new openfl_geom_Rectangle(); +openfl_display_OpenGLRenderer.__textureSizeValue = [0,0]; +openfl_display_PixelSnapping.ALWAYS = 0; +openfl_display_PixelSnapping.AUTO = 1; +openfl_display_PixelSnapping.NEVER = 2; +openfl_display_Preloader.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { onComplete : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_DefaultPreloader.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display_ShaderInput.__meta__ = { fields : { index : { SuppressWarnings : ["checkstyle:Dynamic"]}, name : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_display_ShaderParameter.__meta__ = { fields : { index : { SuppressWarnings : ["checkstyle:Dynamic"]}, name : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_display_ShaderParameterType.BOOL = 0; +openfl_display_ShaderParameterType.BOOL2 = 1; +openfl_display_ShaderParameterType.BOOL3 = 2; +openfl_display_ShaderParameterType.BOOL4 = 3; +openfl_display_ShaderParameterType.FLOAT = 4; +openfl_display_ShaderParameterType.FLOAT2 = 5; +openfl_display_ShaderParameterType.FLOAT3 = 6; +openfl_display_ShaderParameterType.FLOAT4 = 7; +openfl_display_ShaderParameterType.INT = 8; +openfl_display_ShaderParameterType.INT2 = 9; +openfl_display_ShaderParameterType.INT3 = 10; +openfl_display_ShaderParameterType.INT4 = 11; +openfl_display_ShaderParameterType.MATRIX2X2 = 12; +openfl_display_ShaderParameterType.MATRIX2X3 = 13; +openfl_display_ShaderParameterType.MATRIX2X4 = 14; +openfl_display_ShaderParameterType.MATRIX3X2 = 15; +openfl_display_ShaderParameterType.MATRIX3X3 = 16; +openfl_display_ShaderParameterType.MATRIX3X4 = 17; +openfl_display_ShaderParameterType.MATRIX4X2 = 18; +openfl_display_ShaderParameterType.MATRIX4X3 = 19; +openfl_display_ShaderParameterType.MATRIX4X4 = 20; +openfl_display_ShaderPrecision.FAST = 0; +openfl_display_ShaderPrecision.FULL = 1; +openfl_display_SpreadMethod.PAD = 0; +openfl_display_SpreadMethod.REFLECT = 1; +openfl_display_SpreadMethod.REPEAT = 2; +openfl_display_Stage.__meta__ = { fields : { __broadcastEvent : { SuppressWarnings : ["checkstyle:Dynamic"]}, __dispatchEvent : { SuppressWarnings : [["checkstyle:Dynamic","checkstyle:LeftCurly"]]}, __dispatchStack : { SuppressWarnings : [["checkstyle:Dynamic","checkstyle:LeftCurly"]]}, __dispatchTarget : { SuppressWarnings : ["checkstyle:Dynamic"]}, __handleError : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_StageAlign.BOTTOM = 0; +openfl_display_StageAlign.BOTTOM_LEFT = 1; +openfl_display_StageAlign.BOTTOM_RIGHT = 2; +openfl_display_StageAlign.LEFT = 3; +openfl_display_StageAlign.RIGHT = 4; +openfl_display_StageAlign.TOP = 5; +openfl_display_StageAlign.TOP_LEFT = 6; +openfl_display_StageAlign.TOP_RIGHT = 7; +openfl_display_StageDisplayState.FULL_SCREEN = 0; +openfl_display_StageDisplayState.FULL_SCREEN_INTERACTIVE = 1; +openfl_display_StageDisplayState.NORMAL = 2; +openfl_display_StageQuality.BEST = 0; +openfl_display_StageQuality.HIGH = 1; +openfl_display_StageQuality.LOW = 2; +openfl_display_StageQuality.MEDIUM = 3; +openfl_display_StageScaleMode.EXACT_FIT = 0; +openfl_display_StageScaleMode.NO_BORDER = 1; +openfl_display_StageScaleMode.NO_SCALE = 2; +openfl_display_StageScaleMode.SHOW_ALL = 3; +openfl_display_Tile.__meta__ = { fields : { data : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display_TileData.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display_TriangleCulling.NEGATIVE = 0; +openfl_display_TriangleCulling.NONE = 1; +openfl_display_TriangleCulling.POSITIVE = 2; +openfl_display_Window.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { _ : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display__$internal_AbstractNoise.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_CairoBitmap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_CairoDisplayObject.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_CairoGraphics.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_CairoShape.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_CairoTextField.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_CairoTilemap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { renderTileContainer : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display__$internal_CanvasBitmap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_CanvasDisplayObject.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_DrawCommandBuffer.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { o : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display__$internal_DrawCommandBuffer.empty = new openfl_display__$internal_DrawCommandBuffer(); +openfl_display__$internal_CanvasGraphics.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { windingRule : { SuppressWarnings : ["checkstyle:Dynamic"]}, createBitmapFill : { SuppressWarnings : ["checkstyle:Dynamic"]}, createGradientPattern : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display__$internal_CanvasGraphics.SIN45 = 0.70710678118654752440084436210485; +openfl_display__$internal_CanvasGraphics.TAN22 = 0.4142135623730950488016887242097; +openfl_display__$internal_CanvasGraphics.fillCommands = new openfl_display__$internal_DrawCommandBuffer(); +openfl_display__$internal_CanvasGraphics.strokeCommands = new openfl_display__$internal_DrawCommandBuffer(); +openfl_display__$internal_CanvasShape.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_CanvasTextField.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_CanvasTilemap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { renderTileContainer : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display__$internal_CanvasVideo.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_Context3DBitmap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_Context3DBuffer.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_Context3DBuffer.MAX_INDEX_BUFFER_LENGTH = 65535; +openfl_display__$internal_Context3DBuffer.MAX_QUADS_PER_INDEX_BUFFER = 10922; +openfl_display__$internal_Context3DBuffer.MAX_QUAD_INDEX_BUFFER_LENGTH = 65532; +openfl_display__$internal_Context3DDisplayObject.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_geom_Matrix.__meta__ = { fields : { equals : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, to3DString : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, toMozString : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_geom_Matrix.__identity = new openfl_geom_Matrix(); +openfl_geom_Matrix.__pool = new lime_utils_ObjectPool(function() { + return new openfl_geom_Matrix(); +},function(m) { + m.identity(); +}); +openfl_geom_Matrix.__matrix3 = lime_math_Matrix3._new(); +openfl_geom_ColorTransform.__pool = new lime_utils_ObjectPool(function() { + return new openfl_geom_ColorTransform(); +},function(ct) { + ct.__identity(); +}); +openfl_display__$internal_Context3DGraphics.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_Context3DGraphics.blankBitmapData = new openfl_display_BitmapData(1,1,false,0); +openfl_display__$internal_Context3DGraphics.tempColorTransform = new openfl_geom_ColorTransform(1,1,1,1,0,0,0,0); +openfl_display__$internal_Context3DMaskShader.opaqueBitmapData = new openfl_display_BitmapData(1,1,false,0); +openfl_display__$internal_Context3DShape.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_Context3DTextField.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_Context3DTilemap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_Context3DVideo.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_Context3DVideo.__textureSizeValue = [0,0.]; +openfl_display__$internal_DOMBitmap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_DOMDisplayObject.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_DOMShape.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_DOMTextField.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_DOMTextField.__regexColor = new EReg("color=(\"#([^\"]+)\"|'#([^']+)')","i"); +openfl_display__$internal_DOMTextField.__regexFace = new EReg("face=(\"([^\"]+)\"|'([^']+)')","i"); +openfl_display__$internal_DOMTextField.__regexFont = new EReg("]+)>","gi"); +openfl_display__$internal_DOMTextField.__regexCloseFont = new EReg("","gi"); +openfl_display__$internal_DOMTextField.__regexSize = new EReg("size=(\"([^\"]+)\"|'([^']+)')","i"); +openfl_display__$internal_DOMTilemap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_DOMVideo.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_DrawCommandReader.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { obj : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display__$internal_FlashRenderer.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_geom_Point.__pool = new lime_utils_ObjectPool(function() { + return new openfl_geom_Point(); +},function(p) { + p.setTo(0,0); +}); +openfl_display__$internal_FlashTilemap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_FlashTilemap.alphaColorTransform = new openfl_geom_ColorTransform(); +openfl_display__$internal_FlashTilemap.bitmap = new openfl_display_Bitmap(); +openfl_display__$internal_FlashTilemap.destPoint = new openfl_geom_Point(); +openfl_display__$internal_FlashTilemap.sourceRect = new openfl_geom_Rectangle(); +openfl_display__$internal_PerlinNoise.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { P : { SuppressWarnings : ["checkstyle:ConstantName"]}}}; +openfl_display__$internal_PerlinNoise.P = [151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180,151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180]; +openfl_display__$internal_SamplerState.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display__$internal_ShaderBuffer.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { overrideIntValues : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display3D_Context3D.supportsVideoTexture = true; +openfl_display3D_Context3D.__glDepthStencil = -1; +openfl_display3D_Context3D.__glMaxTextureMaxAnisotropy = -1; +openfl_display3D_Context3D.__glMaxViewportDims = -1; +openfl_display3D_Context3D.__glMemoryCurrentAvailable = -1; +openfl_display3D_Context3D.__glMemoryTotalAvailable = -1; +openfl_display3D_Context3D.__glTextureMaxAnisotropy = -1; +openfl_display3D_Context3DBlendFactor.DESTINATION_ALPHA = 0; +openfl_display3D_Context3DBlendFactor.DESTINATION_COLOR = 1; +openfl_display3D_Context3DBlendFactor.ONE = 2; +openfl_display3D_Context3DBlendFactor.ONE_MINUS_DESTINATION_ALPHA = 3; +openfl_display3D_Context3DBlendFactor.ONE_MINUS_DESTINATION_COLOR = 4; +openfl_display3D_Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA = 5; +openfl_display3D_Context3DBlendFactor.ONE_MINUS_SOURCE_COLOR = 6; +openfl_display3D_Context3DBlendFactor.SOURCE_ALPHA = 7; +openfl_display3D_Context3DBlendFactor.SOURCE_COLOR = 8; +openfl_display3D_Context3DBlendFactor.ZERO = 9; +openfl_display3D_Context3DBufferUsage.DYNAMIC_DRAW = 0; +openfl_display3D_Context3DBufferUsage.STATIC_DRAW = 1; +openfl_display3D_Context3DCompareMode.ALWAYS = 0; +openfl_display3D_Context3DCompareMode.EQUAL = 1; +openfl_display3D_Context3DCompareMode.GREATER = 2; +openfl_display3D_Context3DCompareMode.GREATER_EQUAL = 3; +openfl_display3D_Context3DCompareMode.LESS = 4; +openfl_display3D_Context3DCompareMode.LESS_EQUAL = 5; +openfl_display3D_Context3DCompareMode.NEVER = 6; +openfl_display3D_Context3DCompareMode.NOT_EQUAL = 7; +openfl_display3D_Context3DMipFilter.MIPLINEAR = 0; +openfl_display3D_Context3DMipFilter.MIPNEAREST = 1; +openfl_display3D_Context3DMipFilter.MIPNONE = 2; +openfl_display3D_Context3DProfile.BASELINE = 0; +openfl_display3D_Context3DProfile.BASELINE_CONSTRAINED = 1; +openfl_display3D_Context3DProfile.BASELINE_EXTENDED = 2; +openfl_display3D_Context3DProfile.STANDARD = 3; +openfl_display3D_Context3DProfile.STANDARD_CONSTRAINED = 4; +openfl_display3D_Context3DProfile.STANDARD_EXTENDED = 5; +openfl_display3D_Context3DProgramFormat.AGAL = 0; +openfl_display3D_Context3DProgramFormat.GLSL = 1; +openfl_display3D_Context3DProgramType.FRAGMENT = 0; +openfl_display3D_Context3DProgramType.VERTEX = 1; +openfl_display3D_Context3DRenderMode.AUTO = 0; +openfl_display3D_Context3DRenderMode.SOFTWARE = 1; +openfl_display3D_Context3DStencilAction.DECREMENT_SATURATE = 0; +openfl_display3D_Context3DStencilAction.DECREMENT_WRAP = 1; +openfl_display3D_Context3DStencilAction.INCREMENT_SATURATE = 2; +openfl_display3D_Context3DStencilAction.INCREMENT_WRAP = 3; +openfl_display3D_Context3DStencilAction.INVERT = 4; +openfl_display3D_Context3DStencilAction.KEEP = 5; +openfl_display3D_Context3DStencilAction.SET = 6; +openfl_display3D_Context3DStencilAction.ZERO = 7; +openfl_display3D_Context3DTextureFilter.ANISOTROPIC16X = 0; +openfl_display3D_Context3DTextureFilter.ANISOTROPIC2X = 1; +openfl_display3D_Context3DTextureFilter.ANISOTROPIC4X = 2; +openfl_display3D_Context3DTextureFilter.ANISOTROPIC8X = 3; +openfl_display3D_Context3DTextureFilter.LINEAR = 4; +openfl_display3D_Context3DTextureFilter.NEAREST = 5; +openfl_display3D_Context3DTextureFormat.BGR_PACKED = 0; +openfl_display3D_Context3DTextureFormat.BGRA = 1; +openfl_display3D_Context3DTextureFormat.BGRA_PACKED = 2; +openfl_display3D_Context3DTextureFormat.COMPRESSED = 3; +openfl_display3D_Context3DTextureFormat.COMPRESSED_ALPHA = 4; +openfl_display3D_Context3DTextureFormat.RGBA_HALF_FLOAT = 5; +openfl_display3D_Context3DTriangleFace.BACK = 0; +openfl_display3D_Context3DTriangleFace.FRONT = 1; +openfl_display3D_Context3DTriangleFace.FRONT_AND_BACK = 2; +openfl_display3D_Context3DTriangleFace.NONE = 3; +openfl_display3D_Context3DVertexBufferFormat.BYTES_4 = 0; +openfl_display3D_Context3DVertexBufferFormat.FLOAT_1 = 1; +openfl_display3D_Context3DVertexBufferFormat.FLOAT_2 = 2; +openfl_display3D_Context3DVertexBufferFormat.FLOAT_3 = 3; +openfl_display3D_Context3DVertexBufferFormat.FLOAT_4 = 4; +openfl_display3D_Context3DWrapMode.CLAMP = 0; +openfl_display3D_Context3DWrapMode.CLAMP_U_REPEAT_V = 1; +openfl_display3D_Context3DWrapMode.REPEAT = 2; +openfl_display3D_Context3DWrapMode.REPEAT_U_CLAMP_V = 3; +openfl_display3D_Uniform.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display3D_UniformMap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display3D__$internal_AGALConverter.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display3D__$internal_AGALConverter.limitedProfile = true; +openfl_display3D__$internal__$AGALConverter_DestRegister.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display3D__$internal_RegisterMap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display3D__$internal__$AGALConverter_SamplerRegister.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display3D__$internal__$AGALConverter_SourceRegister.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display3D__$internal_ATFReader.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display3D__$internal_Context3DState.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_display3D_textures_TextureBase.__meta__ = { fields : { __textureContext : { SuppressWarnings : ["checkstyle:Dynamic"]}, __getGLFramebuffer : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_display3D_textures_Texture.__lowMemoryMode = false; +openfl_errors_Error.DEFAULT_TO_STRING = "Error"; +openfl_events_ActivityEvent.ACTIVITY = "activity"; +openfl_events_TextEvent.LINK = "link"; +openfl_events_TextEvent.TEXT_INPUT = "textInput"; +openfl_events_ErrorEvent.ERROR = "error"; +openfl_events__$EventDispatcher_DispatchIterator.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_events__$EventDispatcher_Listener.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_events__$EventDispatcher_Listener.supportsWeakReference = (function($this) { + var $r; + var o = $global; + $r = Object.prototype.hasOwnProperty.call(o,"WeakRef"); + return $r; +}(this)); +openfl_events_FocusEvent.FOCUS_IN = "focusIn"; +openfl_events_FocusEvent.FOCUS_OUT = "focusOut"; +openfl_events_FocusEvent.KEY_FOCUS_CHANGE = "keyFocusChange"; +openfl_events_FocusEvent.MOUSE_FOCUS_CHANGE = "mouseFocusChange"; +openfl_events_FullScreenEvent.FULL_SCREEN = "fullScreen"; +openfl_events_FullScreenEvent.FULL_SCREEN_INTERACTIVE_ACCEPTED = "fullScreenInteractiveAccepted"; +openfl_events_GameInputEvent.DEVICE_ADDED = "deviceAdded"; +openfl_events_GameInputEvent.DEVICE_REMOVED = "deviceRemoved"; +openfl_events_GameInputEvent.DEVICE_UNUSABLE = "deviceUnusable"; +openfl_events_HTTPStatusEvent.HTTP_RESPONSE_STATUS = "httpResponseStatus"; +openfl_events_HTTPStatusEvent.HTTP_STATUS = "httpStatus"; +openfl_events_IOErrorEvent.IO_ERROR = "ioError"; +openfl_events_KeyboardEvent.KEY_DOWN = "keyDown"; +openfl_events_KeyboardEvent.KEY_UP = "keyUp"; +openfl_events_MouseEvent.CLICK = "click"; +openfl_events_MouseEvent.DOUBLE_CLICK = "doubleClick"; +openfl_events_MouseEvent.MIDDLE_CLICK = "middleClick"; +openfl_events_MouseEvent.MIDDLE_MOUSE_DOWN = "middleMouseDown"; +openfl_events_MouseEvent.MIDDLE_MOUSE_UP = "middleMouseUp"; +openfl_events_MouseEvent.MOUSE_DOWN = "mouseDown"; +openfl_events_MouseEvent.MOUSE_MOVE = "mouseMove"; +openfl_events_MouseEvent.MOUSE_OUT = "mouseOut"; +openfl_events_MouseEvent.MOUSE_OVER = "mouseOver"; +openfl_events_MouseEvent.MOUSE_UP = "mouseUp"; +openfl_events_MouseEvent.MOUSE_WHEEL = "mouseWheel"; +openfl_events_MouseEvent.RELEASE_OUTSIDE = "releaseOutside"; +openfl_events_MouseEvent.RIGHT_CLICK = "rightClick"; +openfl_events_MouseEvent.RIGHT_MOUSE_DOWN = "rightMouseDown"; +openfl_events_MouseEvent.RIGHT_MOUSE_UP = "rightMouseUp"; +openfl_events_MouseEvent.ROLL_OUT = "rollOut"; +openfl_events_MouseEvent.ROLL_OVER = "rollOver"; +openfl_events_NetStatusEvent.NET_STATUS = "netStatus"; +openfl_events_ProgressEvent.PROGRESS = "progress"; +openfl_events_ProgressEvent.SOCKET_DATA = "socketData"; +openfl_events_RenderEvent.CLEAR_DOM = "clearDOM"; +openfl_events_RenderEvent.RENDER_CAIRO = "renderCairo"; +openfl_events_RenderEvent.RENDER_CANVAS = "renderCanvas"; +openfl_events_RenderEvent.RENDER_DOM = "renderDOM"; +openfl_events_RenderEvent.RENDER_OPENGL = "renderOpenGL"; +openfl_events_SampleDataEvent.SAMPLE_DATA = "sampleData"; +openfl_events_SecurityErrorEvent.SECURITY_ERROR = "securityError"; +openfl_events_TouchEvent.__meta__ = { fields : { delta : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_events_TouchEvent.TOUCH_BEGIN = "touchBegin"; +openfl_events_TouchEvent.TOUCH_END = "touchEnd"; +openfl_events_TouchEvent.TOUCH_MOVE = "touchMove"; +openfl_events_TouchEvent.TOUCH_OUT = "touchOut"; +openfl_events_TouchEvent.TOUCH_OVER = "touchOver"; +openfl_events_TouchEvent.TOUCH_ROLL_OUT = "touchRollOut"; +openfl_events_TouchEvent.TOUCH_ROLL_OVER = "touchRollOver"; +openfl_events_TouchEvent.TOUCH_TAP = "touchTap"; +openfl_events_UncaughtErrorEvent.UNCAUGHT_ERROR = "uncaughtError"; +openfl_filters_ShaderFilter.__meta__ = { fields : { blendMode : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_geom_Matrix3D.__meta__ = { statics : { create2D : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, createABCD : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, createOrtho : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_geom_Orientation3D.AXIS_ANGLE = 0; +openfl_geom_Orientation3D.EULER_ANGLES = 1; +openfl_geom_Orientation3D.QUATERNION = 2; +openfl_media_SoundTransform.__meta__ = { fields : { clone : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_media_SoundMixer.MAX_ACTIVE_CHANNELS = 32; +openfl_media_SoundMixer.__soundChannels = []; +openfl_media_SoundMixer.__soundTransform = new openfl_media_SoundTransform(); +openfl_media_Video.VERTEX_BUFFER_STRIDE = 5; +openfl_net_NetConnection.__meta__ = { statics : { CONNECT_SUCCESS : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_net_NetConnection.CONNECT_SUCCESS = "NetConnection.Connect.Success"; +openfl_net_NetStream.__meta__ = { fields : { audioCodec : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, decodedFrames : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, speed : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, requestVideoStatus : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_net_ObjectEncoding.AMF0 = 0; +openfl_net_ObjectEncoding.AMF3 = 3; +openfl_net_ObjectEncoding.HXSF = 10; +openfl_net_ObjectEncoding.JSON = 12; +openfl_net_ObjectEncoding.DEFAULT = 10; +openfl_net_URLLoaderDataFormat.BINARY = 0; +openfl_net_URLLoaderDataFormat.TEXT = 1; +openfl_net_URLLoaderDataFormat.VARIABLES = 2; +openfl_net_URLRequestDefaults.followRedirects = true; +openfl_net_URLRequestDefaults.idleTimeout = 0; +openfl_net_URLRequestDefaults.manageCookies = true; +openfl_net_URLVariables.__meta__ = { statics : { __get : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __set : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_system_ApplicationDomain.currentDomain = new openfl_system_ApplicationDomain(null); +openfl_system_Capabilities.avHardwareDisable = true; +openfl_system_Capabilities.hasAccessibility = false; +openfl_system_Capabilities.hasAudio = true; +openfl_system_Capabilities.hasAudioEncoder = false; +openfl_system_Capabilities.hasEmbeddedVideo = false; +openfl_system_Capabilities.hasIME = false; +openfl_system_Capabilities.hasMP3 = false; +openfl_system_Capabilities.hasPrinting = true; +openfl_system_Capabilities.hasScreenBroadcast = false; +openfl_system_Capabilities.hasScreenPlayback = false; +openfl_system_Capabilities.hasStreamingAudio = false; +openfl_system_Capabilities.hasStreamingVideo = false; +openfl_system_Capabilities.hasTLS = true; +openfl_system_Capabilities.hasVideoEncoder = true; +openfl_system_Capabilities.isDebugger = false; +openfl_system_Capabilities.isEmbeddedInAcrobat = false; +openfl_system_Capabilities.localFileReadDisable = true; +openfl_system_Capabilities.maxLevelIDC = 0; +openfl_system_Capabilities.playerType = "PlugIn"; +openfl_system_Capabilities.screenColor = "color"; +openfl_system_Capabilities.serverString = ""; +openfl_system_Capabilities.supports32BitProcesses = false; +openfl_system_Capabilities.supports64BitProcesses = false; +openfl_system_Capabilities.touchscreenType = 0; +openfl_system_Capabilities.__standardDensities = [120,160,240,320,480,640,800,960]; +openfl_system_SecurityDomain.__meta__ = { obj : { SuppressWarnings : ["checkstyle:UnnecessaryConstructor"]}}; +openfl_system_SecurityDomain.currentDomain = new openfl_system_SecurityDomain(); +openfl_system_TouchscreenType.FINGER = 0; +openfl_system_TouchscreenType.NONE = 1; +openfl_system_TouchscreenType.STYLUS = 2; +openfl_text_AntiAliasType.ADVANCED = 0; +openfl_text_AntiAliasType.NORMAL = 1; +openfl_text_FontStyle.BOLD = 0; +openfl_text_FontStyle.BOLD_ITALIC = 1; +openfl_text_FontStyle.ITALIC = 2; +openfl_text_FontStyle.REGULAR = 3; +openfl_text_FontType.DEVICE = 0; +openfl_text_FontType.EMBEDDED = 1; +openfl_text_FontType.EMBEDDED_CFF = 2; +openfl_text_GridFitType.NONE = 0; +openfl_text_GridFitType.PIXEL = 1; +openfl_text_GridFitType.SUBPIXEL = 2; +openfl_text_StyleSheet.__supportedStyles = ["color","display","font-family","font-size","font-style","font-weight","kerning","leading","letter-spacing","margin-left","margin-right","text-align","text-decoration","text-indent"]; +openfl_text_TextField.__missingFontWarning = new haxe_ds_StringMap(); +openfl_text_TextFieldAutoSize.CENTER = 0; +openfl_text_TextFieldAutoSize.LEFT = 1; +openfl_text_TextFieldAutoSize.NONE = 2; +openfl_text_TextFieldAutoSize.RIGHT = 3; +openfl_text_TextFieldType.DYNAMIC = 0; +openfl_text_TextFieldType.INPUT = 1; +openfl_text_TextFormat.__meta__ = { fields : { clone : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_text_TextFormatAlign.CENTER = 0; +openfl_text_TextFormatAlign.END = 1; +openfl_text_TextFormatAlign.JUSTIFY = 2; +openfl_text_TextFormatAlign.LEFT = 3; +openfl_text_TextFormatAlign.RIGHT = 4; +openfl_text_TextFormatAlign.START = 5; +openfl_text__$internal_CacheMeasurement.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_text__$internal_GlyphPosition.__meta__ = { obj : { SuppressWarnings : [["checkstyle:FieldDocComment","checkstyle:Dynamic"]]}}; +openfl_text__$internal_HTMLParser.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_text__$internal_HTMLParser.__regexAlign = new EReg("align\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i"); +openfl_text__$internal_HTMLParser.__regexBreakTag = new EReg("","gi"); +openfl_text__$internal_HTMLParser.__regexBlockIndent = new EReg("blockindent\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i"); +openfl_text__$internal_HTMLParser.__regexClass = new EReg("class\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i"); +openfl_text__$internal_HTMLParser.__regexColor = new EReg("color\\s?=\\s?(\"#([^\"]+)\"|'#([^']+)')","i"); +openfl_text__$internal_HTMLParser.__regexEntityApos = new EReg("'","g"); +openfl_text__$internal_HTMLParser.__regexEntityNbsp = new EReg(" ","g"); +openfl_text__$internal_HTMLParser.__regexCharEntity = new EReg("&#(?:([0-9]+)|(x[0-9a-fA-F]+));","g"); +openfl_text__$internal_HTMLParser.__regexFace = new EReg("face\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i"); +openfl_text__$internal_HTMLParser.__regexHTMLTag = new EReg("<.*?>","g"); +openfl_text__$internal_HTMLParser.__regexHref = new EReg("href\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i"); +openfl_text__$internal_HTMLParser.__regexIndent = new EReg(" indent\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i"); +openfl_text__$internal_HTMLParser.__regexLeading = new EReg("leading\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i"); +openfl_text__$internal_HTMLParser.__regexLeftMargin = new EReg("leftmargin\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i"); +openfl_text__$internal_HTMLParser.__regexRightMargin = new EReg("rightmargin\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i"); +openfl_text__$internal_HTMLParser.__regexSize = new EReg("size\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i"); +openfl_text__$internal_HTMLParser.__regexTabStops = new EReg("tabstops\\s?=\\s?(\"([^\"]+)\"|'([^']+)')","i"); +openfl_text__$internal_ShapeCache.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_text__$internal_TextEngine.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { __cairoFont : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_text__$internal_TextEngine.GUTTER = 2; +openfl_text__$internal_TextEngine.UTF8_TAB = 9; +openfl_text__$internal_TextEngine.UTF8_ENDLINE = 10; +openfl_text__$internal_TextEngine.UTF8_SPACE = 32; +openfl_text__$internal_TextEngine.UTF8_HYPHEN = 45; +openfl_text__$internal_TextLayout.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { glyphs : { SuppressWarnings : ["checkstyle:Dynamic"]}, __handle : { SuppressWarnings : ["checkstyle:Dynamic"]}, __hbBuffer : { SuppressWarnings : ["checkstyle:Dynamic"]}, __hbFont : { SuppressWarnings : ["checkstyle:Dynamic"]}, get_glyphs : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_text__$internal_TextLayout.FT_LOAD_DEFAULT = 0; +openfl_text__$internal_TextLayout.FT_LOAD_NO_SCALE = 1; +openfl_text__$internal_TextLayout.FT_LOAD_NO_HINTING = 2; +openfl_text__$internal_TextLayout.FT_LOAD_RENDER = 4; +openfl_text__$internal_TextLayout.FT_LOAD_NO_BITMAP = 8; +openfl_text__$internal_TextLayout.FT_LOAD_VERTICAL_LAYOUT = 16; +openfl_text__$internal_TextLayout.FT_LOAD_FORCE_AUTOHINT = 32; +openfl_text__$internal_TextLayout.FT_LOAD_CROP_BITMAP = 64; +openfl_text__$internal_TextLayout.FT_LOAD_PEDANTIC = 128; +openfl_text__$internal_TextLayout.FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH = 256; +openfl_text__$internal_TextLayout.FT_LOAD_NO_RECURSE = 512; +openfl_text__$internal_TextLayout.FT_LOAD_IGNORE_TRANSFORM = 1024; +openfl_text__$internal_TextLayout.FT_LOAD_MONOCHROME = 2048; +openfl_text__$internal_TextLayout.FT_LOAD_LINEAR_DESIGN = 4096; +openfl_text__$internal_TextLayout.FT_LOAD_NO_AUTOHINT = 8192; +openfl_text__$internal_TextLayout.FT_LOAD_COLOR = 16384; +openfl_text__$internal_TextLayout.FT_LOAD_COMPUTE_METRICS = 32768; +openfl_text__$internal_TextLayout.FT_LOAD_BITMAP_METRICS_ONLY = 65536; +openfl_text__$internal_TextLayout.FT_LOAD_TARGET_NORMAL = 0; +openfl_text__$internal_TextLayout.FT_LOAD_TARGET_LIGHT = 0; +openfl_text__$internal_TextDirection.INVALID = 0; +openfl_text__$internal_TextDirection.LEFT_TO_RIGHT = 4; +openfl_text__$internal_TextDirection.RIGHT_TO_LEFT = 5; +openfl_text__$internal_TextDirection.TOP_TO_BOTTOM = 6; +openfl_text__$internal_TextDirection.BOTTOM_TO_TOP = 7; +openfl_text__$internal_TextScript.COMMON = "Zyyy"; +openfl_text__$internal_TextScript.INHERITED = "Zinh"; +openfl_text__$internal_TextScript.UNKNOWN = "Zzzz"; +openfl_text__$internal_TextScript.ARABIC = "Arab"; +openfl_text__$internal_TextScript.ARMENIAN = "Armn"; +openfl_text__$internal_TextScript.BENGALI = "Beng"; +openfl_text__$internal_TextScript.CYRILLIC = "Cyrl"; +openfl_text__$internal_TextScript.DEVANAGARI = "Deva"; +openfl_text__$internal_TextScript.GEORGIAN = "Geor"; +openfl_text__$internal_TextScript.GREEK = "Grek"; +openfl_text__$internal_TextScript.GUJARATI = "Gujr"; +openfl_text__$internal_TextScript.GURMUKHI = "Guru"; +openfl_text__$internal_TextScript.HANGUL = "Hang"; +openfl_text__$internal_TextScript.HAN = "Hani"; +openfl_text__$internal_TextScript.HEBREW = "Hebr"; +openfl_text__$internal_TextScript.HIRAGANA = "Hira"; +openfl_text__$internal_TextScript.KANNADA = "Knda"; +openfl_text__$internal_TextScript.KATAKANA = "Kana"; +openfl_text__$internal_TextScript.LAO = "Laoo"; +openfl_text__$internal_TextScript.LATIN = "Latn"; +openfl_text__$internal_TextScript.MALAYALAM = "Mlym"; +openfl_text__$internal_TextScript.ORIYA = "Orya"; +openfl_text__$internal_TextScript.TAMIL = "Taml"; +openfl_text__$internal_TextScript.TELUGA = "Telu"; +openfl_text__$internal_TextScript.THAI = "Thai"; +openfl_text__$internal_TextScript.TIBETAN = "Tibt"; +openfl_text__$internal_TextScript.BOPOMOFO = "Bopo"; +openfl_text__$internal_TextScript.BRAILLE = "Brai"; +openfl_text__$internal_TextScript.CANADIAN_SYLLABICS = "Cans"; +openfl_text__$internal_TextScript.CHEROKEE = "Cher"; +openfl_text__$internal_TextScript.ETHIOPIC = "Ethi"; +openfl_text__$internal_TextScript.KHMER = "Khmr"; +openfl_text__$internal_TextScript.MONGOLIAN = "Mong"; +openfl_text__$internal_TextScript.MYANMAR = "Mymr"; +openfl_text__$internal_TextScript.OGHAM = "Ogam"; +openfl_text__$internal_TextScript.RUNIC = "Runr"; +openfl_text__$internal_TextScript.SINHALA = "Sinh"; +openfl_text__$internal_TextScript.SYRIAC = "Syrc"; +openfl_text__$internal_TextScript.THAANA = "Thaa"; +openfl_text__$internal_TextScript.YI = "Yiii"; +openfl_text__$internal_TextScript.DESERET = "Dsrt"; +openfl_text__$internal_TextScript.GOTHIC = "Goth"; +openfl_text__$internal_TextScript.OLD_ITALIC = "Ital"; +openfl_text__$internal_TextScript.BUHID = "Buhd"; +openfl_text__$internal_TextScript.HANUNOO = "Hano"; +openfl_text__$internal_TextScript.TAGALOG = "Tglg"; +openfl_text__$internal_TextScript.TAGBANWA = "Tagb"; +openfl_text__$internal_TextScript.CYPRIOT = "Cprt"; +openfl_text__$internal_TextScript.LIMBU = "Limb"; +openfl_text__$internal_TextScript.LINEAR_B = "Linb"; +openfl_text__$internal_TextScript.OSMANYA = "Osma"; +openfl_text__$internal_TextScript.SHAVIAN = "Shaw"; +openfl_text__$internal_TextScript.TAI_LE = "Tale"; +openfl_text__$internal_TextScript.UGARITIC = "Ugar"; +openfl_text__$internal_TextScript.BUGINESE = "Bugi"; +openfl_text__$internal_TextScript.COPTIC = "Copt"; +openfl_text__$internal_TextScript.GLAGOLITIC = "Glag"; +openfl_text__$internal_TextScript.KHAROSHTHI = "Khar"; +openfl_text__$internal_TextScript.NEW_TAI_LUE = "Talu"; +openfl_text__$internal_TextScript.OLD_PERSIAN = "Xpeo"; +openfl_text__$internal_TextScript.SYLOTI_NAGRI = "Sylo"; +openfl_text__$internal_TextScript.TIFINAGH = "Tfng"; +openfl_text__$internal_TextScript.BALINESE = "Bali"; +openfl_text__$internal_TextScript.CUNEIFORM = "Xsux"; +openfl_text__$internal_TextScript.NKO = "Nkoo"; +openfl_text__$internal_TextScript.PHAGS_PA = "Phag"; +openfl_text__$internal_TextScript.PHOENICIAN = "Phnx"; +openfl_text__$internal_TextScript.CARIAN = "Cari"; +openfl_text__$internal_TextScript.CHAM = "Cham"; +openfl_text__$internal_TextScript.KAYAH_LI = "Kali"; +openfl_text__$internal_TextScript.LEPCHA = "Lepc"; +openfl_text__$internal_TextScript.LYCIAN = "Lyci"; +openfl_text__$internal_TextScript.LYDIAN = "Lydi"; +openfl_text__$internal_TextScript.OL_CHIKI = "Olck"; +openfl_text__$internal_TextScript.REJANG = "Rjng"; +openfl_text__$internal_TextScript.SAURASHTRA = "Saur"; +openfl_text__$internal_TextScript.SUNDANESE = "Sund"; +openfl_text__$internal_TextScript.VAI = "Vaii"; +openfl_text__$internal_TextScript.AVESTAN = "Avst"; +openfl_text__$internal_TextScript.BAMUM = "Bamu"; +openfl_text__$internal_TextScript.EGYPTIAN_HIEROGLYPHS = "Egyp"; +openfl_text__$internal_TextScript.IMPERIAL_ARAMAIC = "Armi"; +openfl_text__$internal_TextScript.INSCRIPTIONAL_PAHLAVI = "Phli"; +openfl_text__$internal_TextScript.INSCRIPTIONAL_PARTHIAN = "Prti"; +openfl_text__$internal_TextScript.JAVANESE = "Java"; +openfl_text__$internal_TextScript.KAITHI = "Kthi"; +openfl_text__$internal_TextScript.LISU = "Lisu"; +openfl_text__$internal_TextScript.MEETEI_MAYEK = "Mtei"; +openfl_text__$internal_TextScript.OLD_SOUTH_ARABIAN = "Sarb"; +openfl_text__$internal_TextScript.OLD_TURKIC = "Orkh"; +openfl_text__$internal_TextScript.SAMARITAN = "Samr"; +openfl_text__$internal_TextScript.TAI_THAM = "Lana"; +openfl_text__$internal_TextScript.TAI_VIET = "Tavt"; +openfl_text__$internal_TextScript.BATAK = "Batk"; +openfl_text__$internal_TextScript.BRAHMI = "Brah"; +openfl_text__$internal_TextScript.MANDAIC = "Mand"; +openfl_text__$internal_TextScript.CHAKMA = "Cakm"; +openfl_text__$internal_TextScript.MEROITIC_CURSIVE = "Merc"; +openfl_text__$internal_TextScript.MEROITIC_HIEROGLYPHS = "Mero"; +openfl_text__$internal_TextScript.MIAO = "Plrd"; +openfl_text__$internal_TextScript.SHARADA = "Shrd"; +openfl_text__$internal_TextScript.SORA_SOMPENG = "Sora"; +openfl_text__$internal_TextScript.TAKRI = "Takr"; +openfl_text__$internal_TextScript.BASSA_VAH = "Bass"; +openfl_text__$internal_TextScript.CAUCASIAN_ALBANIAN = "Aghb"; +openfl_text__$internal_TextScript.DUPLOYAN = "Dupl"; +openfl_text__$internal_TextScript.ELBASAN = "Elba"; +openfl_text__$internal_TextScript.GRANTHA = "Gran"; +openfl_text__$internal_TextScript.KHOJKI = "Khoj"; +openfl_text__$internal_TextScript.KHUDAWADI = "Sind"; +openfl_text__$internal_TextScript.LINEAR_A = "Lina"; +openfl_text__$internal_TextScript.MAHAJANI = "Mahj"; +openfl_text__$internal_TextScript.MANICHAEAN = "Mani"; +openfl_text__$internal_TextScript.MENDE_KIKAKUI = "Mend"; +openfl_text__$internal_TextScript.MODI = "Modi"; +openfl_text__$internal_TextScript.MRO = "Mroo"; +openfl_text__$internal_TextScript.NABATAEAN = "Nbat"; +openfl_text__$internal_TextScript.OLD_NORTH_ARABIAN = "Narb"; +openfl_text__$internal_TextScript.OLD_PERMIC = "Perm"; +openfl_text__$internal_TextScript.PAHAWH_HMONG = "Hmng"; +openfl_text__$internal_TextScript.PALMYRENE = "Palm"; +openfl_text__$internal_TextScript.PAU_CIN_HAU = "Pauc"; +openfl_text__$internal_TextScript.PSALTER_PAHLAVI = "Phlp"; +openfl_text__$internal_TextScript.SIDDHAM = "Sidd"; +openfl_text__$internal_TextScript.TIRHUTA = "Tirh"; +openfl_text__$internal_TextScript.WARANG_CITI = "Wara"; +openfl_text__$internal_TextLayoutGroup.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_ui_GameInput.__meta__ = { fields : { addEventListener : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_ui_GameInput.isSupported = true; +openfl_ui_GameInput.numDevices = 0; +openfl_ui_GameInput.__deviceList = []; +openfl_ui_GameInput.__instances = []; +openfl_ui_GameInput.__devices = new haxe_ds_ObjectMap(); +openfl_ui_GameInputDevice.MAX_BUFFER_SIZE = 32000; +openfl_ui_Keyboard.__meta__ = { statics : { BREAK : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, NUMLOCK : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +openfl_ui_Keyboard.NUMBER_0 = 48; +openfl_ui_Keyboard.NUMBER_1 = 49; +openfl_ui_Keyboard.NUMBER_2 = 50; +openfl_ui_Keyboard.NUMBER_3 = 51; +openfl_ui_Keyboard.NUMBER_4 = 52; +openfl_ui_Keyboard.NUMBER_5 = 53; +openfl_ui_Keyboard.NUMBER_6 = 54; +openfl_ui_Keyboard.NUMBER_7 = 55; +openfl_ui_Keyboard.NUMBER_8 = 56; +openfl_ui_Keyboard.NUMBER_9 = 57; +openfl_ui_Keyboard.A = 65; +openfl_ui_Keyboard.B = 66; +openfl_ui_Keyboard.C = 67; +openfl_ui_Keyboard.D = 68; +openfl_ui_Keyboard.E = 69; +openfl_ui_Keyboard.F = 70; +openfl_ui_Keyboard.G = 71; +openfl_ui_Keyboard.H = 72; +openfl_ui_Keyboard.I = 73; +openfl_ui_Keyboard.J = 74; +openfl_ui_Keyboard.K = 75; +openfl_ui_Keyboard.L = 76; +openfl_ui_Keyboard.M = 77; +openfl_ui_Keyboard.N = 78; +openfl_ui_Keyboard.O = 79; +openfl_ui_Keyboard.P = 80; +openfl_ui_Keyboard.Q = 81; +openfl_ui_Keyboard.R = 82; +openfl_ui_Keyboard.S = 83; +openfl_ui_Keyboard.T = 84; +openfl_ui_Keyboard.U = 85; +openfl_ui_Keyboard.V = 86; +openfl_ui_Keyboard.W = 87; +openfl_ui_Keyboard.X = 88; +openfl_ui_Keyboard.Y = 89; +openfl_ui_Keyboard.Z = 90; +openfl_ui_Keyboard.NUMPAD_0 = 96; +openfl_ui_Keyboard.NUMPAD_1 = 97; +openfl_ui_Keyboard.NUMPAD_2 = 98; +openfl_ui_Keyboard.NUMPAD_3 = 99; +openfl_ui_Keyboard.NUMPAD_4 = 100; +openfl_ui_Keyboard.NUMPAD_5 = 101; +openfl_ui_Keyboard.NUMPAD_6 = 102; +openfl_ui_Keyboard.NUMPAD_7 = 103; +openfl_ui_Keyboard.NUMPAD_8 = 104; +openfl_ui_Keyboard.NUMPAD_9 = 105; +openfl_ui_Keyboard.NUMPAD_MULTIPLY = 106; +openfl_ui_Keyboard.NUMPAD_ADD = 107; +openfl_ui_Keyboard.NUMPAD_ENTER = 108; +openfl_ui_Keyboard.NUMPAD_SUBTRACT = 109; +openfl_ui_Keyboard.NUMPAD_DECIMAL = 110; +openfl_ui_Keyboard.NUMPAD_DIVIDE = 111; +openfl_ui_Keyboard.F1 = 112; +openfl_ui_Keyboard.F2 = 113; +openfl_ui_Keyboard.F3 = 114; +openfl_ui_Keyboard.F4 = 115; +openfl_ui_Keyboard.F5 = 116; +openfl_ui_Keyboard.F6 = 117; +openfl_ui_Keyboard.F7 = 118; +openfl_ui_Keyboard.F8 = 119; +openfl_ui_Keyboard.F9 = 120; +openfl_ui_Keyboard.F10 = 121; +openfl_ui_Keyboard.F11 = 122; +openfl_ui_Keyboard.F12 = 123; +openfl_ui_Keyboard.F13 = 124; +openfl_ui_Keyboard.F14 = 125; +openfl_ui_Keyboard.F15 = 126; +openfl_ui_Keyboard.BACKSPACE = 8; +openfl_ui_Keyboard.TAB = 9; +openfl_ui_Keyboard.ALTERNATE = 18; +openfl_ui_Keyboard.ENTER = 13; +openfl_ui_Keyboard.COMMAND = 15; +openfl_ui_Keyboard.SHIFT = 16; +openfl_ui_Keyboard.CONTROL = 17; +openfl_ui_Keyboard.BREAK = 19; +openfl_ui_Keyboard.CAPS_LOCK = 20; +openfl_ui_Keyboard.NUMPAD = 21; +openfl_ui_Keyboard.ESCAPE = 27; +openfl_ui_Keyboard.SPACE = 32; +openfl_ui_Keyboard.PAGE_UP = 33; +openfl_ui_Keyboard.PAGE_DOWN = 34; +openfl_ui_Keyboard.END = 35; +openfl_ui_Keyboard.HOME = 36; +openfl_ui_Keyboard.LEFT = 37; +openfl_ui_Keyboard.RIGHT = 39; +openfl_ui_Keyboard.UP = 38; +openfl_ui_Keyboard.DOWN = 40; +openfl_ui_Keyboard.INSERT = 45; +openfl_ui_Keyboard.DELETE = 46; +openfl_ui_Keyboard.NUMLOCK = 144; +openfl_ui_Keyboard.SEMICOLON = 186; +openfl_ui_Keyboard.EQUAL = 187; +openfl_ui_Keyboard.COMMA = 188; +openfl_ui_Keyboard.MINUS = 189; +openfl_ui_Keyboard.PERIOD = 190; +openfl_ui_Keyboard.SLASH = 191; +openfl_ui_Keyboard.BACKQUOTE = 192; +openfl_ui_Keyboard.LEFTBRACKET = 219; +openfl_ui_Keyboard.BACKSLASH = 220; +openfl_ui_Keyboard.RIGHTBRACKET = 221; +openfl_ui_Keyboard.QUOTE = 222; +openfl_ui_Mouse.supportsCursor = true; +openfl_ui_Mouse.supportsNativeCursor = true; +openfl_ui_Mouse.__cursor = "auto"; +openfl_ui_MouseCursor.ARROW = "arrow"; +openfl_ui_MouseCursor.AUTO = "auto"; +openfl_ui_MouseCursor.BUTTON = "button"; +openfl_ui_MouseCursor.HAND = "hand"; +openfl_ui_MouseCursor.IBEAM = "ibeam"; +openfl_ui_MouseCursor.__CROSSHAIR = "crosshair"; +openfl_ui_MouseCursor.__CUSTOM = "custom"; +openfl_ui_MouseCursor.__MOVE = "move"; +openfl_ui_MouseCursor.__RESIZE_NESW = "resize_nesw"; +openfl_ui_MouseCursor.__RESIZE_NS = "resize_ns"; +openfl_ui_MouseCursor.__RESIZE_NWSE = "resize_nwse"; +openfl_ui_MouseCursor.__RESIZE_WE = "resize_we"; +openfl_ui_MouseCursor.__WAIT = "wait"; +openfl_ui_MouseCursor.__WAIT_ARROW = "waitarrow"; +openfl_utils_AGALMiniAssembler.__meta__ = { obj : { SuppressWarnings : [["checkstyle:ConstantName","checkstyle:FieldDocComment"]]}}; +openfl_utils_AGALMiniAssembler.OPMAP = new haxe_ds_StringMap(); +openfl_utils_AGALMiniAssembler.REGMAP = new haxe_ds_StringMap(); +openfl_utils_AGALMiniAssembler.SAMPLEMAP = new haxe_ds_StringMap(); +openfl_utils_AGALMiniAssembler.MAX_NESTING = 4; +openfl_utils_AGALMiniAssembler.MAX_OPCODES = 4096; +openfl_utils_AGALMiniAssembler.FRAGMENT = "fragment"; +openfl_utils_AGALMiniAssembler.VERTEX = "vertex"; +openfl_utils_AGALMiniAssembler.SAMPLER_TYPE_SHIFT = 8; +openfl_utils_AGALMiniAssembler.SAMPLER_DIM_SHIFT = 12; +openfl_utils_AGALMiniAssembler.SAMPLER_SPECIAL_SHIFT = 16; +openfl_utils_AGALMiniAssembler.SAMPLER_REPEAT_SHIFT = 20; +openfl_utils_AGALMiniAssembler.SAMPLER_MIPMAP_SHIFT = 24; +openfl_utils_AGALMiniAssembler.SAMPLER_FILTER_SHIFT = 28; +openfl_utils_AGALMiniAssembler.REG_WRITE = 1; +openfl_utils_AGALMiniAssembler.REG_READ = 2; +openfl_utils_AGALMiniAssembler.REG_FRAG = 32; +openfl_utils_AGALMiniAssembler.REG_VERT = 64; +openfl_utils_AGALMiniAssembler.OP_SCALAR = 1; +openfl_utils_AGALMiniAssembler.OP_SPECIAL_TEX = 8; +openfl_utils_AGALMiniAssembler.OP_SPECIAL_MATRIX = 16; +openfl_utils_AGALMiniAssembler.OP_FRAG_ONLY = 32; +openfl_utils_AGALMiniAssembler.OP_VERT_ONLY = 64; +openfl_utils_AGALMiniAssembler.OP_NO_DEST = 128; +openfl_utils_AGALMiniAssembler.OP_VERSION2 = 256; +openfl_utils_AGALMiniAssembler.OP_INCNEST = 512; +openfl_utils_AGALMiniAssembler.OP_DECNEST = 1024; +openfl_utils_AGALMiniAssembler.MOV = "mov"; +openfl_utils_AGALMiniAssembler.ADD = "add"; +openfl_utils_AGALMiniAssembler.SUB = "sub"; +openfl_utils_AGALMiniAssembler.MUL = "mul"; +openfl_utils_AGALMiniAssembler.DIV = "div"; +openfl_utils_AGALMiniAssembler.RCP = "rcp"; +openfl_utils_AGALMiniAssembler.MIN = "min"; +openfl_utils_AGALMiniAssembler.MAX = "max"; +openfl_utils_AGALMiniAssembler.FRC = "frc"; +openfl_utils_AGALMiniAssembler.SQT = "sqt"; +openfl_utils_AGALMiniAssembler.RSQ = "rsq"; +openfl_utils_AGALMiniAssembler.POW = "pow"; +openfl_utils_AGALMiniAssembler.LOG = "log"; +openfl_utils_AGALMiniAssembler.EXP = "exp"; +openfl_utils_AGALMiniAssembler.NRM = "nrm"; +openfl_utils_AGALMiniAssembler.SIN = "sin"; +openfl_utils_AGALMiniAssembler.COS = "cos"; +openfl_utils_AGALMiniAssembler.CRS = "crs"; +openfl_utils_AGALMiniAssembler.DP3 = "dp3"; +openfl_utils_AGALMiniAssembler.DP4 = "dp4"; +openfl_utils_AGALMiniAssembler.ABS = "abs"; +openfl_utils_AGALMiniAssembler.NEG = "neg"; +openfl_utils_AGALMiniAssembler.SAT = "sat"; +openfl_utils_AGALMiniAssembler.M33 = "m33"; +openfl_utils_AGALMiniAssembler.M44 = "m44"; +openfl_utils_AGALMiniAssembler.M34 = "m34"; +openfl_utils_AGALMiniAssembler.DDX = "ddx"; +openfl_utils_AGALMiniAssembler.DDY = "ddy"; +openfl_utils_AGALMiniAssembler.IFE = "ife"; +openfl_utils_AGALMiniAssembler.INE = "ine"; +openfl_utils_AGALMiniAssembler.IFG = "ifg"; +openfl_utils_AGALMiniAssembler.IFL = "ifl"; +openfl_utils_AGALMiniAssembler.IEG = "ieg"; +openfl_utils_AGALMiniAssembler.IEL = "iel"; +openfl_utils_AGALMiniAssembler.ELS = "els"; +openfl_utils_AGALMiniAssembler.EIF = "eif"; +openfl_utils_AGALMiniAssembler.TED = "ted"; +openfl_utils_AGALMiniAssembler.KIL = "kil"; +openfl_utils_AGALMiniAssembler.TEX = "tex"; +openfl_utils_AGALMiniAssembler.SGE = "sge"; +openfl_utils_AGALMiniAssembler.SLT = "slt"; +openfl_utils_AGALMiniAssembler.SGN = "sgn"; +openfl_utils_AGALMiniAssembler.SEQ = "seq"; +openfl_utils_AGALMiniAssembler.SNE = "sne"; +openfl_utils_AGALMiniAssembler.VA = "va"; +openfl_utils_AGALMiniAssembler.VC = "vc"; +openfl_utils_AGALMiniAssembler.VT = "vt"; +openfl_utils_AGALMiniAssembler.VO = "vo"; +openfl_utils_AGALMiniAssembler.VI = "vi"; +openfl_utils_AGALMiniAssembler.FC = "fc"; +openfl_utils_AGALMiniAssembler.FT = "ft"; +openfl_utils_AGALMiniAssembler.FS = "fs"; +openfl_utils_AGALMiniAssembler.FO = "fo"; +openfl_utils_AGALMiniAssembler.FD = "fd"; +openfl_utils_AGALMiniAssembler.IID = "iid"; +openfl_utils_AGALMiniAssembler.D2 = "2d"; +openfl_utils_AGALMiniAssembler.D3 = "3d"; +openfl_utils_AGALMiniAssembler.CUBE = "cube"; +openfl_utils_AGALMiniAssembler.MIPNEAREST = "mipnearest"; +openfl_utils_AGALMiniAssembler.MIPLINEAR = "miplinear"; +openfl_utils_AGALMiniAssembler.MIPNONE = "mipnone"; +openfl_utils_AGALMiniAssembler.NOMIP = "nomip"; +openfl_utils_AGALMiniAssembler.NEAREST = "nearest"; +openfl_utils_AGALMiniAssembler.LINEAR = "linear"; +openfl_utils_AGALMiniAssembler.ANISOTROPIC2X = "anisotropic2x"; +openfl_utils_AGALMiniAssembler.ANISOTROPIC4X = "anisotropic4x"; +openfl_utils_AGALMiniAssembler.ANISOTROPIC8X = "anisotropic8x"; +openfl_utils_AGALMiniAssembler.ANISOTROPIC16X = "anisotropic16x"; +openfl_utils_AGALMiniAssembler.CENTROID = "centroid"; +openfl_utils_AGALMiniAssembler.SINGLE = "single"; +openfl_utils_AGALMiniAssembler.IGNORESAMPLER = "ignoresampler"; +openfl_utils_AGALMiniAssembler.REPEAT = "repeat"; +openfl_utils_AGALMiniAssembler.WRAP = "wrap"; +openfl_utils_AGALMiniAssembler.CLAMP = "clamp"; +openfl_utils_AGALMiniAssembler.REPEAT_U_CLAMP_V = "repeat_u_clamp_v"; +openfl_utils_AGALMiniAssembler.CLAMP_U_REPEAT_V = "clamp_u_repeat_v"; +openfl_utils_AGALMiniAssembler.RGBA = "rgba"; +openfl_utils_AGALMiniAssembler.COMPRESSED = "compressed"; +openfl_utils_AGALMiniAssembler.COMPRESSEDALPHA = "compressedalpha"; +openfl_utils_AGALMiniAssembler.DXT1 = "dxt1"; +openfl_utils_AGALMiniAssembler.DXT5 = "dxt5"; +openfl_utils_AGALMiniAssembler.VIDEO = "video"; +openfl_utils_AGALMiniAssembler.initialized = false; +openfl_utils__$AGALMiniAssembler_OpCode.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_utils__$AGALMiniAssembler_Register.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_utils__$AGALMiniAssembler_Sampler.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_utils_Assets.cache = new openfl_utils_AssetCache(); +openfl_utils_Assets.dispatcher = new openfl_events_EventDispatcher(); +openfl_utils_Assets.libraryBindings = new haxe_ds_StringMap(); +openfl_utils_ByteArray.__bytePointer = new lime_utils_BytePointerData(null,0); +openfl_utils_ByteArrayData.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_utils_ByteArrayData.defaultObjectEncoding = 10; +openfl_utils_CompressionAlgorithm.DEFLATE = 0; +openfl_utils_CompressionAlgorithm.LZMA = 1; +openfl_utils_CompressionAlgorithm.ZLIB = 2; +openfl_utils__$Dictionary_ClassMap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_utils__$Dictionary_FloatMap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_utils__$Dictionary_UtilsObjectMap.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_utils_Endian.BIG_ENDIAN = 0; +openfl_utils_Endian.LITTLE_ENDIAN = 1; +openfl_utils_Object.__meta__ = { statics : { iterator : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __get : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __set : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __getArray : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, __setArray : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}}; +haxe_lang_Iterator.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +haxe_lang_Iterable.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}}; +openfl_utils__$internal_Lib.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, statics : { notImplemented : { SuppressWarnings : ["checkstyle:NullableParameter"]}}}; +openfl_utils__$internal_Lib.__sentWarnings = new haxe_ds_StringMap(); +openfl_utils__$internal_TouchData.__meta__ = { obj : { SuppressWarnings : ["checkstyle:FieldDocComment"]}, fields : { touch : { SuppressWarnings : ["checkstyle:Dynamic"]}}}; +openfl_utils__$internal_TouchData.__pool = new lime_utils_ObjectPool(function() { + return new openfl_utils__$internal_TouchData(); +},function(data) { + data.reset(); +}); +openfl_utils__$internal_format_amf3_AMF3Array.__meta__ = { fields : { extra : { optional : null}}}; +ApplicationMain.main(); +})(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this); + +}); + if (typeof self !== "undefined" && self.constructor.name.includes("Worker")) { + // No need for exports in a worker context, just initialize statics. + $hx_script({}, $global); + } else { + $hx_exports.lime = $hx_exports.lime || {}; + $hx_exports.lime.$scripts = $hx_exports.lime.$scripts || {}; + $hx_exports.lime.$scripts["LPTCManager2026"] = $hx_script; + $hx_exports.lime.embed = function (projectName) { + var exports = {}; + var script = $hx_exports.lime.$scripts[projectName]; + if (!script) throw Error("Cannot find project name \"" + projectName + "\""); + script(exports, $global); + for (var key in exports) $hx_exports[key] = $hx_exports[key] || exports[key]; + var lime = exports.lime || window.lime; + if (lime && lime.embed && this !== lime.embed) lime.embed.apply(lime, arguments); + return exports; + }; + } + + if (typeof define === "function" && define.amd) { + define([], function () { return $hx_exports.lime; }); + define.__amd = define.amd; + define.amd = null; + } +}) + +$lime_init(typeof exports !== "undefined" ? exports : typeof define === "function" && define.amd ? {} : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : this, +typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : this); + + +if(typeof self === "undefined" || !self.constructor.name.includes("Worker")) { /*! howler.js v2.2.4 | (c) 2013-2020, James Simpson of GoldFire Studios | MIT License | howlerjs.com */ +!function(){"use strict";var e=function(){this.init()};e.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var o=this||n;if(e=parseFloat(e),o.ctx||_(),void 0!==e&&e>=0&&e<=1){if(o._volume=e,o._muted)return o;o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var t=0;t=0;o--)e._howls[o].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,_()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||n;if(e.state=e.ctx?e.ctx.state||"suspended":"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{var o=new Audio;void 0===o.oncanplaythrough&&(e._canPlayEvent="canplay")}catch(n){e.noAudio=!0}else e.noAudio=!0;try{var o=new Audio;o.muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,o=null;try{o="undefined"!=typeof Audio?new Audio:null}catch(n){return e}if(!o||"function"!=typeof o.canPlayType)return e;var t=o.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator?e._navigator.userAgent:"",a=r.match(/OPR\/(\d+)/g),u=a&&parseInt(a[0].split("/")[1],10)<33,d=-1!==r.indexOf("Safari")&&-1===r.indexOf("Chrome"),i=r.match(/Version\/(.*?) /),_=d&&i&&parseInt(i[1],10)<15;return e._codecs={mp3:!(u||!t&&!o.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!t,opus:!!o.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(o.canPlayType('audio/wav; codecs="1"')||o.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!o.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!o.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(o.canPlayType("audio/x-m4a;")||o.canPlayType("audio/m4a;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(o.canPlayType("audio/x-m4b;")||o.canPlayType("audio/m4b;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(o.canPlayType("audio/x-mp4;")||o.canPlayType("audio/mp4;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(_||!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(_||!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!o.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(o.canPlayType("audio/x-flac;")||o.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||n;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var o=function(n){for(;e._html5AudioPool.length0?d._seek:t._sprite[e][0]/1e3),s=Math.max(0,(t._sprite[e][0]+t._sprite[e][1])/1e3-_),l=1e3*s/Math.abs(d._rate),c=t._sprite[e][0]/1e3,f=(t._sprite[e][0]+t._sprite[e][1])/1e3;d._sprite=e,d._ended=!1;var p=function(){d._paused=!1,d._seek=_,d._start=c,d._stop=f,d._loop=!(!d._loop&&!t._sprite[e][2])};if(_>=f)return void t._ended(d);var m=d._node;if(t._webAudio){var v=function(){t._playLock=!1,p(),t._refreshBuffer(d);var e=d._muted||t._muted?0:d._volume;m.gain.setValueAtTime(e,n.ctx.currentTime),d._playStart=n.ctx.currentTime,void 0===m.bufferSource.start?d._loop?m.bufferSource.noteGrainOn(0,_,86400):m.bufferSource.noteGrainOn(0,_,s):d._loop?m.bufferSource.start(0,_,86400):m.bufferSource.start(0,_,s),l!==1/0&&(t._endTimers[d._id]=setTimeout(t._ended.bind(t,d),l)),o||setTimeout(function(){t._emit("play",d._id),t._loadQueue()},0)};"running"===n.state&&"interrupted"!==n.ctx.state?v():(t._playLock=!0,t.once("resume",v),t._clearTimer(d._id))}else{var h=function(){m.currentTime=_,m.muted=d._muted||t._muted||n._muted||m.muted,m.volume=d._volume*n.volume(),m.playbackRate=d._rate;try{var r=m.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(t._playLock=!0,p(),r.then(function(){t._playLock=!1,m._unlocked=!0,o?t._loadQueue():t._emit("play",d._id)}).catch(function(){t._playLock=!1,t._emit("playerror",d._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),d._ended=!0,d._paused=!0})):o||(t._playLock=!1,p(),t._emit("play",d._id)),m.playbackRate=d._rate,m.paused)return void t._emit("playerror",d._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||d._loop?t._endTimers[d._id]=setTimeout(t._ended.bind(t,d),l):(t._endTimers[d._id]=function(){t._ended(d),m.removeEventListener("ended",t._endTimers[d._id],!1)},m.addEventListener("ended",t._endTimers[d._id],!1))}catch(e){t._emit("playerror",d._id,e)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===m.src&&(m.src=t._src,m.load());var y=window&&window.ejecta||!m.readyState&&n._navigator.isCocoonJS;if(m.readyState>=3||y)h();else{t._playLock=!0,t._state="loading";var g=function(){t._state="loaded",h(),m.removeEventListener(n._canPlayEvent,g,!1)};m.addEventListener(n._canPlayEvent,g,!1),t._clearTimer(d._id)}}return d._id},pause:function(e){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"pause",action:function(){n.pause(e)}}),n;for(var o=n._getSoundIds(e),t=0;t=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else r.length>=2&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var a;if(!(void 0!==e&&e>=0&&e<=1))return a=o?t._soundById(o):t._sounds[0],a?a._volume:0;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"volume",action:function(){t.volume.apply(t,r)}}),t;void 0===o&&(t._volume=e),o=t._getSoundIds(o);for(var u=0;u0?t/_:t),l=Date.now();e._fadeTo=o,e._interval=setInterval(function(){var r=(Date.now()-l)/t;l=Date.now(),d+=i*r,d=Math.round(100*d)/100,d=i<0?Math.max(o,d):Math.min(o,d),u._webAudio?e._volume=d:u.volume(d,e._id,!0),a&&(u._volume=d),(on&&d>=o)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,u.volume(o,e._id),u._emit("fade",e._id))},s)},_stopFade:function(e){var o=this,t=o._soundById(e);return t&&t._interval&&(o._webAudio&&t._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(t._interval),t._interval=null,o.volume(t._fadeTo,e),t._fadeTo=null,o._emit("fade",e)),o},loop:function(){var e,n,o,t=this,r=arguments;if(0===r.length)return t._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(o=t._soundById(parseInt(r[0],10)))&&o._loop;e=r[0],t._loop=e}else 2===r.length&&(e=r[0],n=parseInt(r[1],10));for(var a=t._getSoundIds(n),u=0;u=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var d;if("number"!=typeof e)return d=t._soundById(o),d?d._rate:t._rate;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"rate",action:function(){t.rate.apply(t,r)}}),t;void 0===o&&(t._rate=e),o=t._getSoundIds(o);for(var i=0;i=0?o=parseInt(r[0],10):t._sounds.length&&(o=t._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));if(void 0===o)return 0;if("number"==typeof e&&("loaded"!==t._state||t._playLock))return t._queue.push({event:"seek",action:function(){t.seek.apply(t,r)}}),t;var d=t._soundById(o);if(d){if(!("number"==typeof e&&e>=0)){if(t._webAudio){var i=t.playing(o)?n.ctx.currentTime-d._playStart:0,_=d._rateSeek?d._rateSeek-d._seek:0;return d._seek+(_+i*Math.abs(d._rate))}return d._node.currentTime}var s=t.playing(o);s&&t.pause(o,!0),d._seek=e,d._ended=!1,t._clearTimer(o),t._webAudio||!d._node||isNaN(d._node.duration)||(d._node.currentTime=e);var l=function(){s&&t.play(o,!0),t._emit("seek",o)};if(s&&!t._webAudio){var c=function(){t._playLock?setTimeout(c,0):l()};setTimeout(c,0)}else l()}return t},playing:function(e){var n=this;if("number"==typeof e){var o=n._soundById(e);return!!o&&!o._paused}for(var t=0;t=0&&n._howls.splice(a,1);var u=!0;for(t=0;t=0){u=!1;break}return r&&u&&delete r[e._src],n.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,n,o,t){var r=this,a=r["_on"+e];return"function"==typeof n&&a.push(t?{id:o,fn:n,once:t}:{id:o,fn:n}),r},off:function(e,n,o){var t=this,r=t["_on"+e],a=0;if("number"==typeof n&&(o=n,n=null),n||o)for(a=0;a=0;a--)r[a].id&&r[a].id!==n&&"load"!==e||(setTimeout(function(e){e.call(this,n,o)}.bind(t,r[a].fn),0),r[a].once&&t.off(e,r[a].fn,r[a].id));return t._loadQueue(e),t},_loadQueue:function(e){var n=this;if(n._queue.length>0){var o=n._queue[0];o.event===e&&(n._queue.shift(),n._loadQueue()),e||o.action()}return n},_ended:function(e){var o=this,t=e._sprite;if(!o._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;t--){if(o<=n)return;e._sounds[t]._ended&&(e._webAudio&&e._sounds[t]._node&&e._sounds[t]._node.disconnect(0),e._sounds.splice(t,1),o--)}}},_getSoundIds:function(e){var n=this;if(void 0===e){for(var o=[],t=0;t=0;if(!e.bufferSource)return o;if(n._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=n._scratchBuffer}catch(e){}return e.bufferSource=null,o},_clearSound:function(e){/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var t=function(e){this._parent=e,this.init()};t.prototype={init:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,o._sounds.push(e),e.create(),e},create:function(){var e=this,o=e._parent,t=n._muted||e._muted||e._parent._muted?0:e._volume;return o._webAudio?(e._node=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(t,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):n.noAudio||(e._node=n._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=o._src,e._node.preload=!0===o._preload?"auto":o._preload,e._node.volume=t*n.volume(),e._node.load()),e},reset:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,o=e._parent;o._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(o._sprite).length&&(o._sprite={__default:[0,1e3*o._duration]}),"loaded"!==o._state&&(o._state="loaded",o._emit("load"),o._loadQueue()),e._node.removeEventListener(n._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,n=e._parent;n._duration===1/0&&(n._duration=Math.ceil(10*e._node.duration)/10,n._sprite.__default[1]===1/0&&(n._sprite.__default[1]=1e3*n._duration),n._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var r={},a=function(e){var n=e._src;if(r[n])return e._duration=r[n].duration,void i(e);if(/^data:[^;]+;base64,/.test(n)){for(var o=atob(n.split(",")[1]),t=new Uint8Array(o.length),a=0;a0?(r[o._src]=e,i(o,e)):t()};"undefined"!=typeof Promise&&1===n.ctx.decodeAudioData.length?n.ctx.decodeAudioData(e).then(a).catch(t):n.ctx.decodeAudioData(e,a,t)},i=function(e,n){n&&!e._duration&&(e._duration=n.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},_=function(){if(n.usingWebAudio){try{"undefined"!=typeof AudioContext?n.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch(e){n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),o=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),t=o?parseInt(o[1],10):null;if(e&&t&&t<9){var r=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!r&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};"function"==typeof define&&define.amd&&define([],function(){return{Howler:n,Howl:o}}),"undefined"!=typeof exports&&(exports.Howler=n,exports.Howl=o),"undefined"!=typeof global?(global.HowlerGlobal=e,global.Howler=n,global.Howl=o,global.Sound=t):"undefined"!=typeof window&&(window.HowlerGlobal=e,window.Howler=n,window.Howl=o,window.Sound=t)}(); +/*! Spatial Plugin */ +!function(){"use strict";HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var n=this;if(!n.ctx||!n.ctx.listener)return n;for(var t=n._howls.length-1;t>=0;t--)n._howls[t].stereo(e);return n},HowlerGlobal.prototype.pos=function(e,n,t){var r=this;return r.ctx&&r.ctx.listener?(n="number"!=typeof n?r._pos[1]:n,t="number"!=typeof t?r._pos[2]:t,"number"!=typeof e?r._pos:(r._pos=[e,n,t],void 0!==r.ctx.listener.positionX?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]),r)):r},HowlerGlobal.prototype.orientation=function(e,n,t,r,o,i){var a=this;if(!a.ctx||!a.ctx.listener)return a;var p=a._orientation;return n="number"!=typeof n?p[1]:n,t="number"!=typeof t?p[2]:t,r="number"!=typeof r?p[3]:r,o="number"!=typeof o?p[4]:o,i="number"!=typeof i?p[5]:i,"number"!=typeof e?p:(a._orientation=[e,n,t,r,o,i],void 0!==a.ctx.listener.forwardX?(a.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.forwardZ.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),a.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),a.ctx.listener.upZ.setTargetAtTime(i,Howler.ctx.currentTime,.1)):a.ctx.listener.setOrientation(e,n,t,r,o,i),a)},Howl.prototype.init=function(e){return function(n){var t=this;return t._orientation=n.orientation||[1,0,0],t._stereo=n.stereo||null,t._pos=n.pos||null,t._pannerAttr={coneInnerAngle:void 0!==n.coneInnerAngle?n.coneInnerAngle:360,coneOuterAngle:void 0!==n.coneOuterAngle?n.coneOuterAngle:360,coneOuterGain:void 0!==n.coneOuterGain?n.coneOuterGain:0,distanceModel:void 0!==n.distanceModel?n.distanceModel:"inverse",maxDistance:void 0!==n.maxDistance?n.maxDistance:1e4,panningModel:void 0!==n.panningModel?n.panningModel:"HRTF",refDistance:void 0!==n.refDistance?n.refDistance:1,rolloffFactor:void 0!==n.rolloffFactor?n.rolloffFactor:1},t._onstereo=n.onstereo?[{fn:n.onstereo}]:[],t._onpos=n.onpos?[{fn:n.onpos}]:[],t._onorientation=n.onorientation?[{fn:n.onorientation}]:[],e.call(this,n)}}(Howl.prototype.init),Howl.prototype.stereo=function(n,t){var r=this;if(!r._webAudio)return r;if("loaded"!==r._state)return r._queue.push({event:"stereo",action:function(){r.stereo(n,t)}}),r;var o=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===t){if("number"!=typeof n)return r._stereo;r._stereo=n,r._pos=[n,0,0]}for(var i=r._getSoundIds(t),a=0;a0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var a=o.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==b)throw new Error(d[a]);if(e.header&&o.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?h.string2buf(e.dictionary):"[object ArrayBuffer]"===_.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=o.deflateSetDictionary(this.strm,n),a!==b)throw new Error(d[a]);this._dict_set=!0}}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg;return a.result}function r(t,e){return e=e||{},e.raw=!0,n(t,e)}function s(t,e){return e=e||{},e.gzip=!0,n(t,e)}var o=t("./zlib/deflate"),l=t("./utils/common"),h=t("./utils/strings"),d=t("./zlib/messages"),f=t("./zlib/zstream"),_=Object.prototype.toString,u=0,c=4,b=0,g=1,m=2,w=-1,p=0,v=8;i.prototype.push=function(t,e){var a,i,n=this.strm,r=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:e===!0?c:u,"string"==typeof t?n.input=h.string2buf(t):"[object ArrayBuffer]"===_.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(0===n.avail_out&&(n.output=new l.Buf8(r),n.next_out=0,n.avail_out=r),a=o.deflate(n,i),a!==g&&a!==b)return this.onEnd(a),this.ended=!0,!1;0!==n.avail_out&&(0!==n.avail_in||i!==c&&i!==m)||("string"===this.options.to?this.onData(h.buf2binstring(l.shrinkBuf(n.output,n.next_out))):this.onData(l.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||0===n.avail_out)&&a!==g);return i===c?(a=o.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===b):i!==m||(this.onEnd(b),n.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===b&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=l.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=i,a.deflate=n,a.deflateRaw=r,a.gzip=s},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(t,e,a){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var a=s.inflateInit2(this.strm,e.windowBits);if(a!==h.Z_OK)throw new Error(d[a]);this.header=new _,s.inflateGetHeader(this.strm,this.header)}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg;return a.result}function r(t,e){return e=e||{},e.raw=!0,n(t,e)}var s=t("./zlib/inflate"),o=t("./utils/common"),l=t("./utils/strings"),h=t("./zlib/constants"),d=t("./zlib/messages"),f=t("./zlib/zstream"),_=t("./zlib/gzheader"),u=Object.prototype.toString;i.prototype.push=function(t,e){var a,i,n,r,d,f,_=this.strm,c=this.options.chunkSize,b=this.options.dictionary,g=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?h.Z_FINISH:h.Z_NO_FLUSH,"string"==typeof t?_.input=l.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?_.input=new Uint8Array(t):_.input=t,_.next_in=0,_.avail_in=_.input.length;do{if(0===_.avail_out&&(_.output=new o.Buf8(c),_.next_out=0,_.avail_out=c),a=s.inflate(_,h.Z_NO_FLUSH),a===h.Z_NEED_DICT&&b&&(f="string"==typeof b?l.string2buf(b):"[object ArrayBuffer]"===u.call(b)?new Uint8Array(b):b,a=s.inflateSetDictionary(this.strm,f)),a===h.Z_BUF_ERROR&&g===!0&&(a=h.Z_OK,g=!1),a!==h.Z_STREAM_END&&a!==h.Z_OK)return this.onEnd(a),this.ended=!0,!1;_.next_out&&(0!==_.avail_out&&a!==h.Z_STREAM_END&&(0!==_.avail_in||i!==h.Z_FINISH&&i!==h.Z_SYNC_FLUSH)||("string"===this.options.to?(n=l.utf8border(_.output,_.next_out),r=_.next_out-n,d=l.buf2string(_.output,n),_.next_out=r,_.avail_out=c-r,r&&o.arraySet(_.output,_.output,n,r,0),this.onData(d)):this.onData(o.shrinkBuf(_.output,_.next_out)))),0===_.avail_in&&0===_.avail_out&&(g=!0)}while((_.avail_in>0||0===_.avail_out)&&a!==h.Z_STREAM_END);return a===h.Z_STREAM_END&&(i=h.Z_FINISH),i===h.Z_FINISH?(a=s.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===h.Z_OK):i!==h.Z_SYNC_FLUSH||(this.onEnd(h.Z_OK),_.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===h.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Inflate=i,a.inflate=n,a.inflateRaw=r,a.ungzip=n},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(t,e,a){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;a.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(var i in a)a.hasOwnProperty(i)&&(t[i]=a[i])}}return t},a.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,a,i,n){if(e.subarray&&t.subarray)return void t.set(e.subarray(a,a+i),n);for(var r=0;r=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;o[254]=o[254]=1,a.string2buf=function(t){var e,a,i,r,s,o=t.length,l=0;for(r=0;r>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},a.buf2binstring=function(t){return i(t,t.length)},a.binstring2buf=function(t){for(var e=new n.Buf8(t.length),a=0,i=e.length;a4)h[n++]=65533,a+=s-1;else{for(r&=2===s?31:3===s?15:7;s>1&&a1?h[n++]=65533:r<65536?h[n++]=r:(r-=65536,h[n++]=55296|r>>10&1023,h[n++]=56320|1023&r)}return i(h,n)},a.utf8border=function(t,e){var a;for(e=e||t.length,e>t.length&&(e=t.length),a=e-1;a>=0&&128===(192&t[a]);)a--;return a<0?e:0===a?e:a+o[t[a]]>e?a:e}},{"./common":3}],5:[function(t,e,a){"use strict";function i(t,e,a,i){for(var n=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){s=a>2e3?2e3:a,a-=s;do n=n+e[i++]|0,r=r+n|0;while(--s);n%=65521,r%=65521}return n|r<<16|0}e.exports=i},{}],6:[function(t,e,a){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],7:[function(t,e,a){"use strict";function i(){for(var t,e=[],a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}function n(t,e,a,i){var n=r,s=i+a;t^=-1;for(var o=i;o>>8^n[255&(t^e[o])];return t^-1}var r=i();e.exports=n},{}],8:[function(t,e,a){"use strict";function i(t,e){return t.msg=D[e],e}function n(t){return(t<<1)-(t>4?9:0)}function r(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(R.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function o(t,e){C._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function l(t,e){t.pending_buf[t.pending++]=e}function h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function d(t,e,a,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,R.arraySet(e,t.input,t.next_in,n,a),1===t.state.wrap?t.adler=N(t.adler,e,n,a):2===t.state.wrap&&(t.adler=O(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)}function f(t,e){var a,i,n=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-ft?t.strstart-(t.w_size-ft):0,h=t.window,d=t.w_mask,f=t.prev,_=t.strstart+dt,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do if(a=e,h[a+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do;while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<_);if(i=dt-(_-r),r=_-dt,i>s){if(t.match_start=e,s=i,i>=o)break;u=h[r+s-1],c=h[r+s]}}while((e=f[e&d])>l&&0!==--n);return s<=t.lookahead?s:t.lookahead}function _(t){var e,a,i,n,r,s=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-ft)){R.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,a=t.hash_size,e=a;do i=t.head[--e],t.head[e]=i>=s?i-s:0;while(--a);a=s,e=a;do i=t.prev[--e],t.prev[e]=i>=s?i-s:0;while(--a);n+=s}if(0===t.strm.avail_in)break;if(a=d(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=a,t.lookahead+t.insert>=ht)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(_(t),0===t.lookahead&&e===I)return vt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,o(t,!1),0===t.strm.avail_out))return vt;if(t.strstart-t.block_start>=t.w_size-ft&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.strstart>t.block_start&&(o(t,!1),0===t.strm.avail_out)?vt:vt}function c(t,e){for(var a,i;;){if(t.lookahead=ht&&(t.ins_h=(t.ins_h<=ht)if(i=C._tr_tally(t,t.strstart-t.match_start,t.match_length-ht),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ht){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=ht&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=ht-1)),t.prev_length>=ht&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ht,i=C._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-ht),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<=ht&&t.strstart>0&&(n=t.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){r=t.strstart+dt;do;while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ht?(a=C._tr_tally(t,1,t.match_length-ht),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function m(t,e){for(var a;;){if(0===t.lookahead&&(_(t),0===t.lookahead)){if(e===I)return vt;break}if(t.match_length=0,a=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function w(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}function p(t){t.window_size=2*t.w_size,r(t.head),t.max_lazy_match=Z[t.level].max_lazy,t.good_match=Z[t.level].good_length,t.nice_match=Z[t.level].nice_length,t.max_chain_length=Z[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ht-1,t.match_available=0,t.ins_h=0}function v(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=V,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new R.Buf16(2*ot),this.dyn_dtree=new R.Buf16(2*(2*rt+1)),this.bl_tree=new R.Buf16(2*(2*st+1)),r(this.dyn_ltree),r(this.dyn_dtree),r(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new R.Buf16(lt+1),this.heap=new R.Buf16(2*nt+1),r(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new R.Buf16(2*nt+1),r(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function k(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=Q,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ut:wt,t.adler=2===e.wrap?0:1,e.last_flush=I,C._tr_init(e),H):i(t,K)}function y(t){var e=k(t);return e===H&&p(t.state),e}function x(t,e){return t&&t.state?2!==t.state.wrap?K:(t.state.gzhead=e,H):K}function z(t,e,a,n,r,s){if(!t)return K;var o=1;if(e===Y&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),r<1||r>$||a!==V||n<8||n>15||e<0||e>9||s<0||s>W)return i(t,K);8===n&&(n=9);var l=new v;return t.state=l,l.strm=t,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<L||e<0)return t?i(t,K):K;if(o=t.state,!t.output||!t.input&&0!==t.avail_in||o.status===pt&&e!==F)return i(t,0===t.avail_out?P:K);if(o.strm=t,a=o.last_flush,o.last_flush=e,o.status===ut)if(2===o.wrap)t.adler=0,l(o,31),l(o,139),l(o,8),o.gzhead?(l(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),l(o,255&o.gzhead.time),l(o,o.gzhead.time>>8&255),l(o,o.gzhead.time>>16&255),l(o,o.gzhead.time>>24&255),l(o,9===o.level?2:o.strategy>=G||o.level<2?4:0),l(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(l(o,255&o.gzhead.extra.length),l(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(t.adler=O(t.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=ct):(l(o,0),l(o,0),l(o,0),l(o,0),l(o,0),l(o,9===o.level?2:o.strategy>=G||o.level<2?4:0),l(o,zt),o.status=wt);else{var _=V+(o.w_bits-8<<4)<<8,u=-1;u=o.strategy>=G||o.level<2?0:o.level<6?1:6===o.level?2:3,_|=u<<6,0!==o.strstart&&(_|=_t),_+=31-_%31,o.status=wt,h(o,_),0!==o.strstart&&(h(o,t.adler>>>16),h(o,65535&t.adler)),t.adler=1}if(o.status===ct)if(o.gzhead.extra){for(d=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending!==o.pending_buf_size));)l(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=bt)}else o.status=bt;if(o.status===bt)if(o.gzhead.name){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindexd&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.gzindex=0,o.status=gt)}else o.status=gt;if(o.status===gt)if(o.gzhead.comment){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindexd&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.status=mt)}else o.status=mt;if(o.status===mt&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&s(t),o.pending+2<=o.pending_buf_size&&(l(o,255&t.adler),l(o,t.adler>>8&255),t.adler=0,o.status=wt)):o.status=wt),0!==o.pending){if(s(t),0===t.avail_out)return o.last_flush=-1,H}else if(0===t.avail_in&&n(e)<=n(a)&&e!==F)return i(t,P);if(o.status===pt&&0!==t.avail_in)return i(t,P);if(0!==t.avail_in||0!==o.lookahead||e!==I&&o.status!==pt){var c=o.strategy===G?m(o,e):o.strategy===X?g(o,e):Z[o.level].func(o,e);if(c!==yt&&c!==xt||(o.status=pt),c===vt||c===yt)return 0===t.avail_out&&(o.last_flush=-1),H;if(c===kt&&(e===U?C._tr_align(o):e!==L&&(C._tr_stored_block(o,0,0,!1),e===T&&(r(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),s(t),0===t.avail_out))return o.last_flush=-1,H}return e!==F?H:o.wrap<=0?j:(2===o.wrap?(l(o,255&t.adler),l(o,t.adler>>8&255),l(o,t.adler>>16&255),l(o,t.adler>>24&255),l(o,255&t.total_in),l(o,t.total_in>>8&255),l(o,t.total_in>>16&255),l(o,t.total_in>>24&255)):(h(o,t.adler>>>16),h(o,65535&t.adler)),s(t),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?H:j)}function E(t){var e;return t&&t.state?(e=t.state.status,e!==ut&&e!==ct&&e!==bt&&e!==gt&&e!==mt&&e!==wt&&e!==pt?i(t,K):(t.state=null,e===wt?i(t,M):H)):K}function A(t,e){var a,i,n,s,o,l,h,d,f=e.length;if(!t||!t.state)return K;if(a=t.state,s=a.wrap,2===s||1===s&&a.status!==ut||a.lookahead)return K;for(1===s&&(t.adler=N(t.adler,e,f,0)),a.wrap=0,f>=a.w_size&&(0===s&&(r(a.head),a.strstart=0,a.block_start=0,a.insert=0),d=new R.Buf8(a.w_size),R.arraySet(d,e,f-a.w_size,a.w_size,0),e=d,f=a.w_size),o=t.avail_in,l=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,_(a);a.lookahead>=ht;){i=a.strstart,n=a.lookahead-(ht-1);do a.ins_h=(a.ins_h<>>24,b>>>=y,g-=y,y=k>>>16&255,0===y)A[o++]=65535&k;else{if(!(16&y)){if(0===(64&y)){k=m[(65535&k)+(b&(1<>>=y,g-=y),g<15&&(b+=E[r++]<>>24,b>>>=y,g-=y,y=k>>>16&255,!(16&y)){if(0===(64&y)){k=w[(65535&k)+(b&(1<d){t.msg="invalid distance too far back",a.mode=i;break t}if(b>>>=y,g-=y,y=o-l,z>y){if(y=z-y,y>_&&a.sane){t.msg="invalid distance too far back",a.mode=i;break t}if(B=0,S=c,0===u){if(B+=f-y,y2;)A[o++]=S[B++],A[o++]=S[B++],A[o++]=S[B++],x-=3;x&&(A[o++]=S[B++],x>1&&(A[o++]=S[B++]))}else{B=o-z;do A[o++]=A[B++],A[o++]=A[B++],A[o++]=A[B++],x-=3;while(x>2);x&&(A[o++]=A[B++],x>1&&(A[o++]=A[B++]))}break}}break}}while(r>3,r-=x,g-=x<<3,b&=(1<>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new w.Buf16(320),this.work=new w.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=T,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new w.Buf32(bt),e.distcode=e.distdyn=new w.Buf32(gt),e.sane=1,e.back=-1,Z):N}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,r(t)):N}function o(t,e){var a,i;return t&&t.state?(i=t.state,e<0?(a=0,e=-e):(a=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?N:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,s(t))):N}function l(t,e){var a,i;return t?(i=new n,t.state=i,i.window=null,a=o(t,e),a!==Z&&(t.state=null),a):N}function h(t){return l(t,wt)}function d(t){if(pt){var e;for(g=new w.Buf32(512),m=new w.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(y(z,t.lens,0,288,g,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;y(B,t.lens,0,32,m,0,t.work,{bits:5}),pt=!1}t.lencode=g,t.lenbits=9,t.distcode=m,t.distbits=5}function f(t,e,a,i){var n,r=t.state;return null===r.window&&(r.wsize=1<=r.wsize?(w.arraySet(r.window,e,a-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(n=r.wsize-r.wnext,n>i&&(n=i),w.arraySet(r.window,e,a-i,n,r.wnext),i-=n,i?(w.arraySet(r.window,e,a-i,i,0),r.wnext=i,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave>>8&255,a.check=v(a.check,Et,2,0),_=0,u=0,a.mode=F;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&_)<<8)+(_>>8))%31){t.msg="incorrect header check",a.mode=_t;break}if((15&_)!==U){t.msg="unknown compression method",a.mode=_t;break}if(_>>>=4,u-=4,yt=(15&_)+8,0===a.wbits)a.wbits=yt;else if(yt>a.wbits){t.msg="invalid window size",a.mode=_t;break}a.dmax=1<>8&1),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0,a.mode=L;case L:for(;u<32;){if(0===l)break t;l--,_+=n[s++]<>>8&255,Et[2]=_>>>16&255,Et[3]=_>>>24&255,a.check=v(a.check,Et,4,0)),_=0,u=0,a.mode=H;case H:for(;u<16;){if(0===l)break t;l--,_+=n[s++]<>8),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0,a.mode=j;case j:if(1024&a.flags){for(;u<16;){if(0===l)break t;l--,_+=n[s++]<>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0}else a.head&&(a.head.extra=null);a.mode=K;case K:if(1024&a.flags&&(g=a.length,g>l&&(g=l),g&&(a.head&&(yt=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Array(a.head.extra_len)),w.arraySet(a.head.extra,n,s,g,yt)),512&a.flags&&(a.check=v(a.check,n,g,s)),l-=g,s+=g,a.length-=g),a.length))break t;a.length=0,a.mode=M;case M:if(2048&a.flags){if(0===l)break t;g=0;do yt=n[s+g++],a.head&&yt&&a.length<65536&&(a.head.name+=String.fromCharCode(yt));while(yt&&g>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=X;break;case q:for(;u<32;){if(0===l)break t;l--,_+=n[s++]<>>=7&u,u-=7&u,a.mode=ht;break}for(;u<3;){if(0===l)break t;l--,_+=n[s++]<>>=1,u-=1,3&_){case 0:a.mode=J;break;case 1:if(d(a),a.mode=at,e===A){_>>>=2,u-=2;break t}break;case 2:a.mode=$;break;case 3:t.msg="invalid block type",a.mode=_t}_>>>=2,u-=2;break;case J:for(_>>>=7&u,u-=7&u;u<32;){if(0===l)break t;l--,_+=n[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=_t;break}if(a.length=65535&_,_=0,u=0,a.mode=Q,e===A)break t;case Q:a.mode=V;case V:if(g=a.length){if(g>l&&(g=l),g>h&&(g=h),0===g)break t;w.arraySet(r,n,s,g,o),l-=g,s+=g,h-=g,o+=g,a.length-=g;break}a.mode=X;break;case $:for(;u<14;){if(0===l)break t; +l--,_+=n[s++]<>>=5,u-=5,a.ndist=(31&_)+1,_>>>=5,u-=5,a.ncode=(15&_)+4,_>>>=4,u-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=_t;break}a.have=0,a.mode=tt;case tt:for(;a.have>>=3,u-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=y(x,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=_t;break}a.have=0,a.mode=et;case et:for(;a.have>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<>>=gt,u-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;u>>=gt,u-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=_t;break}yt=a.lens[a.have-1],g=3+(3&_),_>>>=2,u-=2}else if(17===wt){for(Bt=gt+3;u>>=gt,u-=gt,yt=0,g=3+(7&_),_>>>=3,u-=3}else{for(Bt=gt+7;u>>=gt,u-=gt,yt=0,g=11+(127&_),_>>>=7,u-=7}if(a.have+g>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=_t;break}for(;g--;)a.lens[a.have++]=yt}}if(a.mode===_t)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=_t;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=y(z,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=_t;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=y(B,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=_t;break}if(a.mode=at,e===A)break t;case at:a.mode=it;case it:if(l>=6&&h>=258){t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,k(t,b),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,a.mode===X&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=lt;break}if(32&mt){a.back=-1,a.mode=X;break}if(64&mt){t.msg="invalid literal/length code",a.mode=_t;break}a.extra=15&mt,a.mode=nt;case nt:if(a.extra){for(Bt=a.extra;u>>=a.extra,u-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=rt;case rt:for(;St=a.distcode[_&(1<>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=_t;break}a.offset=wt,a.extra=15&mt,a.mode=st;case st:if(a.extra){for(Bt=a.extra;u>>=a.extra,u-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=_t;break}a.mode=ot;case ot:if(0===h)break t;if(g=b-h,a.offset>g){if(g=a.offset-g,g>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=_t;break}g>a.wnext?(g-=a.wnext,m=a.wsize-g):m=a.wnext-g,g>a.length&&(g=a.length),bt=a.window}else bt=r,m=o-a.offset,g=a.length;g>h&&(g=h),h-=g,a.length-=g;do r[o++]=bt[m++];while(--g);0===a.length&&(a.mode=it);break;case lt:if(0===h)break t;r[o++]=a.length,h--,a.mode=it;break;case ht:if(a.wrap){for(;u<32;){if(0===l)break t;l--,_|=n[s++]<=1&&0===j[N];N--);if(O>N&&(O=N),0===N)return b[g++]=20971520,b[g++]=20971520,w.bits=1,0;for(C=1;C0&&(t===o||1!==N))return-1;for(K[1]=0,Z=1;Zr||t===h&&T>s)return 1;for(var Y=0;;){Y++,B=Z-I,m[R]z?(S=M[P+m[R]],E=L[H+m[R]]):(S=96,E=0),p=1<>I)+v]=B<<24|S<<16|E|0;while(0!==v);for(p=1<>=1;if(0!==p?(F&=p-1,F+=p):F=0,R++,0===--j[Z]){if(Z===N)break;Z=e[a+m[R]]}if(Z>O&&(F&y)!==k){for(0===I&&(I=O),x+=C,D=Z-I,U=1<r||t===h&&T>s)return 1;k=F&y,b[k]=O<<24|D<<16|x-g|0}}return 0!==F&&(b[x+F]=Z-I<<24|64<<16|0),w.bits=O,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?lt[t]:lt[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>W-a?(t.bi_buf|=e<>W-t.bi_valid,t.bi_valid+=a-W):(t.bi_buf|=e<>>=1,a<<=1;while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=X;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;ac&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)n=t.heap[--a],n>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(X+1),s=0;for(i=1;i<=X;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(X+1);for(a=0,i=0;i>=7;i8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),N.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]>1;a>=1;a--)p(t,r,a);n=l;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return D;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return I;for(e=32;e0?(t.strm.data_type===U&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=n&&(n=r)):n=r=a+5,a+4<=n&&e!==-1?A(t,e,a,i):t.strategy===O||r===n?(l(t,(F<<1)+(i?1:0),3),v(t,st,ot)):(l(t,(L<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)}function C(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(ht[a]+M+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1}var N=t("../utils/common"),O=4,D=0,I=1,U=2,T=0,F=1,L=2,H=3,j=258,K=29,M=256,P=M+1+K,Y=30,q=19,G=2*P+1,X=15,W=16,J=7,Q=256,V=16,$=17,tt=18,et=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],at=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,st=new Array(2*(P+2));i(st);var ot=new Array(2*Y);i(ot);var lt=new Array(rt);i(lt);var ht=new Array(j-H+1);i(ht);var dt=new Array(K);i(dt);var ft=new Array(Y);i(ft);var _t,ut,ct,bt=!1;a._tr_init=E,a._tr_stored_block=A,a._tr_flush_block=R,a._tr_tally=C,a._tr_align=Z},{"../utils/common":3}],15:[function(t,e,a){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=i},{}],"/":[function(t,e,a){"use strict";var i=t("./lib/utils/common").assign,n=t("./lib/deflate"),r=t("./lib/inflate"),s=t("./lib/zlib/constants"),o={};i(o,n,r,s),e.exports=o},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")}); + +if(typeof self === "undefined" || !self.constructor.name.includes("Worker")) { var e=function(){"use strict";function r(e,r){postMessage({action:xt,cbn:r,result:e})}function t(e){var r=[];return r[e-1]=void 0,r}function o(e,r){return i(e[0]+r[0],e[1]+r[1])}function n(e,r){return u(~~Math.max(Math.min(e[1]/Ot,2147483647),-2147483648)&~~Math.max(Math.min(r[1]/Ot,2147483647),-2147483648),c(e)&c(r))}function s(e,r){var t,o;return e[0]==r[0]&&e[1]==r[1]?0:(t=0>e[1],o=0>r[1],t&&!o?-1:!t&&o?1:h(e,r)[1]<0?-1:1)}function i(e,r){var t,o;for(r%=0x10000000000000000,e%=0x10000000000000000,t=r%Ot,o=Math.floor(e/Ot)*Ot,r=r-t+o,e=e-o+t;0>e;)e+=Ot,r-=Ot;for(;e>4294967295;)e-=Ot,r+=Ot;for(r%=0x10000000000000000;r>0x7fffffff00000000;)r-=0x10000000000000000;for(;-0x8000000000000000>r;)r+=0x10000000000000000;return[e,r]}function _(e,r){return e[0]==r[0]&&e[1]==r[1]}function a(e){return e>=0?[e,0]:[e+Ot,-Ot]}function c(e){return e[0]>=2147483648?~~Math.max(Math.min(e[0]-Ot,2147483647),-2147483648):~~Math.max(Math.min(e[0],2147483647),-2147483648)}function u(e,r){var t,o;return t=e*Ot,o=r,0>r&&(o+=Ot),[o,t]}function f(e){return 30>=e?1<e[1])throw Error("Neg");return s=f(r),o=e[1]*s%0x10000000000000000,n=e[0]*s,t=n-n%Ot,o+=t,n-=t,o>=0x8000000000000000&&(o-=0x10000000000000000),[n,o]}function d(e,r){var t;return r&=63,t=f(r),i(Math.floor(e[0]/t),e[1]/t)}function p(e,r){var t;return r&=63,t=d(e,r),0>e[1]&&(t=o(t,m([2,0],63-r))),t}function h(e,r){return i(e[0]-r[0],e[1]-r[1])}function P(e,r){return e.Mc=r,e.Lc=0,e.Yb=r.length,e}function l(e){return e.Lc>=e.Yb?-1:255&e.Mc[e.Lc++]}function v(e,r,t,o){return e.Lc>=e.Yb?-1:(o=Math.min(o,e.Yb-e.Lc),M(e.Mc,e.Lc,r,t,o),e.Lc+=o,o)}function B(e){return e.Mc=t(32),e.Yb=0,e}function S(e){var r=e.Mc;return r.length=e.Yb,r}function g(e,r){e.Mc[e.Yb++]=r<<24>>24}function k(e,r,t,o){M(r,t,e.Mc,e.Yb,o),e.Yb+=o}function R(e,r,t,o,n){var s;for(s=r;t>s;++s)o[n++]=e.charCodeAt(s)}function M(e,r,t,o,n){for(var s=0;n>s;++s)t[o+s]=e[r+s]}function D(e,r){Ar(r,1<a;a+=8)g(o,255&c(d(n,a)));r.yb=(_.W=0,_.oc=t,_.pc=0,Mr(_),_.d.Ab=o,Fr(_),wr(_),br(_),_.$.rb=_.n+1-2,Qr(_.$,1<<_.Y),_.i.rb=_.n+1-2,Qr(_.i,1<<_.Y),void(_.g=Gt),X({},_))}function w(e,r,t){return e.Nb=B({}),b(e,P({},r),e.Nb,a(r.length),t),e}function E(e,r,t){var o,n,s,i,_="",c=[];for(n=0;5>n;++n){if(s=l(r),-1==s)throw Error("truncated input");c[n]=s<<24>>24}if(o=ir({}),!ar(o,c))throw Error("corrupted input");for(n=0;64>n;n+=8){if(s=l(r),-1==s)throw Error("truncated input");s=s.toString(16),1==s.length&&(s="0"+s),_=s+""+_}/^0+$|^f+$/i.test(_)?e.Tb=At:(i=parseInt(_,16),e.Tb=i>4294967295?At:a(i)),e.yb=nr(o,r,t,e.Tb)}function L(e,r){return e.Nb=B({}),E(e,P({},r),e.Nb),e}function y(e,r,o,n){var s;e.Bc=r,e._b=o,s=r+o+n,(null==e.c||e.Kb!=s)&&(e.c=null,e.Kb=s,e.c=t(e.Kb)),e.H=e.Kb-o}function C(e,r){return e.c[e.f+e.o+r]}function z(e,r,t,o){var n,s;for(e.T&&e.o+r+o>e.h&&(o=e.h-(e.o+r)),++t,s=e.f+e.o+r,n=0;o>n&&e.c[s+n]==e.c[s+n-t];++n);return n}function F(e){return e.h-e.o}function I(e){var r,t,o;for(o=e.f+e.o-e.Bc,o>0&&--o,t=e.f+e.h-o,r=0;t>r;++r)e.c[r]=e.c[o+r];e.f-=o}function x(e){var r;++e.o,e.o>e.zb&&(r=e.f+e.o,r>e.H&&I(e),N(e))}function N(e){var r,t,o;if(!e.T)for(;;){if(o=-e.f+e.Kb-e.h,!o)return;if(r=v(e.cc,e.c,e.f+e.h,o),-1==r)return e.zb=e.h,t=e.f+e.zb,t>e.H&&(e.zb=e.H-e.f),void(e.T=1);e.h+=r,e.h>=e.o+e._b&&(e.zb=e.h-e._b)}}function O(e,r){e.f+=r,e.zb-=r,e.o-=r,e.h-=r}function A(e,r,o,n,s){var i,_,a;1073741567>r&&(e.Fc=16+(n>>1),a=~~((r+o+n+s)/2)+256,y(e,r+o,n+s,a),e.ob=n,i=r+1,e.p!=i&&(e.L=t(2*(e.p=i))),_=65536,e.qb&&(_=r-1,_|=_>>1,_|=_>>2,_|=_>>4,_|=_>>8,_>>=1,_|=65535,_>16777216&&(_>>=1),e.Ec=_,++_,_+=e.R),_!=e.rc&&(e.ub=t(e.rc=_)))}function H(e,r){var t,o,n,s,i,_,a,c,u,f,m,d,p,h,P,l,v,B,S,g,k;if(e.h>=e.o+e.ob)h=e.ob;else if(h=e.h-e.o,e.xb>h)return W(e),0;for(v=0,P=e.o>e.p?e.o-e.p:0,o=e.f+e.o,l=1,c=0,u=0,e.qb?(k=Tt[255&e.c[o]]^255&e.c[o+1],c=1023&k,k^=(255&e.c[o+2])<<8,u=65535&k,f=(k^Tt[255&e.c[o+3]]<<5)&e.Ec):f=255&e.c[o]^(255&e.c[o+1])<<8,n=e.ub[e.R+f]||0,e.qb&&(s=e.ub[c]||0,i=e.ub[1024+u]||0,e.ub[c]=e.o,e.ub[1024+u]=e.o,s>P&&e.c[e.f+s]==e.c[o]&&(r[v++]=l=2,r[v++]=e.o-s-1),i>P&&e.c[e.f+i]==e.c[o]&&(i==s&&(v-=2),r[v++]=l=3,r[v++]=e.o-i-1,s=i),0!=v&&s==n&&(v-=2,l=1)),e.ub[e.R+f]=e.o,S=(e.k<<1)+1,g=e.k<<1,d=p=e.w,0!=e.w&&n>P&&e.c[e.f+n+e.w]!=e.c[o+e.w]&&(r[v++]=l=e.w,r[v++]=e.o-n-1),t=e.Fc;;){if(P>=n||0==t--){e.L[S]=e.L[g]=0;break}if(a=e.o-n,_=(e.k>=a?e.k-a:e.k-a+e.p)<<1,B=e.f+n,m=p>d?d:p,e.c[B+m]==e.c[o+m]){for(;++m!=h&&e.c[B+m]==e.c[o+m];);if(m>l&&(r[v++]=l=m,r[v++]=a-1,m==h)){e.L[g]=e.L[_],e.L[S]=e.L[_+1];break}}(255&e.c[o+m])>(255&e.c[B+m])?(e.L[g]=n,g=_+1,n=e.L[g],p=m):(e.L[S]=n,S=_,n=e.L[S],d=m)}return W(e),v}function G(e){e.f=0,e.o=0,e.h=0,e.T=0,N(e),e.k=0,O(e,-1)}function W(e){var r;++e.k>=e.p&&(e.k=0),x(e),1073741823==e.o&&(r=e.o-e.p,T(e.L,2*e.p,r),T(e.ub,e.rc,r),O(e,r))}function T(e,r,t){var o,n;for(o=0;r>o;++o)n=e[o]||0,t>=n?n=0:n-=t,e[o]=n}function Z(e,r){e.qb=r>2,e.qb?(e.w=0,e.xb=4,e.R=66560):(e.w=2,e.xb=3,e.R=0)}function Y(e,r){var t,o,n,s,i,_,a,c,u,f,m,d,p,h,P,l,v;do{if(e.h>=e.o+e.ob)d=e.ob;else if(d=e.h-e.o,e.xb>d){W(e);continue}for(p=e.o>e.p?e.o-e.p:0,o=e.f+e.o,e.qb?(v=Tt[255&e.c[o]]^255&e.c[o+1],_=1023&v,e.ub[_]=e.o,v^=(255&e.c[o+2])<<8,a=65535&v,e.ub[1024+a]=e.o,c=(v^Tt[255&e.c[o+3]]<<5)&e.Ec):c=255&e.c[o]^(255&e.c[o+1])<<8,n=e.ub[e.R+c],e.ub[e.R+c]=e.o,P=(e.k<<1)+1,l=e.k<<1,f=m=e.w,t=e.Fc;;){if(p>=n||0==t--){e.L[P]=e.L[l]=0;break}if(i=e.o-n,s=(e.k>=i?e.k-i:e.k-i+e.p)<<1,h=e.f+n,u=m>f?f:m,e.c[h+u]==e.c[o+u]){for(;++u!=d&&e.c[h+u]==e.c[o+u];);if(u==d){e.L[l]=e.L[s],e.L[P]=e.L[s+1];break}}(255&e.c[o+u])>(255&e.c[h+u])?(e.L[l]=n,l=s+1,n=e.L[l],m=u):(e.L[P]=n,P=s,n=e.L[P],f=u)}W(e)}while(0!=--r)}function V(e,r,t){var o=e.o-r-1;for(0>o&&(o+=e.M);0!=t;--t)o>=e.M&&(o=0),e.Lb[e.o++]=e.Lb[o++],e.o>=e.M&&$(e)}function j(e,r){(null==e.Lb||e.M!=r)&&(e.Lb=t(r)),e.M=r,e.o=0,e.h=0}function $(e){var r=e.o-e.h;r&&(k(e.cc,e.Lb,e.h,r),e.o>=e.M&&(e.o=0),e.h=e.o)}function K(e,r){var t=e.o-r-1;return 0>t&&(t+=e.M),e.Lb[t]}function q(e,r){e.Lb[e.o++]=r,e.o>=e.M&&$(e)}function J(e){$(e),e.cc=null}function Q(e){return e-=2,4>e?e:3}function U(e){return 4>e?0:10>e?e-3:e-6}function X(e,r){return e.cb=r,e.Z=null,e.zc=1,e}function er(e,r){return e.Z=r,e.cb=null,e.zc=1,e}function rr(e){if(!e.zc)throw Error("bad state");return e.cb?or(e):tr(e),e.zc}function tr(e){var r=sr(e.Z);if(-1==r)throw Error("corrupted input");e.Pb=At,e.Pc=e.Z.g,(r||s(e.Z.Nc,Gt)>=0&&s(e.Z.g,e.Z.Nc)>=0)&&($(e.Z.B),J(e.Z.B),e.Z.e.Ab=null,e.zc=0)}function or(e){Rr(e.cb,e.cb.Xb,e.cb.uc,e.cb.Kc),e.Pb=e.cb.Xb[0],e.cb.Kc[0]&&(Or(e.cb),e.zc=0)}function nr(e,r,t,o){return e.e.Ab=r,J(e.B),e.B.cc=t,_r(e),e.U=0,e.ib=0,e.Jc=0,e.Ic=0,e.Qc=0,e.Nc=o,e.g=Gt,e.jc=0,er({},e)}function sr(e){var r,t,n,i,_,u;if(u=c(e.g)&e.Dc,vt(e.e,e.Gb,(e.U<<4)+u)){if(vt(e.e,e.Zb,e.U))n=0,vt(e.e,e.Cb,e.U)?(vt(e.e,e.Db,e.U)?(vt(e.e,e.Eb,e.U)?(t=e.Qc,e.Qc=e.Ic):t=e.Ic,e.Ic=e.Jc):t=e.Jc,e.Jc=e.ib,e.ib=t):vt(e.e,e.pb,(e.U<<4)+u)||(e.U=7>e.U?9:11,n=1),n||(n=mr(e.sb,e.e,u)+2,e.U=7>e.U?8:11);else if(e.Qc=e.Ic,e.Ic=e.Jc,e.Jc=e.ib,n=2+mr(e.Rb,e.e,u),e.U=7>e.U?7:10,_=at(e.kb[Q(n)],e.e),_>=4){if(i=(_>>1)-1,e.ib=(2|1&_)<_)e.ib+=ut(e.kc,e.ib-_-1,e.e,i);else if(e.ib+=Bt(e.e,i-4)<<4,e.ib+=ct(e.Fb,e.e),0>e.ib)return-1==e.ib?1:-1}else e.ib=_;if(s(a(e.ib),e.g)>=0||e.ib>=e.nb)return-1;V(e.B,e.ib,n),e.g=o(e.g,a(n)),e.jc=K(e.B,0)}else r=Pr(e.gb,c(e.g),e.jc),e.jc=7>e.U?vr(r,e.e):Br(r,e.e,K(e.B,e.ib)),q(e.B,e.jc),e.U=U(e.U),e.g=o(e.g,Wt);return 0}function ir(e){e.B={},e.e={},e.Gb=t(192),e.Zb=t(12),e.Cb=t(12),e.Db=t(12),e.Eb=t(12),e.pb=t(192),e.kb=t(4),e.kc=t(114),e.Fb=_t({},4),e.Rb=dr({}),e.sb=dr({}),e.gb={};for(var r=0;4>r;++r)e.kb[r]=_t({},6);return e}function _r(e){e.B.h=0,e.B.o=0,gt(e.Gb),gt(e.pb),gt(e.Zb),gt(e.Cb),gt(e.Db),gt(e.Eb),gt(e.kc),lr(e.gb);for(var r=0;4>r;++r)gt(e.kb[r].G);pr(e.Rb),pr(e.sb),gt(e.Fb.G),St(e.e)}function ar(e,r){var t,o,n,s,i,_,a;if(5>r.length)return 0;for(a=255&r[0],n=a%9,_=~~(a/9),s=_%5,i=~~(_/5),t=0,o=0;4>o;++o)t+=(255&r[1+o])<<8*o;return t>99999999||!ur(e,n,s,i)?0:cr(e,t)}function cr(e,r){return 0>r?0:(e.Ob!=r&&(e.Ob=r,e.nb=Math.max(e.Ob,1),j(e.B,Math.max(e.nb,4096))),1)}function ur(e,r,t,o){if(r>8||t>4||o>4)return 0;hr(e.gb,t,r);var n=1<e.O;++e.O)e.ec[e.O]=_t({},3),e.hc[e.O]=_t({},3)}function mr(e,r,t){if(!vt(r,e.wc,0))return at(e.ec[t],r);var o=8;return o+=vt(r,e.wc,1)?8+at(e.tc,r):at(e.hc[t],r)}function dr(e){return e.wc=t(2),e.ec=t(16),e.hc=t(16),e.tc=_t({},8),e.O=0,e}function pr(e){gt(e.wc);for(var r=0;e.O>r;++r)gt(e.ec[r].G),gt(e.hc[r].G);gt(e.tc.G)}function hr(e,r,o){var n,s;if(null==e.V||e.u!=o||e.I!=r)for(e.I=r,e.qc=(1<n;++n)e.V[n]=Sr({})}function Pr(e,r,t){return e.V[((r&e.qc)<>>8-e.u)]}function lr(e){var r,t;for(t=1<r;++r)gt(e.V[r].Ib)}function vr(e,r){var t=1;do t=t<<1|vt(r,e.Ib,t);while(256>t);return t<<24>>24}function Br(e,r,t){var o,n,s=1;do if(n=t>>7&1,t<<=1,o=vt(r,e.Ib,(1+n<<8)+s),s=s<<1|o,n!=o){for(;256>s;)s=s<<1|vt(r,e.Ib,s);break}while(256>s);return s<<24>>24}function Sr(e){return e.Ib=t(768),e}function gr(e,r){var t,o,n,s;e.jb=r,n=e.a[r].r,o=e.a[r].j;do e.a[r].t&&(st(e.a[n]),e.a[n].r=n-1,e.a[r].Ac&&(e.a[n-1].t=0,e.a[n-1].r=e.a[r].r2,e.a[n-1].j=e.a[r].j2)),s=n,t=o,o=e.a[s].j,n=e.a[s].r,e.a[s].j=t,e.a[s].r=r,r=s;while(r>0);return e.mb=e.a[0].j,e.q=e.a[0].r}function kr(e){e.l=0,e.J=0;for(var r=0;4>r;++r)e.v[r]=0}function Rr(e,r,t,n){var i,u,f,m,d,p,P,l,v,B,S,g,k,R,M;if(r[0]=Gt,t[0]=Gt,n[0]=1,e.oc&&(e.b.cc=e.oc,G(e.b),e.W=1,e.oc=null),!e.pc){if(e.pc=1,R=e.g,_(e.g,Gt)){if(!F(e.b))return void Er(e,c(e.g));xr(e),k=c(e.g)&e.y,kt(e.d,e.C,(e.l<<4)+k,0),e.l=U(e.l),f=C(e.b,-e.s),rt(Xr(e.A,c(e.g),e.J),e.d,f),e.J=f,--e.s,e.g=o(e.g,Wt)}if(!F(e.b))return void Er(e,c(e.g));for(;;){if(P=Lr(e,c(e.g)),B=e.mb,k=c(e.g)&e.y,u=(e.l<<4)+k,1==P&&-1==B)kt(e.d,e.C,u,0),f=C(e.b,-e.s),M=Xr(e.A,c(e.g),e.J),7>e.l?rt(M,e.d,f):(v=C(e.b,-e.v[0]-1-e.s),tt(M,e.d,v,f)),e.J=f,e.l=U(e.l);else{if(kt(e.d,e.C,u,1),4>B){if(kt(e.d,e.bb,e.l,1),B?(kt(e.d,e.hb,e.l,1),1==B?kt(e.d,e.Ub,e.l,0):(kt(e.d,e.Ub,e.l,1),kt(e.d,e.vc,e.l,B-2))):(kt(e.d,e.hb,e.l,0),1==P?kt(e.d,e._,u,0):kt(e.d,e._,u,1)),1==P?e.l=7>e.l?9:11:(Kr(e.i,e.d,P-2,k),e.l=7>e.l?8:11),m=e.v[B],0!=B){for(p=B;p>=1;--p)e.v[p]=e.v[p-1];e.v[0]=m}}else{for(kt(e.d,e.bb,e.l,0),e.l=7>e.l?7:10,Kr(e.$,e.d,P-2,k),B-=4,g=Tr(B),l=Q(P),mt(e.K[l],e.d,g),g>=4&&(d=(g>>1)-1,i=(2|1&g)<g?Pt(e.Sb,i-g-1,e.d,d,S):(Rt(e.d,S>>4,d-4),pt(e.S,e.d,15&S),++e.Qb)),m=B,p=3;p>=1;--p)e.v[p]=e.v[p-1];e.v[0]=m,++e.Mb}e.J=C(e.b,P-1-e.s)}if(e.s-=P,e.g=o(e.g,a(P)),!e.s){if(e.Mb>=128&&wr(e),e.Qb>=16&&br(e),r[0]=e.g,t[0]=Mt(e.d),!F(e.b))return void Er(e,c(e.g));if(s(h(e.g,R),[4096,0])>=0)return e.pc=0,void(n[0]=0)}}}}function Mr(e){var r,t;e.b||(r={},t=4,e.X||(t=2),Z(r,t),e.b=r),Ur(e.A,e.eb,e.fb),(e.ab!=e.wb||e.Hb!=e.n)&&(A(e.b,e.ab,4096,e.n,274),e.wb=e.ab,e.Hb=e.n)}function Dr(e){var r;for(e.v=t(4),e.a=[],e.d={},e.C=t(192),e.bb=t(12),e.hb=t(12),e.Ub=t(12),e.vc=t(12),e._=t(192),e.K=[],e.Sb=t(114),e.S=ft({},4),e.$=qr({}),e.i=qr({}),e.A={},e.m=[],e.P=[],e.lb=[],e.nc=t(16),e.x=t(4),e.Q=t(4),e.Xb=[Gt],e.uc=[Gt],e.Kc=[0],e.fc=t(5),e.yc=t(128),e.vb=0,e.X=1,e.D=0,e.Hb=-1,e.mb=0,r=0;4096>r;++r)e.a[r]={};for(r=0;4>r;++r)e.K[r]=ft({},6);return e}function br(e){for(var r=0;16>r;++r)e.nc[r]=ht(e.S,r);e.Qb=0}function wr(e){var r,t,o,n,s,i,_,a;for(n=4;128>n;++n)i=Tr(n),o=(i>>1)-1,r=(2|1&i)<s;++s){for(t=e.K[s],_=s<<6,i=0;e.$b>i;++i)e.P[_+i]=dt(t,i);for(i=14;e.$b>i;++i)e.P[_+i]+=(i>>1)-1-4<<6;for(a=128*s,n=0;4>n;++n)e.lb[a+n]=e.P[_+n];for(;128>n;++n)e.lb[a+n]=e.P[_+Tr(n)]+e.yc[n]}e.Mb=0}function Er(e,r){Nr(e),Wr(e,r&e.y);for(var t=0;5>t;++t)bt(e.d)}function Lr(e,r){var t,o,n,s,i,_,a,c,u,f,m,d,p,h,P,l,v,B,S,g,k,R,M,D,b,w,E,L,y,I,x,N,O,A,H,G,W,T,Z,Y,V,j,$,K,q,J,Q,X,er,rr;if(e.jb!=e.q)return p=e.a[e.q].r-e.q,e.mb=e.a[e.q].j,e.q=e.a[e.q].r,p;if(e.q=e.jb=0,e.N?(d=e.vb,e.N=0):d=xr(e),E=e.D,b=F(e.b)+1,2>b)return e.mb=-1,1;for(b>273&&(b=273),Y=0,u=0;4>u;++u)e.x[u]=e.v[u],e.Q[u]=z(e.b,-1,e.x[u],273),e.Q[u]>e.Q[Y]&&(Y=u);if(e.Q[Y]>=e.n)return e.mb=Y,p=e.Q[Y],Ir(e,p-1),p;if(d>=e.n)return e.mb=e.m[E-1]+4,Ir(e,d-1),d;if(a=C(e.b,-1),v=C(e.b,-e.v[0]-1-1),2>d&&a!=v&&2>e.Q[Y])return e.mb=-1,1;if(e.a[0].Hc=e.l,A=r&e.y,e.a[1].z=Yt[e.C[(e.l<<4)+A]>>>2]+nt(Xr(e.A,r,e.J),e.l>=7,v,a),st(e.a[1]),B=Yt[2048-e.C[(e.l<<4)+A]>>>2],Z=B+Yt[2048-e.bb[e.l]>>>2],v==a&&(V=Z+zr(e,e.l,A),e.a[1].z>V&&(e.a[1].z=V,it(e.a[1]))),m=d>=e.Q[Y]?d:e.Q[Y],2>m)return e.mb=e.a[1].j,1;e.a[1].r=0,e.a[0].bc=e.x[0],e.a[0].ac=e.x[1],e.a[0].dc=e.x[2],e.a[0].lc=e.x[3],f=m;do e.a[f--].z=268435455;while(f>=2);for(u=0;4>u;++u)if(T=e.Q[u],!(2>T)){G=Z+Cr(e,u,e.l,A);do s=G+Jr(e.i,T-2,A),x=e.a[T],x.z>s&&(x.z=s,x.r=0,x.j=u,x.t=0);while(--T>=2)}if(D=B+Yt[e.bb[e.l]>>>2],f=e.Q[0]>=2?e.Q[0]+1:2,d>=f){for(L=0;f>e.m[L];)L+=2;for(;c=e.m[L+1],s=D+yr(e,c,f,A),x=e.a[f],x.z>s&&(x.z=s,x.r=0,x.j=c+4,x.t=0),f!=e.m[L]||(L+=2,L!=E);++f);}for(t=0;;){if(++t,t==m)return gr(e,t);if(S=xr(e),E=e.D,S>=e.n)return e.vb=S,e.N=1,gr(e,t);if(++r,O=e.a[t].r,e.a[t].t?(--O,e.a[t].Ac?($=e.a[e.a[t].r2].Hc,$=4>e.a[t].j2?7>$?8:11:7>$?7:10):$=e.a[O].Hc,$=U($)):$=e.a[O].Hc,O==t-1?$=e.a[t].j?U($):7>$?9:11:(e.a[t].t&&e.a[t].Ac?(O=e.a[t].r2,N=e.a[t].j2,$=7>$?8:11):(N=e.a[t].j,$=4>N?7>$?8:11:7>$?7:10),I=e.a[O],4>N?N?1==N?(e.x[0]=I.ac,e.x[1]=I.bc,e.x[2]=I.dc,e.x[3]=I.lc):2==N?(e.x[0]=I.dc,e.x[1]=I.bc,e.x[2]=I.ac,e.x[3]=I.lc):(e.x[0]=I.lc,e.x[1]=I.bc,e.x[2]=I.ac,e.x[3]=I.dc):(e.x[0]=I.bc,e.x[1]=I.ac,e.x[2]=I.dc,e.x[3]=I.lc):(e.x[0]=N-4,e.x[1]=I.bc,e.x[2]=I.ac,e.x[3]=I.dc)),e.a[t].Hc=$,e.a[t].bc=e.x[0],e.a[t].ac=e.x[1],e.a[t].dc=e.x[2],e.a[t].lc=e.x[3],_=e.a[t].z,a=C(e.b,-1),v=C(e.b,-e.x[0]-1-1),A=r&e.y,o=_+Yt[e.C[($<<4)+A]>>>2]+nt(Xr(e.A,r,C(e.b,-2)),$>=7,v,a),R=e.a[t+1],g=0,R.z>o&&(R.z=o,R.r=t,R.j=-1,R.t=0,g=1),B=_+Yt[2048-e.C[($<<4)+A]>>>2],Z=B+Yt[2048-e.bb[$]>>>2],v!=a||t>R.r&&!R.j||(V=Z+(Yt[e.hb[$]>>>2]+Yt[e._[($<<4)+A]>>>2]),R.z>=V&&(R.z=V,R.r=t,R.j=0,R.t=0,g=1)),w=F(e.b)+1,w=w>4095-t?4095-t:w,b=w,!(2>b)){if(b>e.n&&(b=e.n),!g&&v!=a&&(q=Math.min(w-1,e.n),P=z(e.b,0,e.x[0],q),P>=2)){for(K=U($),H=r+1&e.y,M=o+Yt[2048-e.C[(K<<4)+H]>>>2]+Yt[2048-e.bb[K]>>>2],y=t+1+P;y>m;)e.a[++m].z=268435455;s=M+(J=Jr(e.i,P-2,H),J+Cr(e,0,K,H)),x=e.a[y],x.z>s&&(x.z=s,x.r=t+1,x.j=0,x.t=1,x.Ac=0)}for(j=2,W=0;4>W;++W)if(h=z(e.b,-1,e.x[W],b),!(2>h)){l=h;do{for(;t+h>m;)e.a[++m].z=268435455;s=Z+(Q=Jr(e.i,h-2,A),Q+Cr(e,W,$,A)),x=e.a[t+h],x.z>s&&(x.z=s,x.r=t,x.j=W,x.t=0)}while(--h>=2);if(h=l,W||(j=h+1),w>h&&(q=Math.min(w-1-h,e.n),P=z(e.b,h,e.x[W],q),P>=2)){for(K=7>$?8:11,H=r+h&e.y,n=Z+(X=Jr(e.i,h-2,A),X+Cr(e,W,$,A))+Yt[e.C[(K<<4)+H]>>>2]+nt(Xr(e.A,r+h,C(e.b,h-1-1)),1,C(e.b,h-1-(e.x[W]+1)),C(e.b,h-1)),K=U(K),H=r+h+1&e.y,k=n+Yt[2048-e.C[(K<<4)+H]>>>2],M=k+Yt[2048-e.bb[K]>>>2],y=h+1+P;t+y>m;)e.a[++m].z=268435455;s=M+(er=Jr(e.i,P-2,H),er+Cr(e,0,K,H)),x=e.a[t+y],x.z>s&&(x.z=s,x.r=t+h+1,x.j=0,x.t=1,x.Ac=1,x.r2=t,x.j2=W)}}if(S>b){for(S=b,E=0;S>e.m[E];E+=2);e.m[E]=S,E+=2}if(S>=j){for(D=B+Yt[e.bb[$]>>>2];t+S>m;)e.a[++m].z=268435455;for(L=0;j>e.m[L];)L+=2;for(h=j;;++h)if(i=e.m[L+1],s=D+yr(e,i,h,A),x=e.a[t+h],x.z>s&&(x.z=s,x.r=t,x.j=i+4,x.t=0),h==e.m[L]){if(w>h&&(q=Math.min(w-1-h,e.n),P=z(e.b,h,i,q),P>=2)){for(K=7>$?7:10,H=r+h&e.y,n=s+Yt[e.C[(K<<4)+H]>>>2]+nt(Xr(e.A,r+h,C(e.b,h-1-1)),1,C(e.b,h-(i+1)-1),C(e.b,h-1)),K=U(K),H=r+h+1&e.y,k=n+Yt[2048-e.C[(K<<4)+H]>>>2],M=k+Yt[2048-e.bb[K]>>>2],y=h+1+P;t+y>m;)e.a[++m].z=268435455;s=M+(rr=Jr(e.i,P-2,H),rr+Cr(e,0,K,H)),x=e.a[t+y],x.z>s&&(x.z=s,x.r=t+h+1,x.j=0,x.t=1,x.Ac=1,x.r2=t,x.j2=i+4)}if(L+=2,L==E)break}}}}}function yr(e,r,t,o){var n,s=Q(t);return n=128>r?e.lb[128*s+r]:e.P[(s<<6)+Zr(r)]+e.nc[15&r],n+Jr(e.$,t-2,o)}function Cr(e,r,t,o){var n;return r?(n=Yt[2048-e.hb[t]>>>2],1==r?n+=Yt[e.Ub[t]>>>2]:(n+=Yt[2048-e.Ub[t]>>>2],n+=wt(e.vc[t],r-2))):(n=Yt[e.hb[t]>>>2],n+=Yt[2048-e._[(t<<4)+o]>>>2]),n}function zr(e,r,t){return Yt[e.hb[r]>>>2]+Yt[e._[(r<<4)+t]>>>2]}function Fr(e){kr(e),Dt(e.d),gt(e.C),gt(e._),gt(e.bb),gt(e.hb),gt(e.Ub),gt(e.vc),gt(e.Sb),et(e.A);for(var r=0;4>r;++r)gt(e.K[r].G);jr(e.$,1<0&&(Y(e.b,r),e.s+=r)}function xr(e){var r=0;return e.D=H(e.b,e.m),e.D>0&&(r=e.m[e.D-2],r==e.n&&(r+=z(e.b,r-1,e.m[e.D-1],273-r))),++e.s,r}function Nr(e){e.b&&e.W&&(e.b.cc=null,e.W=0)}function Or(e){Nr(e),e.d.Ab=null}function Ar(e,r){e.ab=r;for(var t=0;r>1<>24;for(var t=0;4>t;++t)e.fc[1+t]=e.ab>>8*t<<24>>24;k(r,e.fc,0,5)}function Wr(e,r){if(e.Gc){kt(e.d,e.C,(e.l<<4)+r,1),kt(e.d,e.bb,e.l,0),e.l=7>e.l?7:10,Kr(e.$,e.d,0,r);var t=Q(2);mt(e.K[t],e.d,63),Rt(e.d,67108863,26),pt(e.S,e.d,15)}}function Tr(e){return 2048>e?Zt[e]:2097152>e?Zt[e>>10]+20:Zt[e>>20]+40}function Zr(e){return 131072>e?Zt[e>>6]+12:134217728>e?Zt[e>>16]+32:Zt[e>>26]+52}function Yr(e,r,t,o){8>t?(kt(r,e.db,0,0),mt(e.Vb[o],r,t)):(t-=8,kt(r,e.db,0,1),8>t?(kt(r,e.db,1,0),mt(e.Wb[o],r,t)):(kt(r,e.db,1,1),mt(e.ic,r,t-8)))}function Vr(e){e.db=t(2),e.Vb=t(16),e.Wb=t(16),e.ic=ft({},8);for(var r=0;16>r;++r)e.Vb[r]=ft({},3),e.Wb[r]=ft({},3);return e}function jr(e,r){gt(e.db);for(var t=0;r>t;++t)gt(e.Vb[t].G),gt(e.Wb[t].G);gt(e.ic.G)}function $r(e,r,t,o,n){var s,i,_,a,c;for(s=Yt[e.db[0]>>>2],i=Yt[2048-e.db[0]>>>2],_=i+Yt[e.db[1]>>>2],a=i+Yt[2048-e.db[1]>>>2],c=0,c=0;8>c;++c){if(c>=t)return;o[n+c]=s+dt(e.Vb[r],c)}for(;16>c;++c){if(c>=t)return;o[n+c]=_+dt(e.Wb[r],c-8)}for(;t>c;++c)o[n+c]=a+dt(e.ic,c-8-8)}function Kr(e,r,t,o){Yr(e,r,t,o),0==--e.sc[o]&&($r(e,o,e.rb,e.Cc,272*o),e.sc[o]=e.rb)}function qr(e){return Vr(e),e.Cc=[],e.sc=[],e}function Jr(e,r,t){return e.Cc[272*t+r]}function Qr(e,r){for(var t=0;r>t;++t)$r(e,t,e.rb,e.Cc,272*t),e.sc[t]=e.rb}function Ur(e,r,o){var n,s;if(null==e.V||e.u!=o||e.I!=r)for(e.I=r,e.qc=(1<n;++n)e.V[n]=ot({})}function Xr(e,r,t){return e.V[((r&e.qc)<>>8-e.u)]}function et(e){var r,t=1<r;++r)gt(e.V[r].tb)}function rt(e,r,t){var o,n,s=1;for(n=7;n>=0;--n)o=t>>n&1,kt(r,e.tb,s,o),s=s<<1|o}function tt(e,r,t,o){var n,s,i,_,a=1,c=1;for(s=7;s>=0;--s)n=o>>s&1,_=c,a&&(i=t>>s&1,_+=1+i<<8,a=i==n),kt(r,e.tb,_,n),c=c<<1|n}function ot(e){return e.tb=t(768),e}function nt(e,r,t,o){var n,s,i=1,_=7,a=0;if(r)for(;_>=0;--_)if(s=t>>_&1,n=o>>_&1,a+=wt(e.tb[(1+s<<8)+i],n),i=i<<1|n,s!=n){--_;break}for(;_>=0;--_)n=o>>_&1,a+=wt(e.tb[i],n),i=i<<1|n;return a}function st(e){e.j=-1,e.t=0}function it(e){e.j=0,e.t=0}function _t(e,r){return e.F=r,e.G=t(1<o;++o)t=vt(r,e.G,n),n<<=1,n+=t,s|=t<s;++s)n=vt(t,e,r+i),i<<=1,i+=n,_|=n<>>n&1,kt(r,e.G,s,o),s=s<<1|o}function dt(e,r){var t,o,n=1,s=0;for(o=e.F;0!=o;)--o,t=r>>>o&1,s+=wt(e.G[n],t),n=(n<<1)+t;return s}function pt(e,r,t){var o,n,s=1;for(n=0;e.F>n;++n)o=1&t,kt(r,e.G,s,o),s=s<<1|o,t>>=1}function ht(e,r){var t,o,n=1,s=0;for(o=e.F;0!=o;--o)t=1&r,r>>>=1,s+=wt(e.G[n],t),n=n<<1|t;return s}function Pt(e,r,t,o,n){var s,i,_=1;for(i=0;o>i;++i)s=1&n,kt(t,e,r+_,s),_=_<<1|s,n>>=1}function lt(e,r,t,o){var n,s,i=1,_=0;for(s=t;0!=s;--s)n=1&o,o>>>=1,_+=Yt[(2047&(e[r+i]-n^-n))>>>2],i=i<<1|n;return _}function vt(e,r,t){var o,n=r[t];return o=(e.E>>>11)*n,(-2147483648^o)>(-2147483648^e.Bb)?(e.E=o,r[t]=n+(2048-n>>>5)<<16>>16,-16777216&e.E||(e.Bb=e.Bb<<8|l(e.Ab),e.E<<=8),0):(e.E-=o,e.Bb-=o,r[t]=n-(n>>>5)<<16>>16,-16777216&e.E||(e.Bb=e.Bb<<8|l(e.Ab),e.E<<=8),1)}function Bt(e,r){var t,o,n=0;for(t=r;0!=t;--t)e.E>>>=1,o=e.Bb-e.E>>>31,e.Bb-=e.E&o-1,n=n<<1|1-o,-16777216&e.E||(e.Bb=e.Bb<<8|l(e.Ab),e.E<<=8);return n}function St(e){e.Bb=0,e.E=-1;for(var r=0;5>r;++r)e.Bb=e.Bb<<8|l(e.Ab)}function gt(e){for(var r=e.length-1;r>=0;--r)e[r]=1024}function kt(e,r,t,s){var i,_=r[t];i=(e.E>>>11)*_,s?(e.xc=o(e.xc,n(a(i),[4294967295,0])),e.E-=i,r[t]=_-(_>>>5)<<16>>16):(e.E=i,r[t]=_+(2048-_>>>5)<<16>>16),-16777216&e.E||(e.E<<=8,bt(e))}function Rt(e,r,t){for(var n=t-1;n>=0;--n)e.E>>>=1,1==(r>>>n&1)&&(e.xc=o(e.xc,a(e.E))),-16777216&e.E||(e.E<<=8,bt(e))}function Mt(e){return o(o(a(e.Jb),e.mc),[4,0])}function Dt(e){e.mc=Gt,e.xc=Gt,e.E=-1,e.Jb=1,e.Oc=0}function bt(e){var r,t=c(p(e.xc,32));if(0!=t||s(e.xc,[4278190080,0])<0){e.mc=o(e.mc,a(e.Jb)),r=e.Oc;do g(e.Ab,r+t),r=255;while(0!=--e.Jb);e.Oc=c(e.xc)>>>24}++e.Jb,e.xc=m(n(e.xc,[16777215,0]),8)}function wt(e,r){return Yt[(2047&(e-r^-r))>>>2]}function Et(e){for(var r,t,o,n=0,s=0,i=e.length,_=[],a=[];i>n;++n,++s){if(r=255&e[n],128&r)if(192==(224&r)){if(n+1>=i)return e;if(t=255&e[++n],128!=(192&t))return e;a[s]=(31&r)<<6|63&t}else{if(224!=(240&r))return e; +if(n+2>=i)return e;if(t=255&e[++n],128!=(192&t))return e;if(o=255&e[++n],128!=(192&o))return e;a[s]=(15&r)<<12|(63&t)<<6|63&o}else{if(!r)return e;a[s]=r}16383==s&&(_.push(String.fromCharCode.apply(String,a)),s=-1)}return s>0&&(a.length=s,_.push(String.fromCharCode.apply(String,a))),_.join("")}function Lt(e){var r,t,o,n=[],s=0,i=e.length;if("object"==typeof e)return e;for(R(e,0,i,n,0),o=0;i>o;++o)r=n[o],r>=1&&127>=r?++s:s+=!r||r>=128&&2047>=r?2:3;for(t=[],s=0,o=0;i>o;++o)r=n[o],r>=1&&127>=r?t[s++]=r<<24>>24:!r||r>=128&&2047>=r?(t[s++]=(192|r>>6&31)<<24>>24,t[s++]=(128|63&r)<<24>>24):(t[s++]=(224|r>>12&15)<<24>>24,t[s++]=(128|r>>6&63)<<24>>24,t[s++]=(128|63&r)<<24>>24);return t}function yt(e){return e[1]+e[0]}function Ct(e,t,o,n){function s(){try{for(var e,r=(new Date).getTime();rr(a.c.yb);)if(i=yt(a.c.yb.Pb)/yt(a.c.Tb),(new Date).getTime()-r>200)return n(i),Nt(s,0),0;n(1),e=S(a.c.Nb),Nt(o.bind(null,e),0)}catch(t){o(null,t)}}var i,_,a={},c=void 0===o&&void 0===n;if("function"!=typeof o&&(_=o,o=n=0),n=n||function(e){return void 0!==_?r(e,_):void 0},o=o||function(e,r){return void 0!==_?postMessage({action:Ft,cbn:_,result:e,error:r}):void 0},c){for(a.c=w({},Lt(e),Vt(t));rr(a.c.yb););return S(a.c.Nb)}try{a.c=w({},Lt(e),Vt(t)),n(0)}catch(u){return o(null,u)}Nt(s,0)}function zt(e,t,o){function n(){try{for(var e,r=0,i=(new Date).getTime();rr(c.d.yb);)if(++r%1e3==0&&(new Date).getTime()-i>200)return _&&(s=yt(c.d.yb.Z.g)/a,o(s)),Nt(n,0),0;o(1),e=Et(S(c.d.Nb)),Nt(t.bind(null,e),0)}catch(u){t(null,u)}}var s,i,_,a,c={},u=void 0===t&&void 0===o;if("function"!=typeof t&&(i=t,t=o=0),o=o||function(e){return void 0!==i?r(_?e:-1,i):void 0},t=t||function(e,r){return void 0!==i?postMessage({action:It,cbn:i,result:e,error:r}):void 0},u){for(c.d=L({},e);rr(c.d.yb););return Et(S(c.d.Nb))}try{c.d=L({},e),a=yt(c.d.Tb),_=a>-1,o(0)}catch(f){return t(null,f)}Nt(n,0)}var Ft=1,It=2,xt=3,Nt="function"==typeof setImmediate?setImmediate:setTimeout,Ot=4294967296,At=[4294967295,-Ot],Ht=[0,-0x8000000000000000],Gt=[0,0],Wt=[1,0],Tt=function(){var e,r,t,o=[];for(e=0;256>e;++e){for(t=e,r=0;8>r;++r)0!=(1&t)?t=t>>>1^-306674912:t>>>=1;o[e]=t}return o}(),Zt=function(){var e,r,t,o=2,n=[0,1];for(t=2;22>t;++t)for(r=1<<(t>>1)-1,e=0;r>e;++e,++o)n[o]=t<<24>>24;return n}(),Yt=function(){var e,r,t,o,n=[];for(r=8;r>=0;--r)for(o=1<<9-r-1,e=1<<9-r,t=o;e>t;++t)n[t]=(r<<6)+(e-t<<6>>>9-r-1);return n}(),Vt=function(){var e=[{s:16,f:64,m:0},{s:20,f:64,m:0},{s:19,f:64,m:1},{s:20,f:64,m:1},{s:21,f:128,m:1},{s:22,f:128,m:1},{s:23,f:128,m:1},{s:24,f:255,m:1},{s:25,f:255,m:1}];return function(r){return e[r-1]||e[6]}}();return"undefined"==typeof onmessage||"undefined"!=typeof window&&void 0!==window.document||!function(){onmessage=function(r){r&&r.gc&&(r.gc.action==It?e.decompress(r.gc.gc,r.gc.cbn):r.gc.action==Ft&&e.compress(r.gc.gc,r.gc.Rc,r.gc.cbn))}}(),{compress:Ct,decompress:zt}}();this.LZMA=this.LZMA_WORKER=e; } +if(typeof self === "undefined" || !self.constructor.name.includes("Worker")) { /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ +var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&i)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define("FileSaver.js",function(){return saveAs})} + } + +if (typeof define === "function" && define.__amd) { + define.amd = define.__amd; + delete define.__amd; +} diff --git a/bin/html5/bin/assets/fonts/Montserrat/MontserratBold700.ttf b/bin/html5/bin/assets/fonts/Montserrat/MontserratBold700.ttf new file mode 100644 index 0000000..9a425b9 Binary files /dev/null and b/bin/html5/bin/assets/fonts/Montserrat/MontserratBold700.ttf differ diff --git a/bin/html5/bin/assets/fonts/Montserrat/MontserratLight300.ttf b/bin/html5/bin/assets/fonts/Montserrat/MontserratLight300.ttf new file mode 100644 index 0000000..a3cf5f5 Binary files /dev/null and b/bin/html5/bin/assets/fonts/Montserrat/MontserratLight300.ttf differ diff --git a/bin/html5/bin/assets/fonts/Montserrat/MontserratMedium500.ttf b/bin/html5/bin/assets/fonts/Montserrat/MontserratMedium500.ttf new file mode 100644 index 0000000..db5b1af Binary files /dev/null and b/bin/html5/bin/assets/fonts/Montserrat/MontserratMedium500.ttf differ diff --git a/bin/html5/bin/assets/fonts/Montserrat/MontserratRegular400.ttf b/bin/html5/bin/assets/fonts/Montserrat/MontserratRegular400.ttf new file mode 100644 index 0000000..2a2b2aa Binary files /dev/null and b/bin/html5/bin/assets/fonts/Montserrat/MontserratRegular400.ttf differ diff --git a/bin/html5/bin/index.html b/bin/html5/bin/index.html index 2ee07ec..d2949f7 100644 --- a/bin/html5/bin/index.html +++ b/bin/html5/bin/index.html @@ -27,8 +27,26 @@ html,body { margin: 0; padding: 0; height: 100%; overflow: hidden; } #openfl-content { background: #000000; width: 100%; height: 100%; } @font-face { - font-family: 'Montserrat SemiBold'; - src: url('assets/fonts/Montserrat/MontserratSemiBold600.ttf') format('truetype'); + font-family: 'Montserrat Light'; + src: url('assets/fonts/Montserrat/MontserratLight300.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + } + @font-face { + font-family: 'Montserrat Regular'; + src: url('assets/fonts/Montserrat/MontserratRegular400.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + } + @font-face { + font-family: 'Montserrat Medium'; + src: url('assets/fonts/Montserrat/MontserratMedium500.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + } + @font-face { + font-family: 'Montserrat Bold'; + src: url('assets/fonts/Montserrat/MontserratBold700.ttf') format('truetype'); font-weight: normal; font-style: normal; } diff --git a/bin/html5/bin/manifest/default.json b/bin/html5/bin/manifest/default.json index 3c5af4c..bd84676 100644 --- a/bin/html5/bin/manifest/default.json +++ b/bin/html5/bin/manifest/default.json @@ -1 +1 @@ -{"name":null,"assets":"aoy4:sizei260936y4:typey4:FONTy9:classNamey58:__ASSET__assets_fonts_montserrat_montserratsemibold600_ttfy2:idy21:MontserratSemiBold600y7:preloadtgh","rootPath":null,"version":2,"libraryArgs":[],"libraryType":null} \ No newline at end of file +{"name":null,"assets":"aoy4:sizei259416y4:typey4:FONTy9:classNamey55:__ASSET__assets_fonts_montserrat_montserratlight300_ttfy2:idy18:MontserratLight300y7:preloadtgoR0i263192R1R2R3y57:__ASSET__assets_fonts_montserrat_montserratregular400_ttfR5y20:MontserratRegular400R7tgoR0i260236R1R2R3y56:__ASSET__assets_fonts_montserrat_montserratmedium500_ttfR5y19:MontserratMedium500R7tgoR0i261588R1R2R3y54:__ASSET__assets_fonts_montserrat_montserratbold700_ttfR5y17:MontserratBold700R7tgh","rootPath":null,"version":2,"libraryArgs":[],"libraryType":null} \ No newline at end of file diff --git a/bin/html5/haxe/ApplicationMain.hx b/bin/html5/haxe/ApplicationMain.hx index bf31d54..c32586f 100644 --- a/bin/html5/haxe/ApplicationMain.hx +++ b/bin/html5/haxe/ApplicationMain.hx @@ -35,7 +35,7 @@ class ApplicationMain ManifestResources.init(config); #end - app.meta["build"] = "5"; + app.meta["build"] = "6"; app.meta["company"] = "Nekotoro"; app.meta["file"] = "LPTCManager2026"; app.meta["name"] = "lepetittrot.com - manager"; diff --git a/bin/html5/haxe/ManifestResources.hx b/bin/html5/haxe/ManifestResources.hx index 797a3d8..eebbc68 100644 --- a/bin/html5/haxe/ManifestResources.hx +++ b/bin/html5/haxe/ManifestResources.hx @@ -68,13 +68,16 @@ import sys.FileSystem; } #if (openfl && !flash && !display) - openfl.text.Font.registerFont (__ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf); + openfl.text.Font.registerFont (__ASSET__OPENFL__assets_fonts_montserrat_montserratlight300_ttf); + openfl.text.Font.registerFont (__ASSET__OPENFL__assets_fonts_montserrat_montserratregular400_ttf); + openfl.text.Font.registerFont (__ASSET__OPENFL__assets_fonts_montserrat_montserratmedium500_ttf); + openfl.text.Font.registerFont (__ASSET__OPENFL__assets_fonts_montserrat_montserratbold700_ttf); #end var data, manifest, library, bundle; - data = '{"name":null,"assets":"aoy4:sizei260936y4:typey4:FONTy9:classNamey58:__ASSET__assets_fonts_montserrat_montserratsemibold600_ttfy2:idy21:MontserratSemiBold600y7:preloadtgh","rootPath":null,"version":2,"libraryArgs":[],"libraryType":null}'; + data = '{"name":null,"assets":"aoy4:sizei259416y4:typey4:FONTy9:classNamey55:__ASSET__assets_fonts_montserrat_montserratlight300_ttfy2:idy18:MontserratLight300y7:preloadtgoR0i263192R1R2R3y57:__ASSET__assets_fonts_montserrat_montserratregular400_ttfR5y20:MontserratRegular400R7tgoR0i260236R1R2R3y56:__ASSET__assets_fonts_montserrat_montserratmedium500_ttfR5y19:MontserratMedium500R7tgoR0i261588R1R2R3y54:__ASSET__assets_fonts_montserrat_montserratbold700_ttfR5y17:MontserratBold700R7tgh","rootPath":null,"version":2,"libraryArgs":[],"libraryType":null}'; manifest = AssetManifest.parse (data, rootPath); library = AssetLibrary.fromManifest (manifest); Assets.registerLibrary ("default", library); @@ -93,20 +96,29 @@ import sys.FileSystem; #if !display #if flash -@:keep @:bind @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratsemibold600_ttf extends null { } +@:keep @:bind @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratlight300_ttf extends null { } +@:keep @:bind @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratregular400_ttf extends null { } +@:keep @:bind @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratmedium500_ttf extends null { } +@:keep @:bind @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratbold700_ttf extends null { } @:keep @:bind @:noCompletion #if display private #end class __ASSET__manifest_default_json extends null { } #elseif (desktop || cpp) -@:keep @:font("bin/html5/obj/webfont/MontserratSemiBold600.ttf") @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratsemibold600_ttf extends lime.text.Font {} +@:keep @:font("bin/html5/obj/webfont/MontserratLight300.ttf") @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratlight300_ttf extends lime.text.Font {} +@:keep @:font("bin/html5/obj/webfont/MontserratRegular400.ttf") @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratregular400_ttf extends lime.text.Font {} +@:keep @:font("bin/html5/obj/webfont/MontserratMedium500.ttf") @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratmedium500_ttf extends lime.text.Font {} +@:keep @:font("bin/html5/obj/webfont/MontserratBold700.ttf") @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratbold700_ttf extends lime.text.Font {} @:keep @:file("") @:noCompletion #if display private #end class __ASSET__manifest_default_json extends haxe.io.Bytes {} #else -@:keep @:expose('__ASSET__assets_fonts_montserrat_montserratsemibold600_ttf') @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratsemibold600_ttf extends lime.text.Font { public function new () { #if !html5 __fontPath = "assets/fonts/Montserrat/MontserratSemiBold600"; #else ascender = 968; descender = -251; height = 1219; numGlyphs = 1943; underlinePosition = -100; underlineThickness = 50; unitsPerEM = 1000; #end name = "Montserrat SemiBold"; super (); }} +@:keep @:expose('__ASSET__assets_fonts_montserrat_montserratlight300_ttf') @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratlight300_ttf extends lime.text.Font { public function new () { #if !html5 __fontPath = "assets/fonts/Montserrat/MontserratLight300"; #else ascender = 968; descender = -251; height = 1219; numGlyphs = 1943; underlinePosition = -100; underlineThickness = 50; unitsPerEM = 1000; #end name = "Montserrat Light"; super (); }} +@:keep @:expose('__ASSET__assets_fonts_montserrat_montserratregular400_ttf') @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratregular400_ttf extends lime.text.Font { public function new () { #if !html5 __fontPath = "assets/fonts/Montserrat/MontserratRegular400"; #else ascender = 968; descender = -251; height = 1219; numGlyphs = 1943; underlinePosition = -100; underlineThickness = 50; unitsPerEM = 1000; #end name = "Montserrat Regular"; super (); }} +@:keep @:expose('__ASSET__assets_fonts_montserrat_montserratmedium500_ttf') @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratmedium500_ttf extends lime.text.Font { public function new () { #if !html5 __fontPath = "assets/fonts/Montserrat/MontserratMedium500"; #else ascender = 968; descender = -251; height = 1219; numGlyphs = 1943; underlinePosition = -100; underlineThickness = 50; unitsPerEM = 1000; #end name = "Montserrat Medium"; super (); }} +@:keep @:expose('__ASSET__assets_fonts_montserrat_montserratbold700_ttf') @:noCompletion #if display private #end class __ASSET__assets_fonts_montserrat_montserratbold700_ttf extends lime.text.Font { public function new () { #if !html5 __fontPath = "assets/fonts/Montserrat/MontserratBold700"; #else ascender = 968; descender = -251; height = 1219; numGlyphs = 1943; underlinePosition = -100; underlineThickness = 50; unitsPerEM = 1000; #end name = "Montserrat Bold"; super (); }} #end @@ -114,10 +126,16 @@ import sys.FileSystem; #if (openfl && !flash) #if html5 -@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratsemibold600_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratlight300_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratlight300_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratlight300_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratregular400_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratregular400_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratregular400_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratmedium500_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratmedium500_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratmedium500_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratbold700_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratbold700_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratbold700_ttf ()); super (); }} #else -@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratsemibold600_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratsemibold600_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratlight300_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratlight300_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratlight300_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratregular400_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratregular400_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratregular400_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratmedium500_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratmedium500_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratmedium500_ttf ()); super (); }} +@:keep @:expose('__ASSET__OPENFL__assets_fonts_montserrat_montserratbold700_ttf') @:noCompletion #if display private #end class __ASSET__OPENFL__assets_fonts_montserrat_montserratbold700_ttf extends openfl.text.Font { public function new () { __fromLimeFont (new __ASSET__assets_fonts_montserrat_montserratbold700_ttf ()); super (); }} #end diff --git a/bin/html5/haxe/debug.hxml b/bin/html5/haxe/debug.hxml index dbffabf..de5db3c 100644 --- a/bin/html5/haxe/debug.hxml +++ b/bin/html5/haxe/debug.hxml @@ -1,23 +1,24 @@ -main ApplicationMain --macro lime._internal.macros.DefineMacro.run() --cp /home/chatmurai/haxelib/lime/8,2,3/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/lime/8,2,3/src -D lime=8.2.3 --cp /home/chatmurai/haxelib/feathersui-cairngorm/1,0,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui-cairngorm/1,0,0/src -D feathersui-cairngorm=1.0.0 --cp /home/chatmurai/haxelib/feathersui/1,3,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui/1,3,0/src -D feathersui=1.3.0 --cp /home/chatmurai/haxelib/actuate/1,9,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/actuate/1,9,0/src -D actuate=1.9.0 --cp /home/chatmurai/haxelib/hxargs/4,0,0 +-cp /Users/chatmurai/Documents/code/Haxe/lib/hxargs/4,0,0 -D hxargs=4.0.0 --macro openfl.utils._internal.ExtraParamsMacro.include() --cp /home/chatmurai/haxelib/openfl/9,4,2/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/openfl/9,4,2/src -D openfl=9.4.2 --cp /home/chatmurai/haxelib/feathersui-rpc-services/1,0,3/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui-rpc-services/1,0,3/src -D feathersui-rpc-services=1.0.3 --cp /home/chatmurai/haxelib/amfio/1,0,2/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/amfio/1,0,2/src -D amfio=1.0.2 -cp src +-D AIR_SDK=/Users/chatmurai/Documents/code/AS3/SDKs/AIR_SDK_32.0 -D lime-threads -D tools=8.2.3 -D lime-canvas diff --git a/bin/html5/haxe/final.hxml b/bin/html5/haxe/final.hxml index fe67d8b..9da6ff3 100644 --- a/bin/html5/haxe/final.hxml +++ b/bin/html5/haxe/final.hxml @@ -1,23 +1,24 @@ -main ApplicationMain --macro lime._internal.macros.DefineMacro.run() --cp /home/chatmurai/haxelib/lime/8,2,3/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/lime/8,2,3/src -D lime=8.2.3 --cp /home/chatmurai/haxelib/feathersui-cairngorm/1,0,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui-cairngorm/1,0,0/src -D feathersui-cairngorm=1.0.0 --cp /home/chatmurai/haxelib/feathersui/1,3,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui/1,3,0/src -D feathersui=1.3.0 --cp /home/chatmurai/haxelib/actuate/1,9,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/actuate/1,9,0/src -D actuate=1.9.0 --cp /home/chatmurai/haxelib/hxargs/4,0,0 +-cp /Users/chatmurai/Documents/code/Haxe/lib/hxargs/4,0,0 -D hxargs=4.0.0 --macro openfl.utils._internal.ExtraParamsMacro.include() --cp /home/chatmurai/haxelib/openfl/9,4,2/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/openfl/9,4,2/src -D openfl=9.4.2 --cp /home/chatmurai/haxelib/feathersui-rpc-services/1,0,3/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui-rpc-services/1,0,3/src -D feathersui-rpc-services=1.0.3 --cp /home/chatmurai/haxelib/amfio/1,0,2/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/amfio/1,0,2/src -D amfio=1.0.2 -cp src +-D AIR_SDK=/Users/chatmurai/Documents/code/AS3/SDKs/AIR_SDK_32.0 -D lime-threads -D tools=8.2.3 -D lime-canvas diff --git a/bin/html5/haxe/release.hxml b/bin/html5/haxe/release.hxml index 5333908..731df9b 100644 --- a/bin/html5/haxe/release.hxml +++ b/bin/html5/haxe/release.hxml @@ -1,23 +1,24 @@ -main ApplicationMain --macro lime._internal.macros.DefineMacro.run() --cp /home/chatmurai/haxelib/lime/8,2,3/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/lime/8,2,3/src -D lime=8.2.3 --cp /home/chatmurai/haxelib/feathersui-cairngorm/1,0,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui-cairngorm/1,0,0/src -D feathersui-cairngorm=1.0.0 --cp /home/chatmurai/haxelib/feathersui/1,3,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui/1,3,0/src -D feathersui=1.3.0 --cp /home/chatmurai/haxelib/actuate/1,9,0/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/actuate/1,9,0/src -D actuate=1.9.0 --cp /home/chatmurai/haxelib/hxargs/4,0,0 +-cp /Users/chatmurai/Documents/code/Haxe/lib/hxargs/4,0,0 -D hxargs=4.0.0 --macro openfl.utils._internal.ExtraParamsMacro.include() --cp /home/chatmurai/haxelib/openfl/9,4,2/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/openfl/9,4,2/src -D openfl=9.4.2 --cp /home/chatmurai/haxelib/feathersui-rpc-services/1,0,3/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/feathersui-rpc-services/1,0,3/src -D feathersui-rpc-services=1.0.3 --cp /home/chatmurai/haxelib/amfio/1,0,2/src +-cp /Users/chatmurai/Documents/code/Haxe/lib/amfio/1,0,2/src -D amfio=1.0.2 -cp src +-D AIR_SDK=/Users/chatmurai/Documents/code/AS3/SDKs/AIR_SDK_32.0 -D lime-threads -D tools=8.2.3 -D lime-canvas diff --git a/project.xml b/project.xml index d073469..7e6402e 100644 --- a/project.xml +++ b/project.xml @@ -22,10 +22,10 @@ - + + + + - - - \ No newline at end of file diff --git a/src/LPTCManager2026.hx b/src/LPTCManager2026.hx index f659972..5822e0a 100644 --- a/src/LPTCManager2026.hx +++ b/src/LPTCManager2026.hx @@ -1,19 +1,15 @@ -import openfl.Assets; -import openfl.text.Font; -import feathers.text.TextFormat; -import model.Constants; +import feathers.layout.VerticalAlign; import components.NekoRectangle; -import openfl.display.Shape; -import openfl.display.Graphics; -import feathers.layout.AnchorLayoutData; -import feathers.layout.AnchorLayout; -import feathers.controls.LayoutGroup; -import openfl.display.Sprite; -import feathers.controls.Panel; -import feathers.controls.navigators.StackNavigator; import feathers.controls.Application; import feathers.controls.Label; +import feathers.controls.LayoutGroup; +import feathers.controls.Panel; +import feathers.layout.AnchorLayout; +import feathers.layout.AnchorLayoutData; +import feathers.text.TextFormat; import model.Constants; +import openfl.Assets; +import openfl.text.Font; class LPTCManager2026 extends Application { private var mainPanel:Panel; @@ -34,23 +30,29 @@ class LPTCManager2026 extends Application { mainPanel.autoSizeMode = STAGE; mainPanel.backgroundSkin = new NekoRectangle(Constants.MAIN_COLOR3); + // ############################################################################################# HEADER var header = new LayoutGroup(); header.autoSizeMode = CONTENT; - header.backgroundSkin = new NekoRectangle(Constants.HERO_COLOR, 0, 0, stage.stageWidth, Std.int(stage.stageHeight * 8 / 100)); + header.backgroundSkin = new NekoRectangle(Constants.HERO_COLOR, 0, 0, Std.int(stage.stageWidth * Constants.MAIN_HEADER_WIDTH_RATIO), Std.int(stage.stageHeight * Constants.MAIN_HEADER_HEIGHT_RATIO)); header.variant = LayoutGroup.VARIANT_TOOL_BAR; header.layout = new AnchorLayout(); var title = new Label(); + title.backgroundSkin = new NekoRectangle(Constants.ACCENT_COLOR2, 0, 0, 200, 80); + title.verticalAlign = VerticalAlign.MIDDLE; title.text = "Header"; - var fnt:Font = Assets.getFont(Constants.MONTSERRAT_SEMIBOLD_600); + var fnt:Font = Assets.getFont(Constants.MONTSERRAT_MEDIUM_500); - title.textFormat = new TextFormat(fnt.fontName, 20, Constants.MAIN_COLOR3); + var tf:TextFormat = new TextFormat(fnt.fontName, Std.int(stage.stageHeight * Constants.MAIN_HEADER_HEIGHT_RATIO * .1), Constants.MAIN_COLOR3); + title.textFormat = tf; + title.variant = Label.VARIANT_HEADING; title.layoutData = AnchorLayoutData.center(); header.addChild(title); mainPanel.header = header; + // ############################################################################################# FOOTER var footer = new LayoutGroup(); footer.autoSizeMode = CONTENT; diff --git a/src/model/Constants.hx b/src/model/Constants.hx index bef5415..54be29c 100644 --- a/src/model/Constants.hx +++ b/src/model/Constants.hx @@ -11,8 +11,14 @@ class Constants { public static final MAIN_COLOR3:Int = 0xECEFF0; // Fonts - public static final MONTSERRAT_SEMIBOLD_600:String = "Montserrat_SemiBold_600"; + public static final MONTSERRAT_LIGHT_300:String = "MontserratLight300"; + public static final MONTSERRAT_REGULAR_400:String = "MontserratRegular400"; + public static final MONTSERRAT_MEDIUM_500:String = "MontserratMedium500"; + public static final MONTSERRAT_BOLD_700:String = "MontserratBold700"; + // UI Proportions against satge dimmentions + public static final MAIN_HEADER_WIDTH_RATIO:Float = 1; + public static final MAIN_HEADER_HEIGHT_RATIO:Float = 0.3; private function new() {