parent
26025a0446
commit
44fd13c654
|
@ -1,4 +1,4 @@
|
||||||
//! flash.filter.BevelFilter object
|
//! flash.filters.BevelFilter object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! flash.filter.BitmapFilter object
|
//! flash.filters.BitmapFilter object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! flash.filter.BlurFilter object
|
//! flash.filters.BlurFilter object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
|
|
@ -10,8 +10,8 @@ use crate::string::AvmString;
|
||||||
use gc_arena::MutationContext;
|
use gc_arena::MutationContext;
|
||||||
|
|
||||||
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"toString" => method(to_string);
|
"toString" => method(to_string; DONT_ENUM | DONT_DELETE);
|
||||||
"valueOf" => method(value_of);
|
"valueOf" => method(value_of; DONT_ENUM | DONT_DELETE);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// `Boolean` constructor
|
/// `Boolean` constructor
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! Button/SimpleButton prototype
|
//! Button prototype
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
@ -7,6 +7,7 @@ use crate::avm1::property_decl::{define_properties_on, Declaration};
|
||||||
use crate::avm1::{Object, ScriptObject, TObject, Value};
|
use crate::avm1::{Object, ScriptObject, TObject, Value};
|
||||||
use crate::display_object::{Avm1Button, TDisplayObject};
|
use crate::display_object::{Avm1Button, TDisplayObject};
|
||||||
use gc_arena::MutationContext;
|
use gc_arena::MutationContext;
|
||||||
|
|
||||||
macro_rules! button_getter {
|
macro_rules! button_getter {
|
||||||
($name:ident) => {
|
($name:ident) => {
|
||||||
|activation, this, _args| {
|
|activation, this, _args| {
|
||||||
|
@ -35,8 +36,8 @@ macro_rules! button_setter {
|
||||||
}
|
}
|
||||||
|
|
||||||
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"enabled" => property(button_getter!(enabled), button_setter!(set_enabled); DONT_ENUM | DONT_DELETE);
|
"enabled" => property(button_getter!(enabled), button_setter!(set_enabled));
|
||||||
"useHandCursor" => property(button_getter!(use_hand_cursor), button_setter!(set_use_hand_cursor); DONT_ENUM | DONT_DELETE);
|
"useHandCursor" => property(button_getter!(use_hand_cursor), button_setter!(set_use_hand_cursor));
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn create_proto<'gc>(
|
pub fn create_proto<'gc>(
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! flash.filter.ColorMatrixFilter object
|
//! flash.filters.ColorMatrixFilter object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
//! ColorTransform object
|
//! flash.geom.ColorTransform object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
use crate::avm1::object::color_transform_object::ColorTransformObject;
|
||||||
use crate::avm1::property_decl::{define_properties_on, Declaration};
|
use crate::avm1::property_decl::{define_properties_on, Declaration};
|
||||||
use crate::avm1::{Object, TObject, Value};
|
use crate::avm1::{Object, TObject, Value};
|
||||||
|
use crate::color_transform::ColorTransform;
|
||||||
use crate::string::AvmString;
|
use crate::string::AvmString;
|
||||||
use gc_arena::MutationContext;
|
use gc_arena::MutationContext;
|
||||||
|
|
||||||
use crate::avm1::object::color_transform_object::ColorTransformObject;
|
|
||||||
use crate::color_transform::ColorTransform;
|
|
||||||
use swf::Fixed8;
|
use swf::Fixed8;
|
||||||
|
|
||||||
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! flash.filter.ConvolutionFilter object
|
//! flash.filters.ConvolutionFilter object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! flash.filter.DisplacementMapFilter object
|
//! flash.filters.DisplacementMapFilter object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! flash.filter.DropShadowFilter object
|
//! flash.filters.DropShadowFilter object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
|
|
@ -9,7 +9,7 @@ use gc_arena::MutationContext;
|
||||||
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"message" => string("Error");
|
"message" => string("Error");
|
||||||
"name" => string("Error");
|
"name" => string("Error");
|
||||||
"toString" => method(to_string; DONT_DELETE);
|
"toString" => method(to_string);
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn constructor<'gc>(
|
pub fn constructor<'gc>(
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! flash.external.ExternalInterface object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
use crate::avm1::property_decl::{define_properties_on, Declaration};
|
use crate::avm1::property_decl::{define_properties_on, Declaration};
|
||||||
|
|
|
@ -8,8 +8,8 @@ use crate::avm1::{Object, ScriptObject, TObject, Value};
|
||||||
use gc_arena::MutationContext;
|
use gc_arena::MutationContext;
|
||||||
|
|
||||||
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"call" => method(call);
|
"call" => method(call; DONT_ENUM | DONT_DELETE);
|
||||||
"apply" => method(apply);
|
"apply" => method(apply; DONT_ENUM | DONT_DELETE);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Implements `new Function()`
|
/// Implements `new Function()`
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! flash.filter.GlowFilter object
|
//! flash.filters.GlowFilter object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! flash.filter.GradientBevelFilter object
|
//! flash.filters.GradientBevelFilter object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! flash.filter.GradientGlowFilter object
|
//! flash.filters.GradientGlowFilter object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//! flash.geom.Matrix
|
//! flash.geom.Matrix object
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
|
|
|
@ -63,45 +63,45 @@ macro_rules! mc_setter {
|
||||||
}
|
}
|
||||||
|
|
||||||
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"attachMovie" => method(mc_method!(attach_movie); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"attachMovie" => method(mc_method!(attach_movie); DONT_ENUM | DONT_DELETE);
|
||||||
"createEmptyMovieClip" => method(mc_method!(create_empty_movie_clip); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"createEmptyMovieClip" => method(mc_method!(create_empty_movie_clip); DONT_ENUM | DONT_DELETE);
|
||||||
"createTextField" => method(mc_method!(create_text_field); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"createTextField" => method(mc_method!(create_text_field); DONT_ENUM | DONT_DELETE);
|
||||||
"duplicateMovieClip" => method(mc_method!(duplicate_movie_clip); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"duplicateMovieClip" => method(mc_method!(duplicate_movie_clip); DONT_ENUM | DONT_DELETE);
|
||||||
"getBounds" => method(mc_method!(get_bounds); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"getBounds" => method(mc_method!(get_bounds); DONT_ENUM | DONT_DELETE);
|
||||||
"getBytesLoaded" => method(mc_method!(get_bytes_loaded); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"getBytesLoaded" => method(mc_method!(get_bytes_loaded); DONT_ENUM | DONT_DELETE);
|
||||||
"getBytesTotal" => method(mc_method!(get_bytes_total); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"getBytesTotal" => method(mc_method!(get_bytes_total); DONT_ENUM | DONT_DELETE);
|
||||||
"getInstanceAtDepth" => method(mc_method!(get_instance_at_depth); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"getInstanceAtDepth" => method(mc_method!(get_instance_at_depth); DONT_ENUM | DONT_DELETE);
|
||||||
"getNextHighestDepth" => method(mc_method!(get_next_highest_depth); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"getNextHighestDepth" => method(mc_method!(get_next_highest_depth); DONT_ENUM | DONT_DELETE);
|
||||||
"getRect" => method(mc_method!(get_rect); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"getRect" => method(mc_method!(get_rect); DONT_ENUM | DONT_DELETE);
|
||||||
"getURL" => method(mc_method!(get_url); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"getURL" => method(mc_method!(get_url); DONT_ENUM | DONT_DELETE);
|
||||||
"globalToLocal" => method(mc_method!(global_to_local); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"globalToLocal" => method(mc_method!(global_to_local); DONT_ENUM | DONT_DELETE);
|
||||||
"gotoAndPlay" => method(mc_method!(goto_and_play); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"gotoAndPlay" => method(mc_method!(goto_and_play); DONT_ENUM | DONT_DELETE);
|
||||||
"gotoAndStop" => method(mc_method!(goto_and_stop); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"gotoAndStop" => method(mc_method!(goto_and_stop); DONT_ENUM | DONT_DELETE);
|
||||||
"hitTest" => method(mc_method!(hit_test); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"hitTest" => method(mc_method!(hit_test); DONT_ENUM | DONT_DELETE);
|
||||||
"loadMovie" => method(mc_method!(load_movie); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"loadMovie" => method(mc_method!(load_movie); DONT_ENUM | DONT_DELETE);
|
||||||
"loadVariables" => method(mc_method!(load_variables); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"loadVariables" => method(mc_method!(load_variables); DONT_ENUM | DONT_DELETE);
|
||||||
"localToGlobal" => method(mc_method!(local_to_global); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"localToGlobal" => method(mc_method!(local_to_global); DONT_ENUM | DONT_DELETE);
|
||||||
"nextFrame" => method(mc_method!(next_frame); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"nextFrame" => method(mc_method!(next_frame); DONT_ENUM | DONT_DELETE);
|
||||||
"play" => method(mc_method!(play); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"play" => method(mc_method!(play); DONT_ENUM | DONT_DELETE);
|
||||||
"prevFrame" => method(mc_method!(prev_frame); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"prevFrame" => method(mc_method!(prev_frame); DONT_ENUM | DONT_DELETE);
|
||||||
"setMask" => method(mc_method!(set_mask); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"setMask" => method(mc_method!(set_mask); DONT_ENUM | DONT_DELETE);
|
||||||
"startDrag" => method(mc_method!(start_drag); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"startDrag" => method(mc_method!(start_drag); DONT_ENUM | DONT_DELETE);
|
||||||
"stop" => method(mc_method!(stop); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"stop" => method(mc_method!(stop); DONT_ENUM | DONT_DELETE);
|
||||||
"stopDrag" => method(mc_method!(stop_drag); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"stopDrag" => method(mc_method!(stop_drag); DONT_ENUM | DONT_DELETE);
|
||||||
"swapDepths" => method(mc_method!(swap_depths); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"swapDepths" => method(mc_method!(swap_depths); DONT_ENUM | DONT_DELETE);
|
||||||
"unloadMovie" => method(mc_method!(unload_movie); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"unloadMovie" => method(mc_method!(unload_movie); DONT_ENUM | DONT_DELETE);
|
||||||
"beginFill" => method(mc_method!(begin_fill); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"beginFill" => method(mc_method!(begin_fill); DONT_ENUM | DONT_DELETE);
|
||||||
"beginBitmapFill" => method(mc_method!(begin_bitmap_fill); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"beginBitmapFill" => method(mc_method!(begin_bitmap_fill); DONT_ENUM | DONT_DELETE);
|
||||||
"beginGradientFill" => method(mc_method!(begin_gradient_fill); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"beginGradientFill" => method(mc_method!(begin_gradient_fill); DONT_ENUM | DONT_DELETE);
|
||||||
"moveTo" => method(mc_method!(move_to); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"moveTo" => method(mc_method!(move_to); DONT_ENUM | DONT_DELETE);
|
||||||
"lineTo" => method(mc_method!(line_to); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"lineTo" => method(mc_method!(line_to); DONT_ENUM | DONT_DELETE);
|
||||||
"curveTo" => method(mc_method!(curve_to); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"curveTo" => method(mc_method!(curve_to); DONT_ENUM | DONT_DELETE);
|
||||||
"endFill" => method(mc_method!(end_fill); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"endFill" => method(mc_method!(end_fill); DONT_ENUM | DONT_DELETE);
|
||||||
"lineStyle" => method(mc_method!(line_style); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"lineStyle" => method(mc_method!(line_style); DONT_ENUM | DONT_DELETE);
|
||||||
"clear" => method(mc_method!(clear); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"clear" => method(mc_method!(clear); DONT_ENUM | DONT_DELETE);
|
||||||
"attachBitmap" => method(mc_method!(attach_bitmap); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"attachBitmap" => method(mc_method!(attach_bitmap); DONT_ENUM | DONT_DELETE);
|
||||||
"removeMovieClip" => method(remove_movie_clip; DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"removeMovieClip" => method(remove_movie_clip; DONT_ENUM | DONT_DELETE);
|
||||||
"transform" => property(mc_getter!(transform), mc_setter!(set_transform); DONT_DELETE | DONT_ENUM);
|
"transform" => property(mc_getter!(transform), mc_setter!(set_transform); DONT_ENUM);
|
||||||
"enabled" => property(mc_getter!(enabled), mc_setter!(set_enabled); DONT_DELETE | DONT_ENUM);
|
"enabled" => property(mc_getter!(enabled), mc_setter!(set_enabled); DONT_DELETE | DONT_ENUM);
|
||||||
"focusEnabled" => property(mc_getter!(focus_enabled), mc_setter!(set_focus_enabled); DONT_DELETE | DONT_ENUM);
|
"focusEnabled" => property(mc_getter!(focus_enabled), mc_setter!(set_focus_enabled); DONT_DELETE | DONT_ENUM);
|
||||||
"_lockroot" => property(mc_getter!(lock_root), mc_setter!(set_lock_root); DONT_DELETE | DONT_ENUM);
|
"_lockroot" => property(mc_getter!(lock_root), mc_setter!(set_lock_root); DONT_DELETE | DONT_ENUM);
|
||||||
|
|
|
@ -13,9 +13,9 @@ use crate::display_object::{TDisplayObject, TDisplayObjectContainer};
|
||||||
use gc_arena::MutationContext;
|
use gc_arena::MutationContext;
|
||||||
|
|
||||||
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"loadClip" => method(load_clip);
|
"loadClip" => method(load_clip; DONT_ENUM | DONT_DELETE);
|
||||||
"unloadClip" => method(unload_clip);
|
"unloadClip" => method(unload_clip; DONT_ENUM | DONT_DELETE);
|
||||||
"getProgress" => method(get_progress);
|
"getProgress" => method(get_progress; DONT_ENUM | DONT_DELETE);
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn constructor<'gc>(
|
pub fn constructor<'gc>(
|
||||||
|
|
|
@ -10,8 +10,8 @@ use crate::string::AvmString;
|
||||||
use gc_arena::MutationContext;
|
use gc_arena::MutationContext;
|
||||||
|
|
||||||
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"toString" => method(to_string);
|
"toString" => method(to_string; DONT_ENUM | DONT_DELETE);
|
||||||
"valueOf" => method(value_of);
|
"valueOf" => method(value_of; DONT_ENUM | DONT_DELETE);
|
||||||
};
|
};
|
||||||
|
|
||||||
const OBJECT_DECLS: &[Declaration] = declare_properties! {
|
const OBJECT_DECLS: &[Declaration] = declare_properties! {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//! Object prototype
|
//! Object prototype
|
||||||
|
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
use crate::avm1::function::{Executable, FunctionObject};
|
use crate::avm1::function::{Executable, FunctionObject};
|
||||||
use crate::avm1::property::Attribute;
|
use crate::avm1::property::Attribute;
|
||||||
|
|
|
@ -25,13 +25,13 @@ const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"offsetPoint" => method(offset_point);
|
"offsetPoint" => method(offset_point);
|
||||||
"intersection" => method(intersection);
|
"intersection" => method(intersection);
|
||||||
"equals" => method(equals);
|
"equals" => method(equals);
|
||||||
"left" => property(get_left, set_left; DONT_ENUM | DONT_DELETE);
|
"left" => property(get_left, set_left);
|
||||||
"top" => property(get_top, set_top; DONT_ENUM | DONT_DELETE);
|
"top" => property(get_top, set_top);
|
||||||
"right" => property(get_right, set_right; DONT_ENUM | DONT_DELETE);
|
"right" => property(get_right, set_right);
|
||||||
"bottom" => property(get_bottom, set_bottom; DONT_ENUM | DONT_DELETE);
|
"bottom" => property(get_bottom, set_bottom);
|
||||||
"size" => property(get_size, set_size; DONT_ENUM | DONT_DELETE);
|
"size" => property(get_size, set_size);
|
||||||
"topLeft" => property(get_top_left, set_top_left; DONT_ENUM | DONT_DELETE);
|
"topLeft" => property(get_top_left, set_top_left);
|
||||||
"bottomRight" => property(get_bottom_right, set_bottom_right; DONT_ENUM | DONT_DELETE);
|
"bottomRight" => property(get_bottom_right, set_bottom_right);
|
||||||
};
|
};
|
||||||
|
|
||||||
fn constructor<'gc>(
|
fn constructor<'gc>(
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use std::borrow::Cow;
|
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
use crate::avm1::function::{Executable, FunctionObject};
|
use crate::avm1::function::{Executable, FunctionObject};
|
||||||
|
@ -14,22 +12,23 @@ use flash_lso::types::Value as AmfValue;
|
||||||
use flash_lso::types::{AMFVersion, Element, Lso};
|
use flash_lso::types::{AMFVersion, Element, Lso};
|
||||||
use gc_arena::MutationContext;
|
use gc_arena::MutationContext;
|
||||||
use json::JsonValue;
|
use json::JsonValue;
|
||||||
|
use std::borrow::Cow;
|
||||||
|
|
||||||
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"clear" => method(clear);
|
"clear" => method(clear; DONT_ENUM | DONT_DELETE);
|
||||||
"close" => method(close);
|
"close" => method(close; DONT_ENUM | DONT_DELETE);
|
||||||
"connect" => method(connect);
|
"connect" => method(connect; DONT_ENUM | DONT_DELETE);
|
||||||
"flush" => method(flush);
|
"flush" => method(flush; DONT_ENUM | DONT_DELETE);
|
||||||
"getSize" => method(get_size);
|
"getSize" => method(get_size; DONT_ENUM | DONT_DELETE);
|
||||||
"send" => method(send);
|
"send" => method(send; DONT_ENUM | DONT_DELETE);
|
||||||
"setFps" => method(set_fps);
|
"setFps" => method(set_fps; DONT_ENUM | DONT_DELETE);
|
||||||
"onStatus" => method(on_status);
|
"onStatus" => method(on_status; DONT_ENUM | DONT_DELETE);
|
||||||
"onSync" => method(on_sync);
|
"onSync" => method(on_sync; DONT_ENUM | DONT_DELETE);
|
||||||
};
|
};
|
||||||
|
|
||||||
const OBJECT_DECLS: &[Declaration] = declare_properties! {
|
const OBJECT_DECLS: &[Declaration] = declare_properties! {
|
||||||
"deleteAll" => method(delete_all);
|
"deleteAll" => method(delete_all; DONT_ENUM);
|
||||||
"getDiskUsage" => method(get_disk_usage);
|
"getDiskUsage" => method(get_disk_usage; DONT_ENUM);
|
||||||
"getLocal" => method(get_local);
|
"getLocal" => method(get_local);
|
||||||
"getRemote" => method(get_remote);
|
"getRemote" => method(get_remote);
|
||||||
"getMaxSize" => method(get_max_size);
|
"getMaxSize" => method(get_max_size);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
//! Stage object
|
//! Stage object
|
||||||
//!
|
//!
|
||||||
//! TODO: This is a very rough stub with not much implementation.
|
//! TODO: This is a very rough stub with not much implementation.
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
use crate::avm1::globals::as_broadcaster::BroadcasterFunctions;
|
use crate::avm1::globals::as_broadcaster::BroadcasterFunctions;
|
||||||
|
@ -11,12 +12,12 @@ use crate::string::{AvmString, WStr, WString};
|
||||||
use gc_arena::MutationContext;
|
use gc_arena::MutationContext;
|
||||||
|
|
||||||
const OBJECT_DECLS: &[Declaration] = declare_properties! {
|
const OBJECT_DECLS: &[Declaration] = declare_properties! {
|
||||||
"align" => property(align, set_align; DONT_ENUM | DONT_DELETE);
|
"align" => property(align, set_align);
|
||||||
"height" => property(height; DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"height" => property(height);
|
||||||
"scaleMode" => property(scale_mode, set_scale_mode; DONT_ENUM | DONT_DELETE);
|
"scaleMode" => property(scale_mode, set_scale_mode);
|
||||||
"displayState" => property(display_state, set_display_state; DONT_ENUM | DONT_DELETE);
|
"displayState" => property(display_state, set_display_state);
|
||||||
"showMenu" => property(show_menu, set_show_menu; DONT_ENUM | DONT_DELETE);
|
"showMenu" => property(show_menu, set_show_menu);
|
||||||
"width" => property(width; DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"width" => property(width);
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn create_stage_object<'gc>(
|
pub fn create_stage_object<'gc>(
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//! `String` class impl
|
//! `String` class impl
|
||||||
|
|
||||||
use crate::avm1::activation::Activation;
|
use crate::avm1::activation::Activation;
|
||||||
use crate::avm1::error::Error;
|
use crate::avm1::error::Error;
|
||||||
use crate::avm1::function::{Executable, FunctionObject};
|
use crate::avm1::function::{Executable, FunctionObject};
|
||||||
|
@ -10,23 +11,23 @@ use crate::string::{utils as string_utils, AvmString, WString};
|
||||||
use gc_arena::MutationContext;
|
use gc_arena::MutationContext;
|
||||||
|
|
||||||
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"toString" => method(to_string_value_of);
|
"toString" => method(to_string_value_of; DONT_ENUM | DONT_DELETE);
|
||||||
"valueOf" => method(to_string_value_of);
|
"valueOf" => method(to_string_value_of; DONT_ENUM | DONT_DELETE);
|
||||||
"charAt" => method(char_at; DONT_DELETE | DONT_ENUM);
|
"charAt" => method(char_at; DONT_ENUM | DONT_DELETE);
|
||||||
"charCodeAt" => method(char_code_at; DONT_DELETE | DONT_ENUM);
|
"charCodeAt" => method(char_code_at; DONT_ENUM | DONT_DELETE);
|
||||||
"concat" => method(concat; DONT_DELETE | DONT_ENUM);
|
"concat" => method(concat; DONT_ENUM | DONT_DELETE);
|
||||||
"indexOf" => method(index_of; DONT_DELETE | DONT_ENUM);
|
"indexOf" => method(index_of; DONT_ENUM | DONT_DELETE);
|
||||||
"lastIndexOf" => method(last_index_of; DONT_DELETE | DONT_ENUM);
|
"lastIndexOf" => method(last_index_of; DONT_ENUM | DONT_DELETE);
|
||||||
"slice" => method(slice; DONT_DELETE | DONT_ENUM);
|
"slice" => method(slice; DONT_ENUM | DONT_DELETE);
|
||||||
"split" => method(split; DONT_DELETE | DONT_ENUM);
|
"split" => method(split; DONT_ENUM | DONT_DELETE);
|
||||||
"substr" => method(substr; DONT_DELETE | DONT_ENUM);
|
"substr" => method(substr; DONT_ENUM | DONT_DELETE);
|
||||||
"substring" => method(substring; DONT_DELETE | DONT_ENUM);
|
"substring" => method(substring; DONT_ENUM | DONT_DELETE);
|
||||||
"toLowerCase" => method(to_lower_case; DONT_DELETE | DONT_ENUM);
|
"toLowerCase" => method(to_lower_case; DONT_ENUM | DONT_DELETE);
|
||||||
"toUpperCase" => method(to_upper_case; DONT_DELETE | DONT_ENUM);
|
"toUpperCase" => method(to_upper_case; DONT_ENUM | DONT_DELETE);
|
||||||
};
|
};
|
||||||
|
|
||||||
const OBJECT_DECLS: &[Declaration] = declare_properties! {
|
const OBJECT_DECLS: &[Declaration] = declare_properties! {
|
||||||
"fromCharCode" => method(from_char_code; DONT_DELETE | DONT_ENUM);
|
"fromCharCode" => method(from_char_code; DONT_ENUM | DONT_DELETE);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// `String` constructor
|
/// `String` constructor
|
||||||
|
|
|
@ -52,37 +52,37 @@ macro_rules! tf_setter {
|
||||||
}
|
}
|
||||||
|
|
||||||
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"getNewTextFormat" => method(tf_method!(get_new_text_format); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"getNewTextFormat" => method(tf_method!(get_new_text_format); DONT_ENUM | DONT_DELETE);
|
||||||
"setNewTextFormat" => method(tf_method!(set_new_text_format); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"setNewTextFormat" => method(tf_method!(set_new_text_format); DONT_ENUM | DONT_DELETE);
|
||||||
"getTextFormat" => method(tf_method!(get_text_format); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"getTextFormat" => method(tf_method!(get_text_format); DONT_ENUM | DONT_DELETE);
|
||||||
"setTextFormat" => method(tf_method!(set_text_format); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"setTextFormat" => method(tf_method!(set_text_format); DONT_ENUM | DONT_DELETE);
|
||||||
"replaceSel" => method(tf_method!(replace_sel); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"replaceSel" => method(tf_method!(replace_sel); DONT_ENUM | DONT_DELETE);
|
||||||
"replaceText" => method(tf_method!(replace_text); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"replaceText" => method(tf_method!(replace_text); DONT_ENUM | DONT_DELETE);
|
||||||
"removeTextField" => method(tf_method!(remove_text_field); DONT_ENUM | DONT_DELETE | READ_ONLY);
|
"removeTextField" => method(tf_method!(remove_text_field); DONT_ENUM | DONT_DELETE);
|
||||||
"autoSize" => property(tf_getter!(auto_size), tf_setter!(set_auto_size); DONT_DELETE);
|
"autoSize" => property(tf_getter!(auto_size), tf_setter!(set_auto_size));
|
||||||
"background" => property(tf_getter!(background), tf_setter!(set_background); DONT_DELETE);
|
"background" => property(tf_getter!(background), tf_setter!(set_background));
|
||||||
"backgroundColor" => property(tf_getter!(background_color), tf_setter!(set_background_color); DONT_DELETE);
|
"backgroundColor" => property(tf_getter!(background_color), tf_setter!(set_background_color));
|
||||||
"border" => property(tf_getter!(border), tf_setter!(set_border); DONT_DELETE);
|
"border" => property(tf_getter!(border), tf_setter!(set_border));
|
||||||
"borderColor" => property(tf_getter!(border_color), tf_setter!(set_border_color); DONT_DELETE);
|
"borderColor" => property(tf_getter!(border_color), tf_setter!(set_border_color));
|
||||||
"bottomScroll" => property(tf_getter!(bottom_scroll); DONT_DELETE | READ_ONLY);
|
"bottomScroll" => property(tf_getter!(bottom_scroll));
|
||||||
"embedFonts" => property(tf_getter!(embed_fonts), tf_setter!(set_embed_fonts); DONT_DELETE);
|
"embedFonts" => property(tf_getter!(embed_fonts), tf_setter!(set_embed_fonts));
|
||||||
"hscroll" => property(tf_getter!(hscroll), tf_setter!(set_hscroll); DONT_DELETE);
|
"hscroll" => property(tf_getter!(hscroll), tf_setter!(set_hscroll));
|
||||||
"html" => property(tf_getter!(html), tf_setter!(set_html); DONT_DELETE);
|
"html" => property(tf_getter!(html), tf_setter!(set_html));
|
||||||
"htmlText" => property(tf_getter!(html_text), tf_setter!(set_html_text); DONT_DELETE);
|
"htmlText" => property(tf_getter!(html_text), tf_setter!(set_html_text));
|
||||||
"length" => property(tf_getter!(length); DONT_DELETE | READ_ONLY);
|
"length" => property(tf_getter!(length));
|
||||||
"maxhscroll" => property(tf_getter!(maxhscroll); DONT_DELETE | READ_ONLY);
|
"maxhscroll" => property(tf_getter!(maxhscroll));
|
||||||
"maxscroll" => property(tf_getter!(maxscroll); DONT_DELETE | READ_ONLY);
|
"maxscroll" => property(tf_getter!(maxscroll));
|
||||||
"multiline" => property(tf_getter!(multiline), tf_setter!(set_multiline); DONT_DELETE);
|
"multiline" => property(tf_getter!(multiline), tf_setter!(set_multiline));
|
||||||
"password" => property(tf_getter!(password), tf_setter!(set_password); DONT_DELETE);
|
"password" => property(tf_getter!(password), tf_setter!(set_password));
|
||||||
"scroll" => property(tf_getter!(scroll), tf_setter!(set_scroll); DONT_DELETE);
|
"scroll" => property(tf_getter!(scroll), tf_setter!(set_scroll));
|
||||||
"selectable" => property(tf_getter!(selectable), tf_setter!(set_selectable); DONT_DELETE);
|
"selectable" => property(tf_getter!(selectable), tf_setter!(set_selectable));
|
||||||
"text" => property(tf_getter!(text), tf_setter!(set_text); DONT_DELETE);
|
"text" => property(tf_getter!(text), tf_setter!(set_text));
|
||||||
"textColor" => property(tf_getter!(text_color), tf_setter!(set_text_color); DONT_DELETE);
|
"textColor" => property(tf_getter!(text_color), tf_setter!(set_text_color));
|
||||||
"textHeight" => property(tf_getter!(text_height); DONT_DELETE);
|
"textHeight" => property(tf_getter!(text_height));
|
||||||
"textWidth" => property(tf_getter!(text_width); DONT_DELETE);
|
"textWidth" => property(tf_getter!(text_width));
|
||||||
"type" => property(tf_getter!(get_type), tf_setter!(set_type); DONT_DELETE);
|
"type" => property(tf_getter!(get_type), tf_setter!(set_type));
|
||||||
"variable" => property(tf_getter!(variable), tf_setter!(set_variable); DONT_DELETE);
|
"variable" => property(tf_getter!(variable), tf_setter!(set_variable));
|
||||||
"wordWrap" => property(tf_getter!(word_wrap), tf_setter!(set_word_wrap); DONT_DELETE);
|
"wordWrap" => property(tf_getter!(word_wrap), tf_setter!(set_word_wrap));
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Implements `TextField`
|
/// Implements `TextField`
|
||||||
|
|
|
@ -31,9 +31,9 @@ const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"docTypeDecl" => property(doc_type_decl; READ_ONLY);
|
"docTypeDecl" => property(doc_type_decl; READ_ONLY);
|
||||||
"ignoreWhite" => bool(false);
|
"ignoreWhite" => bool(false);
|
||||||
"contentType" => string("application/x-www-form-urlencoded"; READ_ONLY);
|
"contentType" => string("application/x-www-form-urlencoded"; READ_ONLY);
|
||||||
"xmlDecl" => property(xml_decl; READ_ONLY);
|
"xmlDecl" => property(xml_decl);
|
||||||
"idMap" => property(id_map; READ_ONLY);
|
"idMap" => property(id_map);
|
||||||
"status" => property(status; READ_ONLY);
|
"status" => property(status);
|
||||||
"createElement" => method(create_element);
|
"createElement" => method(create_element);
|
||||||
"createTextNode" => method(create_text_node);
|
"createTextNode" => method(create_text_node);
|
||||||
"parseXML" => method(parse_xml);
|
"parseXML" => method(parse_xml);
|
||||||
|
|
|
@ -12,19 +12,19 @@ use crate::xml::XmlNode;
|
||||||
use gc_arena::MutationContext;
|
use gc_arena::MutationContext;
|
||||||
|
|
||||||
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
const PROTO_DECLS: &[Declaration] = declare_properties! {
|
||||||
"localName" => property(local_name; READ_ONLY);
|
"localName" => property(local_name);
|
||||||
"nodeName" => property(node_name; READ_ONLY);
|
"nodeName" => property(node_name);
|
||||||
"nodeType" => property(node_type; READ_ONLY);
|
"nodeType" => property(node_type);
|
||||||
"nodeValue" => property(node_value; READ_ONLY);
|
"nodeValue" => property(node_value);
|
||||||
"prefix" => property(prefix; READ_ONLY);
|
"prefix" => property(prefix);
|
||||||
"childNodes" => property(child_nodes; READ_ONLY);
|
"childNodes" => property(child_nodes);
|
||||||
"firstChild" => property(first_child; READ_ONLY);
|
"firstChild" => property(first_child);
|
||||||
"lastChild" => property(last_child; READ_ONLY);
|
"lastChild" => property(last_child);
|
||||||
"parentNode" => property(parent_node; READ_ONLY);
|
"parentNode" => property(parent_node);
|
||||||
"previousSibling" => property(previous_sibling; READ_ONLY);
|
"previousSibling" => property(previous_sibling);
|
||||||
"nextSibling" => property(next_sibling; READ_ONLY);
|
"nextSibling" => property(next_sibling);
|
||||||
"attributes" => property(attributes; READ_ONLY);
|
"attributes" => property(attributes);
|
||||||
"namespaceURI" => property(namespace_uri; READ_ONLY);
|
"namespaceURI" => property(namespace_uri);
|
||||||
"appendChild" => method(append_child);
|
"appendChild" => method(append_child);
|
||||||
"insertBefore" => method(insert_before);
|
"insertBefore" => method(insert_before);
|
||||||
"cloneNode" => method(clone_node);
|
"cloneNode" => method(clone_node);
|
||||||
|
|
Loading…
Reference in New Issue