3 Routines for compiling Flash2 AVM2 ABC Actionscript
5 Extension module for the rfxswf library.
6 Part of the swftools package.
8 Copyright (c) 2008 Matthias Kramm <kramm@quiss.org>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
27 static namespace_t static_empty_ns = {
30 static namespace_t static_flash_display_ns = {
31 ACCESS_PACKAGE, "flash.display"
33 static multiname_t static_object_class = {
34 QNAME, &static_empty_ns, 0, "Object"
36 static multiname_t static_anytype_class = {
37 QNAME, &static_empty_ns, 0, 0
39 static multiname_t static_string_class = {
40 QNAME, &static_empty_ns, 0, "String"
42 static multiname_t static_boolean_class = {
43 QNAME, &static_empty_ns, 0, "Boolean"
45 static multiname_t static_number_class = {
46 QNAME, &static_empty_ns, 0, "Number"
48 static multiname_t static_int_class = {
49 QNAME, &static_empty_ns, 0, "int"
51 static multiname_t static_uint_class = {
52 QNAME, &static_empty_ns, 0, "uint"
54 static multiname_t static_null_class = {
55 QNAME, &static_empty_ns, 0, "null"
57 static multiname_t static_movieclip_class = {
58 QNAME, &static_flash_display_ns, 0, "MovieClip"
61 multiname_t* registry_getobjectclass() {return &static_object_class;}
62 multiname_t* registry_getanytype() {return &static_anytype_class;}
63 multiname_t* registry_getstringclass() {return &static_string_class;}
64 multiname_t* registry_getintclass() {return &static_int_class;}
65 multiname_t* registry_getuintclass() {return &static_uint_class;}
66 multiname_t* registry_getnullclass() {return &static_null_class;}
67 multiname_t* registry_getbooleanclass() {return &static_boolean_class;}
68 multiname_t* registry_getnumberclass() {return &static_number_class;}
69 multiname_t* registry_getMovieClip() {return &static_movieclip_class;}
72 multiname_t* registry_findclass(const char*package, const char*name)
76 m = multiname_new(0, name);
80 /* things in the "flash" package are usually public */
81 if(!strncmp(package, "flash", 5))
82 ns =namespace_new_package(package);
84 ns = namespace_new_packageinternal(package);
86 m = multiname_new(ns,name);
87 namespace_destroy(ns);
91 multiname_t* registry_getsuperclass(multiname_t*m)
95 if(!strcmp(m->name, "Object"))
98 else if(!strcmp(m->name, "MovieClip"))
99 return multiname_fromstring("[package]flash.display::Sprite");
100 else if(!strcmp(m->name, "Sprite"))
101 return multiname_fromstring("[package]flash.display::DisplayObjectContainer");
102 else if(!strcmp(m->name, "DisplayObjectContainer"))
103 return multiname_fromstring("[package]flash.display::InteractiveObject");
104 else if(!strcmp(m->name, "InteractiveObject"))
105 return multiname_fromstring("[package]flash.display::DisplayObject");
106 else if(!strcmp(m->name, "DisplayObject"))
107 return multiname_fromstring("[package]flash.events::EventDispatcher");
109 return &static_object_class;