Browse Source

externe enums fixes

Nicolas Cannasse 16 years ago
parent
commit
cccf03dc45

+ 4 - 0
genswf9.ml

@@ -238,6 +238,10 @@ let classify ctx t =
 		KFloat
 	| TEnum ({ e_path = [],"Bool" },_) ->
 		KBool
+	| TEnum ({ e_extern = true; e_path = "flash" :: _ , name },[]) ->
+		(match name with
+		| "ActionScriptVersion" | "SWFVersion" | "EventPhase" | "KeyLocation" | "XmlNodeType" -> KInt
+		| _ -> KType (HMPath ([],"String")))
 	| TEnum _
 	| TInst _ ->
 		KType (type_id ctx t)

+ 1 - 1
std/flash9/display/BitmapData.hx

@@ -10,7 +10,7 @@ extern class BitmapData implements IBitmapDrawable {
 	function clone() : BitmapData;
 	function colorTransform(rect : flash.geom.Rectangle, colorTransform : flash.geom.ColorTransform) : Void;
 	function compare(otherBitmapData : BitmapData) : Dynamic;
-	function copyChannel(sourceBitmapData : BitmapData, sourceRect : flash.geom.Rectangle, destPoint : flash.geom.Point, sourceChannel : BitmapDataChannel, destChannel : BitmapDataChannel) : Void;
+	function copyChannel(sourceBitmapData : BitmapData, sourceRect : flash.geom.Rectangle, destPoint : flash.geom.Point, sourceChannel : Int, destChannel : Int) : Void;
 	function copyPixels(sourceBitmapData : BitmapData, sourceRect : flash.geom.Rectangle, destPoint : flash.geom.Point, ?alphaBitmapData : BitmapData, ?alphaPoint : flash.geom.Point, ?mergeAlpha : Bool) : Void;
 	function dispose() : Void;
 	function draw(source : IBitmapDrawable, ?matrix : flash.geom.Matrix, ?colorTransform : flash.geom.ColorTransform, ?blendMode : BlendMode, ?clipRect : flash.geom.Rectangle, ?smoothing : Bool) : Void;

+ 5 - 5
std/flash9/display/BitmapDataChannel.hx

@@ -1,8 +1,8 @@
 package flash.display;
 
-extern enum BitmapDataChannel {
-	ALPHA;
-	BLUE;
-	GREEN;
-	RED;
+extern class BitmapDataChannel {
+	public static inline var ALPHA = 8;
+	public static inline var BLUE = 4;
+	public static inline var GREEN = 2;
+	public static inline var RED = 1;
 }

+ 6 - 6
std/flash9/display/GraphicsPathCommand.hx

@@ -1,10 +1,10 @@
 package flash.display;
 
 extern class GraphicsPathCommand {
-	public static var LINE_TO(default,null) : Int;
-	public static var MOVE_TO(default,null) : Int;
-	public static var CURVE_TO(default,null) : Int;
-	public static var WIDE_LINE_TO(default,null) : Int;
-	public static var WIDE_MOVE_TO(default,null) : Int;
-	public static var NO_OP(default,null) : Int;
+	public static inline var LINE_TO = 2;
+	public static inline var MOVE_TO = 1;
+	public static inline var CURVE_TO = 3;
+	public static inline var WIDE_LINE_TO = 5;
+	public static inline var WIDE_MOVE_TO = 4;
+	public static inline var NO_OP = 0;
 }