action.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
00003 // 
00004 // This program is free software; you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation; either version 3 of the License, or
00007 // (at your option) any later version.
00008 // 
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 // 
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00017 
00018 // Implementation and helpers for SWF actions.
00019 
00020 
00021 #ifndef GNASH_ACTION_H
00022 #define GNASH_ACTION_H
00023 
00024 #ifdef HAVE_CONFIG_H
00025 #include "gnashconfig.h"
00026 #endif
00027 
00028 #include "tu_config.h"
00029 
00030 #include "gnash.h"
00031 #include "as_object.h"
00032 #include "types.h"
00033 #include "smart_ptr.h"
00034 
00035 #include <cwchar>
00036 
00037 #ifdef __sgi
00038         __SGI_LIBC_USING_FROM_STD(va_list) 
00039 #endif
00040 
00041 namespace gnash {
00042         class sprite_instance;
00043         class as_environment;
00044         class as_object;
00045         class as_value;
00046         class swf_function;
00047 
00048 
00049         extern DSOEXPORT boost::intrusive_ptr<as_object> s_global;
00050 
00051         class DSOLOCAL as_property_interface
00052         {
00053         public:
00054                 virtual ~as_property_interface() {}
00055                 virtual bool    set_property(int index, const as_value& val) = 0;
00056         };
00057 
00058         //
00059         // Some handy helpers
00060         //
00061 
00062         // Dispatching methods from C++.
00063         as_value        call_method0(const as_value& method, as_environment* env, as_object* this_ptr);
00064         as_value        call_method1(
00065                 const as_value& method, as_environment* env, as_object* this_ptr,
00066                 const as_value& arg0);
00067         as_value        call_method2(
00068                 const as_value& method, as_environment* env, as_object* this_ptr,
00069                 const as_value& arg0, const as_value& arg1);
00070         as_value        call_method3(
00071                 const as_value& method, as_environment* env, as_object* this_ptr,
00072                 const as_value& arg0, const as_value& arg1, const as_value& arg2);
00073 
00075         //
00084         DSOEXPORT as_value call_method(const as_value& method, as_environment* env,
00085                 as_object* this_ptr, // this is ourself
00086                 int nargs, int first_arg_bottom_index);
00087 
00088         const char*     call_method_parsed(
00089                 as_environment* env,
00090                 as_object* this_ptr,
00091                 const char* method_name,
00092                 const char* method_arg_fmt,
00093                 va_list args);
00094 
00095         // tulrich: don't use this!  To register a class constructor,
00096         // just assign the classname to the constructor function.  E.g.:
00097         //
00098         // my_movie->set_member("MyClass", as_value(MyClassConstructorFunction));
00099         // 
00100         //void register_as_object(const char* object_name, as_c_function_ptr handler);
00101 
00102         // deprecated, use sprite_instance::loadMovie
00103         //void attach_extern_movie(const char* c_url, const sprite_instance* target, const sprite_instance* root_movie);
00104 
00105 }       // end namespace gnash
00106 
00107 
00108 #endif // GNASH_ACTION_H
00109 
00110 
00111 // Local Variables:
00112 // mode: C++
00113 // indent-tabs-mode: t
00114 // End:

Generated on Thu Mar 6 18:25:06 2008 for Gnash by  doxygen 1.5.4