Forráskód Böngészése

flash 11.6 api merge (fixed issue #1154)

Nicolas Cannasse 12 éve
szülő
commit
ecd403dc85

+ 1 - 1
common.ml

@@ -668,7 +668,7 @@ let flash_versions = List.map (fun v ->
 	let maj = int_of_float v in
 	let min = int_of_float (mod_float (v *. 10.) 10.) in
 	v, string_of_int maj ^ (if min = 0 then "" else "_" ^ string_of_int min)
-) [9.;10.;10.1;10.2;10.3;11.;11.1;11.2;11.3;11.4;11.5]
+) [9.;10.;10.1;10.2;10.3;11.;11.1;11.2;11.3;11.4;11.5;11.6;11.7;11.8]
 
 let raw_defined ctx v =
 	PMap.mem v ctx.defines

+ 2 - 2
doc/extract.hxml

@@ -1,6 +1,6 @@
 -debug
--swf-lib library114.swf
+-swf-lib library.swf
 -swf test.swf
--swf-version 11.4
+-swf-version 11.6
 --macro patchTypes("../doc/extract.patch")
 --gen-hx-classes

+ 17 - 0
doc/extract.patch

@@ -1199,3 +1199,20 @@ flash.system.MessageChannel.state : MessageChannelState;
 
 enum flash.system.WorkerState;
 
+
+// ---  11.6 API
+
+enum flash.display3D.Context3DMipFilter
+enum flash.display3D.Context3DTextureFilter
+enum flash.display3D.Context3DWrapMode
+enum flash.system.ApplicationInstallerMode
+
+@:require(flash11_6) flash.display3D.Context3D.setSamplerStateAt
+flash.display3D.Context3D.$wrap : Context3DWrapMode;
+flash.display3D.Context3D.$filter : Context3DTextureFilter;
+flash.display3D.Context3D.$mipfilter : Context3DMipFilter;
+
+-flash.display.DisplayObject.metaData
+
+@:require(flash11_6) flash.display.Graphics.readGraphicsData
+

+ 3 - 0
genswf.ml

@@ -532,6 +532,9 @@ let swf_ver = function
 	| 11.3 -> 16
 	| 11.4 -> 17
 	| 11.5 -> 18
+	| 11.6 -> 19
+	| 11.7 -> 20
+	| 11.8 -> 21
 	| v -> failwith ("Invalid SWF version " ^ string_of_float v)
 
 let convert_header com (w,h,fps,bg) =

+ 3 - 3
genxml.ml

@@ -333,7 +333,7 @@ let generate_type com t =
 		| Some (Ident "null") ->
 			"?" ^ n ^ " : " ^ stype (notnull t)
 		| Some v ->
-			n ^ " : " ^ stype t ^ " = " ^ (s_constant v)
+			n ^ " : " ^ stype t ^ " = " ^ (match s_constant v with "nan" -> "0./*NaN*/" | v -> v)
 	in
 	let print_meta ml =
 		List.iter (fun (m,pl,_) ->
@@ -412,11 +412,11 @@ let generate_type com t =
 			| ["flash";"utils"], "Dictionnary" -> [" implements ArrayAccess<Dynamic>"]
 			| ["flash";"xml"], "XML" -> [" implements Dynamic<XMLList>"]
 			| ["flash";"xml"], "XMLList" -> [" implements ArrayAccess<XML>"]
-			| ["flash";"display"],"MovieClip" -> [" extends Sprite #if !flash_strict, implements Dynamic #end"]
+			| ["flash";"display"],"MovieClip" -> [" extends Sprite #if !flash_strict implements Dynamic #end"]
 			| ["flash";"errors"], "Error" -> [" #if !flash_strict implements Dynamic #end"]
 			| _ -> ext
 		) in
-		p "%s" (String.concat " " (List.rev ext));
+		p "%s" (String.concat "" (List.rev ext));
 		p " {\n";
 		let sort l =
 			let a = Array.of_list (List.filter (fun f -> f.cf_public && not (List.memq f c.cl_overrides)) l) in

+ 1 - 0
std/flash/concurrent/Condition.hx

@@ -6,4 +6,5 @@ package flash.concurrent;
 	function notify() : Void;
 	function notifyAll() : Void;
 	function wait(timeout : Float = -1) : Bool;
+	static var isSupported(default,null) : Bool;
 }

+ 1 - 0
std/flash/concurrent/Mutex.hx

@@ -5,4 +5,5 @@ package flash.concurrent;
 	function lock() : Void;
 	function tryLock() : Bool;
 	function unlock() : Void;
+	static var isSupported(default,null) : Bool;
 }

+ 1 - 0
std/flash/display/Graphics.hx

@@ -25,4 +25,5 @@ package flash.display;
 	function lineStyle(?thickness : Float, color : UInt = 0, alpha : Float = 1, pixelHinting : Bool = false, ?scaleMode : LineScaleMode, ?caps : CapsStyle, ?joints : JointStyle, miterLimit : Float = 3) : Void;
 	function lineTo(x : Float, y : Float) : Void;
 	function moveTo(x : Float, y : Float) : Void;
+	@:require(flash11_6) function readGraphicsData(recurse : Bool = true) : flash.Vector<IGraphicsData>;
 }

+ 3 - 3
std/flash/display3D/Context3D.hx

@@ -8,10 +8,9 @@ package flash.display3D;
 	function createCubeTexture(size : Int, format : Context3DTextureFormat, optimizeForRenderToTexture : Bool, streamingLevels : Int = 0) : flash.display3D.textures.CubeTexture;
 	function createIndexBuffer(numIndices : Int) : IndexBuffer3D;
 	function createProgram() : Program3D;
-	@:require(flash11_4) function createRectangleTexture(width : Int, height : Int, format : Context3DTextureFormat, optimizeForRenderToTexture : Bool) : flash.display3D.textures.RectangleTexture;
 	function createTexture(width : Int, height : Int, format : Context3DTextureFormat, optimizeForRenderToTexture : Bool, streamingLevels : Int = 0) : flash.display3D.textures.Texture;
 	function createVertexBuffer(numVertices : Int, data32PerVertex : Int) : VertexBuffer3D;
-	function dispose() : Void;
+	function dispose(recreate : Bool = true) : Void;
 	function drawToBitmapData(destination : flash.display.BitmapData) : Void;
 	function drawTriangles(indexBuffer : IndexBuffer3D, firstIndex : Int = 0, numTriangles : Int = -1) : Void;
 	function present() : Void;
@@ -24,7 +23,8 @@ package flash.display3D;
 	function setProgramConstantsFromMatrix(programType : Context3DProgramType, firstRegister : Int, matrix : flash.geom.Matrix3D, transposedMatrix : Bool = false) : Void;
 	function setProgramConstantsFromVector(programType : Context3DProgramType, firstRegister : Int, data : flash.Vector<Float>, numRegisters : Int = -1) : Void;
 	function setRenderToBackBuffer() : Void;
-	function setRenderToTexture(texture : flash.display3D.textures.TextureBase, enableDepthAndStencil : Bool = false, antiAlias : Int = 0, surfaceSelector : Int = 0, colorOutputIndex : Int = 0) : Void;
+	function setRenderToTexture(texture : flash.display3D.textures.TextureBase, enableDepthAndStencil : Bool = false, antiAlias : Int = 0, surfaceSelector : Int = 0) : Void;
+	@:require(flash11_6) function setSamplerStateAt(sampler : Int, wrap : Context3DWrapMode, filter : Context3DTextureFilter, mipfilter : Context3DMipFilter) : Void;
 	function setScissorRectangle(rectangle : flash.geom.Rectangle) : Void;
 	function setStencilActions(?triangleFace : Context3DTriangleFace, ?compareMode : Context3DCompareMode, ?actionOnBothPass : Context3DStencilAction, ?actionOnDepthFail : Context3DStencilAction, ?actionOnDepthPassStencilFail : Context3DStencilAction) : Void;
 	function setStencilReferenceValue(referenceValue : UInt, readMask : UInt = 255, writeMask : UInt = 255) : Void;

+ 7 - 0
std/flash/display3D/Context3DMipFilter.hx

@@ -0,0 +1,7 @@
+package flash.display3D;
+
+@:fakeEnum(String) extern enum Context3DMipFilter {
+	MIPLINEAR;
+	MIPNEAREST;
+	MIPNONE;
+}

+ 0 - 1
std/flash/display3D/Context3DProfile.hx

@@ -3,5 +3,4 @@ package flash.display3D;
 @:fakeEnum(String) extern enum Context3DProfile {
 	BASELINE;
 	BASELINE_CONSTRAINED;
-	BASELINE_EXTENDED;
 }

+ 6 - 0
std/flash/display3D/Context3DTextureFilter.hx

@@ -0,0 +1,6 @@
+package flash.display3D;
+
+@:fakeEnum(String) extern enum Context3DTextureFilter {
+	LINEAR;
+	NEAREST;
+}

+ 6 - 0
std/flash/display3D/Context3DWrapMode.hx

@@ -0,0 +1,6 @@
+package flash.display3D;
+
+@:fakeEnum(String) extern enum Context3DWrapMode {
+	CLAMP;
+	REPEAT;
+}

+ 2 - 0
std/flash/net/GroupSpecifier.hx

@@ -2,6 +2,7 @@ package flash.net;
 
 @:require(flash10_1) extern class GroupSpecifier {
 	var ipMulticastMemberUpdatesEnabled : Bool;
+	var minGroupspecVersion : Int;
 	var multicastEnabled : Bool;
 	var objectReplicationEnabled : Bool;
 	var peerToPeerDisabled : Bool;
@@ -18,6 +19,7 @@ package flash.net;
 	function setPostingPassword(?password : String, ?salt : String) : Void;
 	function setPublishPassword(?password : String, ?salt : String) : Void;
 	function toString() : String;
+	static var maxSupportedGroupspecVersion(default,null) : Int;
 	static function encodeBootstrapPeerIDSpec(peerID : String) : String;
 	static function encodeIPMulticastAddressSpec(address : String, ?port : Dynamic, ?source : String) : String;
 	static function encodePostingAuthorization(password : String) : String;

+ 1 - 1
std/flash/system/ApplicationInstaller.hx

@@ -3,7 +3,7 @@ package flash.system;
 @:final @:require(flash11_3) extern class ApplicationInstaller extends flash.events.EventDispatcher {
 	var isInstalled(default,null) : Bool;
 	function new() : Void;
-	function install(shortcutsOnly : Bool = false) : Void;
+	function install(?mode : String) : Void;
 	static function iconDigest(icon : flash.utils.ByteArray) : String;
 	static function stringsDigest(strings : flash.xml.XML) : String;
 }

+ 7 - 0
std/flash/system/ApplicationInstallerMode.hx

@@ -0,0 +1,7 @@
+package flash.system;
+
+@:fakeEnum(String) extern enum ApplicationInstallerMode {
+	INSTALL_ONLY;
+	INSTALL_WITH_SHORTCUTS;
+	SHORTCUTS_ONLY;
+}

+ 5 - 0
std/flash/system/DomainMemoryWithStage3D.hx

@@ -0,0 +1,5 @@
+package flash.system;
+
+extern class DomainMemoryWithStage3D {
+	function new() : Void;
+}

+ 1 - 1
std/flash/system/MessageChannel.hx

@@ -5,5 +5,5 @@ package flash.system;
 	var state(default,null) : MessageChannelState;
 	function close() : Void;
 	function receive(blockUntilReceived : Bool = false) : Dynamic;
-	function send(arg : Dynamic, queueLimit : Int = -1) : Dynamic;
+	function send(arg : Dynamic, queueLimit : Int = -1) : Void;
 }

+ 2 - 2
std/flash/utils/ByteArray.hx

@@ -11,7 +11,7 @@ extern class ByteArray implements IDataOutput2 implements IDataInput2 implements
 	@:require(flash11_4) function atomicCompareAndSwapIntAt(byteIndex : Int, expectedValue : Int, newValue : Int) : Int;
 	@:require(flash11_4) function atomicCompareAndSwapLength(expectedLength : Int, newLength : Int) : Int;
 	@:require(flash10) function clear() : Void;
-	function compress(#if flash11 ?algorithm : CompressionAlgorithm #end) : Void;
+	function compress(?algorithm : CompressionAlgorithm) : Void;
 	@:require(flash10) function deflate() : Void;
 	@:require(flash10) function inflate() : Void;
 	function readBoolean() : Bool;
@@ -29,7 +29,7 @@ extern class ByteArray implements IDataOutput2 implements IDataInput2 implements
 	function readUnsignedInt() : UInt;
 	function readUnsignedShort() : UInt;
 	function toString() : String;
-	function uncompress(#if flash11 ?algorithm : CompressionAlgorithm #end) : Void;
+	function uncompress(?algorithm : CompressionAlgorithm) : Void;
 	function writeBoolean(value : Bool) : Void;
 	function writeByte(value : Int) : Void;
 	function writeBytes(bytes : ByteArray, offset : UInt = 0, length : UInt = 0) : Void;

+ 1 - 1
std/flash/utils/Proxy.hx

@@ -2,7 +2,7 @@ package flash.utils;
 
 extern class Proxy {
 	function new() : Void;
-	@:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function callProperty(name : Dynamic, __arguments__ : Array<Dynamic> ) : Dynamic;
+	@:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function callProperty(name : Dynamic, ?p1 : Dynamic, ?p2 : Dynamic, ?p3 : Dynamic, ?p4 : Dynamic, ?p5 : Dynamic) : Dynamic;
 	@:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function deleteProperty(name : Dynamic) : Bool;
 	@:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function getDescendants(name : Dynamic) : Dynamic;
 	@:ns("http://www.adobe.com/2006/actionscript/flash/proxy") function getProperty(name : Dynamic) : Dynamic;