use ObjectURI more consistently
[gnash.git] / libcore / asobj / flash / flash_pkg.cpp
blob7f88c908f0cc9f5196e8d4ac1bbb03b2e6fc4a73
1 // flash_pkg.cpp: ActionScript top level "flash" package.
2 //
3 // Copyright (C) 2009, 2010 Free Software Foundation, Inc.
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include "VM.h"
21 #include "VM.h"
22 #include "fn_call.h"
23 #include "namedStrings.h"
24 #include "flash_pkg.h"
25 #include "display/display_pkg.h"
26 #include "external/external_pkg.h"
27 #include "filters/filters_pkg.h"
28 #include "geom/geom_pkg.h"
29 #include "net/net_pkg.h"
30 #include "text/text_pkg.h"
31 #include "Global_as.h"
33 namespace gnash {
35 class as_value;
36 class as_object;
38 static as_value
39 get_flash_package(const fn_call& fn)
41 Global_as& gl = getGlobal(fn);
43 as_object* pkg = createObject(gl);
45 VM& vm = getVM(fn);
47 flash_text_package_init(*pkg, getURI(vm, "text"));
48 flash_display_package_init(*pkg, getURI(vm, "display"));
49 flash_filters_package_init(*pkg, getURI(vm, "filters"));
50 flash_geom_package_init(*pkg, getURI(vm, "geom"));
51 flash_net_package_init(*pkg, getURI(vm, "net"));
52 flash_external_package_init(*pkg, getURI(vm, "external"));
54 return pkg;
57 void
58 flash_package_init(as_object& where, const ObjectURI& uri)
60 const int flags = PropFlags::dontEnum | PropFlags::onlySWF8Up;
61 where.init_destructive_property(uri, get_flash_package, flags);
66 // local Variables:
67 // mode: C++
68 // indent-tabs-mode: nil
69 // End: