~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to libcore/asobj/flash_pkg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Sindhudweep Narayan Sarkar
  • Date: 2009-10-07 00:06:10 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20091007000610-mj9rwqe774gizn1j
Tags: 0.8.6-0ubuntu1
new upstream release 0.8.6 (LP: #435897)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// flash_pkg.cpp:  ActionScript "flash" package, for Gnash.
2
 
// 
3
 
//   Copyright (C) 2005, 2006, 2007, 2008, 2009 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.
14
 
//
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
18
 
//
19
 
 
20
 
#include "log.h"
21
 
#include "VM.h" // for getPlayerVersion() 
22
 
#include "Object.h" // for getObjectInterface
23
 
#include "as_object.h"
24
 
 
25
 
#include "flash/display_pkg.h"
26
 
#include "flash/external_pkg.h"
27
 
#include "flash/filters_pkg.h"
28
 
#include "flash/geom_pkg.h"
29
 
#include "flash/net_pkg.h"
30
 
#include "flash/text_pkg.h"
31
 
 
32
 
namespace gnash {
33
 
 
34
 
static as_value
35
 
get_flash_package(const fn_call& /*fn*/)
36
 
{
37
 
        log_debug("Loading flash package");
38
 
 
39
 
        as_object* pkg = new as_object(getObjectInterface());
40
 
 
41
 
        // sub-packages:
42
 
        // TODO: use a destructive getter-setter for these 
43
 
        flash_display_package_init(*pkg);
44
 
        flash_external_package_init(*pkg);
45
 
        flash_filters_package_init(*pkg);
46
 
        flash_geom_package_init(*pkg);
47
 
        flash_net_package_init(*pkg);
48
 
        flash_text_package_init(*pkg);
49
 
 
50
 
        return pkg;
51
 
}
52
 
 
53
 
void
54
 
flash_package_init(as_object& global)
55
 
{
56
 
        string_table& st = global.getVM().getStringTable();
57
 
        global.init_destructive_property(st.find("flash"), get_flash_package,
58
 
                as_prop_flags::dontEnum|as_prop_flags::onlySWF8Up);
59
 
}
60
 
 
61
 
} // end of gnash namespace