2
// Copyright (C) 2005, 2006, 2007, 2008 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
18
// Implementation and helpers for SWF actions.
21
#ifndef GNASH_ACTION_H
22
#define GNASH_ACTION_H
25
#include "gnashconfig.h"
28
#include "tu_config.h"
31
#include "as_object.h"
33
#include "smart_ptr.h"
38
__SGI_LIBC_USING_FROM_STD(va_list)
42
class sprite_instance;
49
extern DSOEXPORT boost::intrusive_ptr<as_object> s_global;
51
class DSOLOCAL as_property_interface
54
virtual ~as_property_interface() {}
55
virtual bool set_property(int index, const as_value& val) = 0;
62
// Dispatching methods from C++.
63
as_value call_method0(const as_value& method, as_environment* env, as_object* this_ptr);
64
as_value call_method1(
65
const as_value& method, as_environment* env, as_object* this_ptr,
66
const as_value& arg0);
67
as_value call_method2(
68
const as_value& method, as_environment* env, as_object* this_ptr,
69
const as_value& arg0, const as_value& arg1);
70
as_value call_method3(
71
const as_value& method, as_environment* env, as_object* this_ptr,
72
const as_value& arg0, const as_value& arg1, const as_value& arg2);
74
/// Call a method, be it an as_function or a c_function.
76
/// This is a thin wrapper around operator() and fn_call,
77
/// probably worth dropping.
79
/// first_arg_bottom_index is the stack index, from the bottom,
80
/// of the first argument. Subsequent arguments are at *lower*
81
/// indices. E.g. if first_arg_bottom_index = 7, then arg1 is
82
/// at env->bottom(7), arg2 is at env->bottom(6), etc.
84
DSOEXPORT as_value call_method(const as_value& method, as_environment* env,
85
as_object* this_ptr, // this is ourself
86
int nargs, int first_arg_bottom_index);
88
const char* call_method_parsed(
91
const char* method_name,
92
const char* method_arg_fmt,
95
// tulrich: don't use this! To register a class constructor,
96
// just assign the classname to the constructor function. E.g.:
98
// my_movie->set_member("MyClass", as_value(MyClassConstructorFunction));
100
//void register_as_object(const char* object_name, as_c_function_ptr handler);
102
// deprecated, use sprite_instance::loadMovie
103
//void attach_extern_movie(const char* c_url, const sprite_instance* target, const sprite_instance* root_movie);
105
} // end namespace gnash
108
#endif // GNASH_ACTION_H
113
// indent-tabs-mode: t