[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/Makefile.am server/impl....
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/Makefile.am server/impl.... |
Date: |
Tue, 13 Feb 2007 13:35:34 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/02/13 13:35:34
Modified files:
. : ChangeLog
server : Makefile.am impl.cpp
server/parser : Makefile.am
testsuite/misc-ming.all: loadMovieTestRunner.cpp
Added files:
server : BitmapMovieInstance.cpp BitmapMovieInstance.h
server/parser : BitmapMovieDefinition.h
Log message:
* server/parser/: Makefile.am, BitmapMovieDefinition.h:
Class used to return a movie_definition from load of a JPEG.
* server/: Makefile.am, BitmapMovieInstance.{cpp,h}:
Instance of a BitmapMovieDefinition (a movie_instance).
* server/impl.cpp: move the unimplemented stuff over
to the new BitmapMovie classes.
* testsuite/misc-ming.all/loadMovieTestRunner.cpp:
Don't expect a failure in loading the external JPEG
(it loads, just doesn't display).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2340&r2=1.2341
http://cvs.savannah.gnu.org/viewcvs/gnash/server/Makefile.am?cvsroot=gnash&r1=1.101&r2=1.102
http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.cpp?cvsroot=gnash&r1=1.90&r2=1.91
http://cvs.savannah.gnu.org/viewcvs/gnash/server/BitmapMovieInstance.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/BitmapMovieInstance.h?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/Makefile.am?cvsroot=gnash&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/BitmapMovieDefinition.h?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/loadMovieTestRunner.cpp?cvsroot=gnash&r1=1.2&r2=1.3
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2340
retrieving revision 1.2341
diff -u -b -r1.2340 -r1.2341
--- ChangeLog 13 Feb 2007 11:19:10 -0000 1.2340
+++ ChangeLog 13 Feb 2007 13:35:33 -0000 1.2341
@@ -1,5 +1,17 @@
2007-02-13 Sandro Santilli <address@hidden>
+ * server/parser/: Makefile.am, BitmapMovieDefinition.h:
+ Class used to return a movie_definition from load of a JPEG.
+ * server/: Makefile.am, BitmapMovieInstance.{cpp,h}:
+ Instance of a BitmapMovieDefinition (a movie_instance).
+ * server/impl.cpp: move the unimplemented stuff over
+ to the new BitmapMovie classes.
+ * testsuite/misc-ming.all/loadMovieTestRunner.cpp:
+ Don't expect a failure in loading the external JPEG
+ (it loads, just doesn't display).
+
+2007-02-13 Sandro Santilli <address@hidden>
+
* testsuite/misc-mtasc.all/.cvsignore: new file.
* testsuite/misc-ming.all/consecutive_goto_frame_test.c:
expect the current failures, just to allow 'make check'
Index: server/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/server/Makefile.am,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -b -r1.101 -r1.102
--- server/Makefile.am 11 Feb 2007 06:21:29 -0000 1.101
+++ server/Makefile.am 13 Feb 2007 13:35:34 -0000 1.102
@@ -18,7 +18,7 @@
#
#
-# $Id: Makefile.am,v 1.101 2007/02/11 06:21:29 rsavoye Exp $
+# $Id: Makefile.am,v 1.102 2007/02/13 13:35:34 strk Exp $
AUTOMAKE_OPTIONS =
@@ -48,6 +48,7 @@
$(NULL)
libgnashserver_la_SOURCES = \
+ BitmapMovieInstance.cpp \
GetterSetter.cpp \
PropertyList.cpp \
URLAccessManager.cpp \
@@ -102,6 +103,7 @@
as_prop_flags.h \
as_value.h \
bitmap_info.h \
+ BitmapMovieInstance.h \
builtin_function.h \
button_character_instance.h \
character.h \
Index: server/impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/impl.cpp,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -b -r1.90 -r1.91
--- server/impl.cpp 11 Feb 2007 12:47:03 -0000 1.90
+++ server/impl.cpp 13 Feb 2007 13:35:34 -0000 1.91
@@ -14,7 +14,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: impl.cpp,v 1.90 2007/02/11 12:47:03 strk Exp $ */
+/* $Id: impl.cpp,v 1.91 2007/02/13 13:35:34 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -51,6 +51,7 @@
#include "StreamProvider.h"
#include "sprite_instance.h"
#include "VM.h"
+#include "BitmapMovieDefinition.h"
#include <string>
#include <map>
@@ -319,23 +320,28 @@
// Create a movie_definition from a jpeg stream
// NOTE: this method assumes this *is* a jpeg stream
static movie_definition*
-create_jpeg_movie(std::auto_ptr<tu_file> in, const std::string& /*url*/)
+create_jpeg_movie(std::auto_ptr<tu_file> in, const std::string& url)
{
// FIXME: temporarly disabled
- log_msg("Loading of jpegs unsupported");
- return NULL;
+ //log_msg("Loading of jpegs unsupported");
+ //return NULL;
+
+ std::auto_ptr<image::rgb> im ( image::read_jpeg(in.get()) );
- bitmap_info* bi = NULL;
- image::rgb* im = image::read_jpeg(in.get());
- if (im != NULL) {
- bi = render::create_bitmap_info_rgb(im);
- delete im;
- } else {
+ if ( ! im.get() )
+ {
log_error("Can't read jpeg\n");
return NULL;
}
+ boost::intrusive_ptr<bitmap_character_def> def = new
bitmap_character_def(im);
+
+ BitmapMovieDefinition* mdef = new BitmapMovieDefinition(def, url);
+ log_msg("BitmapMovieDefinition %p created", mdef);
+ return mdef;
+
+
// FIXME: create a movie_definition from a jpeg
//bitmap_character* ch = new bitmap_character(bi);
}
@@ -675,6 +681,7 @@
// calling create_library_movie() again and NOT finding
// the just-created movie.
movie_definition* mov = create_movie(url, real_url, false);
+ log_msg("create_movie(%s, %s, false) returned %p", url.str().c_str(),
real_url, mov);
if (mov == NULL)
{
@@ -701,6 +708,7 @@
}
}
+ log_msg("create_library_movie(%s, %s, startLoaderThread=%d) about to
return %p", url.str().c_str(), real_url, startLoaderThread, mov);
return mov;
}
Index: server/parser/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/server/parser/Makefile.am,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- server/parser/Makefile.am 11 Feb 2007 06:21:29 -0000 1.22
+++ server/parser/Makefile.am 13 Feb 2007 13:35:34 -0000 1.23
@@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-# $Id: Makefile.am,v 1.22 2007/02/11 06:21:29 rsavoye Exp $
+# $Id: Makefile.am,v 1.23 2007/02/13 13:35:34 strk Exp $
AUTOMAKE_OPTIONS =
@@ -61,6 +61,7 @@
button_character_def.h \
character_def.h \
bitmap_character_def.h \
+ BitmapMovieDefinition.h \
edit_text_character_def.h \
text_character_def.h \
morph2_character_def.h \
Index: testsuite/misc-ming.all/loadMovieTestRunner.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/loadMovieTestRunner.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- testsuite/misc-ming.all/loadMovieTestRunner.cpp 8 Feb 2007 22:23:01
-0000 1.2
+++ testsuite/misc-ming.all/loadMovieTestRunner.cpp 13 Feb 2007 13:35:34
-0000 1.3
@@ -86,8 +86,9 @@
sleep(1); // give it some time...
coverartch = const_cast<character*>(tester.findDisplayItemByName(*root,
"coverart"));
coverart = coverartch->to_movie();
- // Load of JPEG files is still unsupported
- xcheck_equals(coverart->get_movie_definition()->get_url(),
greenURL.str());
+ check_equals(coverart->get_movie_definition()->get_url(),
greenURL.str());
+ // TODO: find a way to test if the jpeg is really displayed
+ // (like turn it into a mouse-event-handling char and use
isMouseOverActiveEntity ?)
// Click on the third (offspring)
tester.movePointerTo(480, 80);
Index: server/BitmapMovieInstance.cpp
===================================================================
RCS file: server/BitmapMovieInstance.cpp
diff -N server/BitmapMovieInstance.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/BitmapMovieInstance.cpp 13 Feb 2007 13:35:34 -0000 1.1
@@ -0,0 +1,62 @@
+//
+// Copyright (C) 2007 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 "BitmapMovieInstance.h"
+#include "BitmapMovieDefinition.h"
+#include "render.h" // for ::display
+
+using namespace std;
+
+namespace gnash {
+
+BitmapMovieInstance::BitmapMovieInstance(BitmapMovieDefinition* def,
+ character* parent)
+ :
+ movie_instance(def, parent),
+ _bitmap(def->get_bitmap_char_def())
+{
+ // TODO:
+ // - Define a rectangle fill shape using the bitmap as a fill
+ // - add the shape to the display list
+
+}
+
+void
+BitmapMovieInstance::display()
+{
+ // TODO: when things in the constructor are done we can
+ // completely avoid overriding ::display
+ // and things should automatically work
+ // (use sprite_instance::display)
+ //
+ log_error("FIXME: display of BitmapMovieInstance unimplemented !");
+
+ clear_invalidated(); // clear_invalidated is just needed so display()
+ // is not called over and over - to reduce
verbosity
+ // of the FIXME error above.
+
+ do_display_callback();
+}
+
+} // namespace gnash
Index: server/BitmapMovieInstance.h
===================================================================
RCS file: server/BitmapMovieInstance.h
diff -N server/BitmapMovieInstance.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/BitmapMovieInstance.h 13 Feb 2007 13:35:34 -0000 1.1
@@ -0,0 +1,60 @@
+//
+// 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
+
+//
+//
+
+/* $Id: BitmapMovieInstance.h,v 1.1 2007/02/13 13:35:34 strk Exp $ */
+
+#ifndef GNASH_BITMAPMOVIEINSTANCE_H
+#define GNASH_BITMAPMOVIEINSTANCE_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "movie_instance.h" // for inheritance
+#include "bitmap_character_def.h" // for destructor visibility by intrusive_ptr
+
+// Forward declarations
+namespace gnash
+{
+ class BitmapMovieDefinition;
+}
+
+namespace gnash
+{
+
+
+/// Instance of a BitmapMovieDefinition
+class BitmapMovieInstance : public movie_instance
+{
+
+ boost::intrusive_ptr<bitmap_character_def> _bitmap;
+
+public:
+
+ BitmapMovieInstance(BitmapMovieDefinition* def, character* parent);
+
+ virtual ~BitmapMovieInstance() {}
+
+ virtual void display ();
+
+};
+
+} // end of namespace gnash
+
+#endif // GNASH_BITMAPMOVIEINSTANCE_H
Index: server/parser/BitmapMovieDefinition.h
===================================================================
RCS file: server/parser/BitmapMovieDefinition.h
diff -N server/parser/BitmapMovieDefinition.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ server/parser/BitmapMovieDefinition.h 13 Feb 2007 13:35:34 -0000
1.1
@@ -0,0 +1,152 @@
+//
+// 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_BITMAPMOVIEDEFINITION_H
+#define GNASH_BITMAPMOVIEDEFINITION_H
+
+#include "movie_definition.h" // for inheritance
+#include "rect.h" // for composition
+#include "BitmapMovieInstance.h" // for create_instance
+
+#include <string>
+#include <memory> // for auto_ptr
+
+// Forward declarations
+namespace gnash {
+ class bitmap_character_def;
+}
+
+namespace gnash
+{
+
+/// A "movie" definition for a bitmap file
+//
+/// The create_instance function will return a BitmapMovieInstance
+///
+class BitmapMovieDefinition : public movie_definition
+{
+ int _version;
+ rect _framesize;
+ size_t _framecount;
+ std::vector<PlayList> _playlist;
+ float _framerate;
+ std::string _url;
+ boost::intrusive_ptr<bitmap_character_def> _bitmap;
+
+public:
+
+
+ /// Default constructor
+ //
+ /// Will be initialized with the following values
+ ///
+ /// - SWF version 6
+ /// - 640x480 size
+ /// - Single frame (unlabeled)
+ /// - 12 FPS
+ /// - 0 bytes (for get_bytes_loaded()/get_bytes_total())
+ /// - empty url
+ ///
+ BitmapMovieDefinition(boost::intrusive_ptr<bitmap_character_def> bi,
const std::string& url)
+ :
+ _version(6),
+ // FIXME: extract size from the bitmap_character
+ _framesize(0, 0, 640*20, 480*20),
+ _framecount(1),
+ _playlist(_framecount),
+ _framerate(12),
+ _url(url),
+ _bitmap(bi)
+ {
+ }
+
+ bitmap_character_def* get_bitmap_char_def()
+ {
+ return _bitmap.get();
+ }
+
+ virtual int get_version() const {
+ return _version;
+ }
+
+ virtual float get_width_pixels() const {
+ return _framesize.width()/20;
+ }
+
+ virtual float get_height_pixels() const {
+ return _framesize.height()/20;
+ }
+
+ virtual size_t get_frame_count() const {
+ return _framecount;
+ }
+
+ virtual float get_frame_rate() const {
+ return _framerate;
+ }
+
+ virtual const rect& get_frame_size() const {
+ return _framesize;
+ }
+
+ virtual const rect& get_bound() const {
+ return _framesize;
+ }
+
+ virtual size_t get_bytes_loaded() const {
+ return 0;
+ }
+
+ virtual size_t get_bytes_total() const {
+ return 0;
+ }
+
+ /// Create a playable sprite instance from a def.
+ virtual sprite_instance* create_instance()
+ {
+ return create_movie_instance();
+ }
+
+ /// Create a playable movie_instance from this def.
+ virtual movie_instance* create_movie_instance()
+ {
+ return new BitmapMovieInstance(this, NULL);
+ }
+
+ virtual const PlayList& get_playlist(size_t frame_number) {
+ assert ( frame_number < _playlist.size() );
+ return _playlist[frame_number];
+ }
+
+ virtual const std::string& get_url() const {
+ return _url;
+ }
+
+ // Inheritance from movie_definition requires this
+ // TODO: provide a default implementation in movie_definition instead ?
+ size_t get_loading_frame() const
+ {
+ return 0;
+ }
+};
+
+} // namespace gnash
+
+#endif // GNASH_BITMAPMOVIEDEFINITION_H
- [Gnash-commit] gnash ChangeLog server/Makefile.am server/impl....,
Sandro Santilli <=