[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog backend/render_handler_tri.cpp ...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog backend/render_handler_tri.cpp ... |
Date: |
Sat, 11 Nov 2006 22:44:55 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/11/11 22:44:54
Modified files:
. : ChangeLog
backend : render_handler_tri.cpp
libbase : smart_ptr.h
server : action.cpp action.h array.cpp
as_environment.cpp as_function.cpp
button_character_instance.cpp
button_character_instance.h character.h
dlist.cpp dlist.h font.cpp font.h fontlib.cpp
gnash.h impl.cpp mouse_button_state.h
movie_root.cpp movie_root.h sprite_instance.cpp
sprite_instance.h styles.cpp styles.h
swf_function.cpp with_stack_entry.h xml.cpp
server/asobj : ASSound.cpp Key.cpp Key.h MovieClipLoader.cpp
Number.cpp Object.cpp System.cpp string.cpp
server/parser : bitmap_character_def.h button_character_def.cpp
character_def.h movie_def_impl.cpp
movie_def_impl.h movie_definition.h
sprite_definition.h
server/swf : ASHandlers.cpp tag_loaders.cpp
testsuite/libbase: Makefile.am
Added files:
server/asobj : gen-asclass.sh
Removed files:
testsuite/libbase: smart_ptrTest.cpp
Log message:
* libbase/smart_ptr.h: removed smart_ptr definition, added
function helpers and include for boost::intrusive_ptr
* backend/render_handler_tri.cpp, server/action.cpp,
server/action.h,
server/array.cpp, server/as_environment.cpp,
server/as_function.cpp,
server/button_character_instance.cpp,
server/button_character_instance.h, server/character.h,
server/dlist.cpp, server/dlist.h, server/font.cpp,
server/font.h,
server/fontlib.cpp, server/gnash.h, server/impl.cpp,
server/mouse_button_state.h, server/movie_root.cpp,
server/movie_root.h, server/sprite_instance.cpp,
server/sprite_instance.h, server/styles.cpp, server/styles.h,
server/swf_function.cpp, server/with_stack_entry.h,
server/xml.cpp,
server/asobj/ASSound.cpp, server/asobj/Key.cpp,
server/asobj/Key.h,
server/asobj/MovieClipLoader.cpp, server/asobj/Number.cpp,
server/asobj/Object.cpp, server/asobj/System.cpp,
server/asobj/string.cpp, server/parser/bitmap_character_def.h,
server/parser/button_character_def.cpp,
server/parser/character_def.h,
server/parser/movie_def_impl.cpp,
server/parser/movie_def_impl.h,
server/parser/movie_definition.h,
server/parser/sprite_definition.h,
server/swf/ASHandlers.cpp, server/swf/tag_loaders.cpp:
Updated to use boost::intrusive_ptr instead of tu's smart_ptr
* testsuite/libbase/Makefile.am,
testsuite/libbase/smart_ptrTest.cpp:
removed unit test for smart_ptr (obsoleted)
* server/asobj/gen-asclass.sh: stub generator for ActionScript
classes.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1591&r2=1.1592
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_tri.cpp?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/smart_ptr.h?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/server/action.cpp?cvsroot=gnash&r1=1.107&r2=1.108
http://cvs.savannah.gnu.org/viewcvs/gnash/server/action.h?cvsroot=gnash&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/gnash/server/array.cpp?cvsroot=gnash&r1=1.40&r2=1.41
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.cpp?cvsroot=gnash&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_function.cpp?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/server/button_character_instance.cpp?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/server/button_character_instance.h?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/server/character.h?cvsroot=gnash&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.h?cvsroot=gnash&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/gnash/server/font.cpp?cvsroot=gnash&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/gnash/server/font.h?cvsroot=gnash&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/gnash/server/fontlib.cpp?cvsroot=gnash&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/gnash/server/gnash.h?cvsroot=gnash&r1=1.73&r2=1.74
http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.cpp?cvsroot=gnash&r1=1.69&r2=1.70
http://cvs.savannah.gnu.org/viewcvs/gnash/server/mouse_button_state.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.77&r2=1.78
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.h?cvsroot=gnash&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/gnash/server/styles.cpp?cvsroot=gnash&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/gnash/server/styles.h?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf_function.cpp?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/server/with_stack_entry.h?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/server/xml.cpp?cvsroot=gnash&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/ASSound.cpp?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Key.cpp?cvsroot=gnash&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Key.h?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/MovieClipLoader.cpp?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Number.cpp?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/Object.cpp?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/System.cpp?cvsroot=gnash&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/string.cpp?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/gen-asclass.sh?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/bitmap_character_def.h?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/button_character_def.cpp?cvsroot=gnash&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/character_def.h?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.cpp?cvsroot=gnash&r1=1.34&r2=1.35
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.h?cvsroot=gnash&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_definition.h?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/sprite_definition.h?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/ASHandlers.cpp?cvsroot=gnash&r1=1.92&r2=1.93
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.cpp?cvsroot=gnash&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libbase/Makefile.am?cvsroot=gnash&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libbase/smart_ptrTest.cpp?cvsroot=gnash&r1=1.3&r2=0
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1591
retrieving revision 1.1592
diff -u -b -r1.1591 -r1.1592
--- ChangeLog 11 Nov 2006 17:05:25 -0000 1.1591
+++ ChangeLog 11 Nov 2006 22:44:53 -0000 1.1592
@@ -1,5 +1,32 @@
2006-11-11 Sandro Santilli <address@hidden>
+ * libbase/smart_ptr.h: removed smart_ptr definition, added
+ function helpers and include for boost::intrusive_ptr
+ * backend/render_handler_tri.cpp, server/action.cpp, server/action.h,
+ server/array.cpp, server/as_environment.cpp, server/as_function.cpp,
+ server/button_character_instance.cpp,
+ server/button_character_instance.h, server/character.h,
+ server/dlist.cpp, server/dlist.h, server/font.cpp, server/font.h,
+ server/fontlib.cpp, server/gnash.h, server/impl.cpp,
+ server/mouse_button_state.h, server/movie_root.cpp,
+ server/movie_root.h, server/sprite_instance.cpp,
+ server/sprite_instance.h, server/styles.cpp, server/styles.h,
+ server/swf_function.cpp, server/with_stack_entry.h, server/xml.cpp,
+ server/asobj/ASSound.cpp, server/asobj/Key.cpp, server/asobj/Key.h,
+ server/asobj/MovieClipLoader.cpp, server/asobj/Number.cpp,
+ server/asobj/Object.cpp, server/asobj/System.cpp,
+ server/asobj/string.cpp, server/parser/bitmap_character_def.h,
+ server/parser/button_character_def.cpp, server/parser/character_def.h,
+ server/parser/movie_def_impl.cpp, server/parser/movie_def_impl.h,
+ server/parser/movie_definition.h, server/parser/sprite_definition.h,
+ server/swf/ASHandlers.cpp, server/swf/tag_loaders.cpp:
+ Updated to use boost::intrusive_ptr instead of tu's smart_ptr
+ * testsuite/libbase/Makefile.am, testsuite/libbase/smart_ptrTest.cpp:
+ removed unit test for smart_ptr (obsoleted)
+ * server/asobj/gen-asclass.sh: stub generator for ActionScript classes.
+
+2006-11-11 Sandro Santilli <address@hidden>
+
* Makefile.am (mudflap and mudlfap-check rules):
use mudflapth as gnash's a threaded application.
* testsuite/libbase/TCXXRc.cpp: use "check.h" if dejagnu
Index: backend/render_handler_tri.cpp
===================================================================
RCS file: /sources/gnash/gnash/backend/render_handler_tri.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- backend/render_handler_tri.cpp 29 Oct 2006 18:34:17 -0000 1.8
+++ backend/render_handler_tri.cpp 11 Nov 2006 22:44:53 -0000 1.9
@@ -17,7 +17,7 @@
//
//
-/* $Id: render_handler_tri.cpp,v 1.8 2006/10/29 18:34:17 rsavoye Exp $ */
+/* $Id: render_handler_tri.cpp,v 1.9 2006/11/11 22:44:53 strk Exp $ */
#include "render_handler_tri.h"
@@ -233,7 +233,7 @@
if (style.m_gradient_bitmap_info != NULL) {
fill_style_bitmap(
fill_side,
- style.m_gradient_bitmap_info.get_ptr(),
+ style.m_gradient_bitmap_info.get(),
style.m_gradient_matrix,
gnash::render_handler::WRAP_CLAMP);
}
Index: libbase/smart_ptr.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/smart_ptr.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- libbase/smart_ptr.h 8 Nov 2006 10:08:42 -0000 1.14
+++ libbase/smart_ptr.h 11 Nov 2006 22:44:54 -0000 1.15
@@ -9,7 +9,7 @@
// although the nice thing about templates is that no particular
// ref-counted class is mandated.
-/* $Id: smart_ptr.h,v 1.14 2006/11/08 10:08:42 strk Exp $ */
+/* $Id: smart_ptr.h,v 1.15 2006/11/11 22:44:54 strk Exp $ */
#ifndef SMART_PTR_H
#define SMART_PTR_H
@@ -17,166 +17,29 @@
#include "tu_config.h"
#include "utility.h"
+#include <boost/intrusive_ptr.hpp>
-/// A smart (strong) pointer asserts that the pointed-to object will
-/// not go away as long as the strong pointer is valid. "Owners" of an
-/// object should keep strong pointers; other objects should use a
-/// strong pointer temporarily while they are actively using the
-/// object, to prevent the object from being deleted.
-template<class T>
-class DSOEXPORT smart_ptr
+#define COMPILER_SUPPORTS_ARGUMENT_DEPENDENT_LOOKUP 1
+#ifdef COMPILER_SUPPORTS_ARGUMENT_DEPENDENT_LOOKUP
+namespace gnash {
+#else
+namespace boost {
+#endif
+
+template <class T>
+void
+intrusive_ptr_add_ref(T* o)
{
-public:
+ o->add_ref();
+}
- smart_ptr(T* ptr)
- :
- m_ptr(ptr)
- {
- if (m_ptr)
- {
- m_ptr->add_ref();
- }
- testInvariant();
- }
-
- smart_ptr()
- :
- m_ptr(NULL)
- {
- testInvariant();
- }
-
- smart_ptr(const smart_ptr<T>& s)
- :
- m_ptr(s.m_ptr)
- {
- if (m_ptr)
- {
- m_ptr->add_ref();
- }
- testInvariant();
- }
-
- ~smart_ptr()
- {
- testInvariant();
- if (m_ptr)
- {
- m_ptr->drop_ref();
- }
- }
-
- //operator bool() const { return m_ptr != NULL; }
- void operator=(const smart_ptr<T>& s)
- {
- set_ref(s.m_ptr);
- testInvariant();
- }
-
- void operator=(T* ptr)
- {
- set_ref(ptr);
- testInvariant();
- }
-
- T* operator->() const
- {
- assert(m_ptr);
- testInvariant();
- return m_ptr;
- }
-
- const T& operator*() const
- {
- assert(m_ptr);
- testInvariant();
- return *m_ptr;
- }
-
- T& operator*()
- {
- assert(m_ptr);
- testInvariant();
- return *m_ptr;
- }
-
- T* get_ptr() const
- {
- testInvariant();
- return m_ptr;
- }
-
- bool operator==(const smart_ptr<T>& p) const
- {
- testInvariant();
- return m_ptr == p.m_ptr;
- }
-
- bool operator!=(const smart_ptr<T>& p) const
- {
- testInvariant();
- return m_ptr != p.m_ptr;
- }
-
- bool operator==(T* p) const
- {
- testInvariant();
- return m_ptr == p;
- }
-
- bool operator!=(T* p) const
- {
- testInvariant();
- return m_ptr != p;
- }
-
- // Provide work-alikes for static_cast, dynamic_cast, implicit up-cast?
("gentle_cast" a la ajb?)
-
- /// Check invariant of the smart pointer.
- //
- /// This function is called as first thing by every public
- /// inspector function and as last thing by every mutator
- /// function. If you build with NDEBUG defined all such
- /// calls will be removed (in case you're worried about
- /// overhead).
- ///
- /// Leaving the calls in will increase the *probability*
- /// to detect memory corruption errors earier.
- ///
- /// To further improve this we might have the smart_ptr
- /// testInvariant function call the pointed-to testInvariant
- /// function. I dind't push it so far though (yet) :)
- ///
- void testInvariant() const
- {
- // If we have a pointer, check that it's refcount
- // is greater then 0, as if it is not that means
- // that someone deleted it
- assert( m_ptr == NULL || m_ptr->get_ref_count() > 0 );
- }
-
-private:
-
- void set_ref(T* ptr)
- {
- if (ptr != m_ptr)
- {
- if (m_ptr)
- {
- m_ptr->drop_ref();
- }
- m_ptr = ptr;
-
- if (m_ptr)
- {
- m_ptr->add_ref();
- }
- }
-
- testInvariant();
- }
+template <class T>
+void
+intrusive_ptr_release(T* o)
+{
+ o->drop_ref();
+}
- T* m_ptr;
};
Index: server/action.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/action.cpp,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -b -r1.107 -r1.108
--- server/action.cpp 7 Nov 2006 11:55:01 -0000 1.107
+++ server/action.cpp 11 Nov 2006 22:44:54 -0000 1.108
@@ -130,7 +130,7 @@
// Statics.
bool s_inited = false;
-smart_ptr<as_object> s_global;
+boost::intrusive_ptr<as_object> s_global;
void register_component(const tu_stringi& name, as_c_function_ptr handler)
{
Index: server/action.h
===================================================================
RCS file: /sources/gnash/gnash/server/action.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- server/action.h 3 Nov 2006 14:03:37 -0000 1.48
+++ server/action.h 11 Nov 2006 22:44:54 -0000 1.49
@@ -49,7 +49,7 @@
class swf_function;
- extern DSOEXPORT smart_ptr<as_object> s_global;
+ extern DSOEXPORT boost::intrusive_ptr<as_object> s_global;
class DSOLOCAL as_property_interface
{
Index: server/array.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/array.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- server/array.cpp 8 Nov 2006 08:25:28 -0000 1.40
+++ server/array.cpp 11 Nov 2006 22:44:54 -0000 1.41
@@ -731,7 +731,7 @@
log_action("array_new called, nargs = %d", fn.nargs);
);
- //smart_ptr<as_array_object> ao = new as_array_object;
+ //boost::intrusive_ptr<as_array_object> ao = new as_array_object;
as_array_object* ao = new as_array_object;
if (fn.nargs == 0)
@@ -766,7 +766,7 @@
log_action("array_new setting object %p in result", (void*)ao);
);
- //fn.result->set_as_object(ao.get_ptr());
+ //fn.result->set_as_object(ao.get());
fn.result->set_as_object(ao);
}
@@ -800,13 +800,13 @@
static as_object*
getArrayInterface()
{
- static smart_ptr<as_object> proto = NULL;
+ static boost::intrusive_ptr<as_object> proto = NULL;
if ( proto == NULL )
{
proto = new as_object();
attachArrayInterface(*proto);
}
- return proto.get_ptr();
+ return proto.get();
}
// this registers the "Array" member on a "Global"
@@ -818,7 +818,7 @@
array_class_init(as_object& glob)
{
// This is going to be the global Array "class"/"function"
- static smart_ptr<as_function> ar=NULL;
+ static boost::intrusive_ptr<as_function> ar=NULL;
if ( ar == NULL )
{
@@ -830,7 +830,7 @@
}
// Register _global.Array
- glob.set_member("Array", ar.get_ptr());
+ glob.set_member("Array", ar.get());
}
Index: server/as_environment.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- server/as_environment.cpp 3 Nov 2006 14:03:37 -0000 1.28
+++ server/as_environment.cpp 11 Nov 2006 22:44:54 -0000 1.29
@@ -16,7 +16,7 @@
//
-/* $Id: as_environment.cpp,v 1.28 2006/11/03 14:03:37 strk Exp $ */
+/* $Id: as_environment.cpp,v 1.29 2006/11/11 22:44:54 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -79,7 +79,7 @@
// Check the with-stack.
for (size_t i = with_stack.size(); i > 0; --i) {
- as_object* obj = with_stack[i-1].m_object.get_ptr();
+ as_object* obj = with_stack[i-1].m_object.get();
if (obj && obj->get_member(varname.c_str(), &val)) {
// Found the var in this context.
return val;
@@ -109,7 +109,7 @@
return as_value(m_target->get_root_movie());
}
if (varname == "_global") {
- return as_value(s_global.get_ptr());
+ return as_value(s_global.get());
}
if (s_global->get_member(varname.c_str(), &val)) {
return val;
@@ -178,7 +178,7 @@
// Check the with-stack.
for (int i = with_stack.size() - 1; i >= 0; i--)
{
- as_object* obj = with_stack[i].m_object.get_ptr();
+ as_object* obj = with_stack[i].m_object.get();
as_value dummy;
if (obj && obj->get_member(varname.c_str(), &dummy)) {
// This object has the member; so set it here.
Index: server/as_function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_function.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/as_function.cpp 11 Nov 2006 15:25:27 -0000 1.9
+++ server/as_function.cpp 11 Nov 2006 22:44:54 -0000 1.10
@@ -71,17 +71,17 @@
static as_object* getFunctionPrototype()
{
// Make sure the prototype is always
- // alive (static smart_ptr<> should ensure this)
- static smart_ptr<as_object> proto;
+ // alive (static boost::intrusive_ptr<> should ensure this)
+ static boost::intrusive_ptr<as_object> proto;
- if ( proto.get_ptr() == NULL ) {
+ if ( proto.get() == NULL ) {
// Initialize Function prototype
proto = new as_object();
proto->set_member("apply", &function_apply);
proto->set_member("call", &function_call);
}
- return proto.get_ptr();
+ return proto.get();
}
@@ -136,14 +136,14 @@
// TODO: use Function() instead (where Function derives from
as_function, being a class)
// Make sure the prototype is always alive
- // (static smart_ptr<> should ensure this)
- static smart_ptr<as_function> func=new builtin_function(
+ // (static boost::intrusive_ptr<> should ensure this)
+ static boost::intrusive_ptr<as_function> func=new builtin_function(
do_nothing, // function constructor doesn't do anything
getFunctionPrototype() // exported interface
);
// Register _global.Function
- global->set_member("Function", func.get_ptr());
+ global->set_member("Function", func.get());
}
Index: server/button_character_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/button_character_instance.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- server/button_character_instance.cpp 7 Nov 2006 17:16:18 -0000
1.14
+++ server/button_character_instance.cpp 11 Nov 2006 22:44:54 -0000
1.15
@@ -165,7 +165,7 @@
const matrix& mat =
m_def->m_button_records[r].m_button_matrix;
const cxform& cx = m_def->m_button_records[r].m_button_cxform;
- smart_ptr<character> ch =
bdef.m_character_def->create_character_instance(this, id);
+ boost::intrusive_ptr<character> ch =
bdef.m_character_def->create_character_instance(this, id);
m_record_character[r] = ch;
ch->set_matrix(mat);
ch->set_cxform(cx);
@@ -357,7 +357,7 @@
// The mouse is inside the shape.
return this;
// @@ Are there any circumstances where this is correct:
- //return m_record_character[i].get_ptr();
+ //return m_record_character[i].get();
}
}}
Index: server/button_character_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/button_character_instance.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- server/button_character_instance.h 3 Nov 2006 14:03:37 -0000 1.4
+++ server/button_character_instance.h 11 Nov 2006 22:44:54 -0000 1.5
@@ -5,7 +5,7 @@
// SWF buttons. Mouse-sensitive update/display, actions, etc.
-/* $Id: button_character_instance.h,v 1.4 2006/11/03 14:03:37 strk Exp $ */
+/* $Id: button_character_instance.h,v 1.5 2006/11/11 22:44:54 strk Exp $ */
#ifndef GNASH_BUTTON_CHARACTER_INSTANCE_H
#define GNASH_BUTTON_CHARACTER_INSTANCE_H
@@ -41,7 +41,7 @@
{
public:
button_character_definition* m_def;
- std::vector< smart_ptr<character> > m_record_character;
+ std::vector< boost::intrusive_ptr<character> > m_record_character;
enum mouse_flags
{
Index: server/character.h
===================================================================
RCS file: /sources/gnash/gnash/server/character.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- server/character.h 7 Nov 2006 17:16:18 -0000 1.26
+++ server/character.h 11 Nov 2006 22:44:54 -0000 1.27
@@ -18,7 +18,7 @@
//
//
-/* $Id: character.h,v 1.26 2006/11/07 17:16:18 strk Exp $ */
+/* $Id: character.h,v 1.27 2006/11/11 22:44:54 strk Exp $ */
#ifndef GNASH_CHARACTER_H
#define GNASH_CHARACTER_H
@@ -80,7 +80,7 @@
bool m_visible;
- smart_ptr<character> m_parent;
+ boost::intrusive_ptr<character> m_parent;
/// Implement mouse-dragging for this movie.
void do_mouse_drag();
@@ -127,7 +127,7 @@
/// the character has no parent.
character* get_parent() const
{
- return m_parent.get_ptr();
+ return m_parent.get();
}
// for extern movie
Index: server/dlist.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- server/dlist.cpp 11 Nov 2006 15:25:27 -0000 1.37
+++ server/dlist.cpp 11 Nov 2006 22:44:54 -0000 1.38
@@ -43,7 +43,7 @@
{}
bool operator() (const DisplayItem& item) {
- if ( ! item.get_ptr() ) return false;
+ if ( ! item.get() ) return false;
return item->get_depth() == _depth;
}
};
@@ -58,7 +58,7 @@
{}
bool operator() (const DisplayItem& item) {
- if ( ! item.get_ptr() ) return false;
+ if ( ! item.get() ) return false;
return item->get_depth() >= _depth;
}
};
@@ -73,7 +73,7 @@
{}
bool operator() (const DisplayItem& item) {
- if ( ! item.get_ptr() ) return false;
+ if ( ! item.get() ) return false;
return item->get_name() == _name;
}
};
@@ -92,7 +92,7 @@
bool operator() (const DisplayItem& item)
{
- if ( ! item.get_ptr() ) return false;
+ if ( ! item.get() ) return false;
return noCaseEquals(item->get_name(), _name);
}
};
@@ -105,7 +105,7 @@
itEnd = _characters.end();
it != itEnd; ++it)
{
- character* ch = it->get_ptr();
+ character* ch = it->get();
assert(ch); // is this really needed ?
unsigned int chdepth = ch->get_depth();
@@ -127,7 +127,7 @@
itEnd = _characters.end();
it != itEnd; ++it)
{
- character* ch = it->get_ptr();
+ character* ch = it->get();
assert(ch); // is this really needed ?
// found
@@ -151,7 +151,7 @@
NameEquals(name));
if ( it == _characters.end() ) return NULL;
- else return it->get_ptr();
+ else return it->get();
}
@@ -164,7 +164,7 @@
NameEqualsNoCase(name));
if ( it == _characters.end() ) return NULL;
- else return it->get_ptr();
+ else return it->get();
}
@@ -345,7 +345,7 @@
//Vitaly: UNLOAD event in DisplayList::clear() it is not caused,
// since character is removed already
DisplayItem& di = *new_end;
- if (new_end->get_ptr())
+ if (new_end->get())
{
di->on_event(event_id::UNLOAD);
}
@@ -374,7 +374,7 @@
it != itEnd; ++it)
{
DisplayItem& di = *it;
- if ( ! it->get_ptr() ) continue;
+ if ( ! it->get() ) continue;
di->on_event(event_id::UNLOAD);
}
@@ -400,7 +400,7 @@
{
DisplayItem& di = *it;
- int di_depth = di.get_ptr()->get_depth();
+ int di_depth = di.get()->get_depth();
bool is_affected = false;
for (size_t i=0, n=affected_depths.size(); i<n; ++i)
@@ -480,7 +480,7 @@
// keep the character alive in case actions in it
// will remove it from displaylist.
- smart_ptr<character> ch = *it;
+ boost::intrusive_ptr<character> ch = *it;
assert(ch!=NULL);
ch->advance(delta_time);
@@ -509,8 +509,8 @@
{
DisplayItem& dobj = *it;
- //character* ch = dobj.m_character.get_ptr();
- character* ch = dobj.get_ptr();
+ //character* ch = dobj.m_character.get();
+ character* ch = dobj.get();
assert(ch);
Index: server/dlist.h
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- server/dlist.h 3 Nov 2006 14:03:37 -0000 1.17
+++ server/dlist.h 11 Nov 2006 22:44:54 -0000 1.18
@@ -33,7 +33,7 @@
namespace gnash {
/// A DisplayItem is simply a character object
-typedef smart_ptr<character> DisplayItem;
+typedef boost::intrusive_ptr<character> DisplayItem;
/// A list of on-stage characters, ordered by depth
//
@@ -236,7 +236,7 @@
it != itEnd; ++it)
{
DisplayItem& di = *it;
- if ( ! visitor(di.get_ptr()) )
+ if ( ! visitor(di.get()) )
{
break;
}
@@ -253,14 +253,14 @@
{
DisplayItem& di = *it;
- //if ( ! di.get_ptr() ) continue;
+ //if ( ! di.get() ) continue;
- if ( ! visitor(di.get_ptr()) )
+ if ( ! visitor(di.get()) )
{
// Can so happens that the uppermost depth contains
shape
// and under it the button lays
// therefore we skip empty(no events) depth
- if (di.get_ptr()->can_handle_mouse_event())
+ if (di.get()->can_handle_mouse_event())
{
break;
}
Index: server/font.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/font.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- server/font.cpp 9 Nov 2006 14:19:46 -0000 1.23
+++ server/font.cpp 11 Nov 2006 22:44:54 -0000 1.24
@@ -47,7 +47,7 @@
{
if (index >= 0 && index < (int) m_glyphs.size())
{
- return m_glyphs[index].get_ptr();
+ return m_glyphs[index].get();
}
else
{
@@ -483,7 +483,7 @@
out->write_le32(n);
for (int i = 0; i < n; i++)
{
- shape_character_def* s = m_glyphs[i].get_ptr();
+ shape_character_def* s = m_glyphs[i].get();
if (s)
{
s->output_cached_data(out, options);
Index: server/font.h
===================================================================
RCS file: /sources/gnash/gnash/server/font.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- server/font.h 17 Oct 2006 15:32:48 -0000 1.16
+++ server/font.h 11 Nov 2006 22:44:54 -0000 1.17
@@ -46,7 +46,7 @@
return m_bitmap_info != NULL;
}
- /// Argument will be assigned to a smart_ptr
+ /// Argument will be assigned to a boost::intrusive_ptr
void set_bitmap_info(bitmap_info* bi)
{
m_bitmap_info = bi;
@@ -56,7 +56,7 @@
// them, postponed.
//private:
- smart_ptr<bitmap_info> m_bitmap_info;
+ boost::intrusive_ptr<bitmap_info> m_bitmap_info;
rect m_uv_bounds;
@@ -192,7 +192,7 @@
// Read a DefineFont tag
void readDefineFont(stream* in, movie_definition* m);
- std::vector< smart_ptr<shape_character_def> > m_glyphs;
+ std::vector< boost::intrusive_ptr<shape_character_def> >
m_glyphs;
std::vector< texture_glyph > m_texture_glyphs; //
cached info, built by gnash_fontlib.
Index: server/fontlib.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/fontlib.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- server/fontlib.cpp 18 Oct 2006 14:45:02 -0000 1.25
+++ server/fontlib.cpp 11 Nov 2006 22:44:54 -0000 1.26
@@ -5,7 +5,7 @@
// A module to take care of all of gnash's loaded fonts.
-/* $Id: fontlib.cpp,v 1.25 2006/10/18 14:45:02 strk Exp $ */
+/* $Id: fontlib.cpp,v 1.26 2006/11/11 22:44:54 strk Exp $ */
#include "container.h"
#include "tu_file.h"
@@ -24,7 +24,7 @@
namespace gnash {
namespace fontlib {
- std::vector< smart_ptr<font> > s_fonts;
+ std::vector< boost::intrusive_ptr<font> > s_fonts;
// Size (in TWIPS) of the box that the glyph should
// stay within.
@@ -276,12 +276,12 @@
if (owner->get_create_bitmaps() == DO_LOAD_BITMAPS)
{
- smart_ptr<bitmap_info> bi;
+ boost::intrusive_ptr<bitmap_info> bi;
bi = render::create_bitmap_info_alpha(
GLYPH_CACHE_TEXTURE_SIZE,
GLYPH_CACHE_TEXTURE_SIZE,
s_current_cache_image);
- owner->add_bitmap_info(bi.get_ptr());
+ owner->add_bitmap_info(bi.get());
// Push finished glyphs into their respective fonts.
for (int i = 0, n = s_pending_glyphs.size(); i < n; i++)
@@ -290,9 +290,9 @@
assert(pgi->m_glyph_index != -1);
assert(pgi->m_source_font != NULL);
- pgi->m_texture_glyph.set_bitmap_info(bi.get_ptr());
+ pgi->m_texture_glyph.set_bitmap_info(bi.get());
pgi->m_source_font->add_texture_glyph(pgi->m_glyph_index, pgi->m_texture_glyph);
- //s_pending_glyphs[i]->set_bitmap_info(bi.get_ptr());
+ //s_pending_glyphs[i]->set_bitmap_info(bi.get());
}
}
s_pending_glyphs.clear();
@@ -1112,7 +1112,7 @@
if (owner->get_create_bitmaps() == DO_LOAD_BITMAPS)
{
- smart_ptr<bitmap_info> bi;
+ boost::intrusive_ptr<bitmap_info> bi;
// load bitmap contents
if (s_current_cache_image == NULL || w != pw ||
h != ph)
{
@@ -1128,7 +1128,7 @@
w,
h,
s_current_cache_image);
- owner->add_bitmap_info(bi.get_ptr());
+ owner->add_bitmap_info(bi.get());
assert(bi->get_ref_count() == 2); // one ref for
bi, one for the owner.
}
else { // Skip image data bytes.
@@ -1248,7 +1248,7 @@
return NULL;
}
- return s_fonts[index].get_ptr();
+ return s_fonts[index].get();
}
@@ -1258,7 +1258,7 @@
// Dumb linear search.
for (unsigned int i = 0; i < s_fonts.size(); i++)
{
- font* f = s_fonts[i].get_ptr();
+ font* f = s_fonts[i].get();
if (f != NULL)
{
if (strcmp(f->get_name(), name) == 0)
@@ -1319,7 +1319,7 @@
bounds.scale_x(s_scale);
bounds.scale_y(s_scale);
- render::draw_bitmap(mat, tg.m_bitmap_info.get_ptr(), bounds,
tg.m_uv_bounds, color);
+ render::draw_bitmap(mat, tg.m_bitmap_info.get(), bounds,
tg.m_uv_bounds, color);
}
Index: server/gnash.h
===================================================================
RCS file: /sources/gnash/gnash/server/gnash.h,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -b -r1.73 -r1.74
--- server/gnash.h 3 Nov 2006 15:28:30 -0000 1.73
+++ server/gnash.h 11 Nov 2006 22:44:54 -0000 1.74
@@ -17,7 +17,7 @@
//
//
-/* $Id: gnash.h,v 1.73 2006/11/03 15:28:30 alexeev Exp $ */
+/* $Id: gnash.h,v 1.74 2006/11/11 22:44:54 strk Exp $ */
/// \mainpage
///
@@ -214,7 +214,7 @@
///
/// This calls add_ref() on the newly created definition; call
/// drop_ref() when you're done with it.
-/// Or use smart_ptr<T> from base/smart_ptr.h if you want.
+/// Or use boost::intrusive_ptr<T> from base/smart_ptr.h if you want.
///
/// @@ Hm, need to think about these creation API's. Perhaps
/// divide it into "low level" and "high level" calls. Also,
@@ -288,7 +288,7 @@
///
/// This calls add_ref() on the newly created definition; call
/// drop_ref() when you're done with it.
-/// Or use smart_ptr<T> from base/smart_ptr.h if you want.
+/// Or use boost::intrusive_ptr<T> from base/smart_ptr.h if you want.
///
/// IFF real_url is given, the movie's url will be set to that value.
///
Index: server/impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/impl.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- server/impl.cpp 7 Nov 2006 17:16:18 -0000 1.69
+++ server/impl.cpp 11 Nov 2006 22:44:54 -0000 1.70
@@ -18,7 +18,7 @@
//
//
-/* $Id: impl.cpp,v 1.69 2006/11/07 17:16:18 strk Exp $ */
+/* $Id: impl.cpp,v 1.70 2006/11/11 22:44:54 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -531,7 +531,7 @@
//
-//static stringi_hash< smart_ptr<movie_definition> > s_movie_library;
+//static stringi_hash< boost::intrusive_ptr<movie_definition> >
s_movie_library;
/// Library of SWF movies indexed by URL strings
//
@@ -544,7 +544,7 @@
{
private:
- typedef std::map< std::string, smart_ptr<movie_definition> > container;
+ typedef std::map< std::string, boost::intrusive_ptr<movie_definition> >
container;
container _map;
@@ -552,7 +552,7 @@
MovieLibrary() {}
- bool get(const std::string& key, smart_ptr<movie_definition>* ret)
+ bool get(const std::string& key,
boost::intrusive_ptr<movie_definition>* ret)
{
container::iterator it = _map.find(key);
if ( it != _map.end() )
@@ -576,7 +576,7 @@
static MovieLibrary s_movie_library;
-static hash< movie_definition*, smart_ptr<movie_interface> >
s_movie_library_inst;
+static hash< movie_definition*, boost::intrusive_ptr<movie_interface> >
s_movie_library_inst;
static std::vector<movie_interface*> s_extern_sprites;
static movie_interface* s_current_root;
@@ -650,13 +650,13 @@
// Is the movie already in the library?
{
- smart_ptr<movie_definition> m;
+ boost::intrusive_ptr<movie_definition> m;
if ( s_movie_library.get(cache_label, &m) )
{
log_msg(" movie already in library");
// Return cached movie.
// m->add_ref(); let caller add the ref, if needed
- return m.get_ptr();
+ return m.get();
}
}
@@ -681,13 +681,13 @@
{
// Is the movie instance already in the library?
{
- smart_ptr<movie_interface> m;
+ boost::intrusive_ptr<movie_interface> m;
s_movie_library_inst.get(md, &m);
if (m != NULL)
{
// Return cached movie instance.
// m->add_ref(); // let caller increment refcount
- return m.get_ptr();
+ return m.get();
}
}
Index: server/mouse_button_state.h
===================================================================
RCS file: /sources/gnash/gnash/server/mouse_button_state.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- server/mouse_button_state.h 7 Nov 2006 17:16:18 -0000 1.3
+++ server/mouse_button_state.h 11 Nov 2006 22:44:54 -0000 1.4
@@ -27,10 +27,10 @@
public:
/// entity that currently owns the mouse pointer
- smart_ptr<movie> m_active_entity;
+ boost::intrusive_ptr<movie> m_active_entity;
/// what's underneath the mouse right now
- smart_ptr<movie> m_topmost_entity;
+ boost::intrusive_ptr<movie> m_topmost_entity;
/// previous state of mouse button
bool m_mouse_button_state_last;
Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- server/movie_root.cpp 11 Nov 2006 15:25:27 -0000 1.25
+++ server/movie_root.cpp 11 Nov 2006 22:44:54 -0000 1.26
@@ -136,8 +136,8 @@
bool
generate_mouse_button_events(mouse_button_state* ms)
{
- smart_ptr<movie> active_entity = ms->m_active_entity;
- smart_ptr<movie> topmost_entity = ms->m_topmost_entity;
+ boost::intrusive_ptr<movie> active_entity = ms->m_active_entity;
+ boost::intrusive_ptr<movie> topmost_entity = ms->m_topmost_entity;
// Did this event trigger any action that needs redisplay ?
bool need_redisplay = false;
@@ -278,7 +278,7 @@
movie* current_active_entity =
mroot->get_active_entity();
// It's another entity ?
- if (current_active_entity != active_entity.get_ptr())
+ if (current_active_entity != active_entity.get())
{
// First to clean focus
if (current_active_entity != NULL)
@@ -296,7 +296,7 @@
{
if
(active_entity->on_event(event_id::SETFOCUS))
{
-
mroot->set_active_entity(active_entity.get_ptr());
+
mroot->set_active_entity(active_entity.get());
}
}
}
@@ -314,7 +314,7 @@
}
}
- // Write the (possibly modified) smart_ptr copies back
+ // Write the (possibly modified) boost::intrusive_ptr copies back
// into the state struct.
ms->m_active_entity = active_entity;
ms->m_topmost_entity = topmost_entity;
@@ -443,7 +443,7 @@
// onload event for child movieclip is executed before frame 1
actions.
// that's why advance for root movieclip and child movieclip
are different.
m_timer += delta_time;
- sprite_instance* current_root = m_movie.get_ptr();
+ sprite_instance* current_root = m_movie.get();
assert(current_root);
//current_root->advance_root(delta_time);
@@ -542,10 +542,10 @@
continue;
}
- smart_ptr<as_object> listener = *iter; // Hold an owning
reference.
+ boost::intrusive_ptr<as_object> listener = *iter; // Hold an
owning reference.
// sprite, button & input_edit_text characters
- character* ch = (character*) listener.get_ptr();
+ character* ch = (character*) listener.get();
ch->on_event(event_id(event_id::KEY_PRESS, (key::code) k));
}
}
@@ -592,8 +592,8 @@
bool
movie_root::isMouseOverActiveEntity() const
{
- smart_ptr<movie> entity ( m_mouse_button_state.m_active_entity );
- if ( ! entity.get_ptr() ) return false;
+ boost::intrusive_ptr<movie> entity (
m_mouse_button_state.m_active_entity );
+ if ( ! entity.get() ) return false;
#if 0 // debugging...
log_msg("The active entity under the pointer is a %s",
Index: server/movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- server/movie_root.h 29 Oct 2006 18:34:11 -0000 1.23
+++ server/movie_root.h 11 Nov 2006 22:44:54 -0000 1.24
@@ -17,7 +17,7 @@
//
//
-/* $Id: movie_root.h,v 1.23 2006/10/29 18:34:11 rsavoye Exp $ */
+/* $Id: movie_root.h,v 1.24 2006/11/11 22:44:54 strk Exp $ */
#ifndef GNASH_MOVIE_ROOT_H
#define GNASH_MOVIE_ROOT_H
@@ -46,7 +46,7 @@
/// Global, shared root state for a movie and all its characters.
class movie_root : public movie_interface // inheritance should be dropped
{
- smart_ptr<movie_def_impl> m_def;
+ boost::intrusive_ptr<movie_def_impl> m_def;
int m_viewport_x0, m_viewport_y0;
int m_viewport_width, m_viewport_height;
float m_pixel_scale;
@@ -70,7 +70,7 @@
public:
// XXXbastiaan: make these two variables private
- smart_ptr<sprite_instance> m_movie;
+ boost::intrusive_ptr<sprite_instance> m_movie;
/// @@ fold this into m_mouse_button_state?
movie::drag_state m_drag_state;
@@ -91,7 +91,7 @@
return false;
}
- /// @@ should this return m_movie.get_ptr()?
+ /// @@ should this return m_movie.get()?
virtual movie* to_movie() { assert(0); return 0; }
void set_root_movie(sprite_instance* root_movie);
@@ -112,7 +112,7 @@
/// notify_mouse_state(). Coordinates are in PIXELS, NOT TWIPS.
virtual void get_mouse_state(int* x, int* y, int* buttons);
- sprite_instance* get_root_movie() { return m_movie.get_ptr(); }
+ sprite_instance* get_root_movie() { return m_movie.get(); }
void stop_drag() { m_drag_state.m_character = NULL; }
Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -b -r1.77 -r1.78
--- server/sprite_instance.cpp 7 Nov 2006 17:16:18 -0000 1.77
+++ server/sprite_instance.cpp 11 Nov 2006 22:44:54 -0000 1.78
@@ -128,7 +128,7 @@
if (sprite == NULL)
{
IF_VERBOSE_ASCODING_ERRORS(
- log_error("attachMovie called against an object"
+ log_warning("attachMovie called against an object"
" which is NOT a MovieClip (%s), "
"returning undefined", typeid(fn.this_ptr).name());
);
@@ -139,7 +139,7 @@
if (fn.nargs < 3 || fn.nargs > 4)
{
IF_VERBOSE_ASCODING_ERRORS(
- log_error("attachMovie called with wrong number of arguments"
+ log_warning("attachMovie called with wrong number of arguments"
" expected 3 to 4, got (%d) - returning undefined",
fn.nargs);
);
@@ -149,26 +149,26 @@
// Get exported resource
std::string id_name = fn.arg(0).to_std_string();
- smart_ptr<resource> exported =
sprite->get_movie_definition()->get_exported_resource(id_name.c_str());
+ boost::intrusive_ptr<resource> exported =
sprite->get_movie_definition()->get_exported_resource(id_name.c_str());
if ( exported == NULL )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_error("attachMovie: '%s': no such exported resource - "
+ log_warning("attachMovie: '%s': no such exported resource - "
"returning undefined",
id_name.c_str());
);
fn.result->set_undefined();
return;
}
- movie_definition* exported_movie =
dynamic_cast<movie_definition*>(exported.get_ptr());
+ movie_definition* exported_movie =
dynamic_cast<movie_definition*>(exported.get());
if ( ! exported_movie )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_error("attachMovie: exported resource '%s' "
+ log_warning("attachMovie: exported resource '%s' "
"is not a movie definition (%s) -- "
"returning undefined",
id_name.c_str(),
- typeid(*(exported.get_ptr())).name());
+ typeid(*(exported.get())).name());
);
fn.result->set_undefined();
return;
@@ -652,8 +652,8 @@
//log_msg("Target's movie definition at %p\n", (void*)mds);
- // Do I need the smart_ptr here ?
- smart_ptr<text_character_def> txt = new text_character_def(mds);
+ // Do I need the smart_ptr.here ?
+ boost::intrusive_ptr<text_character_def> txt = new
text_character_def(mds);
// Now add a the new TextField to the display list.
@@ -696,7 +696,7 @@
// We should return a ref to the newly created
// TextField here
- //fn.result->set_as_object(txt.get_ptr());
+ //fn.result->set_as_object(txt.get());
@@ -1138,7 +1138,7 @@
void sprite_instance::do_actions()
{
// Keep m_as_environment alive during any method calls!
- smart_ptr<as_object> this_ptr(this);
+ boost::intrusive_ptr<as_object> this_ptr(this);
execute_actions(&m_as_environment, m_action_list);
m_action_list.resize(0);
@@ -1279,7 +1279,7 @@
bool sprite_instance::on_event(const event_id& id)
{
// Keep m_as_environment alive during any method calls!
- smart_ptr<as_object> this_ptr(this);
+ boost::intrusive_ptr<as_object> this_ptr(this);
bool called = false;
@@ -1755,7 +1755,7 @@
// Keep this (particularly m_as_environment) alive during execution!
- smart_ptr<as_object> this_ptr(this);
+ boost::intrusive_ptr<as_object> this_ptr(this);
assert(frame < m_def->get_frame_count());
@@ -1797,7 +1797,7 @@
// Keep this (particularly m_as_environment) alive during execution!
- smart_ptr<as_object> this_ptr(this);
+ boost::intrusive_ptr<as_object> this_ptr(this);
assert(frame < m_def->get_frame_count());
@@ -2028,9 +2028,9 @@
//printf("%s: character %s, id is %d, count is %d\n", __FUNCTION__,
existing_char->get_name(), character_id,m_display_list.get_character_count());
// FIXME:
assert(cdef);
- smart_ptr<character> ch = cdef->create_character_instance(this,
+ boost::intrusive_ptr<character> ch =
cdef->create_character_instance(this,
character_id);
- assert(ch.get_ptr() != NULL);
+ assert(ch.get() != NULL);
if (name != NULL && name[0] != 0)
{
ch->set_name(name);
@@ -2039,11 +2039,11 @@
// Attach event handlers (if any).
{for (int i = 0, n = event_handlers.size(); i < n; i++)
{
- event_handlers[i]->attach_to(ch.get_ptr());
+ event_handlers[i]->attach_to(ch.get());
}}
m_display_list.place_character(
- ch.get_ptr(),
+ ch.get(),
depth,
color_transform,
matrix,
@@ -2051,7 +2051,7 @@
clip_depth);
assert(ch == NULL || ch->get_ref_count() > 1);
- return ch.get_ptr();
+ return ch.get();
}
void
@@ -2078,11 +2078,11 @@
}
assert(cdef);
- smart_ptr<character> ch = cdef->create_character_instance(this,
+ boost::intrusive_ptr<character> ch =
cdef->create_character_instance(this,
character_id);
replace_display_object(
- ch.get_ptr(), name, depth,
+ ch.get(), name, depth,
use_cxform, color_transform,
use_matrix, mat,
ratio, clip_depth);
@@ -2438,7 +2438,7 @@
}
else
{
- return it->second.get_ptr();
+ return it->second.get();
}
}
Index: server/sprite_instance.h
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- server/sprite_instance.h 3 Nov 2006 14:03:37 -0000 1.35
+++ server/sprite_instance.h 11 Nov 2006 22:44:54 -0000 1.36
@@ -17,7 +17,7 @@
//
//
-/* $Id: sprite_instance.h,v 1.35 2006/11/03 14:03:37 strk Exp $ */
+/* $Id: sprite_instance.h,v 1.36 2006/11/11 22:44:54 strk Exp $ */
// Stateful live Sprite instance
@@ -99,7 +99,7 @@
/// Return the sprite_definition (or movie_definition)
/// from which this sprite_instance has been created
movie_definition* get_movie_definition() {
- return m_def.get_ptr();
+ return m_def.get();
}
float get_width() const;
@@ -439,7 +439,7 @@
const char* method_arg_fmt, va_list args)
{
// Keep m_as_environment alive during any method calls!
- smart_ptr<as_object> this_ptr(this);
+ boost::intrusive_ptr<as_object> this_ptr(this);
return call_method_parsed(&m_as_environment, this,
method_name, method_arg_fmt, args);
@@ -506,7 +506,7 @@
/// \brief
/// This is either sprite_definition (for sprites defined by
/// DefineSprite tag) or movie_def_impl (for the top-level movie).
- smart_ptr<movie_definition> m_def;
+ boost::intrusive_ptr<movie_definition> m_def;
movie_root* m_root;
@@ -555,7 +555,7 @@
bool m_has_keypress_event;
/// A container for textfields, indexed by their variable name
- typedef std::map< std::string, smart_ptr<edit_text_character> >
TextfieldMap;
+ typedef std::map< std::string,
boost::intrusive_ptr<edit_text_character> > TextfieldMap;
/// We'll only allocate Textfield variables map if
/// we need them (ie: anyone calls set_textfield_variable)
Index: server/styles.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/styles.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- server/styles.cpp 6 Nov 2006 10:27:53 -0000 1.23
+++ server/styles.cpp 11 Nov 2006 22:44:54 -0000 1.24
@@ -137,7 +137,7 @@
if (md->get_create_bitmaps() == DO_LOAD_BITMAPS) {
m_gradient_bitmap_info = create_gradient_bitmap();
// Make sure our movie_def_impl knows about this bitmap.
- md->add_bitmap_info(m_gradient_bitmap_info.get_ptr());
+ md->add_bitmap_info(m_gradient_bitmap_info.get());
}
}
else if (m_type == SWF::FILL_TILED_BITMAP
@@ -318,7 +318,7 @@
this_non_const->m_gradient_bitmap_info = create_gradient_bitmap();
}
- return m_gradient_bitmap_info.get_ptr();
+ return m_gradient_bitmap_info.get();
}
Index: server/styles.h
===================================================================
RCS file: /sources/gnash/gnash/server/styles.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- server/styles.h 6 Nov 2006 10:27:53 -0000 1.15
+++ server/styles.h 11 Nov 2006 22:44:54 -0000 1.16
@@ -5,7 +5,7 @@
// Fill and line style types.
-/* $Id: styles.h,v 1.15 2006/11/06 10:27:53 strk Exp $ */
+/* $Id: styles.h,v 1.16 2006/11/11 22:44:54 strk Exp $ */
#ifndef GNASH_STYLES_H
#define GNASH_STYLES_H
@@ -102,8 +102,8 @@
rgba m_color;
matrix m_gradient_matrix;
std::vector<gradient_record> m_gradients;
- smart_ptr<gnash::bitmap_info> m_gradient_bitmap_info;
- smart_ptr<bitmap_character_def> m_bitmap_character;
+ boost::intrusive_ptr<gnash::bitmap_info> m_gradient_bitmap_info;
+ boost::intrusive_ptr<bitmap_character_def> m_bitmap_character;
matrix m_bitmap_matrix;
};
@@ -133,8 +133,8 @@
rgba m_color[2];
matrix m_gradient_matrix[2];
std::vector<gradient_record> m_gradients[2];
- smart_ptr<bitmap_info> m_gradient_bitmap_info[2];
- smart_ptr<bitmap_character_def> m_bitmap_character;
+ boost::intrusive_ptr<bitmap_info> m_gradient_bitmap_info[2];
+ boost::intrusive_ptr<bitmap_character_def> m_bitmap_character;
matrix m_bitmap_matrix[2];
};
Index: server/swf_function.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf_function.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/swf_function.cpp 3 Nov 2006 14:03:37 -0000 1.5
+++ server/swf_function.cpp 11 Nov 2006 22:44:54 -0000 1.6
@@ -156,7 +156,7 @@
}
// Init arguments array, if it's going to be needed.
- smart_ptr<as_array_object> arg_array;
+ boost::intrusive_ptr<as_array_object> arg_array;
if ((m_function2_flags & 0x04) || ! (m_function2_flags & 0x08))
{
arg_array = new as_array_object;
@@ -172,7 +172,7 @@
if (m_function2_flags & 0x04)
{
// preload 'arguments' into a register.
-
our_env->local_register(current_reg).set_as_object(arg_array.get_ptr());
+
our_env->local_register(current_reg).set_as_object(arg_array.get());
current_reg++;
}
@@ -183,7 +183,7 @@
else
{
// Put 'arguments' in a local var.
- our_env->add_local("arguments",
as_value(arg_array.get_ptr()));
+ our_env->add_local("arguments",
as_value(arg_array.get()));
}
if (m_function2_flags & 0x10)
@@ -223,7 +223,7 @@
if (m_function2_flags & 0x100)
{
// Put '_global' in a register.
-
our_env->local_register(current_reg).set_as_object(s_global.get_ptr());
+
our_env->local_register(current_reg).set_as_object(s_global.get());
current_reg++;
}
}
Index: server/with_stack_entry.h
===================================================================
RCS file: /sources/gnash/gnash/server/with_stack_entry.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- server/with_stack_entry.h 29 Oct 2006 18:34:11 -0000 1.3
+++ server/with_stack_entry.h 11 Nov 2006 22:44:54 -0000 1.4
@@ -26,7 +26,7 @@
#endif
-#include "as_object.h" // for dtor visibility by smart_ptr
+#include "as_object.h" // for dtor visibility by boost::intrusive_ptr
#include "smart_ptr.h"
namespace gnash {
@@ -40,7 +40,7 @@
{
public:
// should be private
- smart_ptr<as_object> m_object;
+ boost::intrusive_ptr<as_object> m_object;
with_stack_entry()
:
@@ -63,7 +63,7 @@
const as_object* object() const
{
- return m_object.get_ptr();
+ return m_object.get();
}
private:
Index: server/xml.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/xml.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- server/xml.cpp 29 Oct 2006 18:34:11 -0000 1.32
+++ server/xml.cpp 11 Nov 2006 22:44:54 -0000 1.33
@@ -18,7 +18,7 @@
//
//
-/* $Id: xml.cpp,v 1.32 2006/10/29 18:34:11 rsavoye Exp $ */
+/* $Id: xml.cpp,v 1.33 2006/11/11 22:44:54 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -154,7 +154,7 @@
GNASH_REPORT_FUNCTION;
// Keep m_as_environment alive during any method calls!
- // smart_ptr<as_object_interface> this_ptr(this);
+ // boost::intrusive_ptr<as_object_interface> this_ptr(this);
#if 0
// First, check for built-in event handler.
Index: server/asobj/ASSound.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/ASSound.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/asobj/ASSound.cpp 3 Nov 2006 14:03:37 -0000 1.5
+++ server/asobj/ASSound.cpp 11 Nov 2006 22:44:54 -0000 1.6
@@ -196,7 +196,7 @@
// check the import.
movie_definition* def =
fn.env->get_target()->get_root_movie()->get_movie_definition();
assert(def);
- smart_ptr<resource> res = def->get_exported_resource(so->sound.c_str());
+ boost::intrusive_ptr<resource> res =
def->get_exported_resource(so->sound.c_str());
if (res == NULL)
{
log_error("import error: resource '%s' is not exported\n",
so->sound.c_str());
Index: server/asobj/Key.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Key.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- server/asobj/Key.cpp 7 Nov 2006 17:16:19 -0000 1.3
+++ server/asobj/Key.cpp 11 Nov 2006 22:44:54 -0000 1.4
@@ -178,16 +178,16 @@
key_as_object::notify_listeners(const tu_stringi& funcname)
{
// Notify listeners.
- for (std::vector<smart_ptr<as_object> >::iterator iter =
m_listeners.begin();
+ for (std::vector<boost::intrusive_ptr<as_object> >::iterator iter =
m_listeners.begin();
iter != m_listeners.end(); ++iter) {
if (*iter == NULL)
continue;
- smart_ptr<as_object> listener = *iter; // Hold an owning reference.
+ boost::intrusive_ptr<as_object> listener = *iter; // Hold an owning
reference.
as_value method;
if (listener->get_member(funcname, &method))
- call_method(method, NULL /* or root? */, listener.get_ptr(), 0, 0);
+ call_method(method, NULL /* or root? */, listener.get(), 0, 0);
}
}
@@ -197,8 +197,8 @@
// Should we bother doing this every time someone calls add_listener(),
// or should we perhaps skip this check and use unique later?
- std::vector<smart_ptr<as_object> >::const_iterator end = m_listeners.end();
- for (std::vector<smart_ptr<as_object> >::iterator iter =
m_listeners.begin();
+ std::vector<boost::intrusive_ptr<as_object> >::const_iterator end =
m_listeners.end();
+ for (std::vector<boost::intrusive_ptr<as_object> >::iterator iter =
m_listeners.begin();
iter != end; ++iter) {
if (*iter == NULL) {
// Already in the list.
@@ -213,7 +213,7 @@
key_as_object::remove_listener(as_object* listener)
{
- for (std::vector<smart_ptr<as_object> >::iterator iter =
m_listeners.begin(); iter != m_listeners.end(); )
+ for (std::vector<boost::intrusive_ptr<as_object> >::iterator iter =
m_listeners.begin(); iter != m_listeners.end(); )
{
if (*iter == listener)
{
Index: server/asobj/Key.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Key.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/asobj/Key.h 7 Nov 2006 17:16:19 -0000 1.7
+++ server/asobj/Key.h 11 Nov 2006 22:44:54 -0000 1.8
@@ -16,7 +16,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: Key.h,v 1.7 2006/11/07 17:16:19 strk Exp $ */
+/* $Id: Key.h,v 1.8 2006/11/11 22:44:54 strk Exp $ */
#ifndef __KEY_H__
#define __KEY_H__
@@ -95,7 +95,7 @@
private:
uint8_t m_keymap[key::KEYCOUNT / 8 + 1]; // bit-array
- std::vector<smart_ptr<as_object> > m_listeners;
+ std::vector<boost::intrusive_ptr<as_object> > m_listeners;
int m_last_key_pressed;
void notify_listeners(const tu_stringi& funcname);
Index: server/asobj/MovieClipLoader.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/MovieClipLoader.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/asobj/MovieClipLoader.cpp 8 Nov 2006 08:25:28 -0000 1.9
+++ server/asobj/MovieClipLoader.cpp 11 Nov 2006 22:44:54 -0000 1.10
@@ -81,13 +81,13 @@
static as_object*
getMovieClipLoaderInterface()
{
- static smart_ptr<as_object> o;
+ static boost::intrusive_ptr<as_object> o;
if ( o == NULL )
{
o = new as_object();
attachMovieClipLoaderInterface(*o);
}
- return o.get_ptr();
+ return o.get();
}
@@ -401,7 +401,7 @@
as_object* mov_obj = new MovieClipLoader;
- fn.result->set_as_object(mov_obj); // will store in a smart_ptr
+ fn.result->set_as_object(mov_obj); // will store in a boost::intrusive_ptr
}
// Invoked every time the loading content is written to disk during
@@ -423,7 +423,7 @@
mcl_obj->set_member("bytesLoaded", mcl_data->bytes_loaded);
mcl_obj->set_member("bytesTotal", mcl_data->bytes_total);
- fn.result->set_as_object(mcl_obj); // will store in a smart_ptr
+ fn.result->set_as_object(mcl_obj); // will store in a boost::intrusive_ptr
}
static void
Index: server/asobj/Number.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Number.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/asobj/Number.cpp 9 Nov 2006 21:15:42 -0000 1.6
+++ server/asobj/Number.cpp 11 Nov 2006 22:44:54 -0000 1.7
@@ -18,7 +18,7 @@
//
//
-/* $Id: Number.cpp,v 1.6 2006/11/09 21:15:42 strk Exp $ */
+/* $Id: Number.cpp,v 1.7 2006/11/11 22:44:54 strk Exp $ */
// Implementation of ActionScript Number class.
@@ -52,13 +52,13 @@
static as_object*
getNumberInterface()
{
- static smart_ptr<as_object> o=NULL;
+ static boost::intrusive_ptr<as_object> o=NULL;
if ( o == NULL )
{
o = new as_object();
attachNumberInterface(*o);
}
- return o.get_ptr();
+ return o.get();
}
// FIXME: add some useful methods :)
@@ -113,7 +113,7 @@
void number_class_init(as_object& global)
{
// This is going to be the global Number "class"/"function"
- static smart_ptr<builtin_function> cl=NULL;
+ static boost::intrusive_ptr<builtin_function> cl=NULL;
if ( cl == NULL )
{
@@ -125,7 +125,7 @@
}
// Register _global.Number
- global.set_member("Number", cl.get_ptr());
+ global.set_member("Number", cl.get());
}
Index: server/asobj/Object.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/Object.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/asobj/Object.cpp 8 Nov 2006 08:25:28 -0000 1.7
+++ server/asobj/Object.cpp 11 Nov 2006 22:44:54 -0000 1.8
@@ -18,13 +18,13 @@
//
//
-/* $Id: Object.cpp,v 1.7 2006/11/08 08:25:28 strk Exp $ */
+/* $Id: Object.cpp,v 1.8 2006/11/11 22:44:54 strk Exp $ */
// Implementation of ActionScript Object class.
#include "tu_config.h"
#include "Object.h"
-//#include "smart_ptr.h"
+#include "smart_ptr.h"
#include "fn_call.h"
#include "as_object.h" // for inheritance
#include "builtin_function.h" // need builtin_function
@@ -51,13 +51,13 @@
static as_object*
getObjectInterface()
{
- static smart_ptr<as_object> o;
+ static boost::intrusive_ptr<as_object> o;
if ( o == NULL )
{
o = new as_object();
attachObjectInterface(*o);
}
- return o.get_ptr();
+ return o.get();
}
// FIXME: add some useful methods :)
@@ -89,7 +89,7 @@
return;
}
- smart_ptr<as_object> new_obj;
+ boost::intrusive_ptr<as_object> new_obj;
if ( fn.nargs == 0 )
{
new_obj = new object_as_object();
@@ -100,7 +100,7 @@
new_obj = new object_as_object();
}
- fn.result->set_as_object(new_obj.get_ptr()); // will keep alive
+ fn.result->set_as_object(new_obj.get()); // will keep alive
}
std::auto_ptr<as_object>
@@ -114,7 +114,7 @@
void object_class_init(as_object& global)
{
// This is going to be the global Object "class"/"function"
- static smart_ptr<builtin_function> cl=NULL;
+ static boost::intrusive_ptr<builtin_function> cl=NULL;
if ( cl == NULL )
{
@@ -126,7 +126,7 @@
}
// Register _global.Object
- global.set_member("Object", cl.get_ptr());
+ global.set_member("Object", cl.get());
}
Index: server/asobj/System.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/System.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- server/asobj/System.cpp 8 Nov 2006 08:25:28 -0000 1.4
+++ server/asobj/System.cpp 11 Nov 2006 22:44:54 -0000 1.5
@@ -69,7 +69,7 @@
static as_object*
getSystemSecurityInterface()
{
- static smart_ptr<as_object> proto;
+ static boost::intrusive_ptr<as_object> proto;
if ( proto == NULL )
{
proto = new as_object();
@@ -77,19 +77,19 @@
proto->set_member("allowinsecuredomain",
&system_security_allowinsecuredomain);
proto->set_member("loadpolicyfile",
&system_security_loadpolicyfile);
}
- return proto.get_ptr();
+ return proto.get();
}
static as_object*
getSystemCapabilitiesInterface()
{
- static smart_ptr<as_object> proto;
+ static boost::intrusive_ptr<as_object> proto;
if ( proto == NULL )
{
proto = new as_object();
proto->set_member("version", "Gnash-" VERSION);
}
- return proto.get_ptr();
+ return proto.get();
}
static void
@@ -105,7 +105,7 @@
static as_object*
getSystemInterface()
{
- static smart_ptr<as_object> proto;
+ static boost::intrusive_ptr<as_object> proto;
if ( proto == NULL )
{
proto = new as_object();
@@ -113,7 +113,7 @@
proto->set_member("constructor", &system_new);
proto->set_member_flags("constructor", 1);
}
- return proto.get_ptr();
+ return proto.get();
}
system_as_object::system_as_object()
@@ -164,7 +164,7 @@
system_init(as_object* glob)
{
// This is going to be the global System "class"/"function"
- static smart_ptr<as_function> sys;
+ static boost::intrusive_ptr<as_function> sys;
if ( sys == NULL )
{
@@ -175,7 +175,7 @@
}
// Register _global.System
- glob->set_member("System", sys.get_ptr());
+ glob->set_member("System", sys.get());
}
Index: server/asobj/string.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/string.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/asobj/string.cpp 8 Nov 2006 08:25:28 -0000 1.5
+++ server/asobj/string.cpp 11 Nov 2006 22:44:54 -0000 1.6
@@ -18,7 +18,7 @@
//
//
-/* $Id: string.cpp,v 1.5 2006/11/08 08:25:28 strk Exp $ */
+/* $Id: string.cpp,v 1.6 2006/11/11 22:44:54 strk Exp $ */
// Implementation of ActionScript String class.
@@ -66,13 +66,13 @@
static as_object*
getStringInterface()
{
- static smart_ptr<as_object> o;
+ static boost::intrusive_ptr<as_object> o;
if ( o == NULL )
{
o = new as_object();
attachStringInterface(*o);
}
- return o.get_ptr();
+ return o.get();
}
class tu_string_as_object : public as_object
@@ -264,7 +264,7 @@
static void
string_ctor(const fn_call& fn)
{
- smart_ptr<tu_string_as_object> str = new tu_string_as_object;
+ boost::intrusive_ptr<tu_string_as_object> str = new tu_string_as_object;
if (fn.nargs > 0)
{
@@ -274,14 +274,14 @@
// this shouldn't be needed
//attachStringInterface(*str);
- fn.result->set_as_object(str.get_ptr());
+ fn.result->set_as_object(str.get());
}
// extern (used by Global.cpp)
void string_class_init(as_object& global)
{
// This is going to be the global String "class"/"function"
- static smart_ptr<builtin_function> cl;
+ static boost::intrusive_ptr<builtin_function> cl;
if ( cl == NULL )
{
@@ -293,7 +293,7 @@
}
// Register _global.String
- global.set_member("String", cl.get_ptr());
+ global.set_member("String", cl.get());
}
Index: server/parser/bitmap_character_def.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/bitmap_character_def.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- server/parser/bitmap_character_def.h 29 Oct 2006 18:34:15 -0000
1.10
+++ server/parser/bitmap_character_def.h 11 Nov 2006 22:44:54 -0000
1.11
@@ -80,12 +80,12 @@
bitmap_character_def(std::auto_ptr<image::rgba> image);
gnash::bitmap_info* get_bitmap_info() {
- return _bitmap_info.get_ptr();
+ return _bitmap_info.get();
}
private:
- smart_ptr<gnash::bitmap_info> _bitmap_info;
+ boost::intrusive_ptr<gnash::bitmap_info> _bitmap_info;
};
Index: server/parser/button_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/button_character_def.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- server/parser/button_character_def.cpp 4 Nov 2006 14:29:31 -0000
1.7
+++ server/parser/button_character_def.cpp 11 Nov 2006 22:44:54 -0000
1.8
@@ -104,9 +104,9 @@
button_character_definition::button_character_definition()
:
- m_sound(NULL),
m_min_layer(0),
- m_max_layer(0)
+ m_max_layer(0),
+ m_sound(NULL)
// Constructor.
{
Index: server/parser/character_def.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/character_def.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- server/parser/character_def.h 29 Oct 2006 18:34:15 -0000 1.8
+++ server/parser/character_def.h 11 Nov 2006 22:44:54 -0000 1.9
@@ -81,7 +81,7 @@
return 0.0f;
}
- /// Should stick the result in a smart_ptr immediately.
+ /// Should stick the result in a boost::intrusive_ptr immediately.
//
/// default is to make a generic_character
///
Index: server/parser/movie_def_impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- server/parser/movie_def_impl.cpp 8 Nov 2006 02:14:27 -0000 1.34
+++ server/parser/movie_def_impl.cpp 11 Nov 2006 22:44:54 -0000 1.35
@@ -357,7 +357,7 @@
if (inf.m_source_url == source_url)
{
// Do the import.
- smart_ptr<resource> res =
def->get_exported_resource(inf.m_symbol);
+ boost::intrusive_ptr<resource> res =
def->get_exported_resource(inf.m_symbol);
bool imported = true;
if (res == NULL)
@@ -412,9 +412,9 @@
}
#endif // not NDEBUG
- smart_ptr<character_def> ch = _dictionary.get_character(character_id);
+ boost::intrusive_ptr<character_def> ch =
_dictionary.get_character(character_id);
assert(ch == NULL || ch->get_ref_count() > 1);
- return ch.get_ptr(); // mm... why don't we return the smart_ptr?
+ return ch.get(); // mm... why don't we return the boost::intrusive_ptr?
}
void movie_def_impl::add_font(int font_id, font* f)
@@ -434,18 +434,18 @@
}
#endif // not NDEBUG
- smart_ptr<font> f;
+ boost::intrusive_ptr<font> f;
m_fonts.get(font_id, &f);
assert(f == NULL || f->get_ref_count() > 1);
- return f.get_ptr();
+ return f.get();
}
bitmap_character_def* movie_def_impl::get_bitmap_character_def(int
character_id)
{
- smart_ptr<bitmap_character_def> ch;
+ boost::intrusive_ptr<bitmap_character_def> ch;
m_bitmap_characters.get(character_id, &ch);
assert(ch == NULL || ch->get_ref_count() > 1);
- return ch.get_ptr();
+ return ch.get();
}
void
@@ -463,10 +463,10 @@
sound_sample* movie_def_impl::get_sound_sample(int character_id)
{
- smart_ptr<sound_sample> ch;
+ boost::intrusive_ptr<sound_sample> ch;
m_sound_samples.get(character_id, &ch);
assert(ch == NULL || ch->get_ref_count() > 1);
- return ch.get_ptr();
+ return ch.get();
}
void movie_def_impl::add_sound_sample(int character_id, sound_sample* sam)
@@ -622,11 +622,11 @@
std::vector<int> font_ids;
- for (hash<int, smart_ptr<font> >::iterator it = m_fonts.begin();
+ for (hash<int, boost::intrusive_ptr<font> >::iterator it = m_fonts.begin();
it != m_fonts.end();
++it)
{
- font* f = it->second.get_ptr();
+ font* f = it->second.get();
if (f->get_owning_movie() == this)
{
// Sort by character id, so the ordering is
@@ -689,7 +689,7 @@
}
#if 0
- for (hash<int, smart_ptr<character_def> >::iterator it =
m_characters.begin();
+ for (hash<int, boost::intrusive_ptr<character_def> >::iterator it =
m_characters.begin();
it != m_characters.end();
++it)
{
@@ -744,7 +744,7 @@
int16_t id = in->read_le16();
if (id == (int16_t) -1) { break; } // done
- smart_ptr<character_def> ch = _dictionary.get_character(id);
+ boost::intrusive_ptr<character_def> ch =
_dictionary.get_character(id);
//m_characters.get(id, &ch);
if (ch != NULL)
{
@@ -797,12 +797,12 @@
for ( const_iterator it=begin(), endIt=end();
it != endIt; ++it )
{
- log_msg("Character %d @ %p", it->first,
static_cast<void*>(it->second.get_ptr()));
+ log_msg("Character %d @ %p", it->first,
static_cast<void*>(it->second.get()));
//character_def* cdef = it->second;
}
}
-smart_ptr<character_def>
+boost::intrusive_ptr<character_def>
CharacterDictionary::get_character(int id)
{
container::iterator it = _map.find(id);
@@ -812,13 +812,13 @@
log_parse("Could not find char %d, dump is:", id);
dump_chars();
);
- return smart_ptr<character_def>();
+ return boost::intrusive_ptr<character_def>();
}
else return it->second;
}
void
-CharacterDictionary::add_character(int id, smart_ptr<character_def> c)
+CharacterDictionary::add_character(int id, boost::intrusive_ptr<character_def>
c)
{
//log_msg("CharacterDictionary: add char %d", id);
_map[id] = c;
Index: server/parser/movie_def_impl.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- server/parser/movie_def_impl.h 3 Nov 2006 14:03:37 -0000 1.15
+++ server/parser/movie_def_impl.h 11 Nov 2006 22:44:54 -0000 1.16
@@ -29,9 +29,9 @@
#include "jpeg.h"
#include "tu_file.h"
#include "movie_definition.h" // for inheritance
-#include "character_def.h" // for smart_ptr visibility of dtor
-#include "bitmap_character_def.h" // for smart_ptr visibility of dtor
-#include "resource.h" // for smart_ptr visibility of dtor
+#include "character_def.h" // for boost::intrusive_ptr visibility of dtor
+#include "bitmap_character_def.h" // for boost::intrusive_ptr visibility of
dtor
+#include "resource.h" // for boost::intrusive_ptr visibility of dtor
#include "stream.h" // for get_bytes_loaded
#include <map> // for CharacterDictionary
@@ -133,10 +133,10 @@
/// The container used by this dictionary
//
- /// It contains pairs of 'int' and 'smart_ptr<character_def>'
+ /// It contains pairs of 'int' and 'boost::intrusive_ptr<character_def>'
///
- typedef std::map< int, smart_ptr<character_def> > container;
- //typedef hash< int, smart_ptr<character_def> >container;
+ typedef std::map< int, boost::intrusive_ptr<character_def> > container;
+ //typedef hash< int, boost::intrusive_ptr<character_def> >container;
typedef container::iterator iterator;
@@ -146,13 +146,13 @@
//
/// returns a NULL if the id is unknown.
///
- smart_ptr<character_def> get_character(int id);
+ boost::intrusive_ptr<character_def> get_character(int id);
/// Add a Character assigning it the given id
//
/// replaces any existing character with the same id
///
- void add_character(int id, smart_ptr<character_def> c);
+ void add_character(int id, boost::intrusive_ptr<character_def> c);
/// Return an iterator to the first dictionary element
iterator begin() { return _map.begin(); }
@@ -186,15 +186,15 @@
private:
/// Characters Dictionary
CharacterDictionary _dictionary;
- //hash<int, smart_ptr<character_def> > m_characters;
+ //hash<int, boost::intrusive_ptr<character_def> >
m_characters;
/// Tags loader table
SWF::TagLoadersTable& _tag_loaders;
- hash<int, smart_ptr<font> > m_fonts;
- hash<int, smart_ptr<bitmap_character_def> > m_bitmap_characters;
- hash<int, smart_ptr<sound_sample> > m_sound_samples;
- hash<int, smart_ptr<sound_sample> > m_sound_streams;
+ hash<int, boost::intrusive_ptr<font> > m_fonts;
+ hash<int, boost::intrusive_ptr<bitmap_character_def> >
m_bitmap_characters;
+ hash<int, boost::intrusive_ptr<sound_sample> > m_sound_samples;
+ hash<int, boost::intrusive_ptr<sound_sample> > m_sound_streams;
/// A list of movie control events for each frame.
std::vector<std::vector<execute_tag*> > m_playlist;
@@ -205,18 +205,18 @@
/// 0-based frame #'s
stringi_hash<size_t> m_named_frames;
- stringi_hash<smart_ptr<resource> > m_exports;
+ stringi_hash<boost::intrusive_ptr<resource> > m_exports;
/// Items we import.
std::vector<import_info> m_imports;
/// Movies we import from; hold a ref on these,
/// to keep them alive
- std::vector<smart_ptr<movie_definition> > m_import_source_movies;
+ std::vector<boost::intrusive_ptr<movie_definition> >
m_import_source_movies;
/// Bitmaps used in this movie; collected in one place to make
/// it possible for the host to manage them as textures.
- std::vector<smart_ptr<bitmap_info> > m_bitmap_list;
+ std::vector<boost::intrusive_ptr<bitmap_info> > m_bitmap_list;
create_bitmaps_flag m_create_bitmaps;
create_font_shapes_flag m_create_font_shapes;
@@ -318,7 +318,7 @@
virtual bitmap_info* get_bitmap_info(int i) const
{
- return m_bitmap_list[i].get_ptr();
+ return m_bitmap_list[i].get();
}
/// Expose one of our resources under the given symbol,
@@ -332,9 +332,9 @@
/// Get the named exported resource, if we expose it.
/// Otherwise return NULL.
- virtual smart_ptr<resource> get_exported_resource(const tu_string&
symbol)
+ virtual boost::intrusive_ptr<resource> get_exported_resource(const
tu_string& symbol)
{
- smart_ptr<resource> res;
+ boost::intrusive_ptr<resource> res;
m_exports.get(symbol, &res);
return res;
}
@@ -367,8 +367,8 @@
/// \brief
/// Return a character from the dictionary
- /// NOTE: call add_ref() on the return or put in a smart_ptr<>
- /// TODO: return a smart_ptr<> directly...
+ /// NOTE: call add_ref() on the return or put in a
boost::intrusive_ptr<>
+ /// TODO: return a boost::intrusive_ptr<> directly...
///
character_def* get_character_def(int character_id);
Index: server/parser/movie_definition.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_definition.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/parser/movie_definition.h 29 Oct 2006 18:34:16 -0000 1.6
+++ server/parser/movie_definition.h 11 Nov 2006 22:44:54 -0000 1.7
@@ -80,7 +80,7 @@
//
/// This calls add_ref() on the movie_interface internally.
/// Call drop_ref() on the movie_interface when you're done with it.
- /// Or use smart_ptr<T> from base/smart_ptr.h if you want.
+ /// Or use boost::intrusive_ptr<T> from base/smart_ptr.h if you want.
///
virtual movie_interface* create_instance() = 0;
@@ -163,7 +163,7 @@
virtual const std::vector<execute_tag*>& get_playlist(size_t
frame_number) = 0;
virtual const std::vector<execute_tag*>* get_init_actions(size_t
frame_number) = 0;
- virtual smart_ptr<resource> get_exported_resource(const tu_string&
symbol) = 0;
+ virtual boost::intrusive_ptr<resource> get_exported_resource(const
tu_string& symbol) = 0;
/// \brief
Index: server/parser/sprite_definition.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/sprite_definition.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- server/parser/sprite_definition.h 6 Nov 2006 13:24:37 -0000 1.8
+++ server/parser/sprite_definition.h 11 Nov 2006 22:44:54 -0000 1.9
@@ -218,7 +218,7 @@
log_error("can't export from sprite! Malformed SWF?");
}
- virtual smart_ptr<resource> get_exported_resource(const tu_string& sym)
+ virtual boost::intrusive_ptr<resource> get_exported_resource(const
tu_string& sym)
{
return m_movie_def ?
m_movie_def->get_exported_resource(sym)
Index: server/swf/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/ASHandlers.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -b -r1.92 -r1.93
--- server/swf/ASHandlers.cpp 11 Nov 2006 15:25:27 -0000 1.92
+++ server/swf/ASHandlers.cpp 11 Nov 2006 22:44:54 -0000 1.93
@@ -16,7 +16,7 @@
//
-/* $Id: ASHandlers.cpp,v 1.92 2006/11/11 15:25:27 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.93 2006/11/11 22:44:54 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -143,13 +143,13 @@
);
// Create an empty object, with a ref to the constructor's
prototype.
- smart_ptr<as_object> new_obj_ptr(new as_object(proto.to_object()));
+ boost::intrusive_ptr<as_object> new_obj_ptr(new
as_object(proto.to_object()));
- new_obj.set_as_object(new_obj_ptr.get_ptr());
+ new_obj.set_as_object(new_obj_ptr.get());
// Call the actual constructor function; new_obj is its 'this'.
// We don't need the function result.
- call_method(constructor, &env, new_obj_ptr.get_ptr(), nargs,
first_arg_index);
+ call_method(constructor, &env, new_obj_ptr.get(), nargs,
first_arg_index);
}
}
// Vitaly: no actionscript operation should lead to crash player,
including "x=new MyClass();".
@@ -2192,7 +2192,7 @@
ensure_stack(env, nmembers); // members
- smart_ptr<as_object> new_obj_ptr(init_object_instance().release());
+ boost::intrusive_ptr<as_object>
new_obj_ptr(init_object_instance().release());
// Set provided members
for (int i=0; i<nmembers; ++i) {
@@ -2205,7 +2205,7 @@
//log_error("checkme opcode: %02X", action_id);
as_value new_obj;
- new_obj.set_as_object(new_obj_ptr.get_ptr());
+ new_obj.set_as_object(new_obj_ptr.get());
//env.drop(nmembers*2);
env.push(new_obj);
Index: server/swf/tag_loaders.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/tag_loaders.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- server/swf/tag_loaders.cpp 29 Oct 2006 18:34:16 -0000 1.55
+++ server/swf/tag_loaders.cpp 11 Nov 2006 22:44:54 -0000 1.56
@@ -18,7 +18,7 @@
//
//
-/* $Id: tag_loaders.cpp,v 1.55 2006/10/29 18:34:16 rsavoye Exp $ */
+/* $Id: tag_loaders.cpp,v 1.56 2006/11/11 22:44:54 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1414,7 +1414,7 @@
// s_no_recurse_while_loading, change
// create_movie().
- smart_ptr<resource> res =
source_movie->get_exported_resource(symbol_name);
+ boost::intrusive_ptr<resource> res =
source_movie->get_exported_resource(symbol_name);
if (res == NULL)
{
log_error("import error: resource '%s' is not
exported from movie '%s'\n",
Index: testsuite/libbase/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/libbase/Makefile.am,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- testsuite/libbase/Makefile.am 11 Nov 2006 00:14:32 -0000 1.22
+++ testsuite/libbase/Makefile.am 11 Nov 2006 22:44:54 -0000 1.23
@@ -41,7 +41,6 @@
CurlStreamTest \
NoSeekFileTest \
URLTest \
- smart_ptrTest \
RcTest
CLEANFILES = \
@@ -66,9 +65,6 @@
URLTest_SOURCES = URLTest.cpp
URLTest_CPPFLAGS = '-DBUILDDIR="$(abs_builddir)"'
-smart_ptrTest_SOURCES = smart_ptrTest.cpp
-smart_ptrTest_CPPFLAGS = '-DBUILDDIR="$(abs_builddir)"'
-
RcTest_SOURCES = TCXXRc.cpp
RcTest_CPPFLAGS = -DSRCDIR="$(srcdir)"
Index: server/asobj/gen-asclass.sh
===================================================================
RCS file: server/asobj/gen-asclass.sh
diff -N server/asobj/gen-asclass.sh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/asobj/gen-asclass.sh 11 Nov 2006 22:44:54 -0000 1.1
@@ -0,0 +1,244 @@
+#!/bin/sh
+
+#
+# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+# This script generates header file and C++ source file templates
+# for an ActionScript class. It depends on the doc/C/NOTES file for
+# data. It takes a single argument, which is the name of the class,
+# like "./gen-files.sh Camera".
+#
+# This script is only of use to developers, so it's "as is". Your
+# mileage may vary.
+
+if test x"$1" = "x"; then
+ echo "Usage: $0 <classname>" >&2
+ exit 1
+fi
+
+asname=$1
+lowname=`echo ${asname} | tr '[A-Z]' '[a-z]'`
+upname=`echo ${asname} | tr '[a-z]' '[A-Z]'`
+outname=${asname}.h
+srcname=${asname}.cpp
+
+if test -f ${outname}; then
+ echo ${outname} exists!
+ exit 1;
+fi
+
+if test -f ${srcname}; then
+ echo ${srcname} exists!
+ exit 1;
+fi
+
+notes=../../doc/C/NOTES
+#methods=`grep "${asname}\..*()" ${notes} | sed -e 's/${asname}\.//g'`
+methods=`grep "${asname}\\\\..*()" ${notes}`
+#methods=`echo ${methods} | sed -e s/${asname}.//g`
+methods=`echo ${methods} | sed -e s/${asname}\\\\.//g`
+#props=`grep "${asname}\." ${notes} | grep -v "()" | sed -e 's/${asname}\.//g'`
+props=`grep "${asname}\\\\." ${notes} | grep -v "()"`
+#props=`echo ${props} | sed -e s/${asname}.//g`
+props=`echo ${props} | sed -e s/${asname}\\\\.//g`
+
+#echo $methods
+#echo $props
+
+###############################################################
+# Start by generating the header file for this class
+#
+rm -f ${outname}
+cat <<EOF>>${outname}
+//
+// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#ifndef __GNASH_ASOBJ_${upname}_H__
+#define __GNASH_ASOBJ_${upname}_H__
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <memory> // for auto_ptr
+
+namespace gnash {
+
+class as_object;
+
+/// Initialize the global Number class
+void ${lowname}_class_init(as_object& global);
+
+/// Return a ${asname} instance (in case the core lib needs it)
+//std::auto_ptr<as_object> init_${lowname}_instance();
+
+} // end of gnash namespace
+
+// __GNASH_ASOBJ_${upname}_H__
+#endif
+
+EOF
+
+##############################################################
+# now generate the source file
+#
+
+# start with the header part
+cat <<EOF>>${srcname}
+//
+// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "${asname}.h"
+#include "as_object.h" // for inheritance
+#include "log.h"
+#include "fn_call.h"
+#include "smart_ptr.h" // for boost intrusive_ptr
+#include "builtin_function.h" // need builtin_function
+
+namespace gnash {
+
+EOF
+for i in $methods; do
+newi=`echo $i | sed -e 's/)//g' | tr '[A-Z]' '[a-z]'`
+cat <<EOF>>${srcname}
+void ${lowname}_${newi}const fn_call& fn);
+EOF
+done
+cat <<EOF>>${srcname}
+void ${lowname}_ctor(const fn_call& fn);
+
+static void
+attach${asname}Interface(as_object& o)
+{
+EOF
+# now process the methods
+#newi=`echo $i | sed -e 's/)//g'`
+for i in $methods; do
+ newi=`echo $i | sed -e 's/()//g' | tr '[A-Z]' '[a-z]'`
+ cat <<EOF>>${srcname}
+ o.set_member("${newi}", &${lowname}_${newi});
+EOF
+done
+cat <<EOF>>${srcname}
+}
+
+static as_object*
+get${asname}Interface()
+{
+ static boost::intrusive_ptr<as_object> o;
+ if ( ! o )
+ {
+ o = new as_object();
+ attachNumberInterface(*o);
+ }
+ return o.get();
+}
+
+class ${lowname}_as_object: public as_object
+{
+
+public:
+
+ // override from as_object ?
+ //const char* get_text_value() const { return "${asname}"; }
+
+ // override from as_object ?
+ //double get_numeric_value() const { return 0; }
+};
+
+EOF
+
+for i in $methods; do
+newi=`echo $i | sed -e 's/)//g' | tr '[A-Z]' '[a-z]'`
+cat <<EOF>>${srcname}
+void ${lowname}_${newi}const fn_call& /*fn*/) {
+ log_msg("%s:unimplemented \n", __FUNCTION__);
+}
+EOF
+done
+
+cat <<EOF>>${srcname}
+
+void
+${lowname}_ctor(const fn_call& fn)
+{
+ boost::intrusive_ptr<as_object> obj = new ${lowname}_as_object;
+
+ fn.result->set_as_object(obj.get()); // will keep alive
+}
+
+// extern (used by Global.cpp)
+void ${lowname}_class_init(as_object& global)
+{
+ // This is going to be the global Number "class"/"function"
+ static boost::intrusive_ptr<builtin_function> cl;
+
+ if ( cl == NULL )
+ {
+ cl=new builtin_function(&${lowname}_ctor,
get${asname}Interface());
+ // replicate all interface to class, to be able to access
+ // all methods as static functions
+ attach${asname}Interface(*cl);
+
+ }
+
+ // Register _global.${asname}
+ global.set_member("${asname}", cl.get());
+
+}
+
+
+} // end of gnash namespace
+
+EOF
+
+
Index: testsuite/libbase/smart_ptrTest.cpp
===================================================================
RCS file: testsuite/libbase/smart_ptrTest.cpp
diff -N testsuite/libbase/smart_ptrTest.cpp
--- testsuite/libbase/smart_ptrTest.cpp 8 Nov 2006 10:03:56 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,74 +0,0 @@
-//
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "check.h"
-#include "smart_ptr.h"
-#include "ref_counted.h"
-
-#include <iostream>
-#include <sstream>
-#include <cassert>
-
-using namespace std;
-using namespace gnash;
-
-int
-main(int /*argc*/, char** /*argv*/)
-{
- // Can a smart_ptr be allocated on stack ?
- static smart_ptr<ref_counted> static_ptr;
-
- ref_counted* obj = new ref_counted();
- check_equals(obj->get_ref_count(), 0);
-
- smart_ptr<ref_counted> ptr1(obj);
- check_equals(obj->get_ref_count(), 1);
-
- smart_ptr<ref_counted> ptr2(obj);
- check_equals(obj->get_ref_count(), 2);
-
- smart_ptr<ref_counted> ptr3(ptr1);
- check_equals(obj->get_ref_count(), 3);
-
- smart_ptr<ref_counted> ptr4(ptr2.get_ptr());
- check_equals(obj->get_ref_count(), 4);
-
- ptr1 = ptr3;
- check_equals(obj->get_ref_count(), 4);
-
- ptr1 = ptr3.get_ptr();
- check_equals(obj->get_ref_count(), 4);
-
- smart_ptr<ref_counted> ptr5;
- ptr5 = ptr3;
- check_equals(obj->get_ref_count(), 5);
-
- {
- smart_ptr<ref_counted> ptr6(obj);
- check_equals(obj->get_ref_count(), 6);
- smart_ptr<ref_counted> ptr7(ptr6);
- check_equals(obj->get_ref_count(), 7);
- smart_ptr<ref_counted> ptr8(ptr7);
- check_equals(obj->get_ref_count(), 8);
- }
-
- check_equals(obj->get_ref_count(), 5);
-}
-
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog backend/render_handler_tri.cpp ...,
Sandro Santilli <=