[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnash-commit
Subject:    [Gnash-commit] /srv/bzr/gnash/avm2 r9535: Add MovieClip calss.
From:       Tom Stellard <tstellar () gmail ! com>
Date:       2008-08-30 12:13:17
Message-ID: E1KZeBR-0005Eg-Vn () sv ! gnu ! org
[Download RAW message or body]

------------------------------------------------------------
revno: 9535
committer: Tom Stellard <tstellar@gmail.com>
branch nick: gnash_dev
timestamp: Sat 2008-08-30 20:13:17 +0800
message:
  Add MovieClip calss.
added:
  libcore/asobj/flash/display/MovieClip_as.cpp
  libcore/asobj/flash/display/MovieClip_as.h
modified:
  libcore/asobj/Makefile.am
  libcore/asobj/flash/display_pkg.cpp

["r9535.diff" (r9535.diff)]

=== modified file 'libcore/asobj/Makefile.am'
--- a/libcore/asobj/Makefile.am	2008-08-27 05:27:40 +0000
+++ b/libcore/asobj/Makefile.am	2008-08-30 12:13:17 +0000
@@ -83,6 +83,7 @@
 	xmlnode.cpp \
 	xmlsocket.cpp \
 	flash/display/BitmapData_as.cpp \
+	flash/display/MovieClip_as.cpp \
 	flash/display_pkg.cpp \
 	flash/external/ExternalInterface_as.cpp \
 	flash/external_pkg.cpp \
@@ -161,6 +162,7 @@
 	xmlattrs.h \
 	xmlnode.h \
 	flash/display/BitmapData_as.h \
+	flash/display/MovieClip_as.h \
 	flash/display_pkg.h \
 	flash/external/ExternalInterface_as.h \
 	flash/external_pkg.h \

=== added file 'libcore/asobj/flash/display/MovieClip_as.cpp'
--- a/libcore/asobj/flash/display/MovieClip_as.cpp	1970-01-01 00:00:00 +0000
+++ b/libcore/asobj/flash/display/MovieClip_as.cpp	2008-08-30 12:13:17 +0000
@@ -0,0 +1,82 @@
+// EventDispatcher.cpp:  Implementation of ActionScript MovieClip class, for Gnash.
+// 
+//   Copyright (C) 2005, 2006, 2007, 2008 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 3 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
+//
+
+#include "smart_ptr.h"
+#include "fn_call.h"
+#include "as_object.h" // for inheritance
+#include "builtin_function.h" // need builtin_function
+#include "Sprite_as.h"
+
+#include "log.h"
+
+#include <string>
+#include <sstream>
+
+namespace gnash {
+class movie_clip_as_object : public as_object
+{
+
+public:
+
+	movie_clip_as_object()
+		:
+		as_object()
+	{
+	}
+
+};
+
+static as_value
+movie_clip_ctor(const fn_call& fn)
+{
+	boost::intrusive_ptr<as_object> obj = new movie_clip_as_object();
+	
+	return as_value(obj.get()); // will keep alive
+}
+
+as_object*
+getMovieClipInterface()
+{
+	static boost::intrusive_ptr<as_object> o;
+	if ( ! o )
+	{
+		o = new as_object(getSpriteAsInterface());
+	}
+	return o.get();
+}
+
+// extern
+void movie_clip_class_init(as_object& global)
+{
+    static boost::intrusive_ptr<builtin_function> cl;
+
+	cl=new builtin_function(&movie_clip_ctor, getMovieClipInterface());
+	// Register _global.MovieClip
+	global.init_member("MovieClip", cl.get());
+
+}
+
+std::auto_ptr<as_object>
+init_movie_clip_instance()
+{
+	return std::auto_ptr<as_object>(new movie_clip_as_object);
+}
+
+
+}

=== added file 'libcore/asobj/flash/display/MovieClip_as.h'
--- a/libcore/asobj/flash/display/MovieClip_as.h	1970-01-01 00:00:00 +0000
+++ b/libcore/asobj/flash/display/MovieClip_as.h	2008-08-30 12:13:17 +0000
@@ -0,0 +1,44 @@
+// 
+//   Copyright (C) 2005, 2006, 2007, 2008 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 3 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
+
+// 
+//
+//
+
+// Implementation for ActionScript MovieClip object.
+
+#ifndef GNASH_MOVIECLIP_AS_H
+#define GNASH_MOVIECLIP_AS_H
+
+#include <memory> // for auto_ptr
+
+namespace gnash {
+
+class as_object;
+
+/// Initialize the MovieClip class
+void movie_clip_class_init(as_object& global);
+
+/// Return a MovieClip instance
+std::auto_ptr<as_object> init_movie_clip_instance();
+
+as_object* getMovieClipInterface();
+
+
+}
+
+#endif // GNASH_MOVIECLIP_AS_H

=== modified file 'libcore/asobj/flash/display_pkg.cpp'
--- a/libcore/asobj/flash/display_pkg.cpp	2008-08-30 12:10:15 +0000
+++ b/libcore/asobj/flash/display_pkg.cpp	2008-08-30 12:13:17 +0000
@@ -25,6 +25,7 @@
 
 #include "flash/display/BitmapData_as.h"
 #include "Stage.h"
+#include "flash/display/MovieClip_as.h"
 
 namespace gnash {
 
@@ -37,6 +38,7 @@
 
 	BitmapData_class_init(*pkg);
 	stage_class_init(*pkg);
+	movie_clip_class_init(*pkg);
 
 	return pkg;
 }



_______________________________________________
Gnash-commit mailing list
Gnash-commit@gnu.org
http://lists.gnu.org/mailman/listinfo/gnash-commit


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic