2 // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef GNASH_CLASS_HIERARCHY_H
20 #define GNASH_CLASS_HIERARCHY_H
23 #include "gnashconfig.h"
30 #include "ObjectURI.h"
39 /// Register all of the ActionScript classes, with their dependencies.
45 /// The filename for the library relative to the plugins directory.
46 std::string file_name
;
48 /// Initialization function name
50 /// The name of the function which will yield the prototype
51 /// object. It should be a function with signature:
52 /// void init_name(as_object &obj);
53 /// which sets its prototype as the member 'name' in the
54 /// object. See extensions/mysql/mysql_db.cpp function
56 std::string init_name
;
60 /// The version at which this should be added.
67 /// The type of function to use for initialization
68 typedef void (*InitFunc
)(as_object
& obj
, const ObjectURI
& uri
);
70 NativeClass(InitFunc init
, const ObjectURI
& u
, int ver
)
77 /// The initialization function
79 /// See ExtensionClass.init_name for the necessary function.
82 /// The name of the class.
85 /// The version at which this should be visible.
90 /// Construct the declaration object. Later set the global and
91 /// extension objects using setGlobal and setExtension
92 ClassHierarchy(as_object
* global
, Extension
* e
)
99 /// Delete our private namespaces.
102 typedef std::vector
<NativeClass
> NativeClasses
;
104 /// Declare an ActionScript class, with information on how to load it.
107 /// The ExtensionClass structure which defines the class.
109 /// @return true, unless the class with c.name already existed.
110 bool declareClass(ExtensionClass
& c
);
112 /// Declare an ActionScript class and how to instantiate it from the core.
115 /// The NativeClass structure which defines the class.
117 /// @return true, unless the class with c.name already existed.
118 bool declareClass(const NativeClass
& c
);
120 /// Declare a list of native classes.
121 void declareAll(const NativeClasses
& classes
);
123 /// Mark objects for garbage collector.
124 void markReachableResources() const {}
128 Extension
* mExtension
;