Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 2 additions & 24 deletions core/src/avm2/globals/flash/desktop/ClipboardFormats.as
Original file line number Diff line number Diff line change
@@ -1,36 +1,14 @@
// The initial version of this file was autogenerated from the official AS3 reference at
// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/ClipboardFormats.html
// by https://github.com/golfinq/ActionScript_Event_Builder
// It won't be regenerated in the future, so feel free to edit and/or fix

package flash.desktop
{

package flash.desktop {
// The AS3 docs specify various API versions for the different members,
// as also indicated by their comments. The docs, however, are lying.
[API("662")]
public class ClipboardFormats
{
// Image data (AIR only).
public class ClipboardFormats {
public static const BITMAP_FORMAT:String = "air:bitmap";

// An array of files (AIR only).
public static const FILE_LIST_FORMAT:String = "air:file list";

// File promise list (AIR only).
public static const FILE_PROMISE_LIST_FORMAT:String = "air:file promise list";

// HTML data.
public static const HTML_FORMAT:String = "air:html";

// Rich Text Format data.
public static const RICH_TEXT_FORMAT:String = "air:rtf";

// String data.
public static const TEXT_FORMAT:String = "air:text";

// A URL string (AIR only).
public static const URL_FORMAT:String = "air:url";

}
}
20 changes: 2 additions & 18 deletions core/src/avm2/globals/flash/desktop/ClipboardTransferMode.as
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
// The initial version of this file was autogenerated from the official AS3 reference at
// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/ClipboardTransferMode.html
// by https://github.com/golfinq/ActionScript_Event_Builder
// It won't be regenerated in the future, so feel free to edit and/or fix

package flash.desktop
{

public class ClipboardTransferMode
{
// The Clipboard object should only return a copy.
package flash.desktop {
public class ClipboardTransferMode {
public static const CLONE_ONLY:String = "cloneOnly";

// The Clipboard object should return a copy if available and a reference if not.
public static const CLONE_PREFERRED:String = "clonePreferred";

// The Clipboard object should only return a reference.
public static const ORIGINAL_ONLY:String = "originalOnly";

// The Clipboard object should return a reference if available and a copy if not.
public static const ORIGINAL_PREFERRED:String = "originalPreferred";

}
}
3 changes: 1 addition & 2 deletions core/src/avm2/globals/flash/desktop/IFilePromise.as
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package flash.desktop {
function get relativePath():String;
function close():void;
function open():IDataInput;
function reportError(e:ErrorEvent):void

function reportError(e:ErrorEvent):void;
}
}
1 change: 0 additions & 1 deletion core/src/avm2/globals/flash/desktop/NativeDragManager.as
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package flash.desktop {
[API("661")]
[Ruffle(Abstract)]
public class NativeDragManager {

[API("668")]
public static function get isSupported():Boolean {
return false;
Expand Down
2 changes: 1 addition & 1 deletion core/src/avm2/globals/flash/desktop/NativeDragOptions.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ package flash.desktop {
public var allowLink:Boolean = true;
public var allowMove:Boolean = true;

public function NativeDragOptions() { }
public function NativeDragOptions() {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ package flash.desktop {

public function get arguments():Vector.<String> {
stub_getter("flash.desktop.NativeProcessStartupInfo", "arguments");

return null;
}

Expand All @@ -22,7 +21,6 @@ package flash.desktop {

public function get executable():File {
stub_getter("flash.desktop.NativeProcessStartupInfo", "executable");

return null;
}

Expand All @@ -32,7 +30,6 @@ package flash.desktop {

public function get workingDirectory():File {
stub_getter("flash.desktop.NativeProcessStartupInfo", "workingDirectory");

return null;
}

Expand Down
1 change: 0 additions & 1 deletion core/src/avm2/globals/flash/desktop/SystemIdleMode.as
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package flash.desktop {
[API("668")]
public final class SystemIdleMode {
public static const NORMAL:String = "normal";

public static const KEEP_AWAKE:String = "keepAwake";
}
}
4 changes: 2 additions & 2 deletions core/src/avm2/globals/flash/display/ActionScriptVersion.as
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package flash.display {
public final class ActionScriptVersion {
public static const ACTIONSCRIPT2: uint = 2;
public static const ACTIONSCRIPT3: uint = 3;
public static const ACTIONSCRIPT2:uint = 2;
public static const ACTIONSCRIPT3:uint = 3;
}
}
1 change: 0 additions & 1 deletion core/src/avm2/globals/flash/display/Bitmap.as
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package flash.display {

[Ruffle(InstanceAllocator)]
public class Bitmap extends DisplayObject {
public native function get bitmapData():BitmapData;
Expand Down
136 changes: 118 additions & 18 deletions core/src/avm2/globals/flash/display/BitmapData.as
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package flash.display {
import __ruffle__.stub_method;

import flash.geom.Rectangle;
import flash.geom.ColorTransform;
import flash.geom.Point;
import flash.geom.Matrix;
import flash.filters.BitmapFilter;
import flash.filters.ShaderFilter;
import flash.utils.ByteArray;
import __ruffle__.stub_method;

[Ruffle(InstanceAllocator)]
public class BitmapData implements IBitmapDrawable {
Expand All @@ -21,28 +22,59 @@ package flash.display {
public native function get rect():Rectangle;
public native function get transparent():Boolean;

public native function getPixels(rect:Rectangle):ByteArray;
[API("682")]
public native function copyPixelsToByteArray(rect:Rectangle, data:ByteArray):void;
[API("662")]
public native function getVector(rect:Rectangle):Vector.<uint>;

public native function getPixel(x:int, y:int):uint;
public native function getPixel32(x:int, y:int):uint;
public native function setPixel(x:int, y:int, color:uint):void;

public native function getPixel32(x:int, y:int):uint;
public native function setPixel32(x:int, y:int, color:uint):void;

public native function getPixels(rect:Rectangle):ByteArray;
public native function setPixels(rect:Rectangle, inputByteArray:ByteArray):void;

[API("662")]
public native function getVector(rect:Rectangle):Vector.<uint>;
[API("662")]
public native function setVector(rect:Rectangle, inputVector:Vector.<uint>):void;
public native function copyChannel(sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, sourceChannel:uint, destChannel:uint):void;

public native function copyChannel(
sourceBitmapData:BitmapData,
sourceRect:Rectangle,
destPoint:Point,
sourceChannel:uint,
destChannel:uint
):void;

public native function floodFill(x:int, y:int, color:uint):void;
public native function noise(randomSeed:int, low:uint = 0, high:uint = 255, channelOptions:uint = 7, grayScale:Boolean = false):void;

public native function noise(
randomSeed:int,
low:uint = 0,
high:uint = 255,
channelOptions:uint = 7,
grayScale:Boolean = false
):void;

public native function colorTransform(rect:Rectangle, colorTransform:ColorTransform):void;

public native function getColorBoundsRect(mask:uint, color:uint, findColor:Boolean = true):Rectangle;

public native function scroll(x:int, y:int):void;

public native function lock():void;
public native function hitTest(firstPoint:Point, firstAlphaThreshold:uint, secondObject:Object, secondBitmapDataPoint:Point = null, secondAlphaThreshold:uint = 1):Boolean;

public native function hitTest(
firstPoint:Point,
firstAlphaThreshold:uint,
secondObject:Object,
secondBitmapDataPoint:Point = null,
secondAlphaThreshold:uint = 1
):Boolean;

[API("662")]
public function histogram(rect:Rectangle = null): Vector.<Vector.<Number>> {
public function histogram(rect:Rectangle = null):Vector.<Vector.<Number>> {
if (!rect) {
rect = this.rect;
}
Expand All @@ -67,38 +99,105 @@ package flash.display {
result[3] = a;
return result;
}

public native function unlock(changeRect:Rectangle = null):void;

public native function copyPixels(
sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, alphaBitmapData:BitmapData = null, alphaPoint:Point = null, mergeAlpha:Boolean = false
sourceBitmapData:BitmapData,
sourceRect:Rectangle,
destPoint:Point,
alphaBitmapData:BitmapData = null,
alphaPoint:Point = null,
mergeAlpha:Boolean = false
):void;

public native function draw(
source:IBitmapDrawable, matrix:Matrix = null, colorTransform:ColorTransform = null, blendMode:String = null, clipRect:Rectangle = null, smoothing:Boolean = false
source:IBitmapDrawable,
matrix:Matrix = null,
colorTransform:ColorTransform = null,
blendMode:String = null,
clipRect:Rectangle = null,
smoothing:Boolean = false
):void;

[API("680")]
public native function drawWithQuality(
source:IBitmapDrawable, matrix:Matrix = null, colorTransform:ColorTransform = null, blendMode:String = null, clipRect:Rectangle = null, smoothing:Boolean = false, quality:String = null
source:IBitmapDrawable,
matrix:Matrix = null,
colorTransform:ColorTransform = null,
blendMode:String = null,
clipRect:Rectangle = null,
smoothing:Boolean = false,
quality:String = null
):void;

public native function fillRect(rect:Rectangle, color:uint):void;

public native function dispose():void;
public native function applyFilter(sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, filter:BitmapFilter):void;

public native function applyFilter(
sourceBitmapData:BitmapData,
sourceRect:Rectangle,
destPoint:Point,
filter:BitmapFilter
):void;

public native function clone():BitmapData;

public native function paletteMap(
sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, redArray:Array = null, greenArray:Array = null, blueArray:Array = null, alphaArray:Array = null
sourceBitmapData:BitmapData,
sourceRect:Rectangle,
destPoint:Point,
redArray:Array = null,
greenArray:Array = null,
blueArray:Array = null,
alphaArray:Array = null
):void;

public native function perlinNoise(
baseX:Number, baseY:Number, numOctaves:uint, randomSeed:int, stitch:Boolean, fractalNoise:Boolean, channelOptions:uint = 7, grayScale:Boolean = false, offsets:Array = null
baseX:Number,
baseY:Number,
numOctaves:uint,
randomSeed:int,
stitch:Boolean,
fractalNoise:Boolean,
channelOptions:uint = 7,
grayScale:Boolean = false,
offsets:Array = null
):void;

public native function threshold(
sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, operation:String, threshold:uint, color:uint = 0, mask:uint = 0xFFFFFFFF, copySource:Boolean = false
sourceBitmapData:BitmapData,
sourceRect:Rectangle,
destPoint:Point,
operation:String,
threshold:uint,
color:uint = 0,
mask:uint = 0xFFFFFFFF,
copySource:Boolean = false
):uint;

public native function compare(otherBitmapData:BitmapData):Object;

public native function pixelDissolve(
sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, randomSeed:int = 0, numPixels:int = 0,
sourceBitmapData:BitmapData,
sourceRect:Rectangle,
destPoint:Point,
randomSeed:int = 0,
numPixels:int = 0,
fillColor:uint = 0
):int;

public native function merge(
sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, redMultiplier:uint, greenMultiplier:uint, blueMultiplier:uint, alphaMultiplier:uint
sourceBitmapData:BitmapData,
sourceRect:Rectangle,
destPoint:Point,
redMultiplier:uint,
greenMultiplier:uint,
blueMultiplier:uint,
alphaMultiplier:uint
):void;

public function generateFilterRect(sourceRect:Rectangle, filter:BitmapFilter):Rectangle {
// Flash always reports that a ShaderFilter affects the entire BitmapData, ignoring sourceRect.
if (filter is ShaderFilter) {
Expand All @@ -107,6 +206,7 @@ package flash.display {
stub_method("flash.display.BitmapData", "generateFilterRect");
return sourceRect.clone();
}

[API("680")]
public function encode(rect:Rectangle, compressor:Object, byteArray:ByteArray = null):ByteArray {
stub_method("flash.display.BitmapData", "encode");
Expand Down
8 changes: 4 additions & 4 deletions core/src/avm2/globals/flash/display/BitmapDataChannel.as
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package flash.display {
public final class BitmapDataChannel {
public static const RED: uint = 1;
public static const GREEN: uint = 2;
public static const BLUE: uint = 4;
public static const ALPHA: uint = 8;
public static const RED:uint = 1;
public static const GREEN:uint = 2;
public static const BLUE:uint = 4;
public static const ALPHA:uint = 8;
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package flash.display {
[API("680")]
public final class BitmapEncodingColorSpace {
public static const COLORSPACE_AUTO: String = "auto";
public static const COLORSPACE_4_4_4: String = "4:4:4";
public static const COLORSPACE_4_2_2: String = "4:2:2";
public static const COLORSPACE_4_2_0: String = "4:2:0";
public static const COLORSPACE_AUTO:String = "auto";
public static const COLORSPACE_4_4_4:String = "4:4:4";
public static const COLORSPACE_4_2_2:String = "4:2:2";
public static const COLORSPACE_4_2_0:String = "4:2:0";
}
}
Loading
Loading