forked from ruffle-rs/ruffle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobals.rs
More file actions
738 lines (687 loc) · 27.3 KB
/
Copy pathglobals.rs
File metadata and controls
738 lines (687 loc) · 27.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
use crate::avm2::activation::Activation;
use crate::avm2::class::Class;
use crate::avm2::domain::Domain;
use crate::avm2::method::{Method, NativeMethodImpl};
use crate::avm2::object::{ClassObject, FunctionObject, Object, ScriptObject, TObject};
use crate::avm2::scope::{Scope, ScopeChain};
use crate::avm2::script::Script;
use crate::avm2::Avm2;
use crate::avm2::Error;
use crate::avm2::Multiname;
use crate::avm2::Namespace;
use crate::avm2::QName;
use crate::string::AvmString;
use crate::tag_utils::{self, ControlFlow, SwfMovie, SwfSlice, SwfStream};
use gc_arena::{Collect, GcCell, MutationContext};
use std::sync::Arc;
use swf::TagCode;
mod array;
mod avmplus;
mod boolean;
mod class;
mod date;
mod error;
pub mod flash;
mod function;
mod global_scope;
mod int;
mod json;
mod math;
mod namespace;
mod number;
mod object;
mod q_name;
mod reg_exp;
mod string;
mod toplevel;
mod r#uint;
mod vector;
mod xml;
mod xml_list;
/// This structure represents all system builtin classes.
#[derive(Clone, Collect)]
#[collect(no_drop)]
pub struct SystemClasses<'gc> {
pub object: ClassObject<'gc>,
pub function: ClassObject<'gc>,
pub class: ClassObject<'gc>,
pub global: ClassObject<'gc>,
pub string: ClassObject<'gc>,
pub boolean: ClassObject<'gc>,
pub number: ClassObject<'gc>,
pub int: ClassObject<'gc>,
pub uint: ClassObject<'gc>,
pub namespace: ClassObject<'gc>,
pub array: ClassObject<'gc>,
pub movieclip: ClassObject<'gc>,
pub framelabel: ClassObject<'gc>,
pub scene: ClassObject<'gc>,
pub application_domain: ClassObject<'gc>,
pub event: ClassObject<'gc>,
pub fullscreenevent: ClassObject<'gc>,
pub video: ClassObject<'gc>,
pub xml: ClassObject<'gc>,
pub xml_list: ClassObject<'gc>,
pub display_object: ClassObject<'gc>,
pub shape: ClassObject<'gc>,
pub textfield: ClassObject<'gc>,
pub textformat: ClassObject<'gc>,
pub graphics: ClassObject<'gc>,
pub igraphicsdata: ClassObject<'gc>,
pub graphicsbitmapfill: ClassObject<'gc>,
pub graphicsendfill: ClassObject<'gc>,
pub graphicsgradientfill: ClassObject<'gc>,
pub graphicspath: ClassObject<'gc>,
pub graphicstrianglepath: ClassObject<'gc>,
pub graphicssolidfill: ClassObject<'gc>,
pub graphicsstroke: ClassObject<'gc>,
pub loader: ClassObject<'gc>,
pub loaderinfo: ClassObject<'gc>,
pub bytearray: ClassObject<'gc>,
pub stage: ClassObject<'gc>,
pub sprite: ClassObject<'gc>,
pub simplebutton: ClassObject<'gc>,
pub regexp: ClassObject<'gc>,
pub vector: ClassObject<'gc>,
pub soundtransform: ClassObject<'gc>,
pub soundchannel: ClassObject<'gc>,
pub bitmap: ClassObject<'gc>,
pub bitmapdata: ClassObject<'gc>,
pub date: ClassObject<'gc>,
pub qname: ClassObject<'gc>,
pub mouseevent: ClassObject<'gc>,
pub progressevent: ClassObject<'gc>,
pub textevent: ClassObject<'gc>,
pub errorevent: ClassObject<'gc>,
pub ioerrorevent: ClassObject<'gc>,
pub securityerrorevent: ClassObject<'gc>,
pub transform: ClassObject<'gc>,
pub colortransform: ClassObject<'gc>,
pub matrix: ClassObject<'gc>,
pub illegaloperationerror: ClassObject<'gc>,
pub eventdispatcher: ClassObject<'gc>,
pub rectangle: ClassObject<'gc>,
pub keyboardevent: ClassObject<'gc>,
pub point: ClassObject<'gc>,
pub rangeerror: ClassObject<'gc>,
pub referenceerror: ClassObject<'gc>,
pub argumenterror: ClassObject<'gc>,
pub syntaxerror: ClassObject<'gc>,
pub typeerror: ClassObject<'gc>,
pub verifyerror: ClassObject<'gc>,
pub ioerror: ClassObject<'gc>,
pub eoferror: ClassObject<'gc>,
pub urierror: ClassObject<'gc>,
pub error: ClassObject<'gc>,
pub uncaughterrorevents: ClassObject<'gc>,
pub statictext: ClassObject<'gc>,
pub textlinemetrics: ClassObject<'gc>,
pub stage3d: ClassObject<'gc>,
pub context3d: ClassObject<'gc>,
pub indexbuffer3d: ClassObject<'gc>,
pub vertexbuffer3d: ClassObject<'gc>,
pub program3d: ClassObject<'gc>,
pub urlvariables: ClassObject<'gc>,
pub bevelfilter: ClassObject<'gc>,
pub bitmapfilter: ClassObject<'gc>,
pub blurfilter: ClassObject<'gc>,
pub colormatrixfilter: ClassObject<'gc>,
pub convolutionfilter: ClassObject<'gc>,
pub displacementmapfilter: ClassObject<'gc>,
pub dropshadowfilter: ClassObject<'gc>,
pub glowfilter: ClassObject<'gc>,
pub gradientbevelfilter: ClassObject<'gc>,
pub gradientglowfilter: ClassObject<'gc>,
pub texture: ClassObject<'gc>,
pub cubetexture: ClassObject<'gc>,
pub rectangletexture: ClassObject<'gc>,
pub morphshape: ClassObject<'gc>,
}
impl<'gc> SystemClasses<'gc> {
/// Construct a minimal set of system classes necessary for bootstrapping
/// player globals.
///
/// All other system classes aside from the three given here will be set to
/// the empty object also handed to this function. It is the caller's
/// responsibility to instantiate each class and replace the empty object
/// with that.
fn new(
object: ClassObject<'gc>,
function: ClassObject<'gc>,
class: ClassObject<'gc>,
global: ClassObject<'gc>,
) -> Self {
SystemClasses {
object,
function,
class,
global,
// temporary initialization
string: object,
boolean: object,
number: object,
int: object,
uint: object,
namespace: object,
array: object,
movieclip: object,
framelabel: object,
scene: object,
application_domain: object,
event: object,
fullscreenevent: object,
video: object,
xml: object,
xml_list: object,
display_object: object,
shape: object,
textfield: object,
textformat: object,
graphics: object,
igraphicsdata: object,
graphicsbitmapfill: object,
graphicsendfill: object,
graphicsgradientfill: object,
graphicspath: object,
graphicstrianglepath: object,
graphicssolidfill: object,
graphicsstroke: object,
loader: object,
loaderinfo: object,
bytearray: object,
stage: object,
sprite: object,
simplebutton: object,
regexp: object,
vector: object,
soundtransform: object,
soundchannel: object,
bitmap: object,
bitmapdata: object,
date: object,
qname: object,
mouseevent: object,
progressevent: object,
textevent: object,
errorevent: object,
ioerrorevent: object,
securityerrorevent: object,
transform: object,
colortransform: object,
matrix: object,
illegaloperationerror: object,
eventdispatcher: object,
rectangle: object,
keyboardevent: object,
point: object,
rangeerror: object,
referenceerror: object,
argumenterror: object,
syntaxerror: object,
typeerror: object,
verifyerror: object,
ioerror: object,
eoferror: object,
urierror: object,
error: object,
uncaughterrorevents: object,
statictext: object,
textlinemetrics: object,
stage3d: object,
context3d: object,
indexbuffer3d: object,
vertexbuffer3d: object,
program3d: object,
urlvariables: object,
bevelfilter: object,
bitmapfilter: object,
blurfilter: object,
colormatrixfilter: object,
convolutionfilter: object,
displacementmapfilter: object,
dropshadowfilter: object,
glowfilter: object,
gradientbevelfilter: object,
gradientglowfilter: object,
texture: object,
cubetexture: object,
rectangletexture: object,
morphshape: object,
}
}
}
/// Add a free-function builtin to the global scope.
fn function<'gc>(
activation: &mut Activation<'_, 'gc>,
package: impl Into<AvmString<'gc>>,
name: &'static str,
nf: NativeMethodImpl,
script: Script<'gc>,
) -> Result<(), Error<'gc>> {
let (_, mut global, mut domain) = script.init();
let mc = activation.context.gc_context;
let scope = activation.create_scopechain();
let qname = QName::new(
Namespace::package(package, &mut activation.borrow_gc()),
name,
);
let method = Method::from_builtin(nf, name, mc);
let as3fn = FunctionObject::from_method(activation, method, scope, None, None).into();
domain.export_definition(qname, script, mc);
global.install_const_late(mc, qname, as3fn, activation.avm2().classes().function);
Ok(())
}
/// Add a fully-formed class object builtin to the global scope.
///
/// This allows the caller to pre-populate the class's prototype with dynamic
/// properties, if necessary.
fn dynamic_class<'gc>(
mc: MutationContext<'gc, '_>,
class_object: ClassObject<'gc>,
script: Script<'gc>,
// The `ClassObject` of the `Class` class
class_class: ClassObject<'gc>,
) {
let (_, mut global, mut domain) = script.init();
let class = class_object.inner_class_definition();
let name = class.read().name();
global.install_const_late(mc, name, class_object.into(), class_class);
domain.export_definition(name, script, mc)
}
/// Add a class builtin to the global scope.
///
/// This function returns the class object and class prototype as a class, which
/// may be stored in `SystemClasses`
fn class<'gc>(
class_def: GcCell<'gc, Class<'gc>>,
script: Script<'gc>,
activation: &mut Activation<'_, 'gc>,
) -> Result<ClassObject<'gc>, Error<'gc>> {
let (_, mut global, mut domain) = script.init();
let class_read = class_def.read();
let super_class = if let Some(sc_name) = class_read.super_class_name() {
let super_class: Result<Object<'gc>, Error<'gc>> = activation
.resolve_definition(sc_name)
.ok()
.and_then(|v| v)
.and_then(|v| v.as_object())
.ok_or_else(|| {
format!(
"Could not resolve superclass {} when defining global class {}",
sc_name.to_qualified_name(activation.context.gc_context),
class_read
.name()
.to_qualified_name(activation.context.gc_context)
)
.into()
});
let super_class = super_class?
.as_class_object()
.ok_or_else(|| Error::from("Base class of a global class is not a class"))?;
Some(super_class)
} else {
None
};
let class_name = class_read.name();
drop(class_read);
let class_object = ClassObject::from_class(activation, class_def, super_class)?;
global.install_const_late(
activation.context.gc_context,
class_name,
class_object.into(),
activation.avm2().classes().class,
);
domain.export_definition(class_name, script, activation.context.gc_context);
domain.export_class(class_def, activation.context.gc_context);
Ok(class_object)
}
macro_rules! avm2_system_class {
($field:ident, $activation:ident, $class:expr, $script:expr) => {
let class_object = class($class, $script, $activation)?;
let sc = $activation.avm2().system_classes.as_mut().unwrap();
sc.$field = class_object;
};
}
/// Initialize the player global domain.
///
/// This should be called only once, to construct the global scope of the
/// player. It will return a list of prototypes it has created, which should be
/// stored on the AVM. All relevant declarations will also be attached to the
/// given domain.
pub fn load_player_globals<'gc>(
activation: &mut Activation<'_, 'gc>,
domain: Domain<'gc>,
) -> Result<(), Error<'gc>> {
let mc = activation.context.gc_context;
let globals = ScriptObject::custom_object(activation.context.gc_context, None, None);
let gs = ScopeChain::new(domain).chain(mc, &[Scope::new(globals)]);
let script = Script::empty_script(mc, globals, domain);
// Set the outer scope of this activation to the global scope.
activation.set_outer(gs);
// public / root package
//
// This part of global initialization is very complicated, because
// everything has to circularly reference everything else:
//
// - Object is an instance of itself, as well as it's prototype
// - All other types are instances of Class, which is an instance of
// itself
// - Function's prototype is an instance of itself
// - All methods created by the above-mentioned classes are also instances
// of Function
// - All classes are put on Global's trait list, but Global needs
// to be initialized first, but you can't do that until Object/Class are ready.
//
// Hence, this ridiculously complicated dance of classdef, type allocation,
// and partial initialization.
let object_classdef = object::create_class(activation);
let object_class = ClassObject::from_class_partial(activation, object_classdef, None)?;
let object_proto = ScriptObject::custom_object(mc, Some(object_class), None);
domain.export_class(object_classdef, mc);
let fn_classdef = function::create_class(activation);
let fn_class = ClassObject::from_class_partial(activation, fn_classdef, Some(object_class))?;
let fn_proto = ScriptObject::custom_object(mc, Some(fn_class), Some(object_proto));
domain.export_class(fn_classdef, mc);
let class_classdef = class::create_class(activation);
let class_class =
ClassObject::from_class_partial(activation, class_classdef, Some(object_class))?;
let class_proto = ScriptObject::custom_object(mc, Some(object_class), Some(object_proto));
domain.export_class(class_classdef, mc);
let global_classdef = global_scope::create_class(activation);
let global_class =
ClassObject::from_class_partial(activation, global_classdef, Some(object_class))?;
let global_proto = ScriptObject::custom_object(mc, Some(object_class), Some(object_proto));
domain.export_class(global_classdef, mc);
// Now to weave the Gordian knot...
object_class.link_prototype(activation, object_proto)?;
object_class.link_type(activation, class_proto, class_class);
fn_class.link_prototype(activation, fn_proto)?;
fn_class.link_type(activation, class_proto, class_class);
class_class.link_prototype(activation, class_proto)?;
class_class.link_type(activation, class_proto, class_class);
global_class.link_prototype(activation, global_proto)?;
global_class.link_type(activation, class_proto, class_class);
// At this point, we need at least a partial set of system classes in
// order to continue initializing the player. The rest of the classes
// are set to a temporary class until we have a chance to initialize them.
activation.context.avm2.system_classes = Some(SystemClasses::new(
object_class,
fn_class,
class_class,
global_class,
));
// Our activation environment is now functional enough to finish
// initializing the core class weave. We need to initialize superclasses
// (e.g. `Object`) before subclasses, so that `into_finished_class` can
// copy traits from the initialized superclass vtable.
// First, initialize the instance vtable, starting with `Object`. This
// ensures that properties defined in `Object` (e.g. `hasOwnProperty`)
// get copied into the vtable of `Class`, `Function`, and `Global`.
// (which are all subclasses of `Object`)
object_class.init_instance_vtable(activation)?;
class_class.init_instance_vtable(activation)?;
fn_class.init_instance_vtable(activation)?;
global_class.init_instance_vtable(activation)?;
// Now, construct the `ClassObject`s, starting with `Class`. This ensures
// that the `prototype` property of `Class` gets copied into the *class*
// vtables for `Object`, `Function`, and `Global`.
let class_class = class_class.into_finished_class(activation)?;
let object_class = object_class.into_finished_class(activation)?;
let fn_class = fn_class.into_finished_class(activation)?;
let _global_class = global_class.into_finished_class(activation)?;
globals.set_proto(mc, global_proto);
globals.set_instance_of(mc, global_class);
globals.fork_vtable(activation.context.gc_context);
// From this point, `globals` is safe to be modified
dynamic_class(mc, object_class, script, class_class);
dynamic_class(mc, fn_class, script, class_class);
dynamic_class(mc, class_class, script, class_class);
// After this point, it is safe to initialize any other classes.
// Make sure to initialize superclasses *before* their subclasses!
avm2_system_class!(string, activation, string::create_class(activation), script);
avm2_system_class!(
boolean,
activation,
boolean::create_class(activation),
script
);
avm2_system_class!(number, activation, number::create_class(activation), script);
avm2_system_class!(int, activation, int::create_class(activation), script);
avm2_system_class!(uint, activation, uint::create_class(activation), script);
avm2_system_class!(
namespace,
activation,
namespace::create_class(activation),
script
);
avm2_system_class!(array, activation, array::create_class(activation), script);
function(activation, "", "trace", toplevel::trace, script)?;
function(
activation,
"__ruffle__",
"log_warn",
toplevel::log_warn,
script,
)?;
function(
activation,
"__ruffle__",
"stub_method",
toplevel::stub_method,
script,
)?;
function(
activation,
"__ruffle__",
"stub_getter",
toplevel::stub_getter,
script,
)?;
function(
activation,
"__ruffle__",
"stub_setter",
toplevel::stub_setter,
script,
)?;
function(
activation,
"__ruffle__",
"stub_constructor",
toplevel::stub_constructor,
script,
)?;
function(activation, "", "isFinite", toplevel::is_finite, script)?;
function(activation, "", "isNaN", toplevel::is_nan, script)?;
function(activation, "", "parseInt", toplevel::parse_int, script)?;
function(activation, "", "parseFloat", toplevel::parse_float, script)?;
function(activation, "", "escape", toplevel::escape, script)?;
function(activation, "", "encodeURI", toplevel::encode_uri, script)?;
function(
activation,
"",
"encodeURIComponent",
toplevel::encode_uri_component,
script,
)?;
function(activation, "", "decodeURI", toplevel::decode_uri, script)?;
function(
activation,
"",
"decodeURIComponent",
toplevel::decode_uri_component,
script,
)?;
function(activation, "", "unescape", toplevel::unescape, script)?;
avm2_system_class!(vector, activation, vector::create_class(activation), script);
avm2_system_class!(date, activation, date::create_class(activation), script);
// Inside this call, the macro `avm2_system_classes_playerglobal`
// triggers classloading. Therefore, we run `load_playerglobal`
// relative late, so that it can access classes defined before
// this call.
load_playerglobal(activation, domain)?;
Ok(())
}
/// This file is built by 'core/build_playerglobal/'
/// See that tool, and 'core/src/avm2/globals/README.md', for more details
const PLAYERGLOBAL: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/playerglobal.swf"));
mod native {
include!(concat!(env!("OUT_DIR"), "/native_table.rs"));
}
/// Loads classes from our custom 'playerglobal' (which are written in ActionScript)
/// into the environment. See 'core/src/avm2/globals/README.md' for more information
fn load_playerglobal<'gc>(
activation: &mut Activation<'_, 'gc>,
domain: Domain<'gc>,
) -> Result<(), Error<'gc>> {
activation.avm2().native_method_table = native::NATIVE_METHOD_TABLE;
activation.avm2().native_instance_allocator_table = native::NATIVE_INSTANCE_ALLOCATOR_TABLE;
activation.avm2().native_instance_init_table = native::NATIVE_INSTANCE_INIT_TABLE;
activation.avm2().native_call_handler_table = native::NATIVE_CALL_HANDLER_TABLE;
let movie = SwfMovie::from_data(PLAYERGLOBAL, "file:///".into(), None)
.expect("playerglobal.swf should be valid");
let slice = SwfSlice::from(Arc::new(movie));
let mut reader = slice.read_from(0);
let tag_callback = |reader: &mut SwfStream<'_>, tag_code, _tag_len| {
if tag_code == TagCode::DoAbc2 {
let do_abc = reader
.read_do_abc_2()
.expect("playerglobal.swf should be valid");
Avm2::do_abc(
&mut activation.context,
do_abc.data,
None,
do_abc.flags,
domain,
)
.expect("playerglobal.swf should be valid");
} else if tag_code != TagCode::End {
panic!("playerglobal should only contain `DoAbc2` tag - found tag {tag_code:?}")
}
Ok(ControlFlow::Continue)
};
let _ = tag_utils::decode_tags(&mut reader, tag_callback);
macro_rules! avm2_system_classes_playerglobal {
($activation:expr, $script:expr, [$(($package:expr, $class_name:expr, $field:ident)),* $(,)?]) => {
let activation = $activation;
$(
let ns = Namespace::package($package, &mut activation.borrow_gc());
let name = Multiname::new(ns, $class_name);
let class_object = activation.resolve_class(&name)?;
let sc = activation.avm2().system_classes.as_mut().unwrap();
sc.$field = class_object;
)*
}
}
// This acts the same way as 'avm2_system_class', but for classes
// declared in 'playerglobal'. Classes are declared as ("package", "class", field_name),
// and are stored in 'avm2().system_classes'
avm2_system_classes_playerglobal!(
&mut *activation,
script,
[
("", "Error", error),
("", "ArgumentError", argumenterror),
("", "QName", qname),
("", "RangeError", rangeerror),
("", "RegExp", regexp),
("", "ReferenceError", referenceerror),
("", "SyntaxError", syntaxerror),
("", "TypeError", typeerror),
("", "URIError", urierror),
("", "VerifyError", verifyerror),
("", "XML", xml),
("", "XMLList", xml_list),
("flash.display", "Bitmap", bitmap),
("flash.display", "BitmapData", bitmapdata),
("flash.display", "Scene", scene),
("flash.display", "FrameLabel", framelabel),
("flash.display", "IGraphicsData", igraphicsdata),
("flash.display", "GraphicsBitmapFill", graphicsbitmapfill),
("flash.display", "GraphicsEndFill", graphicsendfill),
(
"flash.display",
"GraphicsGradientFill",
graphicsgradientfill
),
("flash.display", "GraphicsPath", graphicspath),
(
"flash.display",
"GraphicsTrianglePath",
graphicstrianglepath
),
("flash.display", "GraphicsSolidFill", graphicssolidfill),
("flash.display", "GraphicsStroke", graphicsstroke),
("flash.display", "Graphics", graphics),
("flash.display", "Loader", loader),
("flash.display", "LoaderInfo", loaderinfo),
("flash.display", "MorphShape", morphshape),
("flash.display", "MovieClip", movieclip),
("flash.display", "Shape", shape),
("flash.display", "SimpleButton", simplebutton),
("flash.display", "Sprite", sprite),
("flash.display", "Stage", stage),
("flash.display", "Stage3D", stage3d),
("flash.display3D", "Context3D", context3d),
("flash.display3D", "IndexBuffer3D", indexbuffer3d),
("flash.display3D", "Program3D", program3d),
("flash.display3D.textures", "CubeTexture", cubetexture),
("flash.display3D.textures", "Texture", texture),
(
"flash.display3D.textures",
"RectangleTexture",
rectangletexture
),
("flash.display3D", "VertexBuffer3D", vertexbuffer3d),
(
"flash.errors",
"IllegalOperationError",
illegaloperationerror
),
("flash.errors", "IOError", ioerror),
("flash.errors", "EOFError", eoferror),
("flash.events", "Event", event),
("flash.events", "EventDispatcher", eventdispatcher),
("flash.events", "TextEvent", textevent),
("flash.events", "ErrorEvent", errorevent),
("flash.events", "KeyboardEvent", keyboardevent),
("flash.events", "ProgressEvent", progressevent),
("flash.events", "SecurityErrorEvent", securityerrorevent),
("flash.events", "IOErrorEvent", ioerrorevent),
("flash.events", "MouseEvent", mouseevent),
("flash.events", "FullScreenEvent", fullscreenevent),
("flash.events", "UncaughtErrorEvents", uncaughterrorevents),
("flash.geom", "Matrix", matrix),
("flash.geom", "Point", point),
("flash.geom", "Rectangle", rectangle),
("flash.geom", "Transform", transform),
("flash.geom", "ColorTransform", colortransform),
("flash.media", "SoundChannel", soundchannel),
("flash.media", "SoundTransform", soundtransform),
("flash.net", "URLVariables", urlvariables),
("flash.utils", "ByteArray", bytearray),
("flash.system", "ApplicationDomain", application_domain),
("flash.text", "StaticText", statictext),
("flash.text", "TextFormat", textformat),
("flash.text", "TextField", textfield),
("flash.text", "TextLineMetrics", textlinemetrics),
("flash.filters", "BevelFilter", bevelfilter),
("flash.filters", "BitmapFilter", bitmapfilter),
("flash.filters", "BlurFilter", blurfilter),
("flash.filters", "ColorMatrixFilter", colormatrixfilter),
("flash.filters", "ConvolutionFilter", convolutionfilter),
(
"flash.filters",
"DisplacementMapFilter",
displacementmapfilter
),
("flash.filters", "DropShadowFilter", dropshadowfilter),
("flash.filters", "GlowFilter", glowfilter),
("flash.filters", "GradientBevelFilter", gradientbevelfilter),
("flash.filters", "GradientGlowFilter", gradientglowfilter),
]
);
// Domain memory must be initialized after playerglobals is loaded because it relies on ByteArray.
domain.init_default_domain_memory(activation)?;
Ok(())
}