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 */
24 #ifndef __abc_registry_h__
25 #define __abc_registry_h__
32 DECLARE_LIST(classinfo);
40 ptroff_t slot; // slot nr in initscript traits
41 classinfo_t*cls; // specific class of a Class type
42 memberinfo_t*function; //specific function of a Function type
45 classinfo_t*superclass;
47 classinfo_t*interfaces[];
49 char classinfo_equals(classinfo_t*c1, classinfo_t*c2);
54 #define MEMBER_GETSET 6
55 #define MEMBER_METHOD 8
62 classinfo_t*return_type;
66 classinfo_list_t*params;
70 extern type_t classinfo_type;
71 extern type_t memberinfo_type;
75 classinfo_t* classinfo_register(int access, char*package, char*name, int num_interfaces);
76 memberinfo_t* memberinfo_register(classinfo_t*cls, const char*name, U8 type);
79 classinfo_t* registry_getanytype();
80 classinfo_t* registry_getarrayclass();
81 classinfo_t* registry_getobjectclass();
82 classinfo_t* registry_getnumberclass();
83 classinfo_t* registry_getstringclass();
84 classinfo_t* registry_getintclass();
85 classinfo_t* registry_getuintclass();
86 classinfo_t* registry_getnullclass();
87 classinfo_t* registry_getbooleanclass();
88 classinfo_t* registry_getMovieClip();
89 classinfo_t* memberinfo_asclass(memberinfo_t*f);
90 classinfo_t* registry_getclassclass(classinfo_t*a);
92 classinfo_t* registry_findclass(const char*package, const char*name);
93 memberinfo_t* registry_findmember(classinfo_t*cls, const char*name, char superclasses);
95 void registry_fill_multiname(multiname_t*m, namespace_t*n, classinfo_t*c);
96 multiname_t* classinfo_to_multiname(classinfo_t*cls);
98 char registry_isfunctionclass();
99 char registry_isclassclass();
101 classinfo_t* memberinfo_gettype(memberinfo_t*);
103 /* convenience functions */
104 #define sig2mname(x) classinfo_to_multiname(x)
105 #define TYPE_ANY registry_getanytype()
106 #define TYPE_IS_ANY(t) ((t) == registry_getanytype())
107 #define TYPE_INT registry_getintclass()
108 #define TYPE_IS_INT(t) ((t) == registry_getintclass())
109 #define TYPE_UINT registry_getuintclass()
110 #define TYPE_IS_UINT(t) ((t) == registry_getuintclass())
111 #define TYPE_NUMBER registry_getnumberclass()
112 #define TYPE_IS_NUMBER(t) ((t) == registry_getnumberclass())
113 #define TYPE_FLOAT registry_getnumberclass()
114 #define TYPE_IS_FLOAT(t) ((t) == registry_getnumberclass())
115 #define TYPE_BOOLEAN registry_getbooleanclass()
116 #define TYPE_IS_BOOLEAN(t)((t) == registry_getbooleanclass())
117 #define TYPE_STRING registry_getstringclass()
118 #define TYPE_IS_STRING(t) ((t) == registry_getstringclass())
120 #define TYPE_OBJECT registry_getobjectclass()
122 #define TYPE_FUNCTION(f) memberinfo_asclass(f)
123 #define TYPE_IS_FUNCTION(t) registry_isfunctionclass(t)
125 #define TYPE_CLASS(f) registry_getclassclass(f)
126 #define TYPE_IS_CLASS(t) registry_isclassclass(t)
128 #define TYPE_NULL registry_getnullclass()
129 #define TYPE_IS_NULL(t) ((t) == registry_getnullclass())
131 #define TYPE_IS_BUILTIN_SIMPLE(type) (TYPE_IS_INT(type) || \
132 TYPE_IS_UINT(type) || \
133 TYPE_IS_FLOAT(type) || \
134 TYPE_IS_BOOLEAN(type) || \
135 TYPE_IS_STRING(type))