1 // desktop_pkg.cpp:  ActionScript "flash.desktop" package, for Gnash.
2 //
3 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 //   Free Software Foundation, Inc
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19 //
20 
21 #include "as_object.h"
22 #include "VM.h"
23 #include "VM.h"
24 #include "fn_call.h"
25 #include "ExternalInterface_as.h"
26 #include "namedStrings.h"
27 #include "external_pkg.h"
28 #include "Global_as.h"
29 
30 namespace gnash {
31 
32 namespace {
33 
34 as_value
get_flash_external_package(const fn_call & fn)35 get_flash_external_package(const fn_call& fn)
36 {
37 
38     log_debug("Loading flash.external package");
39 
40     Global_as& gl = getGlobal(fn);
41 
42     as_object* pkg = createObject(gl);
43 
44     VM& vm = getVM(fn);
45 
46     externalinterface_class_init(*pkg, getURI(vm, "ExternalInterface"));
47 
48     return pkg;
49 }
50 
51 }
52 
53 void
flash_external_package_init(as_object & where,const ObjectURI & uri)54 flash_external_package_init(as_object& where, const ObjectURI& uri)
55 {
56     // TODO: this may not be correct, but it should be enumerable.
57     const int flags = 0;
58     where.init_destructive_property(uri, get_flash_external_package, flags);
59 }
60 
61 
62 } // end of gnash namespace
63