X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fas3%2Fregistry.h;h=1784563c4512e5ebc05416527b3845f63991b313;hb=015fead14e2466763ecfff196756c53f293b266a;hp=bc547e77645b9c41b45e2a506960572f79aa25b0;hpb=021a96c1b603981f1ec214efaa59a049ed7e709a;p=swftools.git diff --git a/lib/as3/registry.h b/lib/as3/registry.h index bc547e7..1784563 100644 --- a/lib/as3/registry.h +++ b/lib/as3/registry.h @@ -31,11 +31,15 @@ DECLARE_LIST(classinfo); DECLARE(memberinfo); struct _classinfo { - /* this is very similar to a QNAME */ U8 access; U8 flags; const char*package; const char*name; + union { + int slot; // slot nr in initscript traits + classinfo_t*cls; // specific class of a Class type + memberinfo_t*function; //specific function of a Function type + }; classinfo_t*superclass; dict_t members; @@ -44,12 +48,17 @@ struct _classinfo { char classinfo_equals(classinfo_t*c1, classinfo_t*c2); #define MEMBER_SLOT 1 -#define MEMBER_METHOD 2 +#define MEMBER_GET 2 +#define MEMBER_SET 4 +#define MEMBER_GETSET 6 +#define MEMBER_METHOD 8 + struct _memberinfo { U8 kind; + U8 flags; const char*name; union { - classinfo_t*returnvalue; + classinfo_t*return_type; classinfo_t*type; }; classinfo_list_t*params; @@ -61,7 +70,7 @@ extern type_t function_signature_type; void registry_init(); -classinfo_t* classinfo_register(int access, char*package, char*name); +classinfo_t* classinfo_register(int access, char*package, char*name, int num_interfaces); memberinfo_t* memberinfo_register(classinfo_t*cls, const char*name, U8 type); // static multinames @@ -73,7 +82,10 @@ classinfo_t* registry_getintclass(); classinfo_t* registry_getuintclass(); classinfo_t* registry_getnullclass(); classinfo_t* registry_getbooleanclass(); +classinfo_t* registry_getfunctionclass(); classinfo_t* registry_getMovieClip(); +classinfo_t* registry_getfunctionclass(memberinfo_t*f); +classinfo_t* registry_getclassclass(classinfo_t*a); classinfo_t* registry_findclass(const char*package, const char*name); memberinfo_t* registry_findmember(classinfo_t*cls, const char*name); @@ -81,6 +93,9 @@ memberinfo_t* registry_findmember(classinfo_t*cls, const char*name); void registry_fill_multiname(multiname_t*m, namespace_t*n, classinfo_t*c); multiname_t* classinfo_to_multiname(classinfo_t*cls); +char registry_isfunctionclass(); +char registry_isclassclass(); + /* convenience functions */ #define sig2mname(x) classinfo_to_multiname(x) #define TYPE_ANY registry_getanytype() @@ -97,6 +112,13 @@ multiname_t* classinfo_to_multiname(classinfo_t*cls); #define TYPE_IS_BOOLEAN(t)((t) == registry_getbooleanclass()) #define TYPE_STRING registry_getstringclass() #define TYPE_IS_STRING(t) ((t) == registry_getstringclass()) + +#define TYPE_FUNCTION(f) registry_getfunctionclass(f) +#define TYPE_IS_FUNCTION(t) registry_isfunctionclass(t) + +#define TYPE_CLASS(f) registry_getclassclass(f) +#define TYPE_IS_CLASS(t) registry_isclassclass(t) + #define TYPE_NULL registry_getnullclass() #define TYPE_IS_NULL(t) ((t) == registry_getnullclass())