[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/avm2 r9705: Merge from trunk.
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/avm2 r9705: Merge from trunk. |
Date: |
Thu, 16 Apr 2009 12:00:54 +0200 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9705
committer: Benjamin Wolsey <address@hidden>
branch nick: avm2
timestamp: Thu 2009-04-16 12:00:54 +0200
message:
Merge from trunk.
added:
libcore/Movie.h
macros/python.m4
packaging/README
renamed:
libcore/BitmapMovieInstance.cpp => libcore/BitmapMovie.cpp
libcore/BitmapMovieInstance.h => libcore/BitmapMovie.h
libcore/movie_instance.cpp => libcore/SWFMovie.cpp
libcore/movie_instance.h => libcore/SWFMovie.h
libcore/swf.cpp => libcore/swf/swf.cpp
libcore/swf.h => libcore/swf/swf.h
modified:
Makefile.am
backend/render_handler_agg.cpp
backend/render_handler_agg_style.h
backend/render_handler_cairo.cpp
backend/render_handler_ogl.cpp
backend/render_handler_ogl.h
configure.ac
cygnal/cvm.cpp
gui/Kde4Gui.cpp
gui/Kde4Gui.h
gui/gnash.cpp
gui/gtk_glue_agg_xv.cpp
gui/gui.cpp
gui/klash4.moc.in
libamf/amf_msg.cpp
libbase/BitsReader.h
libbase/GnashAlgorithm.h
libcore/Bitmap.cpp
libcore/Bitmap.h
libcore/Button.cpp
libcore/Button.h
libcore/DisplayList.cpp
libcore/DisplayObject.cpp
libcore/DisplayObject.h
libcore/DynamicShape.cpp
libcore/DynamicShape.h
libcore/Makefile.am
libcore/MovieClip.cpp
libcore/MovieClip.h
libcore/Property.h
libcore/Shape.cpp
libcore/Shape.h
libcore/StaticText.h
libcore/TextField.cpp
libcore/TextField.h
libcore/Video.cpp
libcore/Video.h
libcore/as_object.cpp
libcore/asobj/NetConnection_as.cpp
libcore/asobj/Object.cpp
libcore/asobj/Sound_as.cpp
libcore/asobj/flash/display/BitmapData_as.cpp
libcore/fill_style.cpp
libcore/fill_style.h
libcore/impl.cpp
libcore/movie_root.cpp
libcore/movie_root.h
libcore/parser/BitmapMovieDefinition.cpp
libcore/parser/BitmapMovieDefinition.h
libcore/parser/SWFMovieDefinition.cpp
libcore/parser/SWFMovieDefinition.h
libcore/parser/movie_definition.h
libcore/parser/sprite_definition.cpp
libcore/parser/sprite_definition.h
libcore/swf/ControlTag.h
libcore/swf/DefineButtonTag.cpp
libcore/swf/DefineButtonTag.h
libcore/swf/DefineEditTextTag.cpp
libcore/swf/DefineEditTextTag.h
libcore/swf/DefineMorphShapeTag.cpp
libcore/swf/DefineMorphShapeTag.h
libcore/swf/DefineShapeTag.cpp
libcore/swf/DefineShapeTag.h
libcore/swf/DefineTextTag.cpp
libcore/swf/DefineTextTag.h
libcore/swf/DefineVideoStreamTag.cpp
libcore/swf/DefineVideoStreamTag.h
libcore/swf/DefinitionTag.h
libcore/swf/DoInitActionTag.h
libcore/swf/SetBackgroundColorTag.h
libcore/swf/TextRecord.cpp
libcore/swf/TextRecord.h
libcore/swf/tag_loaders.cpp
libcore/swf_event.h
libcore/vm/ASHandlers.cpp
libcore/vm/VM.cpp
packaging/deb.am
packaging/redhat/gnash.spec
packaging/rpm.am
packaging/snapshot.am
packaging/xpi.am
plugin/Makefile.am
plugin/win32/plugin.cpp
plugin/xpcom/Makefile.am
pythonmodule/Makefile.am
pythonmodule/gnashpython.cpp
pythonmodule/gnashpython.h
testsuite/DummyCharacter.h
testsuite/DummyMovieDefinition.h
testsuite/MovieTester.cpp
testsuite/MovieTester.h
testsuite/actionscript.all/MovieClip.as
testsuite/libcore.all/AsValueTest.cpp
testsuite/libcore.all/ClassSizes.cpp
testsuite/libcore.all/DisplayListTest.cpp
testsuite/libcore.all/PropertyListTest.cpp
testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp
testsuite/misc-ming.all/DefineEditTextTest-Runner.cpp
testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp
testsuite/misc-ming.all/DefineTextTest-Runner.cpp
testsuite/misc-ming.all/RollOverOutTest-Runner.cpp
testsuite/misc-ming.all/SpriteButtonEventsTest-Runner.cpp
testsuite/misc-ming.all/Video-EmbedSquareTestRunner.cpp
testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp
testsuite/misc-ming.all/attachMovieTestRunner.cpp
testsuite/misc-ming.all/intervalTestRunner.cpp
testsuite/misc-ming.all/loadMovieTest.c
testsuite/misc-ming.all/loadMovieTestRunner.cpp
testsuite/misc-ming.all/loop_test-Runner.cpp
testsuite/misc-ming.all/loop_test2runner.cpp
testsuite/misc-ming.all/masks_testrunner.cpp
testsuite/misc-ming.all/registerClassTestRunner.cpp
testsuite/misc-ming.all/replace_buttons1test_runner.cpp
testsuite/misc-ming.all/replace_shapes1test_runner.cpp
testsuite/misc-ming.all/replace_sprites1test_runner.cpp
testsuite/misc-ming.all/root_stop_testrunner.cpp
testsuite/misc-ming.all/simple_loop_testrunner.cpp
utilities/processor.cpp
libcore/BitmapMovie.cpp
libcore/BitmapMovie.h
libcore/SWFMovie.cpp
libcore/SWFMovie.h
------------------------------------------------------------
revno: 9439.308.1
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Wed 2009-04-08 12:58:37 +0200
message:
Const correct.
modified:
libcore/swf_event.h
------------------------------------------------------------
revno: 9439.308.2
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Wed 2009-04-08 15:00:17 +0200
message:
Remove line break.
modified:
libcore/Video.cpp
------------------------------------------------------------
revno: 9439.308.3
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Wed 2009-04-08 15:16:47 +0200
message:
Use a typedef for std::vector<TextRecord>.
modified:
libcore/swf/TextRecord.cpp
libcore/swf/TextRecord.h
------------------------------------------------------------
revno: 9439.308.4
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Wed 2009-04-08 16:08:39 +0200
message:
Use typedef.
modified:
libcore/swf/DefineTextTag.h
------------------------------------------------------------
revno: 9439.308.5
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-04-09 08:17:15 +0200
message:
Leave callers to decide what matrix and cxform to pass for displaying
TextRecords.
modified:
libcore/TextField.cpp
libcore/swf/DefineTextTag.cpp
libcore/swf/TextRecord.cpp
libcore/swf/TextRecord.h
------------------------------------------------------------
revno: 9439.308.6
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-04-09 08:29:33 +0200
message:
Move variables to where they are needed.
modified:
libcore/swf/TextRecord.cpp
------------------------------------------------------------
revno: 9439.308.7
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-04-09 09:00:34 +0200
message:
Use algorithm.
modified:
libcore/TextField.cpp
------------------------------------------------------------
revno: 9439.308.8
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-04-09 10:59:49 +0200
message:
Move ControlTag under SWF namespace. Const correct movie_definition.
modified:
libcore/parser/SWFMovieDefinition.cpp
libcore/parser/SWFMovieDefinition.h
libcore/parser/movie_definition.h
libcore/parser/sprite_definition.h
libcore/swf/ControlTag.h
------------------------------------------------------------
revno: 9439.308.9
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-04-09 11:58:40 +0200
message:
Make all DisplayObjects non-copyable.
modified:
libcore/DisplayObject.h
------------------------------------------------------------
revno: 9439.308.10
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-04-09 13:39:48 +0200
message:
Renaming, move things about.
modified:
gui/gui.cpp
libcore/MovieClip.cpp
libcore/MovieClip.h
libcore/movie_root.h
libcore/swf/ControlTag.h
libcore/vm/ASHandlers.cpp
testsuite/actionscript.all/MovieClip.as
utilities/processor.cpp
------------------------------------------------------------
revno: 9439.308.11
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-04-09 13:41:59 +0200
message:
Fix testsuite.
modified:
testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp
testsuite/misc-ming.all/DefineEditTextTest-Runner.cpp
testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp
testsuite/misc-ming.all/DefineTextTest-Runner.cpp
testsuite/misc-ming.all/RollOverOutTest-Runner.cpp
testsuite/misc-ming.all/SpriteButtonEventsTest-Runner.cpp
testsuite/misc-ming.all/Video-EmbedSquareTestRunner.cpp
testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp
testsuite/misc-ming.all/attachMovieTestRunner.cpp
testsuite/misc-ming.all/intervalTestRunner.cpp
testsuite/misc-ming.all/loop_test-Runner.cpp
testsuite/misc-ming.all/loop_test2runner.cpp
testsuite/misc-ming.all/masks_testrunner.cpp
testsuite/misc-ming.all/registerClassTestRunner.cpp
testsuite/misc-ming.all/replace_buttons1test_runner.cpp
testsuite/misc-ming.all/replace_shapes1test_runner.cpp
testsuite/misc-ming.all/replace_sprites1test_runner.cpp
testsuite/misc-ming.all/root_stop_testrunner.cpp
testsuite/misc-ming.all/simple_loop_testrunner.cpp
------------------------------------------------------------
revno: 9439.308.12
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-04-09 14:45:20 +0200
message:
Clean up includes and forward declarations. Add more classes to
ClassSizes.
modified:
cygnal/cvm.cpp
libcore/Shape.h
libcore/StaticText.h
libcore/TextField.cpp
libcore/impl.cpp
libcore/parser/SWFMovieDefinition.h
libcore/swf/tag_loaders.cpp
testsuite/libcore.all/ClassSizes.cpp
------------------------------------------------------------
revno: 9439.1.1343
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2009-04-09 15:17:00 +0200
message:
Header cleanups, tidy up member access, rename some functions and enums,
const correct.
modified:
cygnal/cvm.cpp
gui/gui.cpp
libcore/DisplayObject.h
libcore/MovieClip.cpp
libcore/MovieClip.h
libcore/Shape.h
libcore/StaticText.h
libcore/TextField.cpp
libcore/Video.cpp
libcore/impl.cpp
libcore/movie_root.h
libcore/parser/SWFMovieDefinition.cpp
libcore/parser/SWFMovieDefinition.h
libcore/parser/movie_definition.h
libcore/parser/sprite_definition.h
libcore/swf/ControlTag.h
libcore/swf/DefineTextTag.cpp
libcore/swf/DefineTextTag.h
libcore/swf/TextRecord.cpp
libcore/swf/TextRecord.h
libcore/swf/tag_loaders.cpp
libcore/swf_event.h
libcore/vm/ASHandlers.cpp
testsuite/actionscript.all/MovieClip.as
testsuite/libcore.all/ClassSizes.cpp
testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp
testsuite/misc-ming.all/DefineEditTextTest-Runner.cpp
testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp
testsuite/misc-ming.all/DefineTextTest-Runner.cpp
testsuite/misc-ming.all/RollOverOutTest-Runner.cpp
testsuite/misc-ming.all/SpriteButtonEventsTest-Runner.cpp
testsuite/misc-ming.all/Video-EmbedSquareTestRunner.cpp
testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp
testsuite/misc-ming.all/attachMovieTestRunner.cpp
testsuite/misc-ming.all/intervalTestRunner.cpp
testsuite/misc-ming.all/loop_test-Runner.cpp
testsuite/misc-ming.all/loop_test2runner.cpp
testsuite/misc-ming.all/masks_testrunner.cpp
testsuite/misc-ming.all/registerClassTestRunner.cpp
testsuite/misc-ming.all/replace_buttons1test_runner.cpp
testsuite/misc-ming.all/replace_shapes1test_runner.cpp
testsuite/misc-ming.all/replace_sprites1test_runner.cpp
testsuite/misc-ming.all/root_stop_testrunner.cpp
testsuite/misc-ming.all/simple_loop_testrunner.cpp
utilities/processor.cpp
------------------------------------------------------------
revno: 9439.1.1344
committer: address@hidden
branch nick: trunk
timestamp: Fri 2009-04-10 14:20:02 -0600
message:
migrate patch from rtmp branch to fix build problem.
modified:
libamf/amf_msg.cpp
------------------------------------------------------------
revno: 9439.1.1345
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Mon 2009-04-13 11:30:55 +0200
message:
Don't clamp color value in MovieClip.lineStyle. Fixes pollock.swf.
modified:
libcore/MovieClip.cpp
------------------------------------------------------------
revno: 9439.1.1346
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2009-04-13 12:28:31 +0200
message:
Remove extra semicolons.
modified:
libcore/asobj/NetConnection_as.cpp
------------------------------------------------------------
revno: 9439.1.1347
committer: John Wimer <address@hidden>
branch nick: trunk
timestamp: Mon 2009-04-13 17:08:49 +0200
message:
Create a seperate widget that is embedded which contains both the drawing
area and the click to play button.
modified:
gui/Kde4Gui.cpp
gui/Kde4Gui.h
gui/klash4.moc.in
------------------------------------------------------------
revno: 9439.1.1348
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Tue 2009-04-14 10:36:39 +0200
message:
Clean up DefinitionTag interface.
modified:
libcore/Shape.cpp
libcore/Shape.h
libcore/StaticText.h
libcore/TextField.cpp
libcore/Video.cpp
libcore/parser/BitmapMovieDefinition.h
libcore/parser/SWFMovieDefinition.h
libcore/parser/sprite_definition.h
libcore/swf/DefineButtonTag.h
libcore/swf/DefineEditTextTag.h
libcore/swf/DefineMorphShapeTag.h
libcore/swf/DefineShapeTag.h
libcore/swf/DefineTextTag.h
libcore/swf/DefineVideoStreamTag.h
libcore/swf/DefinitionTag.h
testsuite/DummyMovieDefinition.h
------------------------------------------------------------
revno: 9439.309.1
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 09:00:59 +0200
message:
Drop get_bound from DefinitionTag, as it is nonsense for many
subclasses.
Drop all non-const methods from DefineEditTextTag. Drop get_bound
implementations from sprite_instance, SWFMovieDefinition,
DefineMorphShapeTag,
and DefineButtonTag.
modified:
libcore/parser/SWFMovieDefinition.h
libcore/parser/sprite_definition.h
libcore/swf/DefineButtonTag.h
libcore/swf/DefineEditTextTag.h
libcore/swf/DefineMorphShapeTag.h
libcore/swf/DefinitionTag.h
------------------------------------------------------------
revno: 9439.309.2
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 09:23:05 +0200
message:
Drop get_bound from BitmapMovieDefinition.
modified:
libcore/parser/BitmapMovieDefinition.h
libcore/swf/DefineShapeTag.h
libcore/swf/DefineTextTag.h
------------------------------------------------------------
revno: 9439.309.3
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 09:24:33 +0200
message:
Drop get_bound from DummyMovieDefinition.
modified:
testsuite/DummyMovieDefinition.h
------------------------------------------------------------
revno: 9439.309.4
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 09:33:24 +0200
message:
Rename get_bound() to bounds().
modified:
libcore/Shape.cpp
libcore/Shape.h
libcore/StaticText.h
libcore/TextField.cpp
libcore/Video.cpp
libcore/swf/DefineEditTextTag.h
libcore/swf/DefineShapeTag.h
libcore/swf/DefineTextTag.h
libcore/swf/DefineVideoStreamTag.h
------------------------------------------------------------
revno: 9439.1.1349
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Tue 2009-04-14 10:51:26 +0200
message:
Use to_int() for fetching color value passed to MovieClip.lineStyle().
Fixes the UB and still works fine for pollock.swf. Thanks bwy for pointing out.
modified:
libcore/MovieClip.cpp
------------------------------------------------------------
revno: 9439.1.1350
committer: address@hidden
branch nick: trunk
timestamp: Tue 2009-04-14 22:39:10 -0600
message:
refactor package building code to share more code, use more variables and
less cut and paste, and other general improvments. Builds xpis, debs, rpms, and
snapshots.
added:
packaging/README
modified:
Makefile.am
configure.ac
gui/gnash.cpp
packaging/deb.am
packaging/redhat/gnash.spec
packaging/rpm.am
packaging/snapshot.am
packaging/xpi.am
------------------------------------------------------------
revno: 9439.310.1
committer: address@hidden
branch nick: xpi
timestamp: Tue 2009-04-14 10:25:27 -0600
message:
explain the process of building packages and the associated Makefile
targets.
added:
packaging/README
------------------------------------------------------------
revno: 9439.310.2
committer: address@hidden
branch nick: xpi
timestamp: Tue 2009-04-14 12:24:56 -0600
message:
don't print the warnings about missing testing dependencies with
--disable-testsuite.
modified:
configure.ac
------------------------------------------------------------
revno: 9439.310.3
committer: address@hidden
branch nick: xpi
timestamp: Tue 2009-04-14 12:43:12 -0600
message:
clean up hopw bzrversion.h gets generated.
modified:
Makefile.am
------------------------------------------------------------
revno: 9439.310.4
committer: address@hidden
branch nick: xpi
timestamp: Tue 2009-04-14 12:44:05 -0600
message:
improve how packages get built.
modified:
packaging/rpm.am
packaging/snapshot.am
packaging/xpi.am
------------------------------------------------------------
revno: 9439.310.5
committer: address@hidden
branch nick: xpi
timestamp: Tue 2009-04-14 12:44:33 -0600
message:
add the revno and branch name to --version.
modified:
gui/gnash.cpp
------------------------------------------------------------
revno: 9439.310.6
committer: address@hidden
branch nick: xpi
timestamp: Tue 2009-04-14 12:45:05 -0600
message:
drop rtmpget for now.
modified:
packaging/redhat/gnash.spec
------------------------------------------------------------
revno: 9439.310.7
committer: address@hidden
branch nick: xpi
timestamp: Tue 2009-04-14 13:15:30 -0600
message:
fix debian package building to use the new way.
removed:
packaging/redhat/klash.spec
modified:
packaging/README
packaging/deb.am
packaging/rpm.am
packaging/snapshot.am
------------------------------------------------------------
revno: 9439.310.8
committer: address@hidden
branch nick: xpi
timestamp: Tue 2009-04-14 22:36:35 -0600
message:
tweak for Mandriva rpm packages, which name some of the BuildRequires
differently.
modified:
packaging/redhat/gnash.spec
------------------------------------------------------------
revno: 9439.1.1351
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2009-04-15 09:26:30 +0200
message:
Rationalize top-level movie loading.
Improve documentation.
added:
libcore/Movie.h
renamed:
libcore/BitmapMovieInstance.cpp => libcore/BitmapMovie.cpp
libcore/BitmapMovieInstance.h => libcore/BitmapMovie.h
libcore/movie_instance.cpp => libcore/SWFMovie.cpp
libcore/movie_instance.h => libcore/SWFMovie.h
modified:
cygnal/cvm.cpp
gui/gtk_glue_agg_xv.cpp
gui/gui.cpp
libcore/Bitmap.h
libcore/Button.cpp
libcore/DisplayList.cpp
libcore/DisplayObject.cpp
libcore/DisplayObject.h
libcore/DynamicShape.cpp
libcore/DynamicShape.h
libcore/Makefile.am
libcore/MovieClip.cpp
libcore/MovieClip.h
libcore/Property.h
libcore/TextField.cpp
libcore/TextField.h
libcore/as_object.cpp
libcore/asobj/Object.cpp
libcore/asobj/Sound_as.cpp
libcore/asobj/flash/display/BitmapData_as.cpp
libcore/movie_root.cpp
libcore/movie_root.h
libcore/parser/BitmapMovieDefinition.cpp
libcore/parser/BitmapMovieDefinition.h
libcore/parser/SWFMovieDefinition.cpp
libcore/parser/SWFMovieDefinition.h
libcore/parser/movie_definition.h
libcore/parser/sprite_definition.cpp
libcore/parser/sprite_definition.h
libcore/swf/ControlTag.h
libcore/swf/DoInitActionTag.h
libcore/swf/SetBackgroundColorTag.h
libcore/vm/ASHandlers.cpp
libcore/vm/VM.cpp
plugin/win32/plugin.cpp
pythonmodule/gnashpython.cpp
pythonmodule/gnashpython.h
testsuite/DummyCharacter.h
testsuite/DummyMovieDefinition.h
testsuite/MovieTester.cpp
testsuite/MovieTester.h
testsuite/libcore.all/AsValueTest.cpp
testsuite/libcore.all/ClassSizes.cpp
testsuite/libcore.all/DisplayListTest.cpp
testsuite/libcore.all/PropertyListTest.cpp
testsuite/misc-ming.all/RollOverOutTest-Runner.cpp
testsuite/misc-ming.all/loadMovieTestRunner.cpp
utilities/processor.cpp
libcore/BitmapMovie.cpp
libcore/BitmapMovie.h
libcore/SWFMovie.cpp
libcore/SWFMovie.h
------------------------------------------------------------
revno: 9439.311.1
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 11:35:01 +0200
message:
Update docs on movie_root.
modified:
libcore/movie_root.h
------------------------------------------------------------
revno: 9439.311.2
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 13:26:23 +0200
message:
Drop unused and space-wasting dummy style vectors. Put class
definition
in conventional order.
modified:
libcore/TextField.cpp
libcore/TextField.h
------------------------------------------------------------
revno: 9439.311.3
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 14:07:28 +0200
message:
Allow MovieClip to be constructed without a definition, so that it
doesn't have to be faked.
modified:
libcore/MovieClip.cpp
libcore/MovieClip.h
------------------------------------------------------------
revno: 9439.311.4
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 14:39:03 +0200
message:
Make movie_definition const.
modified:
gui/gtk_glue_agg_xv.cpp
libcore/MovieClip.cpp
libcore/MovieClip.h
libcore/TextField.cpp
libcore/asobj/Object.cpp
libcore/asobj/Sound_as.cpp
libcore/movie_instance.h
libcore/movie_root.cpp
libcore/movie_root.h
libcore/parser/SWFMovieDefinition.cpp
libcore/parser/SWFMovieDefinition.h
libcore/parser/movie_definition.h
libcore/parser/sprite_definition.cpp
libcore/parser/sprite_definition.h
------------------------------------------------------------
revno: 9439.311.5
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 14:50:30 +0200
message:
Don't expose MovieClip's definition; this is only needed from
movie_instance.
modified:
libcore/MovieClip.cpp
libcore/MovieClip.h
libcore/TextField.cpp
libcore/asobj/Object.cpp
libcore/movie_instance.h
libcore/movie_root.cpp
libcore/movie_root.h
------------------------------------------------------------
revno: 9439.311.6
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 15:14:27 +0200
message:
Update testsuite.
modified:
libcore/MovieClip.cpp
testsuite/misc-ming.all/loadMovieTestRunner.cpp
------------------------------------------------------------
revno: 9439.311.7
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 16:07:29 +0200
message:
Document MovieClip; correct old docs.
modified:
libcore/MovieClip.cpp
libcore/MovieClip.h
------------------------------------------------------------
revno: 9439.311.8
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 17:07:44 +0200
message:
Drop get_background_alpha and do set_background_color in a sensible
way.
Clean up various other MovieClip functions, typedefs and member
variables.
modified:
libcore/MovieClip.cpp
libcore/MovieClip.h
libcore/asobj/flash/display/BitmapData_as.cpp
libcore/movie_root.cpp
libcore/movie_root.h
libcore/swf/SetBackgroundColorTag.h
------------------------------------------------------------
revno: 9439.311.9
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 17:35:00 +0200
message:
Minor cleanups.
modified:
libcore/movie_instance.cpp
------------------------------------------------------------
revno: 9439.311.10
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 18:13:21 +0200
message:
Use movie_instance's definition less.
modified:
gui/gtk_glue_agg_xv.cpp
gui/gui.cpp
libcore/DisplayObject.cpp
libcore/MovieClip.cpp
libcore/asobj/Sound_as.cpp
libcore/movie_instance.h
libcore/movie_root.cpp
libcore/movie_root.h
libcore/vm/ASHandlers.cpp
------------------------------------------------------------
revno: 9439.311.11
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 19:49:58 +0200
message:
Add common base class (Movie) for top-level movies (SWFMovie,
BitmapMovie,
and perhaps in future FLVMovie). This replaces movie_instance and
BitmapMovieInstance.
renamed:
libcore/BitmapMovieInstance.cpp => libcore/BitmapMovie.cpp
libcore/BitmapMovieInstance.h => libcore/BitmapMovie.h
libcore/movie_instance.cpp => libcore/SWFMovie.cpp
libcore/movie_instance.h => libcore/SWFMovie.h
modified:
cygnal/cvm.cpp
gui/gtk_glue_agg_xv.cpp
gui/gui.cpp
libcore/Button.cpp
libcore/DisplayObject.cpp
libcore/DisplayObject.h
libcore/Makefile.am
libcore/MovieClip.cpp
libcore/MovieClip.h
libcore/TextField.cpp
libcore/asobj/Object.cpp
libcore/movie_root.cpp
libcore/movie_root.h
libcore/parser/BitmapMovieDefinition.cpp
libcore/parser/BitmapMovieDefinition.h
libcore/parser/SWFMovieDefinition.cpp
libcore/parser/SWFMovieDefinition.h
libcore/parser/movie_definition.h
libcore/vm/VM.cpp
plugin/win32/plugin.cpp
pythonmodule/gnashpython.cpp
testsuite/DummyCharacter.h
testsuite/DummyMovieDefinition.h
testsuite/MovieTester.cpp
testsuite/MovieTester.h
testsuite/libcore.all/AsValueTest.cpp
testsuite/libcore.all/ClassSizes.cpp
testsuite/libcore.all/DisplayListTest.cpp
testsuite/libcore.all/PropertyListTest.cpp
utilities/processor.cpp
libcore/BitmapMovie.cpp
libcore/BitmapMovie.h
libcore/SWFMovie.cpp
libcore/SWFMovie.h
------------------------------------------------------------
revno: 9439.311.12
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 19:51:06 +0200
message:
Add Movie.h
added:
libcore/Movie.h
------------------------------------------------------------
revno: 9439.311.13
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 19:52:33 +0200
message:
Fix testsuite.
modified:
testsuite/DummyMovieDefinition.h
------------------------------------------------------------
revno: 9439.311.14
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 20:31:04 +0200
message:
Draw BitmapMovie directly, without relying on a fabricated Shape
character.
modified:
libcore/BitmapMovie.cpp
libcore/BitmapMovie.h
libcore/DynamicShape.cpp
libcore/DynamicShape.h
libcore/parser/BitmapMovieDefinition.cpp
libcore/parser/BitmapMovieDefinition.h
------------------------------------------------------------
revno: 9439.311.15
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Tue 2009-04-14 22:13:59 +0200
message:
Fix testsuite, override pointInVisibleShape for mouse entity detection
now BitmapMovie has no DisplayList.
modified:
gui/gui.cpp
libcore/BitmapMovie.cpp
libcore/BitmapMovie.h
libcore/Movie.h
libcore/MovieClip.cpp
libcore/MovieClip.h
libcore/SWFMovie.cpp
libcore/SWFMovie.h
libcore/parser/BitmapMovieDefinition.cpp
libcore/parser/BitmapMovieDefinition.h
testsuite/DummyMovieDefinition.h
testsuite/libcore.all/AsValueTest.cpp
testsuite/libcore.all/DisplayListTest.cpp
testsuite/libcore.all/PropertyListTest.cpp
------------------------------------------------------------
revno: 9439.311.16
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 07:25:53 +0200
message:
Add more documentation.
modified:
libcore/BitmapMovie.h
libcore/Movie.h
libcore/parser/BitmapMovieDefinition.h
------------------------------------------------------------
revno: 9439.311.17
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 07:33:51 +0200
message:
Rename create_Movie to createMovie.
modified:
cygnal/cvm.cpp
gui/gui.cpp
libcore/BitmapMovie.h
libcore/Button.cpp
libcore/DisplayList.cpp
libcore/DisplayObject.cpp
libcore/DisplayObject.h
libcore/MovieClip.cpp
libcore/Property.h
libcore/TextField.cpp
libcore/as_object.cpp
libcore/movie_root.cpp
libcore/parser/BitmapMovieDefinition.cpp
libcore/parser/BitmapMovieDefinition.h
libcore/parser/SWFMovieDefinition.cpp
libcore/parser/SWFMovieDefinition.h
libcore/parser/movie_definition.h
plugin/win32/plugin.cpp
pythonmodule/gnashpython.cpp
pythonmodule/gnashpython.h
testsuite/DummyCharacter.h
testsuite/DummyMovieDefinition.h
testsuite/MovieTester.cpp
testsuite/libcore.all/AsValueTest.cpp
testsuite/libcore.all/DisplayListTest.cpp
testsuite/libcore.all/PropertyListTest.cpp
testsuite/misc-ming.all/RollOverOutTest-Runner.cpp
utilities/processor.cpp
------------------------------------------------------------
revno: 9439.311.18
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 07:54:30 +0200
message:
Drop advance_sprite(), use advance() on its own.
modified:
libcore/MovieClip.cpp
libcore/MovieClip.h
libcore/SWFMovie.cpp
------------------------------------------------------------
revno: 9439.311.19
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 08:02:24 +0200
message:
Drop empty sprite_definition ctor.
modified:
libcore/parser/sprite_definition.cpp
libcore/parser/sprite_definition.h
------------------------------------------------------------
revno: 9439.311.20
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 08:22:17 +0200
message:
Change header guards.
modified:
libcore/BitmapMovie.h
libcore/Movie.h
libcore/SWFMovie.h
libcore/parser/SWFMovieDefinition.h
------------------------------------------------------------
revno: 9439.311.21
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 08:41:11 +0200
message:
Minor cleanups.
modified:
libcore/MovieClip.cpp
libcore/SWFMovie.h
libcore/swf/ControlTag.h
libcore/swf/DoInitActionTag.h
------------------------------------------------------------
revno: 9439.311.22
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 08:44:13 +0200
message:
More minor formatting changes.
modified:
libcore/MovieClip.cpp
------------------------------------------------------------
revno: 9439.311.23
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 09:01:39 +0200
message:
Add notes on AVM2 implementation.
modified:
libcore/Bitmap.h
libcore/parser/BitmapMovieDefinition.h
------------------------------------------------------------
revno: 9439.1.1352
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2009-04-15 12:16:53 +0200
message:
Restore BitmapMovie's use of DisplayList, fixing loadMovieTest again,
as strk pointed out.
Const correct definitions.
modified:
libcore/BitmapMovie.cpp
libcore/BitmapMovie.h
libcore/Button.cpp
libcore/Button.h
libcore/Video.cpp
libcore/Video.h
libcore/parser/BitmapMovieDefinition.cpp
libcore/parser/BitmapMovieDefinition.h
libcore/parser/SWFMovieDefinition.h
libcore/parser/sprite_definition.cpp
libcore/parser/sprite_definition.h
libcore/swf/DefineButtonTag.cpp
libcore/swf/DefineButtonTag.h
libcore/swf/DefineEditTextTag.cpp
libcore/swf/DefineEditTextTag.h
libcore/swf/DefineMorphShapeTag.cpp
libcore/swf/DefineMorphShapeTag.h
libcore/swf/DefineShapeTag.cpp
libcore/swf/DefineShapeTag.h
libcore/swf/DefineTextTag.cpp
libcore/swf/DefineTextTag.h
libcore/swf/DefineVideoStreamTag.cpp
libcore/swf/DefineVideoStreamTag.h
libcore/swf/DefinitionTag.h
------------------------------------------------------------
revno: 9439.311.24
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 11:08:37 +0200
message:
Restore BitmapMovie as a full MovieClip with DisplayList, as strk
pointed
out there is a non-automated test showing this is the case.
Make createDisplayObject const correct so that it can be called from
BitmapMovie's const definition. This revealed that many other
definition
classes had non-const methods, and some DisplayObjects had non-const
definitions. This is now also fixed.
modified:
libcore/BitmapMovie.cpp
libcore/BitmapMovie.h
libcore/Button.cpp
libcore/Button.h
libcore/Video.cpp
libcore/Video.h
libcore/parser/BitmapMovieDefinition.cpp
libcore/parser/BitmapMovieDefinition.h
libcore/parser/SWFMovieDefinition.h
libcore/parser/sprite_definition.cpp
libcore/parser/sprite_definition.h
libcore/swf/DefineButtonTag.cpp
libcore/swf/DefineButtonTag.h
libcore/swf/DefineEditTextTag.cpp
libcore/swf/DefineEditTextTag.h
libcore/swf/DefineMorphShapeTag.cpp
libcore/swf/DefineMorphShapeTag.h
libcore/swf/DefineShapeTag.cpp
libcore/swf/DefineShapeTag.h
libcore/swf/DefineTextTag.cpp
libcore/swf/DefineTextTag.h
libcore/swf/DefineVideoStreamTag.cpp
libcore/swf/DefineVideoStreamTag.h
libcore/swf/DefinitionTag.h
------------------------------------------------------------
revno: 9439.1.1353
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2009-04-15 15:10:54 +0200
message:
Test that BitmapMovies can have child sprites (they can).
Unify bitmap creation.
Const correct fill_style's BitmapInfo, and adapt the renderers to it.
OGL performs a kind of lazy initialization and currently needs mutable
members
due to this.
modified:
backend/render_handler_agg.cpp
backend/render_handler_agg_style.h
backend/render_handler_cairo.cpp
backend/render_handler_ogl.cpp
backend/render_handler_ogl.h
libcore/Bitmap.cpp
libcore/Bitmap.h
libcore/fill_style.cpp
libcore/fill_style.h
libcore/parser/BitmapMovieDefinition.cpp
libcore/parser/BitmapMovieDefinition.h
testsuite/misc-ming.all/loadMovieTest.c
------------------------------------------------------------
revno: 9439.312.1
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 13:22:17 +0200
message:
Test that a BitmapMovie can have child sprites.
modified:
testsuite/misc-ming.all/loadMovieTest.c
------------------------------------------------------------
revno: 9439.312.2
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 13:24:05 +0200
message:
Update totals.
modified:
testsuite/misc-ming.all/loadMovieTest.c
------------------------------------------------------------
revno: 9439.312.3
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 14:27:37 +0200
message:
Make a Bitmap, not a Shape, for a BitmapMovie, and use the same code
to construct DynamicShapes for displaying bitmaps instead of doing it
in two places.
Const correct fill_style and other things that rely on it.
modified:
backend/render_handler_agg.cpp
backend/render_handler_agg_style.h
libcore/Bitmap.cpp
libcore/Bitmap.h
libcore/fill_style.cpp
libcore/fill_style.h
libcore/parser/BitmapMovieDefinition.cpp
libcore/parser/BitmapMovieDefinition.h
------------------------------------------------------------
revno: 9439.1.1354
committer: address@hidden
branch nick: trunk
timestamp: Wed 2009-04-15 10:13:42 -0600
message:
fix quote marks around none for revno. Reverse logic of which X11
dependencies are used when building rpms.
modified:
Makefile.am
packaging/redhat/gnash.spec
------------------------------------------------------------
revno: 9439.1.1355
committer: address@hidden
branch nick: trunk
timestamp: Wed 2009-04-15 18:11:19 -0600
message:
add --enable-python option, make building pythonmodule optional based on
this, and find the flags needed for python development. task#9300
added:
macros/python.m4
modified:
Makefile.am
configure.ac
packaging/snapshot.am
pythonmodule/Makefile.am
------------------------------------------------------------
revno: 9439.1.1356
committer: address@hidden
branch nick: trunk
timestamp: Wed 2009-04-15 18:41:53 -0600
message:
add pythonmodule to DIST_SUBDIRS, since now it's conditional.
modified:
Makefile.am
------------------------------------------------------------
revno: 9439.1.1357
committer: address@hidden
branch nick: trunk
timestamp: Wed 2009-04-15 21:02:46 -0600
message:
actually install the xpcom support when enabled.
modified:
packaging/snapshot.am
packaging/xpi.am
plugin/Makefile.am
plugin/xpcom/Makefile.am
------------------------------------------------------------
revno: 9439.1.1358
committer: address@hidden
branch nick: trunk
timestamp: Wed 2009-04-15 21:10:39 -0600
message:
evaluate the shell script to set the snapshot dir early on.
modified:
packaging/xpi.am
------------------------------------------------------------
revno: 9439.1.1359
committer: address@hidden
branch nick: trunk
timestamp: Wed 2009-04-15 21:57:36 -0600
message:
fix the path for stripping the executable.
modified:
packaging/xpi.am
------------------------------------------------------------
revno: 9439.1.1360
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2009-04-16 09:36:24 +0200
message:
Minor cleanup to marking SWFMovieDefinition resources, extend generic
templates.
modified:
libbase/GnashAlgorithm.h
libcore/parser/SWFMovieDefinition.cpp
------------------------------------------------------------
revno: 9439.313.1
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 17:04:06 +0200
message:
Replace loops in markReachableResources.
modified:
libcore/parser/SWFMovieDefinition.cpp
------------------------------------------------------------
revno: 9439.313.2
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 17:30:11 +0200
message:
Extend RemovePointer<>, use a template function to mark the mapped
resources in SWFMovieDefinition.
modified:
libbase/GnashAlgorithm.h
libcore/parser/SWFMovieDefinition.cpp
------------------------------------------------------------
revno: 9439.313.3
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Wed 2009-04-15 18:12:31 +0200
message:
Move to anonymous namespace.
modified:
libcore/parser/SWFMovieDefinition.cpp
------------------------------------------------------------
revno: 9439.1.1361
committer: Benjamin Wolsey <address@hidden>
branch nick: temp
timestamp: Thu 2009-04-16 10:42:14 +0200
message:
Move swf.{cpp,h} to libcore/swf. Remove useless include from BitsReader.h
renamed:
libcore/swf.cpp => libcore/swf/swf.cpp
libcore/swf.h => libcore/swf/swf.h
modified:
libbase/BitsReader.h
libcore/Makefile.am
=== modified file 'Makefile.am'
--- a/Makefile.am 2009-02-28 04:34:39 +0000
+++ b/Makefile.am 2009-04-16 00:41:53 +0000
@@ -41,6 +41,7 @@
--disable-testsuite
#--enable-cygnal
+
STD_DIRS = \
libbase \
libamf \
@@ -52,7 +53,6 @@
utilities \
gui \
plugin \
- pythonmodule \
doc \
po \
$(NULL)
@@ -75,11 +75,16 @@
SUBDIRS += extensions
endif
+if USE_PYTHON
+SUBDIRS += pythonmodule
+endif
+
# man_MANS = doc/gnash.1 doc/gprocessor.1 doc/dumpshm.1 soldumper.1
-DIST_SUBDIRS = $(LIBLTDLDIR) $(STD_DIRS) cygnal extensions testsuite
+DIST_SUBDIRS = $(LIBLTDLDIR) $(STD_DIRS) cygnal extensions testsuite
pythonmodule
-EXTRA_DIST = autogen.sh \
+EXTRA_DIST = \
+ autogen.sh \
config.rpath \
macros/incllist macros/libslist \
ChangeLog-0.8.0 ChangeLog-0.8.1 ChangeLog-0.8.2 ChangeLog-0.8.3 \
@@ -91,7 +96,9 @@
packaging/bsd.am \
packaging/rpm.am \
packaging/gnash.xpm \
- packaging/klash.xpm
+ packaging/klash.xpm \
+ bzrversion.h
+
# dist-hook:
# @test -d "$(distdir)/packaging" || $(mkinstalldirs)
"$(distdir)/packaging"
@@ -127,6 +134,41 @@
include $(srcdir)/packaging/xpi.am
#
+# Extract info from the repository to include in the build. If
+# bazar (bzr) isn't installed, just print stubs, as this is only
+# used for display purposes. It's primarily used by the testsuites
+# and when building binary packages from multiple branches.
+# Note that this is only rebuilt after "make clean", if the Makefile
+# has changed, or the source tree gets reconfigured. So unless you do
+# a make clean, or nuke the bzrversion.h file, this can get slightly
+# behind the current version. Currently Gnash doesn't have this info
+# so it'll be an improvement anyway. Bzr is amazing slow producing
+# the info, which is why we don't want to do it all the time.
+#
+CLEANFILES += bzrversion.h
+BUILT_SOURCES = bzrversion.h
+bzrversion.h: Makefile.in
+ @status=`cd $(srcdir) && bzr version-info --custom --template={revno}`;
\
+ if test $${status} -gt 0; then \
+ echo "Generating bzrversion.h"; \
+ $(RM) -f bzrversion.h; \
+ (cd $(srcdir) && bzr version-info --custom --template='static const
char *BRANCH_REVNO = "{revno}";\nstatic const char *BRANCH_NICK =
"{branch_nick}";\n') > bzrversion.h; \
+ else \
+ if test -e bzrversion.h; then \
+ echo "Using existing bzrversion.h"; \
+ else \
+ echo "Generating bzrversion.h"; \
+ echo "static const char *BRANCH_REVNO = "none";\nstatic const char
*BRANCH_NICK = "none";\n" > bzrversion.h; \
+ fi; \
+ fi
+
+BRANCH_REVNO = `grep "REVNO" bzrversion.h | cut -d '"' -f 2`
+BRANCH_NICK = `grep "NICK" bzrversion.h | cut -d '"' -f 2`
+
+test:
+ echo $(SNAPSHOT_NAME)
+
+#
# Binary tarball packaging
#
include $(srcdir)/packaging/snapshot.am
@@ -394,6 +436,11 @@
else
@echo " NPAPI (Mozilla) plugin disabled"
endif
+if USE_PYTHON
+ @echo " PYTHON support enabled"
+else
+ @echo " PYTHON support disabled"
+endif
if TESTSUITE
check: check-recursive
=== modified file 'backend/render_handler_agg.cpp'
--- a/backend/render_handler_agg.cpp 2009-04-07 14:32:06 +0000
+++ b/backend/render_handler_agg.cpp 2009-04-15 12:27:37 +0000
@@ -1345,7 +1345,7 @@
}
}
- sh.add_bitmap(dynamic_cast<agg_bitmap_info*>
+ sh.add_bitmap(dynamic_cast<const agg_bitmap_info*>
(fill_styles[fno].get_bitmap_info()), m, cx,
(fill_type==SWF::FILL_TILED_BITMAP) ||
(fill_type==SWF::FILL_TILED_BITMAP_HARD),
=== modified file 'backend/render_handler_agg_style.h'
--- a/backend/render_handler_agg_style.h 2009-01-22 20:10:39 +0000
+++ b/backend/render_handler_agg_style.h 2009-04-15 12:27:37 +0000
@@ -309,7 +309,7 @@
}
/// Adds a new bitmap fill style
- void add_bitmap(agg_bitmap_info* bi, const gnash::SWFMatrix& mat,
+ void add_bitmap(const agg_bitmap_info* bi, const gnash::SWFMatrix& mat,
const gnash::cxform& cx, bool repeat, bool smooth)
{
@@ -382,7 +382,7 @@
// === RGB24 ===
- void add_bitmap_repeat_nn_rgb24(agg_bitmap_info* bi,
+ void add_bitmap_repeat_nn_rgb24(const agg_bitmap_info* bi,
const gnash::SWFMatrix& mat, const gnash::cxform& cx)
{
@@ -407,7 +407,7 @@
- void add_bitmap_clip_nn_rgb24(agg_bitmap_info* bi,
+ void add_bitmap_clip_nn_rgb24(const agg_bitmap_info* bi,
const gnash::SWFMatrix& mat, const gnash::cxform& cx)
{
@@ -430,7 +430,7 @@
- void add_bitmap_repeat_aa_rgb24(agg_bitmap_info* bi,
+ void add_bitmap_repeat_aa_rgb24(const agg_bitmap_info* bi,
const gnash::SWFMatrix& mat, const gnash::cxform& cx)
{
@@ -453,7 +453,7 @@
}
- void add_bitmap_clip_aa_rgb24(agg_bitmap_info* bi,
+ void add_bitmap_clip_aa_rgb24(const agg_bitmap_info* bi,
const gnash::SWFMatrix& mat, const gnash::cxform& cx)
{
@@ -478,7 +478,7 @@
// === RGBA32 ===
- void add_bitmap_repeat_nn_rgba32(agg_bitmap_info* bi,
+ void add_bitmap_repeat_nn_rgba32(const agg_bitmap_info* bi,
const gnash::SWFMatrix& mat, const gnash::cxform& cx)
{
@@ -503,7 +503,7 @@
- void add_bitmap_clip_nn_rgba32(agg_bitmap_info* bi,
+ void add_bitmap_clip_nn_rgba32(const agg_bitmap_info* bi,
const gnash::SWFMatrix& mat, const gnash::cxform& cx)
{
@@ -526,7 +526,7 @@
- void add_bitmap_repeat_aa_rgba32(agg_bitmap_info* bi,
+ void add_bitmap_repeat_aa_rgba32(const agg_bitmap_info* bi,
const gnash::SWFMatrix& mat, const gnash::cxform& cx)
{
@@ -549,7 +549,7 @@
}
- void add_bitmap_clip_aa_rgba32(agg_bitmap_info* bi,
+ void add_bitmap_clip_aa_rgba32(const agg_bitmap_info* bi,
const gnash::SWFMatrix& mat, const gnash::cxform& cx)
{
=== modified file 'backend/render_handler_cairo.cpp'
--- a/backend/render_handler_cairo.cpp 2009-04-07 14:38:20 +0000
+++ b/backend/render_handler_cairo.cpp 2009-04-15 13:10:54 +0000
@@ -164,7 +164,7 @@
cairo_pattern_destroy(_pattern);
}
- cairo_pattern_t* apply(const cairo_matrix_t* mat, int fill_type)
+ cairo_pattern_t* apply(const cairo_matrix_t* mat, int fill_type) const
{
assert(mat);
assert(_pattern);
@@ -255,8 +255,8 @@
{
SWFMatrix m = style.getBitmapMatrix();
- bitmap_info_cairo* binfo
- = dynamic_cast<bitmap_info_cairo*>(style.get_bitmap_info());
+ const bitmap_info_cairo* binfo
+ = dynamic_cast<const bitmap_info_cairo*>(style.get_bitmap_info());
if (!binfo) {
return NULL;
@@ -315,7 +315,7 @@
cairo_fill(_cr);
- // Surfaces are owned by bitmap_info_cairo
+ // Surfaces are owned by const bitmap_info_cairo
if (cairo_pattern_get_type(_pattern) != CAIRO_PATTERN_TYPE_SURFACE) {
cairo_pattern_destroy(_pattern);
_pattern = 0;
=== modified file 'backend/render_handler_ogl.cpp'
--- a/backend/render_handler_ogl.cpp 2009-04-07 14:45:34 +0000
+++ b/backend/render_handler_ogl.cpp 2009-04-15 13:10:54 +0000
@@ -456,7 +456,7 @@
}
void
-bitmap_info_ogl::setup()
+bitmap_info_ogl::setup() const
{
oglScopeEnable enabler(_ogl_img_type);
@@ -505,7 +505,7 @@
}
void
-bitmap_info_ogl::upload(boost::uint8_t* data, size_t width, size_t height)
+bitmap_info_ogl::upload(boost::uint8_t* data, size_t width, size_t height)
const
{
glTexParameteri(_ogl_img_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -524,7 +524,7 @@
void
bitmap_info_ogl::apply(const gnash::SWFMatrix& bitmap_matrix,
- bitmap_wrap_mode wrap_mode)
+ bitmap_wrap_mode wrap_mode) const
{
glEnable(_ogl_img_type);
@@ -1229,7 +1229,8 @@
case SWF::FILL_FOCAL_GRADIENT:
{
- bitmap_info_ogl* binfo =
static_cast<bitmap_info_ogl*>(style.need_gradient_bitmap());
+ const bitmap_info_ogl* binfo =
+ static_cast<const
bitmap_info_ogl*>(style.need_gradient_bitmap());
SWFMatrix m = style.getGradientMatrix();
binfo->apply(m, bitmap_info_ogl::WRAP_CLAMP);
@@ -1239,7 +1240,8 @@
case SWF::FILL_TILED_BITMAP_HARD:
case SWF::FILL_TILED_BITMAP:
{
- bitmap_info_ogl* binfo =
static_cast<bitmap_info_ogl*>(style.get_bitmap_info());
+ const bitmap_info_ogl* binfo =
+ static_cast<const bitmap_info_ogl*>(style.get_bitmap_info());
binfo->apply(style.getBitmapMatrix(), bitmap_info_ogl::WRAP_REPEAT);
break;
@@ -1249,7 +1251,8 @@
// smooth=true;
case SWF::FILL_CLIPPED_BITMAP_HARD:
{
- bitmap_info_ogl* binfo =
dynamic_cast<bitmap_info_ogl*>(style.get_bitmap_info());
+ const bitmap_info_ogl* binfo =
+ dynamic_cast<const bitmap_info_ogl*>(style.get_bitmap_info());
assert(binfo);
=== modified file 'backend/render_handler_ogl.h'
--- a/backend/render_handler_ogl.h 2009-04-07 14:45:34 +0000
+++ b/backend/render_handler_ogl.h 2009-04-15 13:10:54 +0000
@@ -161,17 +161,17 @@
~bitmap_info_ogl();
void apply(const gnash::SWFMatrix& bitmap_matrix,
- bitmap_wrap_mode wrap_mode);
+ bitmap_wrap_mode wrap_mode) const;
private:
inline bool ogl_accessible() const;
- void setup();
- void upload(boost::uint8_t* data, size_t width, size_t height);
+ void setup() const;
+ void upload(boost::uint8_t* data, size_t width, size_t height) const;
- std::auto_ptr<GnashImage> _img;
+ mutable std::auto_ptr<GnashImage> _img;
GLenum _pixel_format;
GLenum _ogl_img_type;
- bool _ogl_accessible;
- GLuint _texture_id;
+ mutable bool _ogl_accessible;
+ mutable GLuint _texture_id;
size_t _orig_width;
size_t _orig_height;
};
=== modified file 'configure.ac'
--- a/configure.ac 2009-03-31 09:45:01 +0000
+++ b/configure.ac 2009-04-16 10:00:54 +0000
@@ -219,6 +219,14 @@
LC_KEY=${lckey}
AC_SUBST(LC_KEY)
+AC_ARG_ENABLE(python,
+ AC_HELP_STRING([--enable-python],[Enable python for the python wrapper]),
+[case "${enableval}" in
+ yes) python=yes ;;
+ no) python=no ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-python option]) ;;
+esac],python=no)
+
# Maybe use jemalloc, which handles memory fragmentation for
# ECAMscript languages better than the regular system malloc.
# This seems like a good idea, as both the other player and
@@ -1100,8 +1108,11 @@
dnl Check for PKG_CONFIG before any GNASH_PATH call
PKG_PROG_PKG_CONFIG
-AC_PATH_PROG(PYTHON, python, ,[${pathlist}])
-AM_CONDITIONAL([ENABLE_GNASH_PYTHON_MODULE], false)
+dnl If python support is enabled, look for the flags and libs
+if test x"$python" = xyes; then
+ GNASH_PATH_PYTHON
+fi
+AM_CONDITIONAL([USE_PYTHON], test x"$python" != xno)
AC_PATH_PROG(PERL, perl)
AM_CONDITIONAL(HAVE_PERL, test x"$PERL" != x)
@@ -1969,19 +1980,6 @@
GNASH_PATH_PTHREADS
-if test x"$pthreads" = x"yes"; then
- if test x"$PTHREAD_CFLAGS" != x; then
- CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
- fi
- if test "$CC" != "$PTHREAD_CC"; then
- AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support
pthreads.])
- CC="$PTHREAD_CC"
- fi
- if test "$CXX" != "$PTHREAD_CXX"; then
- AC_MSG_WARN([Replacing compiler $CXX with compiler $PTHREAD_CXX to support
pthreads.])
- CXX="$PTHREAD_CXX"
- fi
-fi
GNASH_PATH_BOOST
dnl AX_GCC_ARCHFLAG(no)
@@ -2821,7 +2819,9 @@
if test x"$PTHREAD_LIBS" != x; then
echo " POSIX Threads lib is: $PTHREAD_LIBS"
else
- echo "ERROR: No pthread development package installed!" >&3
+ if test x$cross_compiling = xno; then
+ echo "ERROR: No pthread development package installed!" >&3
+ fi
fi
fi
@@ -2966,97 +2966,93 @@
fi
dnl don't look for the flash compilers when cross compiling.
-if test x$cross_compiling = xno; then
- if test x"$MING_LIBS" != x; then
- echo " MING flags are $MING_CFLAGS"
- echo " MING libs are $MING_LIBS"
- else
- echo " WARNING: You need to have the Ming development package" >&4
- echo " installed to run most of the tests in Gnash
testsuite." >&4
- echo " Install it from http://www.libming.org/" >&4
- echo " or .deb users: apt-get install libming-dev" >&4
- fi
-
- if test x"$MAKESWF" != x; then
- echo " MING version code is $MING_VERSION_CODE"
- echo " MAKESWF is $MAKESWF"
- else
- echo " WARNING: You need to have the Ming utilities package" >&4
- echo " installed to run most of the tests in Gnash
testsuite." >&4
- echo " Install it from http://www.libming.org" >&4
- echo " or .deb users: apt-get install libming-util" >&4
- fi
-
- if test x"$MAKESWF" != x && test $MING_VERSION_CODE -lt 00040006; then
- echo " WARNING: You have an older version of Ming installed and
will not" >&4
- echo " be able to run all of the tests in Gnash
testsuite." >&4
- echo " Install the latest version from
http://www.libming.org" >&4
- fi
-
- if test x"$SWFDEC_TESTSUITE" != x; then
- echo " SWFDEC testsuite dir is $SWFDEC_TESTSUITE"
- fi
-
- if test x"$MTASC" != x; then
- echo " MTASC is $MTASC"
- echo " MTASC CLASSPATH is $MTASC_CLASSPATH"
- else
- echo " WARNING: You need to have the MTASC compiler packages
installed" >&4
- echo " to run some of the tests in Gnash testsuite." >&4
- echo " You can install it from http://mtasc.org" >&4
- echo " or .deb users: apt-get install mtasc" >&4
- fi
-
- if test x"$HAXE" != x; then
- echo " HAXE is $HAXE"
- echo " HAXE CLASSPATH is $HAXE_CLASSPATH"
- else
- echo " WARNING: You need to have the HAXE compiler packages
installed" >&4
- echo " to run some of the tests in Gnash testsuite." >&4
- echo " You can install it from http://haxe.org" >&4
- echo " or .deb users: apt-get install haxe" >&4
- fi
-
- if test x"$SWFMILL" != x; then
- echo " SWFMILL is $SWFMILL"
- else
- echo " WARNING: You need to have the 'swfmill' tool installed" >&4
- echo " to run some of the tests in Gnash testsuite." >&4
- echo " You can install it from http://swfmill.org/" >&4
- echo " or .deb users: apt-get install swfmill" >&4
- fi
-
- if test x"$SWFC" != x; then
- echo " SWFC is $SWFC"
- else
- echo " WARNING: You need to have 'swfc' from SWFTools installed" >&4
- echo " to run some of the tests in Gnash testsuite." >&4
- echo " You can install it from http://www.swftools.org/"
>&4
- echo " or .deb users: apt-get install swftools" >&4
- fi
-
- if test x"$AS3COMPILE" != x; then
+if test x"$testsuite" = x"yes"; then
+ if test x$cross_compiling = xno; then
+ if test x"$MING_LIBS" != x; then
+ echo " MING flags are $MING_CFLAGS"
+ echo " MING libs are $MING_LIBS"
+ else
+ echo " WARNING: You need to have the Ming development package" >&4
+ echo " installed to run most of the tests in Gnash
testsuite." >&4
+ echo " Install it from http://www.libming.org/" >&4
+ echo " or .deb users: apt-get install libming-dev" >&4
+ fi
+
+ if test x"$MAKESWF" != x; then
+ echo " MING version code is $MING_VERSION_CODE"
+ echo " MAKESWF is $MAKESWF"
+ else
+ echo " WARNING: You need to have the Ming utilities package" >&4
+ echo " installed to run most of the tests in Gnash
testsuite." >&4
+ echo " Install it from http://www.libming.org" >&4
+ echo " or .deb users: apt-get install libming-util" >&4
+ fi
+
+ if test x"$MAKESWF" != x && test $MING_VERSION_CODE -lt 00040006; then
+ echo " WARNING: You have an older version of Ming installed and
will not" >&4
+ echo " be able to run all of the tests in Gnash
testsuite." >&4
+ echo " Install the latest version from
http://www.libming.org" >&4
+ fi
+
+ if test x"$SWFDEC_TESTSUITE" != x; then
+ echo " SWFDEC testsuite dir is $SWFDEC_TESTSUITE"
+ fi
+
+ if test x"$MTASC" != x; then
+ echo " MTASC is $MTASC"
+ echo " MTASC CLASSPATH is $MTASC_CLASSPATH"
+ else
+ echo " WARNING: You need to have the MTASC compiler packages
installed" >&4
+ echo " to run some of the tests in Gnash testsuite." >&4
+ echo " You can install it from http://mtasc.org" >&4
+ echo " or .deb users: apt-get install mtasc" >&4
+ fi
+
+ if test x"$HAXE" != x; then
+ echo " HAXE is $HAXE"
+ echo " HAXE CLASSPATH is $HAXE_CLASSPATH"
+ else
+ echo " WARNING: You need to have the HAXE compiler packages
installed" >&4
+ echo " to run some of the tests in Gnash testsuite." >&4
+ echo " You can install it from http://haxe.org" >&4
+ echo " or .deb users: apt-get install haxe" >&4
+ fi
+
+ if test x"$SWFMILL" != x; then
+ echo " SWFMILL is $SWFMILL"
+ else
+ echo " WARNING: You need to have the 'swfmill' tool installed" >&4
+ echo " to run some of the tests in Gnash testsuite." >&4
+ echo " You can install it from http://swfmill.org/" >&4
+ echo " or .deb users: apt-get install swfmill" >&4
+ fi
+
+ if test x"$SWFC" != x; then
+ echo " SWFC is $SWFC"
+ else
+ echo " WARNING: You need to have 'swfc' from SWFTools installed"
>&4
+ echo " to run some of the tests in Gnash testsuite." >&4
+ echo " You can install it from http://www.swftools.org/"
>&4
+ echo " or .deb users: apt-get install swftools" >&4
+ fi
+
+ if test x"$AS3COMPILE" != x; then
echo " AS3COMPILE is $AS3COMPILE"
- else
- echo " WARNING: you need as3compile from SWFTools" >&4
- echo " to run some of the tests in Gnash testsuite." >&4
- echo " You can install it from http://www.swftools.org/"
>&4
- fi
-
- if test x"$HTTP_TESTSUITE" != x; then
- echo " HTTP testsuite dir is $HTTP_TESTSUITE"
- fi
-
- if test x"$RED5_HOST" != x; then
- echo " RED5 testing host is $RED5_HOST"
- fi
-
- if test x"$PYTHON" != x; then
- echo " PYTHON is $PYTHON"
- else
- echo " WARNING: You need to have python installed" >&4
- echo " to run some of the tests in Gnash testsuite." >&4
- fi
+ else
+ echo " WARNING: you need as3compile from SWFTools" >&4
+ echo " to run some of the tests in Gnash testsuite." >&4
+ echo " You can install it from http://www.swftools.org/"
>&4
+ fi
+
+ if test x"$HTTP_TESTSUITE" != x; then
+ echo " HTTP testsuite dir is $HTTP_TESTSUITE"
+ fi
+
+ if test x"$RED5_HOST" != x; then
+ echo " RED5 testing host is $RED5_HOST"
+ fi
+ fi
+fi
if test x"$PERL" != x; then
echo " PERL is $PERL"
@@ -3065,6 +3061,7 @@
echo " to run some of the tests in Gnash testsuite." >&4
fi
+if test x"$testsuite" = x"yes"; then
if test x"$CSOUND" != x; then
echo " CSOUND is $CSOUND"
else
@@ -3074,7 +3071,6 @@
echo " or .deb users: apt-get install csound" >&4
echo " or .rpm users: yum install csound" >&4
fi
-
fi
if test x"$Z_LIBS" != x; then
@@ -3191,6 +3187,15 @@
echo " ERROR: No NSPR development package is installed." >&3
fi
fi
+if test x"$python" = x"yes"; then
+ if test x"$has_python" = x"yes"; then
+ echo " PYTHON flags are: $PYTHON_CFLAGS"
+ echo " PYTHON libs are: $PYTHON_LIBS"
+ echo " PYTHON executable is are: $PYTHON"
+ else
+ echo " ERROR: No Python development package is installed, but it's
enabled." >&3
+ fi
+fi
if test x$cross_compiling = xyes; then
AC_MSG_NOTICE([This build is setup for cross compiling])
=== modified file 'cygnal/cvm.cpp'
--- a/cygnal/cvm.cpp 2009-02-25 22:33:03 +0000
+++ b/cygnal/cvm.cpp 2009-04-15 05:33:51 +0000
@@ -456,7 +456,7 @@
md->completeLoad();
- std::auto_ptr<movie_instance> mi ( md->create_movie_instance() );
+ std::auto_ptr<Movie> mi ( md->createMovie() );
m.setRootMovie( mi.release() );
if ( quitrequested ) // setRootMovie would execute actions in first frame
@@ -537,7 +537,7 @@
fprintf(stderr, "Kicking movie after %g seconds in STOP mode,
kick ct = %d\n", waitforadvance, kick_count);
fflush(stderr);
m.goto_frame(last_frame + 1);
- m.set_play_state(gnash::MovieClip::PLAY);
+ m.set_play_state(gnash::MovieClip::PLAYSTATE_PLAY);
kick_count++;
if (kick_count > 10) {
=== modified file 'gui/Kde4Gui.cpp'
--- a/gui/Kde4Gui.cpp 2009-03-17 12:01:42 +0000
+++ b/gui/Kde4Gui.cpp 2009-04-13 15:08:49 +0000
@@ -95,7 +95,8 @@
_application.reset(new QApplication(*i, r));
_window.reset(new QMainWindow());
- _drawingWidget = new DrawingWidget(*this);
+ _embedWidget = new EmbedWidget(*this);
+ _drawingWidget = _embedWidget->drawingWidget();
_glue.init (argc, argv);
@@ -137,17 +138,16 @@
_window->setWindowIcon(QIcon(PKGDATADIR"/GnashG.png"));
if(_xid) {
- _drawingWidget->embedInto(_xid);
- _drawingWidget->show();
+ _embedWidget->embedInto(_xid);
+ _embedWidget->show();
// Adjust width and height to the window we're being embedded into...
XWindowAttributes winAttributes;
XGetWindowAttributes(QX11Info::display(), _xid, &winAttributes);
_width=winAttributes.width;
_height=winAttributes.height;
- _drawingWidget->resize(_width, _height);
} else {
- // The QMainWindow takes ownership of the DrawingWidget.
- _window->setCentralWidget(_drawingWidget);
+ // The QMainWindow takes ownership of the widgets.
+ _window->setCentralWidget(_embedWidget);
_window->show();
}
@@ -287,9 +287,8 @@
_fullscreen = true;
fullscreenAction->setChecked(_fullscreen);
- // Make the widget a top level window so it can be fullscreen
- _drawingWidget->setWindowFlags(Qt::Window);
- _drawingWidget->showFullScreen();
+ _embedWidget->setWindowFlags(Qt::Window);
+ _embedWidget->showFullScreen();
}
void
@@ -298,18 +297,13 @@
_fullscreen = false;
fullscreenAction->setChecked(_fullscreen);
- if (_drawingWidget->isFullScreen()) {
- // Re-embed the drawing wiget into the browser
+ if (_embedWidget->isFullScreen()) {
+ _embedWidget->setWindowFlags(Qt::Widget);
+ _embedWidget->showNormal();
if (_xid) {
- _drawingWidget->showNormal();
- _drawingWidget->embedInto(_xid);
- }
- else {
- _drawingWidget->setWindowFlags(Qt::Widget);
- _drawingWidget->showNormal();
+ _embedWidget->embedInto(_xid);
}
}
-
}
gnash::key::code
@@ -636,9 +630,54 @@
(Qt::Key_QuoteDbl, gnash::key::DOUBLE_QUOTE);
}
+void
+Kde4Gui::playHook()
+{
+ _embedWidget->hidePlayButton();
+}
+
+void
+Kde4Gui::stopHook()
+{
+ _embedWidget->showPlayButton();
+}
+
+/// EmbedWidget implementation
+
+EmbedWidget::EmbedWidget(Kde4Gui& gui)
+ : QX11EmbedWidget()
+{
+ _drawingWidget = new DrawingWidget(gui);
+ _playButton = new QPushButton(_q("Click to Play"), this);
+
+ QVBoxLayout* layout = new QVBoxLayout(this);
+ layout->setContentsMargins(0,0,0,0);
+ layout->setSpacing(0);
+ layout->addWidget(_playButton);
+ layout->addWidget(_drawingWidget);
+ _playButton->hide();
+
+ connect(_playButton, SIGNAL(clicked()), this, SLOT(hidePlayButton()));
+ connect(_playButton, SIGNAL(clicked()), _drawingWidget, SLOT(play()));
+}
+
+void EmbedWidget::hidePlayButton()
+{
+ _playButton->hide();
+}
+
+void EmbedWidget::showPlayButton()
+{
+ _playButton->show();
+}
/// DrawingWidget implementation
+DrawingWidget::DrawingWidget(Kde4Gui& gui)
+ : _gui(gui)
+{
+}
+
void
DrawingWidget::paintEvent(QPaintEvent *event)
{
=== modified file 'gui/Kde4Gui.h'
--- a/gui/Kde4Gui.h 2009-02-08 21:11:17 +0000
+++ b/gui/Kde4Gui.h 2009-04-13 15:08:49 +0000
@@ -45,6 +45,7 @@
class QSlider;
class QLineEdit;
class QSpinBox;
+class QStackedWidget;
namespace gnash {
class Kde4Gui;
@@ -53,17 +54,12 @@
namespace gnash
{
-class DrawingWidget : public QX11EmbedWidget
+class DrawingWidget : public QWidget
{
Q_OBJECT
public:
- DrawingWidget(Kde4Gui& gui)
- :
- QX11EmbedWidget(),
- _gui(gui)
- {}
-
+ DrawingWidget(Kde4Gui& gui);
~DrawingWidget() {}
public slots:
@@ -95,6 +91,26 @@
};
+class EmbedWidget : public QX11EmbedWidget
+{
+ Q_OBJECT
+
+public:
+ EmbedWidget(Kde4Gui& gui);
+ ~EmbedWidget() {};
+
+ DrawingWidget* drawingWidget() { return _drawingWidget; }
+
+public slots:
+ void hidePlayButton();
+ void showPlayButton();
+
+private:
+ QPushButton* _playButton;
+ DrawingWidget* _drawingWidget;
+};
+
+
class DSOEXPORT Kde4Gui : public Gui
{
@@ -136,12 +152,23 @@
/// Set up the map of Qt to Gnash keys.
void setupKeyMap();
+ /// Called when the movie is stopped. Also called at startup if
+ /// start stopped is configured.
+ void stopHook();
+
+ /// Called when the movie is played.
+ void playHook();
+
+
DrawBounds _drawbounds;
/// The main application, which should destroy everything
/// left on closing.
std::auto_ptr<QApplication> _application;
+ /// The widget that is used for embedding between processes.
+ EmbedWidget* _embedWidget;
+
/// The widget for rendering and handling user events.
//
/// Ownership is transferred to the main window, which
=== modified file 'gui/gnash.cpp'
--- a/gui/gnash.cpp 2009-04-01 12:26:49 +0000
+++ b/gui/gnash.cpp 2009-04-14 18:44:33 +0000
@@ -27,6 +27,7 @@
#include "debugger.h"
#include "arg_parser.h"
#include "GnashNumeric.h" // for clamp
+#include "bzrversion.h"
#ifdef HAVE_FFMPEG_AVCODEC_H
extern "C" {
@@ -172,7 +173,8 @@
<< _(" - Media handler: ") << MEDIA_CONFIG << endl
<< _(" Configured with: ") << CONFIG_CONFIG << endl
- << _(" CXXFLAGS: ") << CXXFLAGS << endl;
+ << _(" CXXFLAGS: ") << CXXFLAGS << endl
+ << " Version: " << BRANCH_NICK << ":" << BRANCH_REVNO << endl;
#ifdef USE_FFMPEG
cout << _("Built against ffmpeg version: ") << LIBAVCODEC_IDENT << endl;
=== modified file 'gui/gtk_glue_agg_xv.cpp'
--- a/gui/gtk_glue_agg_xv.cpp 2009-03-19 23:14:43 +0000
+++ b/gui/gtk_glue_agg_xv.cpp 2009-04-14 17:49:58 +0000
@@ -116,11 +116,10 @@
if (first && VM::isInitialized()) {
first = false;
- movie_definition* def = VM::get().getRoot().get_movie_definition();
- assert(def);
+ const Movie& mi = VM::get().getRoot().getRootMovie();
- _movie_width = def->get_width_pixels();
- _movie_height = def->get_height_pixels();
+ _movie_width = mi.widthPixels();
+ _movie_height = mi.heightPixels();
if (!create_xv_shmimage(_movie_width, _movie_height)) {
if (!create_xv_image(_movie_width, _movie_height)) {
=== modified file 'gui/gui.cpp'
--- a/gui/gui.cpp 2009-04-03 18:45:30 +0000
+++ b/gui/gui.cpp 2009-04-15 05:33:51 +0000
@@ -592,7 +592,7 @@
{
if ( _stage )
{
- float fps =
_stage->get_movie_definition()->get_frame_rate();
+ float fps = _stage->frameRate();
// Min interval allowed: 1/100
second (100FPS)
unsigned int ni = 1000.0/fps;
setInterval(ni);
@@ -899,7 +899,7 @@
return;
}
- std::auto_ptr<movie_instance> mr ( _movieDef->create_movie_instance() );
+ std::auto_ptr<Movie> mr ( _movieDef->createMovie() );
mr->setVariables(_flashVars);
_stage->setRootMovie( mr.release() ); // will construct the instance
@@ -948,9 +948,9 @@
size_t cur_frame = m->getRootMovie()->get_current_frame();
size_t tot_frames = m->getRootMovie()->get_frame_count();
bool advanced = m->advance();
- m->get_movie_definition()->ensure_frame_loaded(tot_frames);
+ m->getRootMovie.ensureFrameLoaded(tot_frames);
m->goto_frame(cur_frame+1);
- m->set_play_state(gnash::MovieClip::PLAY);
+ m->set_play_state(gnash::MovieClip::PLAYSTATE_PLAY);
log_debug(_("Frame %d"), m->get_current_frame());
#endif
@@ -1004,8 +1004,8 @@
if ( ! loops() )
{
size_t curframe = m->get_current_frame(); // can be 0 on
malformed SWF
- gnash::MovieClip* si = m->getRootMovie();
- if (curframe + 1 >= si->get_frame_count())
+ const gnash::MovieClip& si = m->getRootMovie();
+ if (curframe + 1 >= si.get_frame_count())
{
quit();
}
=== modified file 'gui/klash4.moc.in'
--- a/gui/klash4.moc.in 2009-03-19 16:27:50 +0000
+++ b/gui/klash4.moc.in 2009-04-13 15:08:49 +0000
@@ -1,7 +1,7 @@
/****************************************************************************
** Meta object code from reading C++ file 'Kde4Gui.h'
**
-** Created: Mon Feb 9 08:36:10 2009
+** Created: Sun Apr 12 21:07:39 2009
** by: The Qt Meta Object Compiler version 59 (Qt 4.4.3)
**
** WARNING! All changes made in this file will be lost!
@@ -47,7 +47,7 @@
};
const QMetaObject gnash::DrawingWidget::staticMetaObject = {
- { &QX11EmbedWidget::staticMetaObject,
qt_meta_stringdata_gnash__DrawingWidget,
+ { &QWidget::staticMetaObject, qt_meta_stringdata_gnash__DrawingWidget,
qt_meta_data_gnash__DrawingWidget, 0 }
};
@@ -61,12 +61,12 @@
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_gnash__DrawingWidget))
return static_cast<void*>(const_cast< DrawingWidget*>(this));
- return QX11EmbedWidget::qt_metacast(_clname);
+ return QWidget::qt_metacast(_clname);
}
int gnash::DrawingWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
- _id = QX11EmbedWidget::qt_metacall(_c, _id, _a);
+ _id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
@@ -84,6 +84,60 @@
}
return _id;
}
+static const uint qt_meta_data_gnash__EmbedWidget[] = {
+
+ // content:
+ 1, // revision
+ 0, // classname
+ 0, 0, // classinfo
+ 2, 10, // methods
+ 0, 0, // properties
+ 0, 0, // enums/sets
+
+ // slots: signature, parameters, type, tag, flags
+ 20, 19, 19, 19, 0x0a,
+ 37, 19, 19, 19, 0x0a,
+
+ 0 // eod
+};
+
+static const char qt_meta_stringdata_gnash__EmbedWidget[] = {
+ "gnash::EmbedWidget\0\0hidePlayButton()\0"
+ "showPlayButton()\0"
+};
+
+const QMetaObject gnash::EmbedWidget::staticMetaObject = {
+ { &QX11EmbedWidget::staticMetaObject,
qt_meta_stringdata_gnash__EmbedWidget,
+ qt_meta_data_gnash__EmbedWidget, 0 }
+};
+
+const QMetaObject *gnash::EmbedWidget::metaObject() const
+{
+ return &staticMetaObject;
+}
+
+void *gnash::EmbedWidget::qt_metacast(const char *_clname)
+{
+ if (!_clname) return 0;
+ if (!strcmp(_clname, qt_meta_stringdata_gnash__EmbedWidget))
+ return static_cast<void*>(const_cast< EmbedWidget*>(this));
+ return QX11EmbedWidget::qt_metacast(_clname);
+}
+
+int gnash::EmbedWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
+{
+ _id = QX11EmbedWidget::qt_metacall(_c, _id, _a);
+ if (_id < 0)
+ return _id;
+ if (_c == QMetaObject::InvokeMetaMethod) {
+ switch (_id) {
+ case 0: hidePlayButton(); break;
+ case 1: showPlayButton(); break;
+ }
+ _id -= 2;
+ }
+ return _id;
+}
static const uint qt_meta_data_gnash__Kde4GuiPrefs__PreferencesDialog[] = {
// content:
=== modified file 'libamf/amf_msg.cpp'
--- a/libamf/amf_msg.cpp 2009-03-29 13:08:23 +0000
+++ b/libamf/amf_msg.cpp 2009-04-10 20:20:02 +0000
@@ -44,9 +44,15 @@
size_t size = sizeof(AMF_msg::context_header_t);
boost::shared_ptr<amf::Buffer> buf (new amf::Buffer(size));
- *buf = htons(version);
- *buf += htons(headers);
- *buf += htons(messages);
+ // use a short as a temporary, as it turns out htons() returns a 32bit int
+ // instead when compiling with -O2. This forces appending bytes to get the
+ // right size.
+ boost::uint16_t swapped = htons(version);
+ *buf = swapped;
+ swapped = htons(headers);
+ *buf += swapped;
+ swapped = htons(messages);
+ *buf += swapped;
return buf;
}
=== modified file 'libbase/BitsReader.h'
--- a/libbase/BitsReader.h 2009-02-25 22:33:03 +0000
+++ b/libbase/BitsReader.h 2009-04-16 08:42:14 +0000
@@ -21,7 +21,6 @@
#ifndef BITSREADER_H
#define BITSREADER_H
-#include "swf.h"
#include "dsodefs.h"
#include "GnashException.h"
#include "log.h"
=== modified file 'libbase/GnashAlgorithm.h'
--- a/libbase/GnashAlgorithm.h 2009-03-14 09:22:52 +0000
+++ b/libbase/GnashAlgorithm.h 2009-04-15 15:30:11 +0000
@@ -22,6 +22,8 @@
#include <algorithm>
#include <boost/checked_delete.hpp>
+#include <boost/intrusive_ptr.hpp>
+#include <boost/shared_ptr.hpp>
namespace gnash {
@@ -58,6 +60,20 @@
typedef typename RemovePointer<T>::value_type value_type;
};
+template<typename T>
+struct RemovePointer<boost::intrusive_ptr<T> >
+{
+ typedef typename RemovePointer<T>::value_type value_type;
+};
+
+template<typename T>
+struct RemovePointer<boost::shared_ptr<T> >
+{
+ typedef typename RemovePointer<T>::value_type value_type;
+};
+
+
+
/// Delete a pointer safely
//
/// Any depth of pointers-to-pointers (up to maximum template recursion) can
=== modified file 'libcore/Bitmap.cpp'
--- a/libcore/Bitmap.cpp 2009-04-07 09:19:54 +0000
+++ b/libcore/Bitmap.cpp 2009-04-15 12:27:37 +0000
@@ -33,21 +33,37 @@
_width(_bitmapData->getWidth()),
_height(_bitmapData->getHeight())
{
- _shape.setBounds(rect(0, 0, _width * 20, _height * 20));
+ _shape.setBounds(rect(0, 0, pixelsToTwips(_width),
pixelsToTwips(_height)));
}
+Bitmap::Bitmap(const BitmapMovieDefinition* const def, DisplayObject* parent,
+ int id)
+ :
+ DisplayObject(parent, id),
+ _def(def),
+ _bitmapInfo(0),
+ _width(twipsToPixels(def->get_frame_size().width())),
+ _height(twipsToPixels(def->get_frame_size().height()))
+{
+ _shape.setBounds(def->get_frame_size());
+}
Bitmap::~Bitmap()
{
}
+const BitmapInfo*
+Bitmap::bitmap() const
+{
+ if (_def) return _def->bitmap();
+ return _bitmapInfo.get();
+}
void
Bitmap::stagePlacementCallback(as_object* initObj)
{
assert(!initObj);
-
- _bitmapData->registerBitmap(this);
+ if (_bitmapData) _bitmapData->registerBitmap(this);
update();
}
@@ -60,8 +76,10 @@
void
Bitmap::display()
{
+ /// Don't display cleared Bitmaps.
+ if (!_def && !_bitmapData) return;
+
_shape.display(*this);
-
clear_invalidated();
}
@@ -85,7 +103,7 @@
}
void
-Bitmap::drawBitmap()
+Bitmap::makeBitmap()
{
const BitmapData_as::BitmapArray& data = _bitmapData->getBitmapData();
@@ -112,10 +130,11 @@
void
-Bitmap::finalize()
+Bitmap::checkBitmapData()
{
- if (!_bitmapData) return;
+ /// Nothing to do for disposed bitmaps.
+ if (_def && !_bitmapData) return;
const BitmapData_as::BitmapArray& data = _bitmapData->getBitmapData();
@@ -126,20 +145,26 @@
_shape.clear();
return;
}
-
- drawBitmap();
+}
+
+void
+Bitmap::makeBitmapShape()
+{
+
+ if (!_def && !_bitmapData) return;
+
+ if (_bitmapData) makeBitmap();
// Width and height are a maximum of 2880, so there is no risk of
// overflow
- const int w = _width * 20;
- const int h = _height * 20;
+ const int w = pixelsToTwips(_width);
+ const int h = pixelsToTwips(_height);
SWFMatrix mat;
mat.set_scale(1.0 / 20, 1.0 / 20);
- fill_style fill(_bitmapInfo.get(), mat);
+ fill_style fill(bitmap(), mat);
const size_t fillLeft = _shape.add_fill_style(fill);
-
Path bmpath(w, h, fillLeft, 0, 0, false);
bmpath.drawLineTo(w, 0);
bmpath.drawLineTo(0, 0);
@@ -155,11 +180,9 @@
void
Bitmap::update()
{
-
set_invalidated();
-
- finalize();
-
+ checkBitmapData();
+ makeBitmapShape();
}
}
=== modified file 'libcore/Bitmap.h'
--- a/libcore/Bitmap.h 2009-04-07 17:33:15 +0000
+++ b/libcore/Bitmap.h 2009-04-15 12:27:37 +0000
@@ -23,23 +23,41 @@
#include "BitmapInfo.h"
#include "flash/display/BitmapData_as.h"
#include "render.h"
-
+#include "BitmapMovieDefinition.h"
#include "DynamicShape.h"
namespace gnash {
-/// A Dynamic Bitmap DisplayObject. This is not AS-referencable, but can be
-/// removed and placed using depths like normal DisplayObjects
(DisplayObjects).
+/// A Bitmap DisplayObject. This is not AS-referencable, but can be
+/// removed and placed using depths like normal DisplayObjects.
+//
+/// This can be constructed dynamically from a BitmapData, or non-dynamically
+/// as part of a BitmapMovie.
+//
+/// For non-dynamic Bitmap DisplayObjects, the bitmap data never changes. The
+/// update() function is called once on stage placement.
+//
+/// For dynamic Bitmap DisplayObjects, the attached BitmapData_as should call
+/// update() whenever the data changes. This Bitmap registers itself with
+/// the BitmapData_as on stage placement.
class Bitmap : public DisplayObject
{
public:
- Bitmap(boost::intrusive_ptr<BitmapData_as> bd, DisplayObject* parent,
int id);
+ Bitmap(boost::intrusive_ptr<BitmapData_as> bd, DisplayObject* parent,
+ int id);
+
+ Bitmap(const BitmapMovieDefinition* const def, DisplayObject* parent,
+ int id);
~Bitmap();
+ /// Called to update the Bitmap's DynamicShape for display.
+ //
+ /// For non-dynamic bitmaps, this should only be called once (for
+ /// efficiency - there are no harmful side-effects)
void update();
virtual void add_invalidated_bounds(InvalidatedRanges& ranges, bool force);
@@ -57,17 +75,32 @@
void markReachableObjects() const {
if (_bitmapData) _bitmapData->setReachable();
if (_bitmapInfo) _bitmapInfo->setReachable();
+ if (_def) _def->setReachable();
}
private:
- /// This must convert the BitmapData to a BitmapInfo.
- //
- /// The result must be stored in _bitmapInfo.
- void drawBitmap();
-
- /// Call this before rendering to make sure the BitmapInfo is updated.
- void finalize();
+ /// Return the bitmap used for this Bitmap DisplayObject.
+ //
+ /// It comes either from the definition or the BitmapData_as.
+ const BitmapInfo* bitmap() const;
+
+ /// This updates _bitmapInfo from the BitmapData_as
+ void makeBitmap();
+
+ /// Checks whether an attached BitmapData_as is disposed.
+ //
+ /// If the BitmapData_as has been disposed, deletes _bitmapData.
+ /// and clears the DynamicShape.
+ void checkBitmapData();
+
+ /// This creates the DynamicShape for rendering.
+ //
+ /// It should be called every time the underlying bitmap changes; for
+ /// non-dynamic Bitmaps, this is only on construction.
+ void makeBitmapShape();
+
+ const boost::intrusive_ptr<const BitmapMovieDefinition> _def;
boost::intrusive_ptr<BitmapData_as> _bitmapData;
=== renamed file 'libcore/BitmapMovieInstance.cpp' => 'libcore/BitmapMovie.cpp'
--- a/libcore/BitmapMovieInstance.cpp 2009-04-07 09:19:54 +0000
+++ b/libcore/BitmapMovie.cpp 2009-04-15 09:08:37 +0000
@@ -15,33 +15,28 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#include "BitmapMovieInstance.h"
+#include "BitmapMovie.h"
#include "BitmapMovieDefinition.h"
-#include "fill_style.h"
-#include "Geometry.h" // for class path and class edge
-#include "render.h" // for ::display
namespace gnash {
-BitmapMovieInstance::BitmapMovieInstance(BitmapMovieDefinition* def,
+BitmapMovie::BitmapMovie(const BitmapMovieDefinition* const def,
DisplayObject* parent)
:
- movie_instance(def, parent)
-{
- // We need to assign a DisplayObject id to the instance, or an assertion
- // will fail in DisplayObject.cpp (parent==NULL || id != -1)
+ Movie(def, parent),
+ _def(def)
+{
+ assert(def);
+ boost::intrusive_ptr<DisplayObject> ch = def->createDisplayObject(this, 1);
- assert(def);
- boost::intrusive_ptr<DisplayObject> ch = def->createDisplayObject(this,
1);
-
- const int depth = 1 + DisplayObject::staticDepthOffset;
- placeDisplayObject(ch.get(), depth);
+ const int depth = 1 + DisplayObject::staticDepthOffset;
+ placeDisplayObject(ch.get(), depth);
}
std::auto_ptr<GnashImage>
-BitmapMovieInstance::drawToBitmap(const SWFMatrix& /* mat */, const cxform& /*
cx */,
- DisplayObject::BlendMode /* bm */, const
rect& /* clipRect */,
- bool /* smooth */)
+BitmapMovie::drawToBitmap(const SWFMatrix& /* mat */, const cxform& /* cx */,
+ DisplayObject::BlendMode /* bm */, const rect& /* clipRect */,
+ bool /* smooth */)
{
return std::auto_ptr<GnashImage>();
}
=== renamed file 'libcore/BitmapMovieInstance.h' => 'libcore/BitmapMovie.h'
--- a/libcore/BitmapMovieInstance.h 2009-04-03 09:18:40 +0000
+++ b/libcore/BitmapMovie.h 2009-04-15 09:08:37 +0000
@@ -16,32 +16,63 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#ifndef GNASH_BITMAPMOVIEINSTANCE_H
-#define GNASH_BITMAPMOVIEINSTANCE_H
+#ifndef GNASH_BITMAP_MOVIE_H
+#define GNASH_BITMAP_MOVIE_H
-#include "movie_instance.h" // for inheritance
+#include "BitmapMovieDefinition.h"
+#include "Movie.h" // for inheritance
// Forward declarations
namespace gnash
{
- class BitmapMovieDefinition;
class GnashImage;
+ class DisplayObject;
}
namespace gnash
{
-/// Instance of a BitmapMovieDefinition
-class BitmapMovieInstance : public movie_instance
+/// A top-level movie displaying a still bitmap.
+//
+/// A loaded BitmapMovie is tested in misc-ming.all/loadMovieTest.swf to
+/// have a DisplayList, so it is appropriate that it inherits from MovieClip.
+class BitmapMovie : public Movie
{
public:
- BitmapMovieInstance(BitmapMovieDefinition* def, DisplayObject*
parent=0);
-
- virtual ~BitmapMovieInstance() {}
-
+ BitmapMovie(const BitmapMovieDefinition* const def, DisplayObject*
parent);
+
+ virtual ~BitmapMovie() {}
+
+ /// This is a no-op for a BitmapMovie, as it never changes.
+ virtual void advance() { }
+
+ virtual float frameRate() const {
+ return _def->get_frame_rate();
+ }
+
+ virtual float widthPixels() const {
+ return _def->get_width_pixels();
+ }
+
+ virtual float heightPixels() const {
+ return _def->get_height_pixels();
+ }
+
+ virtual const std::string& url() const {
+ return _def->get_url();
+ }
+
+ virtual int version() const {
+ return _def->get_version();
+ }
+
+ virtual const movie_definition* definition() const {
+ return _def;
+ }
+
/// Render this MovieClip to a GnashImage using the passed transform
//
/// @return The GnashImage with the MovieClip drawn onto it.
@@ -51,16 +82,9 @@
DisplayObject::BlendMode bm = DisplayObject::BLENDMODE_NORMAL,
const rect& clipRect = rect(),
bool smooth = false);
-
- /// Do nothing on restart. Especially don't trash the DisplayList
- //
- /// TODO: this is needed due to the implementation detail of
- /// using the DisplayList to store our bitmap-filled
- /// shape. Using the _drawable instead, or overriding
- /// ::display to simply display our definition is likely
- /// the best way to go instead (we'd also reuse the same
- /// bitmap info rather then creating new instances..)
- void restart() {}
+private:
+
+ const BitmapMovieDefinition* const _def;
};
=== modified file 'libcore/Button.cpp'
--- a/libcore/Button.cpp 2009-04-07 12:34:43 +0000
+++ b/libcore/Button.cpp 2009-04-15 09:08:37 +0000
@@ -294,7 +294,8 @@
}
-Button::Button(SWF::DefineButtonTag& def, DisplayObject* parent, int id)
+Button::Button(const SWF::DefineButtonTag* const def, DisplayObject* parent,
+ int id)
:
InteractiveObject(parent, id),
m_last_mouse_flags(IDLE),
@@ -306,7 +307,7 @@
set_prototype(getButtonInterface());
// check up presence Key events
- if ( _def.hasKeyPressHandler() )
+ if ( _def->hasKeyPressHandler() )
{
_vm.getRoot().add_key_listener(this);
}
@@ -352,7 +353,7 @@
if ( id.keyCode() == key::INVALID ) return false;
ButtonActionPusher xec(getVM().getRoot(), this);
- _def.forEachTrigger(id, xec);
+ _def->forEachTrigger(id, xec);
return xec.called;
}
@@ -386,7 +387,7 @@
InteractiveObject*
Button::topmostMouseEntity(boost::int32_t x, boost::int32_t y)
{
- if (!isVisible() || !isEnabled())
+ if (!visible() || !isEnabled())
{
return 0;
}
@@ -411,7 +412,7 @@
it!=itE; ++it)
{
DisplayObject* ch = *it;
- if ( ! ch->isVisible() ) continue;
+ if ( ! ch->visible() ) continue;
InteractiveObject *hit = ch->topmostMouseEntity(p.x, p.y);
if ( hit ) return hit;
}
@@ -492,7 +493,7 @@
// Button transition sounds.
do {
- if (!_def.hasSound()) break;
+ if (!_def->hasSound()) break;
// Check if there is a sound handler
sound::sound_handler* s = _vm.getRoot().runInfo().soundHandler();
@@ -523,7 +524,7 @@
if (bi < 0) break;
const SWF::DefineButtonSoundTag::ButtonSound& bs =
- _def.buttonSound(bi);
+ _def->buttonSound(bi);
// DisplayObject zero is considered as null DisplayObject
if (!bs.soundID) break;
@@ -566,7 +567,7 @@
movie_root& mr = getVM().getRoot();
ButtonActionPusher xec(mr, this);
- _def.forEachTrigger(event, xec);
+ _def->forEachTrigger(event, xec);
// check for built-in event handler.
std::auto_ptr<ExecutableCode> code ( get_event_handler(event) );
@@ -621,7 +622,7 @@
list.clear();
using namespace SWF;
- const DefineButtonTag::ButtonRecords& br = _def.buttonRecords();
+ const DefineButtonTag::ButtonRecords& br = _def->buttonRecords();
size_t index = 0;
for (DefineButtonTag::ButtonRecords::const_iterator i = br.begin(),
@@ -727,7 +728,7 @@
if ( ! oldch )
{
// Not there, instantiate
- SWF::ButtonRecord& bdef = _def.buttonRecords()[i];
+ const SWF::ButtonRecord& bdef = _def->buttonRecords()[i];
const SWFMatrix& mat = bdef.m_button_matrix;
const cxform& cx = bdef.m_button_cxform;
@@ -784,7 +785,7 @@
{
// Not visible anyway
- if (!isVisible()) return;
+ if (!visible()) return;
ranges.add(m_old_invalidated_ranges);
@@ -890,7 +891,7 @@
get_active_records(hitChars, HIT);
for (ActiveRecords::iterator i=hitChars.begin(),e=hitChars.end(); i!=e;
++i)
{
- SWF::ButtonRecord& bdef = _def.buttonRecords()[*i];
+ const SWF::ButtonRecord& bdef = _def->buttonRecords()[*i];
const SWFMatrix& mat = bdef.m_button_matrix;
const cxform& cx = bdef.m_button_cxform;
@@ -915,7 +916,7 @@
// Some slots will probably be never used (consider HIT-only records)
// but for now this direct corrispondence between record number
// and active DisplayObject will be handy.
- _stateCharacters.resize(_def.buttonRecords().size());
+ _stateCharacters.resize(_def->buttonRecords().size());
// Instantiate the default state DisplayObjects
ActiveRecords upChars;
@@ -924,7 +925,7 @@
for (ActiveRecords::iterator i=upChars.begin(),e=upChars.end(); i!=e; ++i)
{
int rno = *i;
- SWF::ButtonRecord& bdef = _def.buttonRecords()[rno];
+ const SWF::ButtonRecord& bdef = _def->buttonRecords()[rno];
const SWFMatrix& mat = bdef.m_button_matrix;
const cxform& cx = bdef.m_button_cxform;
@@ -959,7 +960,7 @@
{
assert(isReachable());
- _def.setReachable();
+ _def->setReachable();
// Mark state DisplayObjects as reachable
for (DisplayObjects::const_iterator i=_stateCharacters.begin(),
e=_stateCharacters.end();
@@ -1070,7 +1071,7 @@
movie_root& mr = _vm.getRoot();
unsigned int levelno;
if ( mr.isLevelTarget(name, levelno) ) {
- movie_instance* mo = mr.getLevel(levelno).get();
+ Movie* mo = mr.getLevel(levelno).get();
if ( mo ) {
val->set_as_object(mo);
return true;
@@ -1132,7 +1133,7 @@
int
Button::getSWFVersion() const
{
- return _def.getSWFVersion();
+ return _def->getSWFVersion();
}
static as_object*
=== modified file 'libcore/Button.h'
--- a/libcore/Button.h 2009-04-05 08:55:10 +0000
+++ b/libcore/Button.h 2009-04-15 09:08:37 +0000
@@ -70,7 +70,8 @@
HIT
};
- Button(SWF::DefineButtonTag& def, DisplayObject* parent, int id);
+ Button(const SWF::DefineButtonTag* const def, DisplayObject* parent,
+ int id);
~Button();
@@ -165,7 +166,7 @@
MouseState m_mouse_state;
- SWF::DefineButtonTag& _def;
+ const boost::intrusive_ptr<const SWF::DefineButtonTag> _def;
DisplayObjects _stateCharacters;
=== modified file 'libcore/DisplayList.cpp'
--- a/libcore/DisplayList.cpp 2009-04-03 09:48:13 +0000
+++ b/libcore/DisplayList.cpp 2009-04-15 05:33:51 +0000
@@ -579,7 +579,7 @@
DisplayObject* ch = it->get();
DisplayObject* mask = ch->getMask();
- if (mask && ch->isVisible() && ! mask->isUnloaded())
+ if (mask && ch->visible() && ! mask->isUnloaded())
{
render::begin_submit_mask();
@@ -614,7 +614,7 @@
}
// check for non-mask hiden DisplayObjects
- if (!renderAsMask && (!ch->isVisible())) {
+ if (!renderAsMask && (!ch->visible())) {
ch->omit_display();
// Don't display non-mask hidden DisplayObjects
continue;
=== modified file 'libcore/DisplayObject.cpp'
--- a/libcore/DisplayObject.cpp 2009-04-03 17:25:34 +0000
+++ b/libcore/DisplayObject.cpp 2009-04-15 05:33:51 +0000
@@ -242,7 +242,7 @@
DisplayObject::add_invalidated_bounds(InvalidatedRanges& ranges, bool force)
{
ranges.add(m_old_invalidated_ranges);
- if (isVisible() && (m_invalidated||force))
+ if (visible() && (m_invalidated||force))
{
rect bounds;
bounds.expand_to_transformed_rect(getWorldMatrix(), getBounds());
@@ -733,7 +733,7 @@
as_value rv;
if (!fn.nargs) // getter
{
- rv = as_value(ptr->isVisible());
+ rv = as_value(ptr->visible());
}
else // setter
{
@@ -1210,7 +1210,7 @@
{
// TODO: check what happens when this DisplayObject
- // is a movie_instance loaded into another
+ // is a Movie loaded into another
// running movie.
typedef std::vector<std::string> Path;
@@ -1240,7 +1240,7 @@
if ( path.empty() )
{
- if ( _vm.getRoot().getRootMovie() == this ) return "/";
+ if (&_vm.getRoot().getRootMovie() == this) return "/";
std::stringstream ss;
ss << "_level" << m_depth-DisplayObject::staticDepthOffset;
return ss.str();
@@ -1248,7 +1248,7 @@
// Build the target string from the parents stack
std::string target;
- if ( topLevel != _vm.getRoot().getRootMovie() )
+ if (topLevel != &_vm.getRoot().getRootMovie() )
{
std::stringstream ss;
ss << "_level" <<
topLevel->get_depth()-DisplayObject::staticDepthOffset;
@@ -1282,7 +1282,7 @@
{
// TODO: check what happens when this DisplayObject
- // is a movie_instance loaded into another
+ // is a Movie loaded into another
// running movie.
typedef std::vector<std::string> Path;
@@ -1298,14 +1298,14 @@
if ( ! parent )
{
std::stringstream ss;
- if (!dynamic_cast<const movie_instance*>(ch))
+ if (!dynamic_cast<const Movie*>(ch))
{
// must be an as-referenceable
// DisplayObject created using 'new'
// like, new MovieClip, new Video, new
TextField...
//
log_debug("DisplayObject %p (%s) doesn't have a
parent and "
- "is not a movie_instance", ch, typeName(*ch));
+ "is not a Movie", ch, typeName(*ch));
ss << "<no parent, depth" << ch->get_depth() <<
">";
path.push_back(ss.str());
}
=== modified file 'libcore/DisplayObject.h'
--- a/libcore/DisplayObject.h 2009-04-08 07:08:06 +0000
+++ b/libcore/DisplayObject.h 2009-04-15 05:33:51 +0000
@@ -40,13 +40,14 @@
#include <string>
#include <cassert>
#include <boost/cstdint.hpp> // For C99 int types
+#include <boost/noncopyable.hpp>
//#define DEBUG_SET_INVALIDATED 1
// Forward declarations
namespace gnash {
class MovieClip;
- class movie_instance;
+ class Movie;
class ExecutableCode;
class action_buffer;
class movie_definition;
@@ -79,7 +80,7 @@
/// dynamic DisplayObjects, but tags are not always stored. They are not
/// stored in most InteractiveObjects because most properties can be
/// overridden during SWF execution.
-class DisplayObject : public as_object
+class DisplayObject : public as_object, boost::noncopyable
{
public:
@@ -481,21 +482,21 @@
///
virtual bool pointInVisibleShape(boost::int32_t x, boost::int32_t y) const
{
- if ( ! isVisible() ) return false;
+ if ( ! visible() ) return false;
if ( isMask() ) return false;
return pointInShape(x, y);
}
/// Return the relative root of this DisplayObject
//
- /// The "relative" is the movie_instance created by
+ /// The "relative" is the Movie created by
/// the same SWF definition that contained the
/// definition of this DisplayObject.
///
/// The default implementation is to invoke get_root
/// against this DisplayObject's parent.
///
- virtual movie_instance* get_root() const {
+ virtual Movie* get_root() const {
return get_parent()->get_root();
}
@@ -601,7 +602,7 @@
void set_visible(bool visible);
// Return true if this DisplayObject should be rendered
- bool isVisible() const { return _visible; }
+ bool visible() const { return _visible; }
/// ActionScript event handler. Returns true if a handler was called.
//
@@ -645,7 +646,7 @@
virtual const DisplayObject* findDropTarget(boost::int32_t x,
boost::int32_t y, DisplayObject* dragging) const
{
- if (this != dragging && isVisible() && pointInVisibleShape(x, y)) {
+ if (this != dragging && visible() && pointInVisibleShape(x, y)) {
return this;
}
=== modified file 'libcore/DynamicShape.cpp'
--- a/libcore/DynamicShape.cpp 2009-04-07 13:26:18 +0000
+++ b/libcore/DynamicShape.cpp 2009-04-14 18:31:04 +0000
@@ -42,7 +42,7 @@
}
void
-DynamicShape::display(const DisplayObject& inst)
+DynamicShape::display(const DisplayObject& inst) const
{
render::drawShape(_shape, inst.get_world_cxform(), inst.getWorldMatrix());
}
=== modified file 'libcore/DynamicShape.h'
--- a/libcore/DynamicShape.h 2009-04-07 12:34:43 +0000
+++ b/libcore/DynamicShape.h 2009-04-14 18:31:04 +0000
@@ -83,7 +83,7 @@
}
/// Display a DynamicShape object.
- void display(const DisplayObject& inst);
+ void display(const DisplayObject& inst) const;
/// Set current line style and start a new path.
//
=== modified file 'libcore/Makefile.am'
--- a/libcore/Makefile.am 2009-04-08 11:48:21 +0000
+++ b/libcore/Makefile.am 2009-04-16 10:00:54 +0000
@@ -48,7 +48,7 @@
$(NULL)
libgnashcore_la_SOURCES = \
- BitmapMovieInstance.cpp \
+ BitmapMovie.cpp \
Property.cpp \
PropertyList.cpp \
URLAccessManager.cpp \
@@ -80,12 +80,12 @@
parser/filter_factory.cpp \
InteractiveObject.cpp \
SWFMatrix.cpp \
- movie_instance.cpp \
+ SWFMovie.cpp \
movie_root.cpp \
namedStrings.cpp \
rect.cpp \
MovieClip.cpp \
- swf.cpp \
+ swf/swf.cpp \
swf/TagLoadersTable.cpp \
swf/DefineVideoStreamTag.cpp \
swf/DefineTextTag.cpp \
@@ -144,7 +144,7 @@
asClass.h \
Bitmap.h \
BitmapInfo.h \
- BitmapMovieInstance.h \
+ BitmapMovie.h \
builtin_function.h \
Button.h \
DisplayObject.h \
@@ -179,7 +179,8 @@
LoadVariablesThread.h \
SWFMatrix.h \
MouseButtonState.h \
- movie_instance.h \
+ SWFMovie.h \
+ Movie.h \
movie_root.h \
namedStrings.h \
rect.h \
@@ -189,7 +190,7 @@
MovieClip.h \
SWFStream.h \
styles.h \
- swf.h \
+ swf/swf.h \
swf/TagLoadersTable.h \
swf/tag_loaders.h \
swf/VideoFrameTag.h \
=== added file 'libcore/Movie.h'
--- a/libcore/Movie.h 1970-01-01 00:00:00 +0000
+++ b/libcore/Movie.h 2009-04-15 06:22:17 +0000
@@ -0,0 +1,88 @@
+//
+// Copyright (C) 2005, 2006, 2007, 2008, 2009 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
+
+// Stateful live Movie instance
+
+
+#ifndef GNASH_MOVIE_H
+#define GNASH_MOVIE_H
+
+#include <vector>
+#include <set>
+
+#include "MovieClip.h" // for inheritance
+#include "smart_ptr.h" // for composition
+
+// Forward declarations
+namespace gnash {
+ class DisplayObject;
+ class movie_definition;
+}
+
+namespace gnash
+{
+
+/// A top-level, standalone Movie that can be loaded and played.
+//
+/// This is an abstract interface for any Movie that can be loaded directly
+/// into Gnash, including SWFs and Bitmaps.
+//
+/// The interface is not especially clean because SWFs and Bitmaps are
+/// treated the same as top-level movies despite having almost nothing
+/// in common. As this is required by Flash, it seems unavoidable.
+class Movie : public MovieClip
+{
+
+public:
+
+ Movie(const movie_definition* const def, DisplayObject* parent)
+ :
+ MovieClip(def, this, parent, parent ? 0 : -1)
+ {}
+
+ virtual ~Movie() {}
+
+ virtual void advance() = 0;
+
+ virtual float frameRate() const = 0;
+
+ virtual float widthPixels() const = 0;
+
+ virtual float heightPixels() const = 0;
+
+ virtual bool ensureFrameLoaded(size_t /*frameNo*/) const {
+ return true;
+ }
+
+ virtual const std::string& url() const = 0;
+
+ virtual int version() const = 0;
+
+ /// Set a DisplayObject in the dictionary as initialized, returning
+ /// true if not already initialized.
+ virtual bool setCharacterInitialized(int /*cid*/) {
+ return false;
+ }
+
+ virtual const movie_definition* definition() const = 0;
+
+};
+
+
+} // end of namespace gnash
+
+#endif
=== modified file 'libcore/MovieClip.cpp'
--- a/libcore/MovieClip.cpp 2009-04-08 11:48:21 +0000
+++ b/libcore/MovieClip.cpp 2009-04-16 10:00:54 +0000
@@ -33,7 +33,7 @@
#include "fn_call.h"
#include "Key_as.h"
#include "movie_root.h"
-#include "movie_instance.h"
+#include "Movie.h"
#include "swf_event.h"
#include "sprite_definition.h"
#include "ActionExec.h"
@@ -267,7 +267,7 @@
}
return;
}
- if (! ch->isVisible()) return;
+ if (! ch->visible()) return;
_candidates.push_back(ch);
}
@@ -479,30 +479,26 @@
} // anonymous namespace
-MovieClip::MovieClip(movie_definition* def, movie_instance* r,
+MovieClip::MovieClip(const movie_definition* const def, Movie* r,
DisplayObject* parent, int id)
:
InteractiveObject(parent, id),
- m_root(r),
- m_play_state(PLAY),
- m_current_frame(0),
- m_has_looped(false),
+ _def(def),
+ _swf(r),
+ _playState(PLAYSTATE_PLAY),
+ _currentFrame(0),
+ _hasLooped(false),
_callingFrameActions(false),
- m_as_environment(_vm),
- _text_variables(),
+ _environment(_vm),
m_sound_stream_id(-1),
- _userCxform(),
_droptarget(),
- _lockroot(false),
- m_def(def)
+ _lockroot(false)
{
- assert(m_def != NULL);
- assert(m_root != NULL);
+ assert(_swf);
set_prototype(getMovieClipInterface());
- //m_root->add_ref(); // @@ circular!
- m_as_environment.set_target(this);
+ _environment.set_target(this);
// TODO: have the 'MovieClip' constructor take care of this !
attachMovieClipProperties(*this);
@@ -513,15 +509,18 @@
{
stopStreamSound();
- // We might have been deleted by Quit...
- //assert(isDestroyed());
-
_vm.getRoot().remove_key_listener(this);
_vm.getRoot().remove_mouse_listener(this);
deleteAllChecked(_loadVariableRequests);
}
+int
+MovieClip::getSWFVersion() const
+{
+ return _swf->version();
+}
+
// Execute the actions in the action list, in the given
// environment. The list of action will be consumed
// starting from the first element. When the function returns
@@ -546,7 +545,7 @@
DisplayObject*
MovieClip::getDisplayObjectAtDepth(int depth)
{
- return m_display_list.getDisplayObjectAtDepth(depth);
+ return _displayList.getDisplayObjectAtDepth(depth);
}
// Set *val to the value of the named member and
@@ -587,7 +586,7 @@
unsigned int levelno;
if ( mr.isLevelTarget(name, levelno) )
{
- movie_instance* mo = _vm.getRoot().getLevel(levelno).get();
+ Movie* mo = _vm.getRoot().getLevel(levelno).get();
if ( mo )
{
val->set_as_object(mo);
@@ -617,9 +616,9 @@
// Try items on our display list.
DisplayObject* ch;
if ( _vm.getSWFVersion() >= 7 ) {
- ch = m_display_list.getDisplayObjectByName(name);
+ ch = _displayList.getDisplayObjectByName(name);
}
- else ch = m_display_list.getDisplayObjectByName_i(name);
+ else ch = _displayList.getDisplayObjectByName_i(name);
if (ch) {
// Found object.
@@ -638,13 +637,13 @@
}
// Try textfield variables
- TextFieldPtrVect* etc = get_textfield_variable(name);
+ TextFields* etc = get_textfield_variable(name);
if ( etc )
{
- for (TextFieldPtrVect::const_iterator i=etc->begin(), e=etc->end();
+ for (TextFields::const_iterator i=etc->begin(), e=etc->end();
i!=e; ++i)
{
- TextFieldPtr tf = *i;
+ boost::intrusive_ptr<TextField> tf = i->get();
if ( tf->getTextDefined() )
{
val->set_string(tf->get_text_value());
@@ -676,7 +675,10 @@
bool
MovieClip::get_frame_number(const as_value& frame_spec, size_t& frameno) const
{
- //GNASH_REPORT_FUNCTION;
+
+ // If there is no definition, this is a dynamically-created MovieClip
+ // and has no frames.
+ if (!_def) return false;
std::string fspecStr = frame_spec.to_string();
@@ -688,7 +690,7 @@
if (!isFinite(num) || int(num) != num || num == 0)
{
- bool ret = m_def->get_labeled_frame(fspecStr, frameno);
+ bool ret = _def->get_labeled_frame(fspecStr, frameno);
//log_debug("get_labeled_frame(%s) returned %d, frameno is %d",
fspecStr, ret, frameno);
return ret;
}
@@ -709,6 +711,10 @@
void
MovieClip::call_frame_actions(const as_value& frame_spec)
{
+ // If there is no definition, this is a dynamically-created MovieClip
+ // and has no frames.
+ if (!_def) return;
+
size_t frame_number;
if ( ! get_frame_number(frame_spec, frame_number) )
{
@@ -720,13 +726,6 @@
return;
}
-#if 0 // why would we want to do this ?
- // Set the current sound_stream_id to -1, meaning that no stream are
- // active. If there are an active stream it will be updated while
- // executing the ControlTags.
- set_sound_stream_id(-1);
-#endif
-
// Execute the ControlTag actions
// We set _callingFrameActions to true so that add_action_buffer
// will execute immediately instead of queuing them.
@@ -735,14 +734,14 @@
// to properly queue actions back on the global queue.
//
_callingFrameActions=true;
- const PlayList* playlist = m_def->getPlaylist(frame_number);
+ const PlayList* playlist = _def->getPlaylist(frame_number);
if ( playlist )
{
PlayList::const_iterator it = playlist->begin();
const PlayList::const_iterator e = playlist->end();
for(; it != e; it++)
{
- (*it)->execute_action(this, m_display_list);
+ (*it)->execute_action(this, _displayList);
}
}
_callingFrameActions=false;
@@ -752,11 +751,7 @@
DisplayObject*
MovieClip::add_empty_movieclip(const std::string& name, int depth)
{
- // empty_movieclip_def will be deleted during deleting movieclip
- sprite_definition* empty_sprite_def =
- new sprite_definition(*get_movie_definition());
-
- MovieClip* movieclip = new MovieClip(empty_sprite_def, m_root, this, 0);
+ MovieClip* movieclip = new MovieClip(0, _swf, this, 0);
movieclip->set_name(name);
movieclip->setDynamic();
@@ -764,7 +759,7 @@
// an existing one !
set_invalidated();
- m_display_list.placeDisplayObject(movieclip, depth);
+ _displayList.placeDisplayObject(movieclip, depth);
return movieclip;
}
@@ -789,7 +784,7 @@
txt_char->setMatrix(txt_matrix, true); // update caches (altought
shouldn't be needed as we only set translation)
// Here we add the DisplayObject to the displayList.
- m_display_list.placeDisplayObject(txt_char.get(), depth);
+ _displayList.placeDisplayObject(txt_char.get(), depth);
return txt_char;
}
@@ -811,8 +806,8 @@
return NULL;
}
- boost::intrusive_ptr<MovieClip> newmovieclip = new MovieClip(m_def.get(),
- m_root, parent, get_id());
+ boost::intrusive_ptr<MovieClip> newmovieclip = new MovieClip(_def.get(),
+ _swf, parent, get_id());
newmovieclip->set_name(newname);
newmovieclip->setDynamic();
@@ -833,7 +828,7 @@
newmovieclip->set_ratio(get_ratio());
newmovieclip->set_clip_depth(get_clip_depth());
- parent->m_display_list.placeDisplayObject(newmovieclip.get(), depth,
+ parent->_displayList.placeDisplayObject(newmovieclip.get(), depth,
initObject);
return newmovieclip;
@@ -886,32 +881,24 @@
bool called = false;
- // First, check for clip event handler.
+ std::auto_ptr<ExecutableCode> code ( get_event_handler(id) );
+ if ( code.get() )
{
- std::auto_ptr<ExecutableCode> code ( get_event_handler(id) );
- if ( code.get() )
- {
- // Dispatch.
- code->execute();
+ // Dispatch.
+ code->execute();
- called = true;
- }
+ called = true;
}
- // Fall through and call the function also, if it's defined!
-
-
// user-defined onInitialize is never called
- if ( id.id() == event_id::INITIALIZE )
- {
- testInvariant();
- return called;
+ if ( id.id() == event_id::INITIALIZE ) {
+ testInvariant();
+ return called;
}
-
// NOTE: user-defined onLoad is not invoked for static
- // clips on which no clip-events are defined.
- // see
testsuite/misc-ming.all/action_execution_order_extend_test.swf
+ // clips on which no clip-events are defined.
+ // see testsuite/misc-ming.all/action_execution_order_extend_test.swf
//
// Note that this can't be true for movieclips
// not placed by PlaceObject, see
@@ -921,8 +908,8 @@
// a registered class on them, see
// testsuite/misc-ming.all/registerClassTest2.swf
//
- // TODO: test the case in which it's MovieClip.prototype.onLoad
defined !
- //
+ // TODO: test the case in which it's MovieClip.prototype.onLoad
+ // defined !
if ( id.id() == event_id::LOAD )
{
// TODO: we're likely making too much noise for nothing here,
@@ -938,8 +925,8 @@
// nor if it's dynamic
if ( isDynamic() ) break;
- sprite_definition* def =
- dynamic_cast<sprite_definition*>(m_def.get());
+ const sprite_definition* def =
+ dynamic_cast<const sprite_definition*>(_def.get());
// must be a loaded movie (loadMovie doesn't mark it as
// "dynamic" - should it? no, or getBytesLoaded will always
@@ -970,7 +957,7 @@
if ( method )
{
- call_method0(as_value(method.get()), m_as_environment, this);
+ call_method0(as_value(method.get()), _environment, this);
called = true;
}
}
@@ -988,21 +975,17 @@
as_object*
MovieClip::get_path_element(string_table::key key)
{
- //log_debug("%s.get_path_element(%s) called", getTarget(),
_vm.getStringTable().value(key));
as_object* obj = getPathElementSeparator(key);
- if ( obj )
- {
- return obj;
- }
+ if (obj) return obj;
std::string name = _vm.getStringTable().value(key);
// See if we have a match on the display list.
DisplayObject* ch;
if ( _vm.getSWFVersion() >= 7 ) ch =
- m_display_list.getDisplayObjectByName(name);
+ _displayList.getDisplayObjectByName(name);
- else ch = m_display_list.getDisplayObjectByName_i(name);
+ else ch = _displayList.getDisplayObjectByName_i(name);
// TODO: should we check for isActionScriptReferenceable here ?
if ( ch )
@@ -1053,16 +1036,15 @@
// property (ie: have a textfield use _x as variable name
and
// be scared)
//
- TextFieldPtrVect* etc =
get_textfield_variable(_vm.getStringTable().value(name));
+ TextFields* etc = get_textfield_variable(_vm.getStringTable().value(name));
if ( etc )
{
#ifdef DEBUG_DYNTEXT_VARIABLES
log_debug(_("it's a Text Variable, associated with %d TextFields"),
etc->size());
#endif
- for (TextFieldPtrVect::iterator i=etc->begin(), e=etc->end(); i!=e;
++i)
+ for (TextFields::iterator i=etc->begin(), e=etc->end(); i!=e; ++i)
{
- TextFieldPtr tf = *i;
- tf->updateText(val.to_string());
+ (*i)->updateText(val.to_string());
}
found = true;
}
@@ -1087,18 +1069,24 @@
LOG_ONCE(log_unimpl("MovieClip.unloadMovie()"));
}
+// child movieclip advance
void
-MovieClip::advance_sprite()
+MovieClip::advance()
{
+#ifdef GNASH_DEBUG
+ log_debug(_("Advance movieclip '%s' at frame %u/%u"),
+ getTargetPath(), _currentFrame,
+ get_frame_count());
+#endif
+
assert(!isUnloaded());
// call_frame should never trigger advance_movieclip
assert(!_callingFrameActions);
// We might have loaded NO frames !
- if ( get_loaded_frames() == 0 )
- {
+ if (get_loaded_frames() == 0) {
IF_VERBOSE_MALFORMED_SWF(
LOG_ONCE( log_swferror(_("advance_movieclip: no frames loaded "
"for movieclip/movie %s"), getTarget()) );
@@ -1106,15 +1094,14 @@
return;
}
-
// Process any pending loadVariables request
processCompletedLoadVariableRequests();
#ifdef GNASH_DEBUG
- size_t frame_count = m_def->get_frame_count();
+ size_t frame_count = _def->get_frame_count();
log_debug(_("Advance_movieclip for movieclip '%s' - frame %u/%u "),
- getTarget(), m_current_frame,
+ getTarget(), _currentFrame,
frame_count);
#endif
@@ -1122,27 +1109,28 @@
queueEvent(event_id::ENTER_FRAME, movie_root::apDOACTION);
// Update current and next frames.
- if (m_play_state == PLAY)
+ if (_playState == PLAYSTATE_PLAY)
{
#ifdef GNASH_DEBUG
- log_debug(_("MovieClip::advance_movieclip we're in PLAY mode"));
+ log_debug(_("MovieClip::advance_movieclip we're in PLAYSTATE_PLAY
mode"));
#endif
- int prev_frame = m_current_frame;
+ int prev_frame = _currentFrame;
#ifdef GNASH_DEBUG
log_debug(_("on_event_load called, incrementing"));
#endif
increment_frame_and_check_for_loop();
#ifdef GNASH_DEBUG
- log_debug(_("after increment we are at frame %u/%u"), m_current_frame,
frame_count);
+ log_debug(_("after increment we are at frame %u/%u"), _currentFrame,
frame_count);
#endif
// Execute the current frame's tags.
- // First time execute_frame_tags(0) executed in dlist.cpp(child) or
SWFMovieDefinition(root)
- if (m_current_frame != (size_t)prev_frame)
+ // First time executeFrameTags(0) executed in dlist.cpp(child) or
+ // SWFMovieDefinition(root)
+ if (_currentFrame != (size_t)prev_frame)
{
- if ( m_current_frame == 0 && has_looped() )
+ if ( _currentFrame == 0 && has_looped() )
{
#ifdef GNASH_DEBUG
log_debug(_("Jumping back to frame 0 of movieclip %s"),
@@ -1154,11 +1142,13 @@
{
#ifdef GNASH_DEBUG
log_debug(_("Executing frame%d (0-based) tags of movieclip "
- "%s"), m_current_frame, getTarget());
+ "%s"), _currentFrame, getTarget());
#endif
- // Make sure m_current_frame is 0-based during execution of
DLIST tags
- execute_frame_tags(m_current_frame, m_display_list,
- TAG_DLIST|TAG_ACTION);
+ // Make sure _currentFrame is 0-based during execution of
+ // DLIST tags
+ executeFrameTags(_currentFrame, _displayList,
+ SWF::ControlTag::TAG_DLIST |
+ SWF::ControlTag::TAG_ACTION);
}
}
@@ -1167,41 +1157,19 @@
else
{
log_debug(_("MovieClip::advance_movieclip we're in STOP mode"));
- // shouldn't we execute frame tags anyway when in STOP mode ?
- //execute_frame_tags(m_current_frame);
}
#endif
-}
-
-// child movieclip advance
-void
-MovieClip::advance()
-{
-// GNASH_REPORT_FUNCTION;
-
-#ifdef GNASH_DEBUG
- log_debug(_("Advance movieclip '%s' at frame %u/%u"),
- getTargetPath(), m_current_frame,
- get_frame_count());
-#endif
-
- // child movieclip frame rate is the same the root movieclip frame rate
- // that's why it is not needed to analyze 'm_time_remainder'
-
- advance_sprite();
}
void
MovieClip::execute_init_action_buffer(const action_buffer& a, int cid)
{
- // WARNING! get_root() would depend on _lockroot !!
- movie_instance* mi = m_root;
- if ( mi->setCharacterInitialized(cid) )
+ if ( _swf->setCharacterInitialized(cid) )
{
#ifdef GNASH_DEBUG
log_debug(_("Queuing init actions in frame %d of movieclip %s"),
- m_current_frame, getTarget());
+ _currentFrame, getTarget());
#endif
std::auto_ptr<ExecutableCode> code (
new GlobalCode(a, boost::intrusive_ptr<MovieClip>(this)) );
@@ -1220,49 +1188,50 @@
void
MovieClip::execute_action(const action_buffer& ab)
{
- as_environment& env = m_as_environment; // just type less
-
- ActionExec exec(ab, env);
+ ActionExec exec(ab, _environment);
exec();
}
-/*private*/
void
MovieClip::restoreDisplayList(size_t tgtFrame)
{
// This is not tested as usable for jump-forwards (yet)...
// TODO: I guess just moving here the code currently in goto_frame
// for jump-forwards would do
- assert(tgtFrame <= m_current_frame);
+ assert(tgtFrame <= _currentFrame);
// Just invalidate this DisplayObject before jumping back.
// Should be optimized, but the invalidating model is not clear enough,
// and there are some old questions spreading the source files.
set_invalidated();
- DisplayList m_tmp_display_list;
+ DisplayList tmplist;
for (size_t f = 0; f<tgtFrame; ++f)
{
- m_current_frame = f;
- execute_frame_tags(f, m_tmp_display_list, TAG_DLIST);
+ _currentFrame = f;
+ executeFrameTags(f, tmplist, SWF::ControlTag::TAG_DLIST);
}
// Execute both action tags and DLIST tags of the target frame
- m_current_frame = tgtFrame;
- execute_frame_tags(tgtFrame, m_tmp_display_list, TAG_DLIST|TAG_ACTION);
+ _currentFrame = tgtFrame;
+ executeFrameTags(tgtFrame, tmplist, SWF::ControlTag::TAG_DLIST |
+ SWF::ControlTag::TAG_ACTION);
- m_display_list.mergeDisplayList(m_tmp_display_list);
+ _displayList.mergeDisplayList(tmplist);
}
// 0-based frame number !
void
-MovieClip::execute_frame_tags(size_t frame, DisplayList& dlist, int typeflags)
+MovieClip::executeFrameTags(size_t frame, DisplayList& dlist, int typeflags)
{
+ // If there is no definition, this is a dynamically-created MovieClip
+ // and has no frames.
+ if (!_def) return;
+
testInvariant();
-
assert(typeflags);
- const PlayList* playlist = m_def->getPlaylist(frame);
+ const PlayList* playlist = _def->getPlaylist(frame);
if ( playlist )
{
PlayList::const_iterator it = playlist->begin();
@@ -1275,14 +1244,15 @@
getTargetPath());
);
- if ( (typeflags&TAG_DLIST) && (typeflags&TAG_ACTION) )
+ if ((typeflags & SWF::ControlTag::TAG_DLIST) &&
+ (typeflags & SWF::ControlTag::TAG_ACTION) )
{
for( ; it != e; it++)
{
(*it)->execute(this, dlist);
}
}
- else if ( typeflags & TAG_DLIST )
+ else if ( typeflags & SWF::ControlTag::TAG_DLIST )
{
for( ; it != e; it++)
{
@@ -1291,7 +1261,7 @@
}
else
{
- assert(typeflags & TAG_ACTION);
+ assert(typeflags & SWF::ControlTag::TAG_ACTION);
for( ; it != e; it++)
{
(*it)->execute_action(this, dlist);
@@ -1307,42 +1277,42 @@
{
#if defined(DEBUG_GOTOFRAME) || defined(GNASH_DEBUG_TIMELINE)
log_debug(_("movieclip %s ::goto_frame(%d) - current frame is %d"),
- getTargetPath(), target_frame_number, m_current_frame);
+ getTargetPath(), target_frame_number, _currentFrame);
#endif
// goto_frame stops by default.
// ActionGotoFrame tells the movieClip to go to the target frame
// and stop at that frame.
- set_play_state(STOP);
+ setPlayState(PLAYSTATE_STOP);
- if ( target_frame_number > m_def->get_frame_count() - 1)
+ if ( target_frame_number > _def->get_frame_count() - 1)
{
- target_frame_number = m_def->get_frame_count() - 1;
+ target_frame_number = _def->get_frame_count() - 1;
- if ( ! m_def->ensure_frame_loaded(target_frame_number+1) )
+ if ( ! _def->ensure_frame_loaded(target_frame_number+1) )
{
log_error(_("Target frame of a gotoFrame(%d) was never loaded,"
"although frame count in header (%d) said we "
"should have found it"),
- target_frame_number+1, m_def->get_frame_count());
+ target_frame_number+1, _def->get_frame_count());
return; // ... I guess, or not ?
}
// Just set _currentframe and return.
- m_current_frame = target_frame_number;
+ _currentFrame = target_frame_number;
// don't push actions, already tested.
return;
}
- if (target_frame_number == m_current_frame)
+ if (target_frame_number == _currentFrame)
{
// don't push actions
return;
}
// Unless the target frame is the next one, stop playback of soundstream
- if (target_frame_number != m_current_frame+1 )
+ if (target_frame_number != _currentFrame+1 )
{
stopStreamSound();
}
@@ -1363,12 +1333,12 @@
loaded_frames);
);
- if ( ! m_def->ensure_frame_loaded(target_frame_number+1) )
+ if ( ! _def->ensure_frame_loaded(target_frame_number+1) )
{
log_error(_("Target frame of a gotoFrame(%d) was never loaded, "
"although frame count in header (%d) said we should"
" have found it"),
- target_frame_number+1, m_def->get_frame_count());
+ target_frame_number+1, _def->get_frame_count());
return; // ... I guess, or not ?
}
}
@@ -1378,7 +1348,7 @@
// Construct the DisplayList of the target frame
//
- if (target_frame_number < m_current_frame)
+ if (target_frame_number < _currentFrame)
{
// Go backward to a previous frame
// NOTE: just in case we're being called by code in a called frame
@@ -1387,25 +1357,26 @@
_callingFrameActions = false;
// restoreDisplayList takes care of properly setting the
- // m_current_frame variable
+ // _currentFrame variable
restoreDisplayList(target_frame_number);
- assert(m_current_frame == target_frame_number);
+ assert(_currentFrame == target_frame_number);
_callingFrameActions = callingFrameActionsBackup;
}
else
// Go forward to a later frame
{
- // We'd immediately return if target_frame_number == m_current_frame
- assert(target_frame_number > m_current_frame);
- while (++m_current_frame < target_frame_number)
+ // We'd immediately return if target_frame_number == _currentFrame
+ assert(target_frame_number > _currentFrame);
+ while (++_currentFrame < target_frame_number)
{
- //for (size_t f = m_current_frame+1; f<target_frame_number; ++f)
+ //for (size_t f = _currentFrame+1; f<target_frame_number; ++f)
// Second argument requests that only "DisplayList" tags
// are executed. This means NO actions will be
// pushed on m_action_list.
- execute_frame_tags(m_current_frame, m_display_list, TAG_DLIST);
+ executeFrameTags(_currentFrame, _displayList,
+ SWF::ControlTag::TAG_DLIST);
}
- assert(m_current_frame == target_frame_number);
+ assert(_currentFrame == target_frame_number);
// Now execute target frame tags (queuing actions)
@@ -1413,18 +1384,24 @@
// we'll backup and resume the _callingFrameActions flag
bool callingFrameActionsBackup = _callingFrameActions;
_callingFrameActions = false;
- execute_frame_tags(target_frame_number, m_display_list,
- TAG_DLIST|TAG_ACTION);
+ executeFrameTags(target_frame_number, _displayList,
+ SWF::ControlTag::TAG_DLIST | SWF::ControlTag::TAG_ACTION);
_callingFrameActions = callingFrameActionsBackup;
}
- assert(m_current_frame == target_frame_number);
+ assert(_currentFrame == target_frame_number);
}
-bool MovieClip::goto_labeled_frame(const std::string& label)
+bool
+MovieClip::goto_labeled_frame(const std::string& label)
{
+
+ // If there is no definition, this is a dynamically-created MovieClip
+ // and has no frames. (We are also probably not called in this case).
+ if (!_def) return false;
+
size_t target_frame;
- if (m_def->get_labeled_frame(label, target_frame))
+ if (_def->get_labeled_frame(label, target_frame))
{
goto_frame(target_frame);
return true;
@@ -1453,23 +1430,23 @@
// descend the display list
- m_display_list.display();
+ _displayList.display();
clear_invalidated();
}
void MovieClip::omit_display()
{
- if (m_child_invalidated)
- m_display_list.omit_display();
+ if (m_child_invalidated) _displayList.omit_display();
clear_invalidated();
}
bool
-MovieClip::attachCharacter(DisplayObject& newch, int depth, as_object*
initObject)
+MovieClip::attachCharacter(DisplayObject& newch, int depth,
+ as_object* initObject)
{
- m_display_list.placeDisplayObject(&newch, depth, initObject);
+ _displayList.placeDisplayObject(&newch, depth, initObject);
// FIXME: check return from placeDisplayObject above ?
return true;
@@ -1477,8 +1454,8 @@
std::auto_ptr<GnashImage>
MovieClip::drawToBitmap(const SWFMatrix& /* mat */, const cxform& /* cx */,
- DisplayObject::BlendMode /* bm */, const rect& /*
clipRect */,
- bool /* smooth */)
+ DisplayObject::BlendMode /* bm */, const rect& /* clipRect */,
+ bool /* smooth */)
{
return std::auto_ptr<GnashImage>();
}
@@ -1487,19 +1464,20 @@
MovieClip::attachBitmap(boost::intrusive_ptr<BitmapData_as> bd, int depth)
{
DisplayObject* ch = new Bitmap(bd, this, 0);
-
attachCharacter(*ch, depth, 0);
-
}
DisplayObject*
MovieClip::add_display_object(const SWF::PlaceObject2Tag* tag,
DisplayList& dlist)
{
- assert(m_def);
+
+ // If this MovieClip has no definition, it should also have no ControlTags,
+ // and this shouldn't be called.
+ assert(_def);
assert(tag);
- SWF::DefinitionTag* cdef = m_def->getDefinitionTag(tag->getID());
+ SWF::DefinitionTag* cdef = _def->getDefinitionTag(tag->getID());
if (!cdef)
{
IF_VERBOSE_MALFORMED_SWF(
@@ -1559,12 +1537,16 @@
NULL);
}
-void MovieClip::replace_display_object(const SWF::PlaceObject2Tag* tag,
DisplayList& dlist)
+void
+MovieClip::replace_display_object(const SWF::PlaceObject2Tag* tag,
+ DisplayList& dlist)
{
- assert(m_def != NULL);
+ // A MovieClip without a definition cannot have any ControlTags, so this
+ // should not be called.
+ assert(_def);
assert(tag != NULL);
- SWF::DefinitionTag* cdef = m_def->getDefinitionTag(tag->getID());
+ SWF::DefinitionTag* cdef = _def->getDefinitionTag(tag->getID());
if (cdef == NULL)
{
log_error(_("movieclip::replace_display_object(): "
@@ -1628,14 +1610,14 @@
bool use_old_cxform, bool use_old_matrix)
{
assert(ch);
- m_display_list.replaceDisplayObject(ch, depth,
+ _displayList.replaceDisplayObject(ch, depth,
use_old_cxform, use_old_matrix);
}
int
MovieClip::get_id_at_depth(int depth)
{
- DisplayObject* ch = m_display_list.getDisplayObjectAtDepth(depth);
+ DisplayObject* ch = _displayList.getDisplayObjectAtDepth(depth);
if ( ! ch ) return -1;
return ch->get_id();
}
@@ -1644,14 +1626,14 @@
MovieClip::increment_frame_and_check_for_loop()
{
size_t frame_count = get_loaded_frames();
- if ( ++m_current_frame >= frame_count )
+ if ( ++_currentFrame >= frame_count )
{
// Loop.
- m_current_frame = 0;
- m_has_looped = true;
+ _currentFrame = 0;
+ _hasLooped = true;
if (frame_count > 1)
{
- //m_display_list.reset();
+ //_displayList.reset();
}
}
@@ -1679,7 +1661,7 @@
MovieClip::pointInShape(boost::int32_t x, boost::int32_t y) const
{
ShapeContainerFinder finder(x, y);
- const_cast<DisplayList&>(m_display_list).visitBackward(finder);
+ const_cast<DisplayList&>(_displayList).visitBackward(finder);
if ( finder.hitFound() ) return true;
return hitTestDrawable(x, y);
}
@@ -1687,7 +1669,7 @@
bool
MovieClip::pointInVisibleShape(boost::int32_t x, boost::int32_t y) const
{
- if ( ! isVisible() ) return false;
+ if ( ! visible() ) return false;
if ( isDynamicMask() && ! mouseEnabled() )
{
// see testsuite/misc-ming.all/masks_test.swf
@@ -1698,7 +1680,7 @@
return false;
}
DisplayObject* mask = getMask(); // dynamic one
- if ( mask && mask->isVisible() && ! mask->pointInShape(x, y) )
+ if ( mask && mask->visible() && ! mask->pointInShape(x, y) )
{
#ifdef GNASH_DEBUG_HITTEST
log_debug(_("%s is dynamically masked by %s, which "
@@ -1708,7 +1690,7 @@
return false;
}
VisibleShapeContainerFinder finder(x, y);
- const_cast<DisplayList&>(m_display_list).visitBackward(finder);
+ const_cast<DisplayList&>(_displayList).visitBackward(finder);
if (finder.hitFound()) return true;
return hitTestDrawable(x, y);
}
@@ -1733,7 +1715,7 @@
if (mask && !mask->pointInShape(x, y)) return false;
HitableShapeContainerFinder finder(x, y);
- m_display_list.visitBackward(finder);
+ _displayList.visitBackward(finder);
if (finder.hitFound()) return true;
return hitTestDrawable(x, y);
@@ -1744,10 +1726,10 @@
{
//GNASH_REPORT_FUNCTION;
- if (!isVisible()) return 0;
+ if (!visible()) return 0;
// point is in parent's space, we need to convert it in world space
- point wp(x, y);
+ point wp(x, y);
DisplayObject* parent = get_parent();
if ( parent )
{
@@ -1759,9 +1741,9 @@
parent->getWorldMatrix().transform(wp);
}
- if ( mouseEnabled() )
+ if (mouseEnabled())
{
- if ( pointInVisibleShape(wp.x, wp.y) ) return this;
+ if (pointInVisibleShape(wp.x, wp.y)) return this;
else return NULL;
}
@@ -1770,7 +1752,7 @@
m.invert().transform(pp);
MouseEntityFinder finder(wp, pp);
- m_display_list.visitAll(finder);
+ _displayList.visitAll(finder);
InteractiveObject* ch = finder.getEntity();
// It doesn't make any sense to query _drawable, as it's
@@ -1835,7 +1817,7 @@
if ( ch->isMaskLayer() )
{
- if ( ! ch->isVisible() )
+ if ( ! ch->visible() )
{
log_debug(_("FIXME: invisible mask in MouseEntityFinder."));
}
@@ -1895,10 +1877,10 @@
{
if ( this == dragging ) return 0; // not here...
- if ( ! isVisible() ) return 0; // isn't me !
+ if ( ! visible() ) return 0; // isn't me !
DropTargetFinder finder(x, y, dragging);
- m_display_list.visitAll(finder);
+ _displayList.visitAll(finder);
// does it hit any child ?
const DisplayObject* ch = finder.getDropChar();
@@ -1934,7 +1916,7 @@
static const size_t size = sizeof(EH) / sizeof(EH[0]);
- for (size_t i = 0; i < size; i++)
+ for (size_t i = 0; i < size; ++i)
{
const event_id &event = EH[i];
@@ -1954,67 +1936,36 @@
return false;
}
-DisplayObject*
-MovieClip::getDisplayObject(int /* id */)
-{
- //return m_def->getDefinitionTag(id);
- // @@ TODO -- look through our dlist for a match
- log_unimpl(_("%s doesn't even check for a char"),
- __PRETTY_FUNCTION__);
- return NULL;
-}
-
-
void
MovieClip::stop_drag()
{
- //assert(m_parent == NULL); // why should we care ?
_vm.getRoot().stop_drag();
}
-float
-MovieClip::get_background_alpha() const
-{
- // @@ this doesn't seem right...
- return _vm.getRoot().get_background_alpha();
-}
-
void
MovieClip::set_background_color(const rgba& color)
{
_vm.getRoot().set_background_color(color);
}
-static bool isTextFieldUnloaded(boost::intrusive_ptr<TextField>& p)
-{
- return p->isUnloaded();
-}
-
-/*private*/
void
MovieClip::cleanup_textfield_variables()
{
// nothing to do
- if ( ! _text_variables.get() ) return;
-
- TextFieldMap& m = *_text_variables;
-
- for (TextFieldMap::iterator i=m.begin(), ie=m.end(); i!=ie; ++i)
+ if (!_text_variables.get()) return;
+
+ TextFieldIndex& m = *_text_variables;
+
+ for (TextFieldIndex::iterator i=m.begin(), ie=m.end(); i!=ie; ++i)
{
- TextFieldPtrVect& v=i->second;
- TextFieldPtrVect::iterator lastValid =
- std::remove_if(v.begin(), v.end(),
- boost::bind(isTextFieldUnloaded, _1));
+ TextFields& v=i->second;
+ TextFields::iterator lastValid = std::remove_if(v.begin(), v.end(),
+ boost::mem_fn(&DisplayObject::isUnloaded));
v.erase(lastValid, v.end());
- // TODO: remove the map element if vector is empty
- //if ( v.empty() )
- //{
- //}
}
}
-/* public */
void
MovieClip::set_textfield_variable(const std::string& name, TextField* ch)
{
@@ -2023,29 +1974,22 @@
// lazy allocation
if ( ! _text_variables.get() )
{
- _text_variables.reset(new TextFieldMap);
+ _text_variables.reset(new TextFieldIndex);
}
(*_text_variables)[name].push_back(ch);
}
-/* private */
-MovieClip::TextFieldPtrVect*
+MovieClip::TextFields*
MovieClip::get_textfield_variable(const std::string& name)
{
// nothing allocated yet...
if ( ! _text_variables.get() ) return NULL;
// TODO: should variable name be considered case-insensitive ?
- TextFieldMap::iterator it = _text_variables->find(name);
- if ( it == _text_variables->end() )
- {
- return 0;
- }
- else
- {
- return &(it->second);
- }
+ TextFieldIndex::iterator it = _text_variables->find(name);
+ if (it == _text_variables->end()) return 0;
+ else return &(it->second);
}
@@ -2055,7 +1999,7 @@
{
// nothing to do if this movieclip is not visible
- if (!isVisible() || get_cxform().is_invisible() )
+ if (!visible() || get_cxform().is_invisible() )
{
ranges.add(m_old_invalidated_ranges); // (in case we just hided)
return;
@@ -2075,7 +2019,7 @@
}
- m_display_list.add_invalidated_bounds(ranges, force||m_invalidated);
+ _displayList.add_invalidated_bounds(ranges, force||m_invalidated);
/// Add drawable.
rect bounds;
@@ -2120,7 +2064,6 @@
// It seems it's legal to place 0-framed movieclips on stage.
// See testsuite/misc-swfmill.all/zeroframe_definemovieclip.swf
-
// Now execute frame tags and take care of queuing the LOAD event.
//
// DLIST tags are executed immediately while ACTION tags are queued.
@@ -2134,7 +2077,8 @@
#ifdef GNASH_DEBUG
log_debug(_("Executing tags of frame0 in movieclip %s"), getTarget());
#endif
- execute_frame_tags(0, m_display_list, TAG_DLIST|TAG_ACTION);
+ executeFrameTags(0, _displayList, SWF::ControlTag::TAG_DLIST |
+ SWF::ControlTag::TAG_ACTION);
if (_vm.getSWFVersion() > 5)
{
@@ -2155,7 +2099,8 @@
#ifdef GNASH_DEBUG
log_debug(_("Executing tags of frame0 in movieclip %s"), getTarget());
#endif
- execute_frame_tags(0, m_display_list, TAG_DLIST|TAG_ACTION);
+ executeFrameTags(0, _displayList, SWF::ControlTag::TAG_DLIST |
+ SWF::ControlTag::TAG_ACTION);
}
// We execute events immediately when the stage-placed DisplayObject
@@ -2201,7 +2146,7 @@
}
-/*private*/
+
void
MovieClip::constructAsScriptObject()
{
@@ -2224,10 +2169,11 @@
break;
}
- sprite_definition* def = dynamic_cast<sprite_definition*>(m_def.get());
+ const sprite_definition* def =
+ dynamic_cast<const sprite_definition*>(_def.get());
// We won't "construct" top-level movies
- if ( ! def ) break;
+ if (!def) break;
as_function* ctor = def->getRegisteredClass();
#ifdef GNASH_DEBUG
@@ -2301,7 +2247,7 @@
// stop any pending streaming sounds
stopStreamSound();
- bool childHaveUnloadHandler = m_display_list.unload();
+ bool childHaveUnloadHandler = _displayList.unload();
// We won't be displayed again, so worth releasing
// some memory. The drawable might take a lot of memory
@@ -2329,7 +2275,7 @@
const movie_root& mr = _vm.getRoot();
- boost::intrusive_ptr<movie_definition> md (
+ boost::intrusive_ptr<movie_definition> md(
create_library_movie(url, mr.runInfo(), NULL, true, postdata));
if (!md)
@@ -2339,11 +2285,11 @@
return false;
}
- boost::intrusive_ptr<movie_instance> extern_movie;
- extern_movie = md->create_movie_instance(parent);
+ boost::intrusive_ptr<Movie> extern_movie;
+ extern_movie = md->createMovie(parent);
if (extern_movie == NULL)
{
- log_error(_("can't create extern movie_instance "
+ log_error(_("can't create extern Movie "
"for %s"), url.str());
return false;
}
@@ -2529,9 +2475,7 @@
// removing _level#
_vm.getRoot().dropLevel(depth);
// I guess this can only happen if someone uses
- // _root.swapDepth([0..1048575])
- //log_error(_("Can't remove movieclip %s as it has no parent"),
- //getTarget());
+ // _swf.swapDepth([0..1048575])
}
}
@@ -2541,7 +2485,7 @@
{
rect bounds;
BoundsFinder f(bounds);
- const_cast<DisplayList&>(m_display_list).visitAll(f);
+ const_cast<DisplayList&>(_displayList).visitAll(f);
rect drawableBounds = _drawable.getBounds();
bounds.expand_to_rect(drawableBounds);
@@ -2600,15 +2544,15 @@
MovieClip::enumerateNonProperties(as_environment& env) const
{
EnumerateVisitor visitor(env);
- m_display_list.visitAll(visitor);
+ _displayList.visitAll(visitor);
}
void
MovieClip::cleanupDisplayList()
{
//log_debug("%s.cleanDisplayList() called, current dlist is %p",
- //getTarget(), (void*)&m_display_list);
- m_display_list.removeUnloaded();
+ //getTarget(), (void*)&_displayList);
+ _displayList.removeUnloaded();
cleanup_textfield_variables();
}
@@ -2625,48 +2569,28 @@
{
ReachableMarker marker;
- m_display_list.visitAll(marker);
+ _displayList.visitAll(marker);
- m_as_environment.markReachableResources();
+ _environment.markReachableResources();
// Mark our own definition
- if ( m_def.get() ) m_def->setReachable();
+ if (_def.get()) _def->setReachable();
- // Mark textfields in the TextFieldMap
+ // Mark textfields in the TextFieldIndex
if ( _text_variables.get() )
{
- for(TextFieldMap::const_iterator i=_text_variables->begin(),
+ for (TextFieldIndex::const_iterator i=_text_variables->begin(),
e=_text_variables->end();
i!=e; ++i)
{
- const TextFieldPtrVect& tfs=i->second;
- for (TextFieldPtrVect::const_iterator j=tfs.begin(), je=tfs.end();
j!=je; ++j)
- {
- if ( (*j)->isUnloaded() )
- {
- // NOTE: cleanup_display_list should have cleared
- // these up on ::cleanupDisplayList.
- // I guess if we get more might be due to ::destroy
- // calls happening after our own ::cleanupDisplayList
- // call. Should be ok to postpone cleanup on next
- // ::advance, or we should cleanup here (locally)
- // although we're a 'const' method...
- // Yet another approach would be for TextField::unload
- // to unregister self from our map, but TextField
- // doesn't really store a pointer to the movieclip
- // it's registered against.
- //
- //log_debug("Unloaded TextField in registered textfield "
- //"variables container on ::markReachableResources");
- }
- (*j)->setReachable();
- }
+ const TextFields& tfs=i->second;
+ std::for_each(tfs.begin(), tfs.end(),
+ boost::mem_fn(&DisplayObject::setReachable));
}
}
// Mark our relative root
- assert(m_root != NULL);
- m_root->setReachable();
+ _swf->setReachable();
markDisplayObjectReachable();
@@ -2678,7 +2602,7 @@
{
stopStreamSound();
- m_display_list.destroy();
+ _displayList.destroy();
/// We don't need these anymore
clearProperties();
@@ -2694,22 +2618,20 @@
return cf;
}
-movie_instance*
+Movie*
MovieClip::get_root() const
{
- return m_root;
+ return _swf;
}
const MovieClip*
MovieClip::getAsRoot() const
{
- //log_debug("getAsRoot called for movieclip %s, with _lockroot "
- //"%d and version %d", getTarget(), getLockRoot(), getSWFVersion());
// TODO1: as an optimization, if swf version < 7
- // we might as well just return m_root,
+ // we might as well just return _swf,
// the whole chain from this movieclip to it's
- // m_root should have the same version...
+ // _swf should have the same version...
//
// TODO2: implement this with iteration rather
// then recursion.
@@ -2721,16 +2643,10 @@
// If we have a parent, we descend to it unless
// our _lockroot is true AND our or the VM's
// SWF version is > 6
- //
- int topSWFVersion =
getVM().getRoot().get_movie_definition()->get_version();
- //int topSWFVersion = getVM().getSWFVersion() > 6;
+ int topSWFVersion = getVM().getRoot().getRootMovie().version();
- if ( getSWFVersion() > 6 || topSWFVersion > 6 )
- {
- if ( getLockRoot() )
- {
- return this; // locked
- }
+ if (getSWFVersion() > 6 || topSWFVersion > 6) {
+ if (getLockRoot()) return this;
}
return parent->getAsRoot();
@@ -2739,8 +2655,7 @@
as_value
MovieClip::lockroot_getset(const fn_call& fn)
{
- boost::intrusive_ptr<MovieClip> ptr =
- ensureType<MovieClip>(fn.this_ptr);
+ boost::intrusive_ptr<MovieClip> ptr = ensureType<MovieClip>(fn.this_ptr);
as_value rv;
if ( fn.nargs == 0 ) // getter
@@ -2782,11 +2697,11 @@
}
void
-MovieClip::set_play_state(play_state s)
+MovieClip::setPlayState(PlayState s)
{
- if ( s == m_play_state ) return; // nothing to do
- if ( s == MovieClip::STOP ) stopStreamSound();
- m_play_state = s;
+ if (s == _playState) return; // nothing to do
+ if (s == PLAYSTATE_STOP) stopStreamSound();
+ _playState = s;
}
#ifdef USE_SWFTREE
@@ -2819,14 +2734,14 @@
{
InfoTree::iterator selfIt = DisplayObject::getMovieInfo(tr, it);
std::ostringstream os;
- os << m_display_list.size();
+ os << _displayList.size();
InfoTree::iterator localIter = tr.append_child(selfIt,
StringPair(_("Children"), os.str()));
//localIter = tr.append_child(localIter, StringPair("child1", "fake"));
//localIter = tr.append_child(localIter, StringPair("child2", "fake"));
MovieInfoVisitor v(tr, localIter);
- m_display_list.visitAll(v);
+ _displayList.visitAll(v);
return selfIt;
@@ -2999,7 +2914,7 @@
boost::intrusive_ptr<MovieClip> movieclip =
ensureType<MovieClip>(fn.this_ptr);
- movieclip->set_play_state(MovieClip::PLAY);
+ movieclip->setPlayState(MovieClip::PLAYSTATE_PLAY);
return as_value();
}
@@ -3009,7 +2924,7 @@
boost::intrusive_ptr<MovieClip> movieclip =
ensureType<MovieClip>(fn.this_ptr);
- movieclip->set_play_state(MovieClip::STOP);
+ movieclip->setPlayState(MovieClip::PLAYSTATE_STOP);
return as_value();
}
@@ -3123,8 +3038,8 @@
// Get exported resource
const std::string& id_name = fn.arg(0).to_string();
- boost::intrusive_ptr<ExportableResource> exported =
- movieclip->get_movie_definition()->get_exported_resource(id_name);
+ boost::intrusive_ptr<ExportableResource> exported =
+ movieclip->get_root()->definition()->get_exported_resource(id_name);
if (!exported)
{
@@ -3534,7 +3449,7 @@
// Convert to 0-based
movieclip->goto_frame(frame_number);
- movieclip->set_play_state(MovieClip::PLAY);
+ movieclip->setPlayState(MovieClip::PLAYSTATE_PLAY);
return as_value();
}
@@ -3564,7 +3479,7 @@
// Convert to 0-based
movieclip->goto_frame(frame_number);
- movieclip->set_play_state(MovieClip::STOP);
+ movieclip->setPlayState(MovieClip::PLAYSTATE_STOP);
return as_value();
}
@@ -3579,7 +3494,7 @@
{
movieclip->goto_frame(current_frame + 1);
}
- movieclip->set_play_state(MovieClip::STOP);
+ movieclip->setPlayState(MovieClip::PLAYSTATE_STOP);
return as_value();
}
@@ -3594,7 +3509,7 @@
{
movieclip->goto_frame(current_frame - 1);
}
- movieclip->set_play_state(MovieClip::STOP);
+ movieclip->setPlayState(MovieClip::PLAYSTATE_STOP);
return as_value();
}
@@ -4510,8 +4425,10 @@
}
case 2:
{
- boost::uint32_t rgbval = boost::uint32_t(
- clamp<float>(fn.arg(1).to_number(), 0, 16777216));
+ // See pollock.swf for eventual regressions.
+ // It sets color to a random number from
+ // 0 to 160000000 (about 10 times more then the max).
+ boost::uint32_t rgbval = fn.arg(1).to_int();
r = boost::uint8_t((rgbval & 0xFF0000) >> 16);
g = boost::uint8_t((rgbval & 0x00FF00) >> 8);
b = boost::uint8_t((rgbval & 0x0000FF) );
@@ -5141,18 +5058,16 @@
as_value
movieclip_url_getset(const fn_call& fn)
{
- boost::intrusive_ptr<MovieClip> ptr =
- ensureType<MovieClip>(fn.this_ptr);
+ boost::intrusive_ptr<MovieClip> ptr = ensureType<MovieClip>(fn.this_ptr);
- return as_value(ptr->get_movie_definition()->get_url());
+ return as_value(ptr->get_root()->url());
}
// TODO: move this to DisplayObject class, _focusrect seems a generic property
as_value
movieclip_focusrect_getset(const fn_call& fn)
{
- boost::intrusive_ptr<MovieClip> ptr =
- ensureType<MovieClip>(fn.this_ptr);
+ boost::intrusive_ptr<MovieClip> ptr = ensureType<MovieClip>(fn.this_ptr);
UNUSED(ptr);
if ( fn.nargs == 0 ) // getter
=== modified file 'libcore/MovieClip.h'
--- a/libcore/MovieClip.h 2009-04-08 07:08:06 +0000
+++ b/libcore/MovieClip.h 2009-04-15 05:54:30 +0000
@@ -25,6 +25,7 @@
#include "gnashconfig.h" // GNASH_USE_GC, USE_SWFTREE
#endif
+#include "swf/ControlTag.h"
#include "movie_definition.h" // for inlines
#include "DisplayList.h" // DisplayList
#include "InteractiveObject.h"
@@ -42,11 +43,10 @@
#include <list>
#include <map>
#include <string>
-#include <boost/noncopyable.hpp>
// Forward declarations
namespace gnash {
- class movie_instance;
+ class Movie;
class swf_event;
class drag_state;
class LoadVariablesThread;
@@ -62,13 +62,28 @@
namespace gnash
{
-/// Stateful Sprite object. Also known as a MovieClip.
-//
-/// Instance of this class are also known as "timelines".
-/// This means that they define a variable scope (see
-/// the as_environment member) and are divided into "frames"
-///
-class MovieClip : public InteractiveObject, boost::noncopyable
+/// A MovieClip is a container for DisplayObjects.
+//
+/// In AS3 is it distinguished from a Sprite by having a timeline, i.e.
+/// more than one frame. In AS2, there is no Sprite class.
+//
+/// There are basically two types of MovieClip: dynamic and non-dynamic.
+/// Dynamic clips are created using createEmptyMovieClip() or
+/// duplicateMovieClip(). Non-dynamic MovieClips are parsed from a SWF file.
+/// The isDynamic() member function is the only way to tell the difference
+/// (see following paragraph).
+//
+/// The presence of a definition (the _def member) reveals whether the
+/// MovieClip was constructed with an immutable definition or not. MovieClips
+/// created using createEmptyMovieClip() have no definition. MovieClips
+/// constructed using duplicateMovieClip() have the same definition as the
+/// duplicated clip. They are "dynamic", but may have a definition!
+//
+/// A MovieClip always has an _swf member. This is the top-level SWF
+/// (Movie) containing either the definition or the code from
+/// which the MovieClip was created. The _url member and SWF version are
+/// dependent on the _swf. Exports are also sought in this Movie.
+class MovieClip : public InteractiveObject
{
public:
@@ -77,20 +92,25 @@
typedef movie_definition::PlayList PlayList;
- typedef std::vector<swf_event*> SWFEventsVector;
+ enum PlayState
+ {
+ PLAYSTATE_PLAY,
+ PLAYSTATE_STOP
+ };
/// Construct a MovieClip instance
//
/// @param def
/// Pointer to the movie_definition this object is an
/// instance of (may be a top-level movie or a sprite).
+ /// This may be 0 if there is no immutable definition.
///
/// @param root
- /// The "relative" _root of this sprite, which is the
+ /// The "relative" _swf of this sprite, which is the
/// instance of top-level sprite defined by the same
/// SWF that also contained *this* sprite definition.
/// Note that this can be *different* from the top-level
- /// movie accessible trought the VM, in case this sprite
+ /// movie accessible through the VM, in case this sprite
/// was defined in an externally loaded movie.
///
/// @param parent
@@ -103,34 +123,15 @@
/// to be deprecated if every instance has a reference to its
/// definition, which should know its id...
///
- MovieClip(movie_definition* def, movie_instance* root,
+ MovieClip(const movie_definition* const def, Movie* root,
DisplayObject* parent, int id);
virtual ~MovieClip();
- enum play_state
- {
- PLAY,
- STOP
- };
-
- /// Type of execute tags
- //
- /// TODO: move to ControlTag.h ?
- ///
- enum control_tag_type
- {
- /// Action tag
- TAG_ACTION = 1<<0,
-
- /// DisplayList tag
- TAG_DLIST = 1<<1
- };
-
- // Overridden to use the m_root member
- virtual movie_instance* get_root() const;
-
- /// Return the _root ActionScript property of this sprite.
+ // Return the originating SWF
+ virtual Movie* get_root() const;
+
+ /// Return the _swf ActionScript property of this sprite.
//
/// Relative or absolute is determined by
/// the _lockroot property, see getLockRoot
@@ -138,47 +139,31 @@
///
virtual const MovieClip* getAsRoot() const;
- /// \brief
- /// Return the sprite_definition (or movie_definition)
- /// from which this MovieClip has been created
- movie_definition* get_movie_definition() {
- return m_def.get();
- }
-
- /// \brief
- /// Return version of the SWF definition of this instance
- /// as been parsed from.
- //
- int getSWFVersion() const
- {
- return m_def->get_version();
- }
-
/// Get the composite bounds of all component drawing elements
virtual rect getBounds() const;
// See dox in DisplayObject.h
- bool pointInShape(boost::int32_t x, boost::int32_t y) const;
+ virtual bool pointInShape(boost::int32_t x, boost::int32_t y) const;
// See dox in DisplayObject.h
- bool pointInVisibleShape(boost::int32_t x, boost::int32_t y) const;
+ virtual bool pointInVisibleShape(boost::int32_t x, boost::int32_t y) const;
/// return true if the given point is located in a(this) hitable sprite.
///
/// all sprites except mouse-insensitive dynamic masks are hitable.
/// _visible property is ignored for hitable DisplayObjects.
///
- bool pointInHitableShape(boost::int32_t x, boost::int32_t y) const;
+ virtual bool pointInHitableShape(boost::int32_t x, boost::int32_t y) const;
/// Return 0-based index to current frame
size_t get_current_frame() const
{
- return m_current_frame;
+ return _currentFrame;
}
size_t get_frame_count() const
{
- return m_def->get_frame_count();
+ return _def ? _def->get_frame_count() : 1;
}
/// Return number of completely loaded frames of this sprite/movie
@@ -188,26 +173,27 @@
///
size_t get_loaded_frames() const
{
- return m_def->get_loading_frame();
+ return _def ? _def->get_loading_frame() : 1;
}
/// Return total number of bytes in the movie
/// (not sprite!)
size_t get_bytes_total() const
{
- return isDynamic() ? 0 : m_def->get_bytes_total();
+ return isDynamic() ? 0 : _def->get_bytes_total();
}
/// Return number of loaded bytes in the movie
/// (not sprite!)
size_t get_bytes_loaded() const
{
- return isDynamic() ? 0 : m_def->get_bytes_loaded();
+ return isDynamic() ? 0 : _def->get_bytes_loaded();
}
const rect& get_frame_size() const
{
- return m_def->get_frame_size();
+ static const rect r;
+ return _def ? _def->get_frame_size() : r;
}
/// Stop or play the sprite.
@@ -215,21 +201,16 @@
/// If stopped, any stream sound associated with this sprite
/// will also be stopped.
///
- DSOEXPORT void set_play_state(play_state s);
-
- play_state get_play_state() const { return m_play_state; }
-
- DisplayObject* getDisplayObject(int DisplayObject_id);
-
- // delegates to movie_root (possibly wrong)
- virtual float get_background_alpha() const;
+ DSOEXPORT void setPlayState(PlayState s);
+
+ PlayState getPlayState() const { return _playState; }
// delegates to movie_root (possibly wrong)
void set_background_color(const rgba& color);
bool has_looped() const
{
- return m_has_looped;
+ return _hasLooped;
}
/// Return true if we have any mouse event handlers.
@@ -331,7 +312,7 @@
///
void swapDepths(DisplayObject* ch1, int newdepth)
{
- m_display_list.swapDepths(ch1, newdepth);
+ _displayList.swapDepths(ch1, newdepth);
}
/// Return the DisplayObject at given depth in our DisplayList.
@@ -416,7 +397,7 @@
void remove_display_object(int depth, int /* id */)
{
set_invalidated();
- m_display_list.removeDisplayObject(depth);
+ _displayList.removeDisplayObject(depth);
}
void unloadMovie();
@@ -601,7 +582,7 @@
// inherited from DisplayObject class, see dox in DisplayObject.h
as_environment& get_environment() {
- return m_as_environment;
+ return _environment;
}
/// \brief
@@ -615,7 +596,7 @@
void add_invalidated_bounds(InvalidatedRanges& ranges, bool force);
const DisplayList& getDisplayList() const {
- return m_display_list;
+ return _displayList;
}
/// Return the next highest available depth
@@ -625,16 +606,14 @@
/// that is displayd above all others
///
int getNextHighestDepth() const {
- return m_display_list.getNextHighestDepth();
+ return _displayList.getNextHighestDepth();
}
void testInvariant() const {
- assert(m_play_state == PLAY || m_play_state == STOP);
-
- // m_current_frame may be 0, since this is our initial
+ // _currentFrame may be 0, since this is our initial
// condition. Still, frame count might be 0 as well, and
// loaded frames too !
- //assert(m_current_frame < m_def->get_frame_count());
+ //assert(_currentFrame < _def->get_frame_count());
#ifndef GNASH_USE_GC
assert(get_ref_count() > 0); // or we're constructed but
// not stored in a boost::intrusive_ptr
@@ -712,12 +691,14 @@
_drawable.beginFill(color);
}
- void beginLinearGradientFill(const std::vector<gradient_record>& grad,
const SWFMatrix& mat)
+ void beginLinearGradientFill(const std::vector<gradient_record>& grad,
+ const SWFMatrix& mat)
{
_drawable.beginLinearGradientFill(grad, mat);
}
- void beginRadialGradientFill(const std::vector<gradient_record>& grad,
const SWFMatrix& mat)
+ void beginRadialGradientFill(const std::vector<gradient_record>& grad,
+ const SWFMatrix& mat)
{
_drawable.beginRadialGradientFill(grad, mat);
}
@@ -757,7 +738,6 @@
virtual bool handleFocus();
/// @} Drawing API
-
typedef std::map<std::string, std::string> VariableMap;
@@ -774,12 +754,12 @@
/// from the display lists
void cleanupDisplayList();
- /// Queue the given action buffer
- //
- /// The action will be pushed on the current
- /// global list (see movie_root).
- ///
- void queueAction(const action_buffer& buf);
+ /// Queue the given action buffer
+ //
+ /// The action will be pushed on the current
+ /// global list (see movie_root).
+ ///
+ void queueAction(const action_buffer& buf);
/// Construct this instance as an ActionScript object
//
@@ -791,13 +771,12 @@
void constructAsScriptObject();
- /// Return true if get_root() should return the *relative* root,
+ /// Return true if getAsRoot() should return the *relative* root,
/// false otherwise.
bool getLockRoot() const { return _lockroot; }
- /// Set whether get_root() should return the *relative* root,
+ /// Set whether getAsRoot() should return the *relative* root,
/// false otherwise. True for relative root.
- ///
void setLockRoot(bool lr) { _lockroot=lr; }
/// Getter-setter for MovieClip._lockroot
@@ -805,11 +784,66 @@
#ifdef USE_SWFTREE
// Override to append display list info, see dox in DisplayObject.h
- virtual InfoTree::iterator getMovieInfo(InfoTree& tr, InfoTree::iterator
it);
+ virtual InfoTree::iterator getMovieInfo(InfoTree& tr,
+ InfoTree::iterator it);
#endif
+
+ /// \brief
+ /// Return version of the SWF definition of this instance
+ /// as been parsed from.
+ //
+ int getSWFVersion() const;
+
+protected:
+
+#ifdef GNASH_USE_GC
+ /// Mark sprite-specific reachable resources and invoke
+ /// the parent's class version (markDisplayObjectReachable)
+ //
+ /// sprite-specific reachable resources are:
+ /// - DisplayList items (current, backup and frame0 ones)
+ /// - Canvas for dynamic drawing (_drawable)
+ /// - sprite environment
+ /// - definition the sprite has been instantiated from
+ /// - Textfields having an associated variable registered in this instance.
+ /// - Relative root of this instance (_swf)
+ ///
+ virtual void markReachableResources() const;
+#endif // GNASH_USE_GC
+
+ // Used by BitmapMovie.
+ void placeDisplayObject(DisplayObject* ch, int depth) {
+ _displayList.placeDisplayObject(ch, depth);
+ }
private:
+ typedef std::vector<boost::intrusive_ptr<TextField> > TextFields;
+
+ /// A container for textfields, indexed by their variable name
+ typedef std::map<std::string, TextFields> TextFieldIndex;
+
+ /// Process any completed loadVariables request
+ void processCompletedLoadVariableRequests();
+
+ /// Process a completed loadVariables request
+ void processCompletedLoadVariableRequest(LoadVariablesThread& request);
+
+
+ /// Execute the tags associated with the specified frame.
+ //
+ /// @param frame
+ /// Frame number. 0-based
+ ///
+ /// @param dlist
+ /// The display list to have control tags act upon.
+ ///
+ /// @param typeflags
+ /// Which kind of control tags we want to execute.
+ void executeFrameTags(size_t frame, DisplayList& dlist,
+ int typeflags = SWF::ControlTag::TAG_DLIST |
+ SWF::ControlTag::TAG_ACTION);
+
void stopStreamSound();
/// Register this sprite as a listener of core broadcasters
@@ -852,7 +886,7 @@
/// more at the original depth
/// - Dynamic instances found in the static depth zone
/// - Execute all displaylist tags from first to one-before target frame,
- /// appropriately setting m_current_frame as it goes, finally execute
+ /// appropriately setting _currentFrame as it goes, finally execute
/// both displaylist and action
/// tags for target frame.
///
@@ -871,7 +905,7 @@
//
/// POSTCONDITIONS:
///
- /// - m_current_frame == targetFrame
+ /// - _currentFrame == targetFrame
///
/// TODO: consider using this same function for jump-forward too,
/// with some modifications...
@@ -892,47 +926,9 @@
///
void execute_actions(ActionList& action_list);
- // TODO: shouldn't we keep this by intrusive_ptr ?
- movie_instance* m_root;
-
- /// Current Display List contents.
- DisplayList m_display_list;
-
- /// The canvas for dynamic drawing
- DynamicShape _drawable;
-
- // this is deprecated, we'll be pushing gotoframe target
- // actions to the global action queue
- //ActionList m_goto_frame_action_list;
-
- play_state m_play_state;
-
- // 0-based index to current frame
- size_t m_current_frame;
-
- // true if this sprite reached the last frame and restarted
- bool m_has_looped;
-
- // true is we're calling frame actions
- bool _callingFrameActions;
-
- /// This timeline's variable scope
- as_environment m_as_environment;
-
- /// Increment m_current_frame, and take care of looping.
+ /// Increment _currentFrame, and take care of looping.
void increment_frame_and_check_for_loop();
-
- typedef boost::intrusive_ptr<TextField> TextFieldPtr;
- typedef std::vector<TextFieldPtr> TextFieldPtrVect;
-
- /// A container for textfields, indexed by their variable name
- typedef std::map< std::string, TextFieldPtrVect > TextFieldMap;
-
- /// We'll only allocate Textfield variables map if
- /// we need them (ie: anyone calls set_textfield_variable)
- ///
- std::auto_ptr<TextFieldMap> _text_variables;
-
+
/// \brief
/// Returns a vector of TextField associated with the given variable name,
/// or NULL if no such variable name is known.
@@ -947,55 +943,18 @@
/// @return a pointer inside a vector, will be invalidated by modifications
/// of the vector (set_textfield_variable)
///
- TextFieldPtrVect* get_textfield_variable(const std::string& name);
+ TextFields* get_textfield_variable(const std::string& name);
/// Unregister textfield variables bound to unloaded TextFields
void cleanup_textfield_variables();
- /// soundid for current playing stream. If no stream set to -1
- int m_sound_stream_id;
-
- cxform _userCxform;
-
- std::string _droptarget;
-
- bool _lockroot;
-
-protected:
-
- /// Used both by this class and movie_instance.
- //
- /// TODO: do this with proper Sprite -> MovieClip inheritance.
- void advance_sprite();
-
- void placeDisplayObject(DisplayObject* ch, int depth)
- {
- m_display_list.placeDisplayObject(ch, depth);
- }
-
- /// Execute the tags associated with the specified frame.
- //
- /// @param frame
- /// Frame number. 0-based
- ///
- /// @param dlist
- /// The display list to have control tags act upon.
- ///
- /// @param typeflags
- /// Which kind of control tags we want to execute.
- /// See control_tag_type enum. TODO: *take* a control_tag_type ?
- ///
- void execute_frame_tags(size_t frame, DisplayList& dlist,
- int typeflags = TAG_DLIST | TAG_ACTION);
-
- /// \brief
/// This is either sprite_definition (for sprites defined by
/// DefineSprite tag) or movie_def_impl (for the top-level movie).
- boost::intrusive_ptr<movie_definition> m_def;
+ const boost::intrusive_ptr<const movie_definition> _def;
/// List of loadVariables requests
typedef std::list<LoadVariablesThread*> LoadVariablesThreads;
-
+
/// List of active loadVariable requests
//
/// At ::advance_sprite time, all completed requests will
@@ -1003,26 +962,42 @@
/// and removed from the list.
LoadVariablesThreads _loadVariableRequests;
- /// Process any completed loadVariables request
- void processCompletedLoadVariableRequests();
-
- /// Process a completed loadVariables request
- void processCompletedLoadVariableRequest(LoadVariablesThread& request);
-
-#ifdef GNASH_USE_GC
- /// Mark sprite-specific reachable resources and invoke
- /// the parent's class version (markDisplayObjectReachable)
- //
- /// sprite-specific reachable resources are:
- /// - DisplayList items (current, backup and frame0 ones)
- /// - Canvas for dynamic drawing (_drawable)
- /// - sprite environment
- /// - definition the sprite has been instantiated from
- /// - Textfields having an associated variable registered in this instance.
- /// - Relative root of this instance (m_root)
+ /// The SWF that this MovieClip belongs to.
+ Movie* _swf;
+
+ /// Current Display List contents.
+ DisplayList _displayList;
+
+ /// The canvas for dynamic drawing
+ DynamicShape _drawable;
+
+ PlayState _playState;
+
+ // 0-based index to current frame
+ size_t _currentFrame;
+
+ // true if this sprite reached the last frame and restarted
+ bool _hasLooped;
+
+ // true is we're calling frame actions
+ bool _callingFrameActions;
+
+ /// This timeline's variable scope
+ as_environment _environment;
+
+ /// We'll only allocate Textfield variables map if
+ /// we need them (ie: anyone calls set_textfield_variable)
///
- virtual void markReachableResources() const;
-#endif // GNASH_USE_GC
+ std::auto_ptr<TextFieldIndex> _text_variables;
+
+ /// soundid for current playing stream. If no stream set to -1
+ int m_sound_stream_id;
+
+ cxform _userCxform;
+
+ std::string _droptarget;
+
+ bool _lockroot;
};
/// Initialize the global MovieClip class
=== modified file 'libcore/Property.h'
--- a/libcore/Property.h 2009-02-25 22:33:03 +0000
+++ b/libcore/Property.h 2009-04-15 05:33:51 +0000
@@ -454,7 +454,7 @@
bool isStatic() const { return _flags.get_static(); }
/// Is this member supposed to be visible by a VM of given version ?
- bool isVisible(int swfVersion) const {
+ bool visible(int swfVersion) const {
return _flags.get_visible(swfVersion);
}
=== renamed file 'libcore/movie_instance.cpp' => 'libcore/SWFMovie.cpp'
--- a/libcore/movie_instance.cpp 2009-04-03 09:18:40 +0000
+++ b/libcore/SWFMovie.cpp 2009-04-15 05:54:30 +0000
@@ -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
-#include "movie_instance.h"
+#include "SWFMovie.h"
#include "movie_definition.h"
#include "movie_root.h"
#include "log.h"
@@ -29,25 +29,21 @@
namespace gnash {
-movie_instance::movie_instance(movie_definition* def, DisplayObject* parent)
+SWFMovie::SWFMovie(const SWFMovieDefinition* const def, DisplayObject* parent)
:
- MovieClip(def, this, parent, parent ? 0 : -1),
+ Movie(def, parent),
_def(def)
{
}
void
-movie_instance::stagePlacementCallback(as_object* initObj)
+SWFMovie::stagePlacementCallback(as_object* initObj)
{
assert (!initObj);
saveOriginalTarget();
- //GNASH_REPORT_FUNCTION;
-
- //_def->stopLoader();
-
// Load first frame (1-based index)
size_t nextframe = 1;
if ( !_def->ensure_frame_loaded(nextframe) )
@@ -64,18 +60,15 @@
// Advance of an SWF-defined movie instance
void
-movie_instance::advance()
+SWFMovie::advance()
{
- //GNASH_REPORT_FUNCTION;
-
- //_def->stopLoader();
-
// Load next frame if available (+2 as m_current_frame is 0-based)
//
// We do this inside advance_root to make sure
// it's only for a root sprite (not a sprite defined
// by DefineSprite!)
- size_t nextframe = std::min<size_t>(get_current_frame()+2,
get_frame_count());
+ size_t nextframe = std::min<size_t>(get_current_frame() + 2,
+ get_frame_count());
if ( !_def->ensure_frame_loaded(nextframe) )
{
IF_VERBOSE_MALFORMED_SWF(
@@ -84,9 +77,7 @@
);
}
- advance_sprite();
-
- //_def->resumeLoader();
+ MovieClip::advance();
}
} // namespace gnash
=== renamed file 'libcore/movie_instance.h' => 'libcore/SWFMovie.h'
--- a/libcore/movie_instance.h 2009-04-03 09:18:40 +0000
+++ b/libcore/SWFMovie.h 2009-04-15 06:41:11 +0000
@@ -18,19 +18,17 @@
// Stateful live Movie instance
-#ifndef GNASH_MOVIE_INSTANCE_H
-#define GNASH_MOVIE_INSTANCE_H
-
-#include <vector>
+#ifndef GNASH_SWF_MOVIE_H
+#define GNASH_SWF_MOVIE_H
+
+#include "Movie.h" // for inheritance
+#include "smart_ptr.h" // for composition
+#include "SWFMovieDefinition.h" // for dtor visibility by smart ptr
+
#include <set>
-#include "MovieClip.h" // for inheritance
-#include "smart_ptr.h" // for composition
-#include "movie_definition.h" // for dtor visibility by smart ptr
-
// Forward declarations
namespace gnash {
- class movie_root;
class DisplayObject;
}
@@ -38,19 +36,33 @@
{
/// Stateful Movie object (a special kind of sprite)
-class movie_instance : public MovieClip
+class SWFMovie : public Movie
{
public:
- // We take a generic movie_definition to allow
- // for subclasses for other then SWF movies
- movie_instance(movie_definition* def, DisplayObject* parent);
+ SWFMovie(const SWFMovieDefinition* const def, DisplayObject* parent);
- virtual ~movie_instance() {}
+ virtual ~SWFMovie() {}
virtual void advance();
+ virtual float frameRate() const {
+ return _def->get_frame_rate();
+ }
+
+ virtual float widthPixels() const {
+ return _def->get_width_pixels();
+ }
+
+ virtual float heightPixels() const {
+ return _def->get_height_pixels();
+ }
+
+ virtual bool ensureFrameLoaded(size_t frameNo) const {
+ return _def->ensure_frame_loaded(frameNo);
+ }
+
/// Handle a top-level movie on stage placement.
//
/// This method will just ensure first frame is loaded
@@ -60,6 +72,14 @@
///
void stagePlacementCallback(as_object* initObj = 0);
+ const std::string& url() const {
+ return _def->get_url();
+ }
+
+ int version() const {
+ return _def->get_version();
+ }
+
/// Set a DisplayObject in the dictionary as initialized, returning
/// true if not already initialized.
bool setCharacterInitialized(int cid)
@@ -67,6 +87,10 @@
return _initializedCharacters.insert(cid).second;
}
+ const movie_definition* definition() const {
+ return _def.get();
+ }
+
private:
/// A map to track execution of init actions
@@ -76,7 +100,8 @@
///
std::set<int> _initializedCharacters;
- boost::intrusive_ptr<movie_definition> _def;
+ /// This should only be a top-level movie, not a sprite_definition.
+ const boost::intrusive_ptr<const SWFMovieDefinition> _def;
};
=== modified file 'libcore/Shape.cpp'
--- a/libcore/Shape.cpp 2009-04-08 07:08:06 +0000
+++ b/libcore/Shape.cpp 2009-04-14 07:33:24 +0000
@@ -41,7 +41,7 @@
// the collision detection find you inside a self-crossing
// shape).
if (_def) {
- if (!_def->get_bound().point_test(lp.x, lp.y)) return false;
+ if (!_def->bounds().point_test(lp.x, lp.y)) return false;
return _def->pointTestLocal(lp.x, lp.y, wm);
}
assert(_shape.get());
=== modified file 'libcore/Shape.h'
--- a/libcore/Shape.h 2009-04-07 12:45:25 +0000
+++ b/libcore/Shape.h 2009-04-14 07:33:24 +0000
@@ -27,11 +27,6 @@
#include <cassert>
#include <boost/shared_ptr.hpp>
-// Forward declarations
-namespace gnash {
- class DefinitionTag;
-}
-
namespace gnash {
/// For DisplayObjects that don't store unusual state in their instances.
@@ -63,7 +58,7 @@
virtual void display();
virtual rect getBounds() const {
- return _def ? _def->get_bound() : _shape->getBounds();
+ return _def ? _def->bounds() : _shape->getBounds();
}
virtual bool pointInShape(boost::int32_t x, boost::int32_t y) const;
=== modified file 'libcore/StaticText.h'
--- a/libcore/StaticText.h 2009-04-07 17:48:48 +0000
+++ b/libcore/StaticText.h 2009-04-14 07:33:24 +0000
@@ -29,7 +29,6 @@
// Forward declarations
namespace gnash {
- class DefinitionTag;
namespace SWF {
class TextRecord;
}
@@ -88,7 +87,7 @@
void setSelectionColor(boost::uint32_t color);
virtual rect getBounds() const {
- return _def->get_bound();
+ return _def->bounds();
}
virtual bool pointInShape(boost::int32_t x, boost::int32_t y) const;
=== modified file 'libcore/TextField.cpp'
--- a/libcore/TextField.cpp 2009-04-07 12:46:29 +0000
+++ b/libcore/TextField.cpp 2009-04-15 05:33:51 +0000
@@ -51,6 +51,7 @@
#include <string>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/assign/list_of.hpp>
+#include <boost/bind.hpp>
// Text fields have a fixed 2 pixel padding for each side (regardless of
border)
#define PADDING_TWIPS 40
@@ -144,7 +145,7 @@
_selectable(!def.noSelect()),
_autoSize(autoSizeNone),
_type(def.readOnly() ? typeDynamic : typeInput),
- _bounds(def.get_bound()),
+ _bounds(def.bounds()),
_selection(0, 0)
{
@@ -231,8 +232,6 @@
registerTextVariable();
- m_dummy_style.push_back(fill_style());
-
reset_bounding_box(0, 0);
}
@@ -336,14 +335,14 @@
// A cleaner implementation is likely correctly setting the
// _xOffset and _yOffset memebers in glyph records.
// Anyway, see bug #17954 for a testcase.
- SWFMatrix m;
+ SWFMatrix m = getWorldMatrix();
- if (!_bounds.is_null())
- {
+ if (!_bounds.is_null()) {
m.concatenate_translation(_bounds.get_x_min(), _bounds.get_y_min());
}
- SWF::TextRecord::displayRecords(m, *this, _textRecords, _embedFonts);
+ SWF::TextRecord::displayRecords(m, get_world_cxform(), _textRecords,
+ _embedFonts);
if (m_has_focus) show_cursor(wmat);
@@ -504,7 +503,7 @@
TextField::topmostMouseEntity(boost::int32_t x, boost::int32_t y)
{
- if (!isVisible()) return 0;
+ if (!visible()) return 0;
// shouldn't this be !can_handle_mouse_event() instead ?
// not selectable, so don't catch mouse events!
@@ -772,7 +771,7 @@
break;
case NSV::PROP_uVISIBLE:
{
- val->set_bool(isVisible());
+ val->set_bool(visible());
return true;
}
case NSV::PROP_uALPHA:
@@ -1285,7 +1284,6 @@
break;
}
-
if (m_cursor > idx)
{
m_xcursor = x;
@@ -1638,20 +1636,12 @@
void
TextField::setTextColor(const rgba& col)
{
- if ( _textColor != col )
- {
+ if (_textColor != col) {
+
set_invalidated();
-
_textColor = col;
-
- // Change color of all current glyph records
- for (TextRecords::iterator i=_textRecords.begin(),
- e = _textRecords.end(); i!=e; ++i)
- {
- SWF::TextRecord& rec = *i;
- rec.setColor(_textColor);
- }
-
+ std::for_each(_textRecords.begin(), _textRecords.end(),
+ boost::bind(&SWF::TextRecord::setColor, _1, _textColor));
}
}
@@ -1823,16 +1813,10 @@
TextField::TypeValue
TextField::parseTypeValue(const std::string& val)
{
- StringNoCaseLessThan cmp;
+ StringNoCaseEqual cmp;
- if ( ! cmp(val, "input") )
- {
- return typeInput;
- }
- if ( ! cmp(val, "dynamic") )
- {
- return typeDynamic;
- }
+ if (cmp(val, "input")) return typeInput;
+ if (cmp(val, "dynamic")) return typeDynamic;
return typeInvalid;
}
@@ -2390,7 +2374,6 @@
as_value
textfield_setTextFormat(const fn_call& fn)
{
- //GNASH_REPORT_FUNCTION;
boost::intrusive_ptr<TextField> text = ensureType<TextField>(fn.this_ptr);
@@ -2451,9 +2434,9 @@
bool italic = tf->italiced();
// NOTE: should query movie-private font lib, not global-shared one
- movie_instance* mi = text->get_root();
+ Movie* mi = text->get_root();
assert(mi);
- movie_definition* md = mi->get_movie_definition();
+ const movie_definition* md = mi->definition();
assert(md);
Font* f = md->get_font(fontName, bold, italic);
if ( ! f ) f = fontlib::get_font(fontName, bold, italic);
=== modified file 'libcore/TextField.h'
--- a/libcore/TextField.h 2009-04-04 15:35:18 +0000
+++ b/libcore/TextField.h 2009-04-14 11:26:23 +0000
@@ -96,7 +96,10 @@
InteractiveObject* topmostMouseEntity(boost::int32_t x,
boost::int32_t y);
- bool wantsInstanceName() const
+ // Text fields need to handle cxform specially
+ virtual cxform get_world_cxform() const;
+
+ bool wantsInstanceName() const
{
return true; // text fields can be referenced
}
@@ -460,16 +463,21 @@
///
void setTextValue(const std::wstring& wstr);
+protected:
+
+ /// Mark reachable reosurces (for GC)
+ //
+ /// Reachable resources are:
+ /// - The font being used (m_font)
+ /// - Our definition
+ /// - Common DisplayObject resources
+ ///
+ void markReachableResources() const;
private:
void init();
- /// The immutable definition of our TextField
- //
- /// This is NULL for dynamic TextFields.
- boost::intrusive_ptr<const SWF::DefineEditTextTag> _tag;
-
/// \brief Set our text to the given string by effect of an update of a
/// registered variable name
//
@@ -492,37 +500,12 @@
/// Call this function when willing to invoke the onChanged event
handler
void onChanged();
- /// The actual text.
- //
- /// Because we have to deal with non-ascii DisplayObjects (129-255), this
- /// is a wide string; the cursor position and the position within the
- /// string are then the same, which makes manipulating the string much
- /// easier.
- std::wstring _text;
-
- /// This flag will be true as soon as the TextField
- /// is assigned a text value. Only way to be false is
- /// when definition has the hasText flag set to false
- /// and no actionscript added text.
- bool _textDefined;
-
- /// bounds of dynamic text, as laid out
- rect m_text_bounding_box;
-
/// Reset our text bounding box to the given point.
void reset_bounding_box(boost::int32_t x, boost::int32_t y)
{
m_text_bounding_box.set_to_point(x, y);
}
- typedef std::vector<SWF::TextRecord> TextRecords;
- TextRecords _textRecords;
-
- /// used to pass a color on to Shape::display()
- std::vector<fill_style> m_dummy_style;
-
- std::vector<line_style> m_dummy_line_style;
-
/// Convert the DisplayObjects in _text into a series of
/// text_glyph_records to be rendered.
void format_text();
@@ -545,6 +528,57 @@
/// m_text_glyph_records.
float align_line(TextAlignment align, int last_line_start_record, float
x);
+ /// Associate a variable to the text of this DisplayObject
+ //
+ /// Setting the associated variable actually changes the
+ /// displayed text. Getting the variable would return the
+ /// displayed text.
+ ///
+ /// If the given variable already exist use it to set
+ /// current text before overriding it.
+ ///
+ /// Since the variable target may be undefined at time
+ /// of instantiation of this EditText DisplayObject, the
+ /// class keeps track of wheter it succeeded registering
+ /// the variable and this function will do nothing in this
+ /// case. Thus it is safe to call it multiple time, using
+ /// an as-needed policy (will be called from get_text_value and
+ /// display)
+ ///
+ void registerTextVariable();
+
+ typedef std::pair<as_object*, string_table::key> VariableRef;
+
+ /// \brief
+ /// Parse the given variable name
+ /// into sprite and a string_table::key components
+ ///
+ VariableRef parseTextVariableRef(const std::string& variableName) const;
+
+ /// The immutable definition of our TextField
+ //
+ /// This is NULL for dynamic TextFields.
+ boost::intrusive_ptr<const SWF::DefineEditTextTag> _tag;
+
+ /// The actual text.
+ //
+ /// Because we have to deal with non-ascii DisplayObjects (129-255), this
+ /// is a wide string; the cursor position and the position within the
+ /// string are then the same, which makes manipulating the string much
+ /// easier.
+ std::wstring _text;
+
+ /// This flag will be true as soon as the TextField
+ /// is assigned a text value. Only way to be false is
+ /// when definition has the hasText flag set to false
+ /// and no actionscript added text.
+ bool _textDefined;
+
+ /// bounds of dynamic text, as laid out
+ rect m_text_bounding_box;
+
+ typedef std::vector<SWF::TextRecord> TextRecords;
+ TextRecords _textRecords;
bool _underlined;
boost::uint16_t _leading;
@@ -579,37 +613,6 @@
/// Corresponds to the maxChars property.
boost::int32_t _maxChars;
-
- /// Associate a variable to the text of this DisplayObject
- //
- /// Setting the associated variable actually changes the
- /// displayed text. Getting the variable would return the
- /// displayed text.
- ///
- /// If the given variable already exist use it to set
- /// current text before overriding it.
- ///
- /// Since the variable target may be undefined at time
- /// of instantiation of this EditText DisplayObject, the
- /// class keeps track of wheter it succeeded registering
- /// the variable and this function will do nothing in this
- /// case. Thus it is safe to call it multiple time, using
- /// an as-needed policy (will be called from get_text_value and
- /// display)
- ///
- void registerTextVariable();
-
- typedef std::pair<as_object*, string_table::key> VariableRef;
-
- /// \brief
- /// Parse the given variable name
- /// into sprite and a string_table::key components
- ///
- VariableRef parseTextVariableRef(const std::string& variableName) const;
-
- // Text fields need to handle cxform specially
- virtual cxform get_world_cxform() const;
-
/// The flag keeping status of TextVariable registration
//
/// It will be set to true if there's no need to register
@@ -657,17 +660,6 @@
/// Represents the selected part of the text. The second element must
/// never be less than the first.
std::pair<size_t, size_t> _selection;
-
-protected:
-
- /// Mark reachable reosurces (for GC)
- //
- /// Reachable resources are:
- /// - The font being used (m_font)
- /// - Our definition
- /// - Common DisplayObject resources
- ///
- void markReachableResources() const;
};
/// Initialize the global TextField class
=== modified file 'libcore/Video.cpp'
--- a/libcore/Video.cpp 2009-04-06 11:16:20 +0000
+++ b/libcore/Video.cpp 2009-04-15 09:08:37 +0000
@@ -52,7 +52,7 @@
as_value video_height(const fn_call& fn);
}
-Video::Video(SWF::DefineVideoStreamTag* def,
+Video::Video(const SWF::DefineVideoStreamTag* const def,
DisplayObject* parent, int id)
:
DisplayObject(parent, id),
@@ -140,7 +140,7 @@
assert(m_def);
SWFMatrix m = getWorldMatrix();
- const rect& bounds = m_def->get_bound();
+ const rect& bounds = m_def->bounds();
GnashImage* img = getVideoFrame();
if (img)
@@ -269,21 +269,20 @@
}
void
-Video::add_invalidated_bounds(InvalidatedRanges& ranges,
- bool force)
+Video::add_invalidated_bounds(InvalidatedRanges& ranges, bool force)
{
if (!force && !m_invalidated) return; // no need to redraw
ranges.add(m_old_invalidated_ranges);
- // NOTE: do not use m_def->get_bounds()
+ // NOTE: do not use m_def->boundss()
// if m_def is NULL we've been constructed by 'new Video', in this
// case I think add_invalidated_bouns would never be invoked on us...
assert ( m_def );
rect bounds;
- bounds.expand_to_transformed_rect(getWorldMatrix(), m_def->get_bound());
+ bounds.expand_to_transformed_rect(getWorldMatrix(), m_def->bounds());
ranges.add(bounds.getRange());
}
@@ -315,7 +314,7 @@
rect
Video::getBounds() const
{
- if (_embeddedStream) return m_def->get_bound();
+ if (_embeddedStream) return m_def->bounds();
// TODO: return the bounds of the dynamically
// loaded video if not embedded ?
=== modified file 'libcore/Video.h'
--- a/libcore/Video.h 2009-04-03 11:03:31 +0000
+++ b/libcore/Video.h 2009-04-15 09:08:37 +0000
@@ -48,7 +48,7 @@
public:
- Video(SWF::DefineVideoStreamTag* def, DisplayObject* parent,
+ Video(const SWF::DefineVideoStreamTag* const def, DisplayObject* parent,
int id);
~Video();
@@ -127,7 +127,7 @@
/// Get video frame to be displayed
GnashImage* getVideoFrame();
- const boost::intrusive_ptr<SWF::DefineVideoStreamTag> m_def;
+ const boost::intrusive_ptr<const SWF::DefineVideoStreamTag> m_def;
// Who owns this ? Should it be an intrusive ptr ?
boost::intrusive_ptr<NetStream_as> _ns;
=== modified file 'libcore/as_object.cpp'
--- a/libcore/as_object.cpp 2009-04-01 14:22:00 +0000
+++ b/libcore/as_object.cpp 2009-04-16 10:00:54 +0000
@@ -460,7 +460,7 @@
Property* prop = _members.getProperty(key, nsname);
// TODO: add ignoreVisibility parameter to allow using
// __proto__ even when not visible ?
- if (prop && prop->isVisible(swfVersion))
+ if (prop && prop->visible(swfVersion))
{
if (owner != NULL)
*owner = this;
@@ -486,7 +486,7 @@
throw ActionLimitException("Lookup depth exceeded.");
Property* prop = obj->_members.getProperty(key);
- if (prop && prop->isVisible(swfVersion) )
+ if (prop && prop->visible(swfVersion) )
{
if (owner != NULL)
*owner = obj.get();
@@ -510,7 +510,7 @@
// We won't scan the inheritance chain if we find a member,
// even if invisible.
//
- if ( prop ) return prop; // TODO: what about isVisible ?
+ if ( prop ) return prop; // TODO: what about visible ?
// don't enter an infinite loop looking for __proto__ ...
if (key == NSV::PROP_uuPROTOuu) return NULL;
@@ -530,7 +530,7 @@
throw ActionLimitException("Property lookup depth
exceeded.");
Property* p = obj->_members.getProperty(key, nsname);
- if (p && (p->isGetterSetter() | p->isStatic()) &&
p->isVisible(swfVersion))
+ if (p && (p->isGetterSetter() | p->isStatic()) &&
p->visible(swfVersion))
{
return p; // What should we do if this is not a
getter/setter ?
}
@@ -1166,7 +1166,7 @@
Property* prop = _members.getProperty(NSV::PROP_uuPROTOuu);
if ( ! prop ) return 0;
- if ( ! prop->isVisible(swfVersion) ) return 0;
+ if ( ! prop->visible(swfVersion) ) return 0;
as_value tmp = prop->getValue(*this);
=== modified file 'libcore/asobj/NetConnection_as.cpp'
--- a/libcore/asobj/NetConnection_as.cpp 2009-03-19 19:16:28 +0000
+++ b/libcore/asobj/NetConnection_as.cpp 2009-04-13 10:28:31 +0000
@@ -180,7 +180,8 @@
/// script specified a callback function, use the optional parameters to
specify
/// the identifier (which must be unique) and the callback object as an
as_value
///
-class HTTPRemotingHandler : public ConnectionHandler {
+class HTTPRemotingHandler : public ConnectionHandler
+{
public:
@@ -268,12 +269,12 @@
{
push_amf(amf);
push_callback(identifier, callback);
- };
+ }
void enqueue(const SimpleBuffer &amf)
{
push_amf(amf);
- };
+ }
};
=== modified file 'libcore/asobj/Object.cpp'
--- a/libcore/asobj/Object.cpp 2009-04-03 09:18:40 +0000
+++ b/libcore/asobj/Object.cpp 2009-04-14 17:49:58 +0000
@@ -288,11 +288,6 @@
// Find the exported resource
- // TODO: check to *which* definition should we ask the export
- // this code uses the *relative* root of current environment's
target
-#if 0
- movie_definition* def = _vm.getRoot().get_movie_definition();
-#else
// Using definition of current target fixes the youtube beta case
// https://savannah.gnu.org/bugs/index.php?23130
DisplayObject* tgt = fn.env().get_target();
@@ -300,11 +295,11 @@
log_error("current environment has no target, wouldn't know
where to look for symbol required for registerClass");
return as_value(false);
}
- movie_instance* relRoot = tgt->get_root();
+ Movie* relRoot = tgt->get_root();
assert(relRoot);
- movie_definition* def = relRoot->get_movie_definition();
-#endif
- boost::intrusive_ptr<ExportableResource> exp_res =
+ const movie_definition* def = relRoot->definition();
+
+ boost::intrusive_ptr<ExportableResource> exp_res =
def->get_exported_resource(symbolid);
if ( ! exp_res )
{
=== modified file 'libcore/asobj/Sound_as.cpp'
--- a/libcore/asobj/Sound_as.cpp 2009-04-03 09:48:13 +0000
+++ b/libcore/asobj/Sound_as.cpp 2009-04-14 16:13:21 +0000
@@ -640,7 +640,7 @@
const std::string& name = fn.arg(0).to_string();
// check the import.
- movie_definition* def = so->getVM().getRoot().get_movie_definition();
+ const movie_definition* def = fn.callerDef;
assert(def);
boost::intrusive_ptr<ExportableResource> res =
def->get_exported_resource(name);
@@ -698,15 +698,7 @@
// check the import.
// NOTE: we should be checking in the SWF containing the calling code
// (see 'winter bell' from orisinal morning sunshine for a testcase)
- const movie_definition* def;
- if ( ! fn.callerDef ) {
- log_error("Function call to Sound.attachSound have no callerDef");
- def = so->getVM().getRoot().get_movie_definition();
- }
- else {
- def = fn.callerDef;
- }
-
+ const movie_definition* def = fn.callerDef;
assert(def);
boost::intrusive_ptr<ExportableResource> res =
def->get_exported_resource(name);
=== modified file 'libcore/asobj/flash/display/BitmapData_as.cpp'
--- a/libcore/asobj/flash/display/BitmapData_as.cpp 2009-04-03 09:18:40
+0000
+++ b/libcore/asobj/flash/display/BitmapData_as.cpp 2009-04-14 15:07:44
+0000
@@ -34,8 +34,6 @@
#include "Object.h" // for AS inheritance
#include "VM.h" // for addStatics
-#include "BitmapMovieInstance.h"
-
#include <vector>
#include <sstream>
#include <algorithm>
=== modified file 'libcore/fill_style.cpp'
--- a/libcore/fill_style.cpp 2009-04-08 11:48:21 +0000
+++ b/libcore/fill_style.cpp 2009-04-16 10:00:54 +0000
@@ -320,7 +320,7 @@
}
-BitmapInfo*
+const BitmapInfo*
fill_style::get_bitmap_info() const
{
assert(m_type != SWF::FILL_SOLID);
@@ -432,7 +432,7 @@
return m_gradients.back().m_color;
}
-BitmapInfo*
+const BitmapInfo*
fill_style::create_gradient_bitmap() const
{
assert(m_type == SWF::FILL_LINEAR_GRADIENT
@@ -499,14 +499,14 @@
break;
}
- BitmapInfo* bi = render::createBitmapInfo(
+ const BitmapInfo* bi = render::createBitmapInfo(
static_cast<std::auto_ptr<GnashImage> >(im));
return bi;
}
-BitmapInfo*
+const BitmapInfo*
fill_style::need_gradient_bitmap() const
{
@@ -593,7 +593,7 @@
return m_gradients[index];
}
-fill_style::fill_style(BitmapInfo* bitmap, const SWFMatrix& mat)
+fill_style::fill_style(const BitmapInfo* const bitmap, const SWFMatrix& mat)
:
_matrix(mat),
_bitmapInfo(bitmap),
=== modified file 'libcore/fill_style.h'
--- a/libcore/fill_style.h 2009-04-08 11:48:21 +0000
+++ b/libcore/fill_style.h 2009-04-16 10:00:54 +0000
@@ -115,7 +115,7 @@
/// @param mat
/// The SWFMatrix to apply to the bitmap.
///
- fill_style(BitmapInfo* bitmap, const SWFMatrix& mat);
+ fill_style(const BitmapInfo* const bitmap, const SWFMatrix& mat);
void setSolid(const rgba& color);
@@ -176,12 +176,12 @@
/// \brief
/// Make a BitmapInfo* corresponding to our gradient.
/// We can use this to set the gradient fill style.
- BitmapInfo* create_gradient_bitmap() const;
+ const BitmapInfo* create_gradient_bitmap() const;
/// \brief
/// Makes sure that _gradientBitmapInfo is not NULL. Calls
/// create_gradient_bitmap() if necessary and returns
_gradientBitmapInfo.
- BitmapInfo* need_gradient_bitmap() const;
+ const BitmapInfo* need_gradient_bitmap() const;
rgba get_color() const { return m_color; }
@@ -209,7 +209,7 @@
/// to a DisplayObject defined in the DisplayObjects dictionary.
/// (it happens..)
///
- BitmapInfo* get_bitmap_info() const;
+ const BitmapInfo* get_bitmap_info() const;
BitmapSmoothingPolicy getBitmapSmoothingPolicy() const {
return _bitmapSmoothingPolicy;
@@ -257,7 +257,7 @@
SWFMatrix _matrix;
// For BITMAP or GRADIENT types
- boost::intrusive_ptr<BitmapInfo> _bitmapInfo;
+ boost::intrusive_ptr<const BitmapInfo> _bitmapInfo;
// For SOLID type (and arguably GRADIENT too)
rgba m_color;
=== modified file 'libcore/impl.cpp'
--- a/libcore/impl.cpp 2009-04-08 11:48:21 +0000
+++ b/libcore/impl.cpp 2009-04-16 10:00:54 +0000
@@ -349,8 +349,7 @@
return NULL;
}
- std::string urlstr = url.str();
- const char* movie_url = reset_url ? reset_url : urlstr.c_str();
+ std::string movie_url = reset_url ? reset_url : url.str();
movie_definition* ret = create_movie(in, movie_url, runInfo,
startLoaderThread);
@@ -558,7 +557,8 @@
/// Mark all library elements as reachable (for GC)
void markReachableResources() const
{
- for ( LibraryContainer::const_iterator i=_map.begin(), e=_map.end();
i!=e; ++i)
+ for (LibraryContainer::const_iterator i=_map.begin(), e=_map.end();
+ i!=e; ++i)
{
i->second.def->setReachable();
}
=== modified file 'libcore/movie_root.cpp'
--- a/libcore/movie_root.cpp 2009-04-08 11:48:21 +0000
+++ b/libcore/movie_root.cpp 2009-04-16 10:00:54 +0000
@@ -23,7 +23,7 @@
#include "movie_root.h"
#include "log.h"
#include "MovieClip.h"
-#include "movie_instance.h" // for implicit upcast to MovieClip
+#include "Movie.h" // for implicit upcast to MovieClip
#include "render.h"
#include "VM.h"
#include "ExecutableCode.h"
@@ -178,13 +178,13 @@
}
void
-movie_root::setRootMovie(movie_instance* movie)
+movie_root::setRootMovie(Movie* movie)
{
_rootMovie = movie;
m_viewport_x0 = 0;
m_viewport_y0 = 0;
- movie_definition* md = movie->get_movie_definition();
+ const movie_definition* md = movie->definition();
float fps = md->get_frame_rate();
_movieAdvancementDelay = static_cast<int>(1000/fps);
@@ -248,7 +248,7 @@
/* private */
void
-movie_root::setLevel(unsigned int num, boost::intrusive_ptr<movie_instance>
movie)
+movie_root::setLevel(unsigned int num, boost::intrusive_ptr<Movie> movie)
{
assert(movie != NULL);
assert(static_cast<unsigned int>(movie->get_depth()) ==
@@ -406,7 +406,7 @@
}
MovieClip* mo = it->second.get();
- if ( mo == getRootMovie() )
+ if (mo == _rootMovie)
{
IF_VERBOSE_ASCODING_ERRORS(
log_aserror(_("Original root movie can't be removed"));
@@ -433,11 +433,11 @@
return false;
}
- boost::intrusive_ptr<movie_instance> extern_movie;
- extern_movie = md->create_movie_instance();
+ boost::intrusive_ptr<Movie> extern_movie;
+ extern_movie = md->createMovie();
if (extern_movie == NULL)
{
- log_error(_("can't create extern movie_instance for %s"),
+ log_error(_("can't create extern Movie for %s"),
url.str());
return false;
}
@@ -455,14 +455,14 @@
return true;
}
-boost::intrusive_ptr<movie_instance>
+boost::intrusive_ptr<Movie>
movie_root::getLevel(unsigned int num) const
{
Levels::const_iterator i =
_movies.find(num+DisplayObject::staticDepthOffset);
if ( i == _movies.end() ) return 0;
- assert(boost::dynamic_pointer_cast<movie_instance>(i->second));
- return boost::static_pointer_cast<movie_instance>(i->second);
+ assert(boost::dynamic_pointer_cast<Movie>(i->second));
+ return boost::static_pointer_cast<Movie>(i->second);
}
void
@@ -1092,7 +1092,7 @@
clearInvalidated();
// TODO: should we consider the union of all levels bounds ?
- const rect& frame_size = getRootMovie()->get_frame_size();
+ const rect& frame_size = _rootMovie->get_frame_size();
if ( frame_size.is_null() )
{
// TODO: check what we should do if other levels
@@ -1115,7 +1115,7 @@
movie->clear_invalidated();
- if (movie->isVisible() == false) continue;
+ if (movie->visible() == false) continue;
// null frame size ? don't display !
const rect& sub_frame_size = movie->get_frame_size();
@@ -1136,7 +1136,7 @@
ch->clear_invalidated();
- if (ch->isVisible() == false) continue;
+ if (ch->visible() == false) continue;
ch->display();
@@ -1311,7 +1311,7 @@
// _level0 also seems unable to receive focus under any circumstances
// TODO: what about _level1 etc ?
if (to == _currentFocus ||
- to == static_cast<DisplayObject*>(getRootMovie())) {
+ to == static_cast<DisplayObject*>(_rootMovie.get())) {
return false;
}
@@ -1426,7 +1426,7 @@
}
// If scaling is allowed, always return the original movie size.
- return static_cast<unsigned
int>(get_movie_definition()->get_width_pixels());
+ return static_cast<unsigned int>(_rootMovie->widthPixels());
}
/// Get actionscript height of stage, in pixels. The height
@@ -1440,7 +1440,7 @@
}
// If scaling is allowed, always return the original movie size.
- return static_cast<unsigned
int>(get_movie_definition()->get_height_pixels());
+ return static_cast<unsigned int>(_rootMovie->heightPixels());
}
/// Takes a short int bitfield: the four bits correspond
@@ -1496,11 +1496,11 @@
// If we go from or to noScale, we notify a resize
// if and only if display viewport is != then actual
// movie size
- movie_definition* md = _rootMovie->get_movie_definition();
+ const movie_definition* md = _rootMovie->definition();
- log_debug("Going to or from scaleMode=noScale. Viewport:%dx%d
Def:%dx%d",
- m_viewport_width, m_viewport_height,
- md->get_width_pixels(), md->get_height_pixels());
+ log_debug("Going to or from scaleMode=noScale. Viewport:%dx%d "
+ "Def:%dx%d", m_viewport_width, m_viewport_height,
+ md->get_width_pixels(), md->get_height_pixels());
if ( m_viewport_width != md->get_width_pixels()
|| m_viewport_height != md->get_height_pixels() )
@@ -2068,11 +2068,13 @@
void
movie_root::set_background_color(const rgba& color)
{
-
- if ( m_background_color_set ) return;
+ if (m_background_color_set) return;
m_background_color_set = true;
+
+ rgba newcolor = color;
+ newcolor.m_a = m_background_color.m_a;
- if ( m_background_color != color ) {
+ if (m_background_color != color) {
setInvalidated();
m_background_color = color;
}
@@ -2081,7 +2083,6 @@
void
movie_root::set_background_alpha(float alpha)
{
- //GNASH_REPORT_FUNCTION;
boost::uint8_t newAlpha = clamp<int>(frnd(alpha * 255.0f), 0, 255);
@@ -2364,7 +2365,7 @@
//
/// Stage
//
- movie_definition* def = get_movie_definition();
+ const movie_definition* def = _rootMovie->definition();
assert(def);
it = tr.insert(it, StringPair("Stage Properties", ""));
=== modified file 'libcore/movie_root.h'
--- a/libcore/movie_root.h 2009-04-04 20:08:19 +0000
+++ b/libcore/movie_root.h 2009-04-14 17:49:58 +0000
@@ -77,7 +77,7 @@
#include "smart_ptr.h" // for memory management
#include "URL.h" // for loadMovie
#include "GnashKey.h" // key::code
-#include "movie_instance.h"
+#include "Movie.h"
#include "RunInfo.h" // for initialization
#include "gnash.h" // Quality
@@ -123,13 +123,22 @@
}
};
-/// The movie stage (absolute top level node in the DisplayObjects hierarchy)
-//
-/// This is a wrapper around the set of loaded levels being played.
-///
-/// There is a *single* instance of this class for each run;
-/// loading external movies will *not* create a new instance of it.
-///
+/// This class represents the 'Stage' and top-level movie.
+//
+/// It is a wrapper around the set of loaded levels being played. Each
+/// 'run' of a SWF movie, including all further movies loaded during the
+/// run, has exactly one movie_root, which is kept for the entire run.
+/// Loading a new top-level movie does not create a new movie_root.
+//
+/// The 'Stage' part of movie_root is accessible through the ActionScript
+/// Stage object, implemented in Stage_as.
+//
+/// The movie_root class is responsible for accepting and passing on
+/// user events (mouse or key events), for maintaining the heart-beat
+/// mechanism, and for advancing all MovieClips on request from the
+/// hosting application.
+//
+/// The _root object is provided by getAsRoot().
class DSOEXPORT movie_root : boost::noncopyable
{
@@ -157,7 +166,7 @@
///
/// Make sure to call this method before using the movie_root,
/// as most operations are delegated to the associated/wrapped
- /// movie_instance.
+ /// Movie.
///
/// Note that the display viewport will be updated to match
/// the size of given movie.
@@ -165,18 +174,18 @@
/// A call to this method is equivalent to a call to setLevel(0, movie).
///
/// @param movie
- /// The movie_instance to wrap.
+ /// The Movie to wrap.
/// Will be stored in an intrusive_ptr.
/// Must have a depth of 0.
///
- void setRootMovie(movie_instance* movie);
+ void setRootMovie(Movie* movie);
/// Return the movie at the given level (0 if unloaded level).
//
/// POST CONDITIONS:
/// - The returned DisplayObject has a depth equal to 'num'
///
- boost::intrusive_ptr<movie_instance> getLevel(unsigned int num) const;
+ boost::intrusive_ptr<Movie> getLevel(unsigned int num) const;
/// Load movie at the specified URL in the given level
//
@@ -199,14 +208,14 @@
/// Character's depths are updated.
///
/// @param sp
- /// The level to change depth/level of. A pointer to it is expected
- /// to be found in the _level# container, or an error will be
printed
- /// and the call would result in a no-op.
+ /// The level to change depth/level of. A pointer to it is expected
+ /// to be found in the _level# container, or an error will be printed
+ /// and the call would result in a no-op.
///
/// @param depth
- /// New depth to assign to the DisplayObject. If another level
exists at
- /// the target depth the latter is moved in place of the former,
with
- /// its depth also updated.
+ /// New depth to assign to the DisplayObject. If another level
+ /// exists at the target depth the latter is moved in place of
+ /// the former, with its depth also updated.
///
void swapLevels(boost::intrusive_ptr<MovieClip> sp, int depth);
@@ -294,9 +303,16 @@
void set_drag_state(const drag_state& st);
/// @return the originating root movie (not necessarely _level0)
- movie_instance* getRootMovie() const
+ const Movie& getRootMovie() const
{
- return _rootMovie.get();
+ return *_rootMovie;
+ }
+
+ /// Return the current nominal frame rate for the Stage.
+ //
+ /// This is dependent on the Movie set as root movie.
+ float frameRate() const {
+ return _rootMovie->frameRate();
}
void stop_drag()
@@ -304,15 +320,6 @@
m_drag_state.reset();
}
- /// Return definition of originating root movie
- //
- /// TODO: rename to getOriginatingDefinition ?
- ///
- movie_definition* get_movie_definition() const
- {
- return getRootMovie()->get_movie_definition();
- }
-
/// Add an interval timer
//
/// @param timer
@@ -344,18 +351,13 @@
///
size_t get_current_frame() const
{
- return getRootMovie()->get_current_frame();
+ return _rootMovie->get_current_frame();
}
void set_background_color(const rgba& color);
void set_background_alpha(float alpha);
- float get_background_alpha() const
- {
- return m_background_color.m_a / 255.0f;
- }
-
/// Return the VM used by this movie_root
VM& getVM() { return _vm; }
@@ -370,13 +372,14 @@
/// Entry point for movie advancement
//
/// This function does:
- /// - Execute all timers
- /// - Reset the next Random number
- /// - Advance all advanceable DisplayObjects in reverse-placement order
- /// - Cleanup key listeners
- /// - Process all queued actions
- /// - Remove unloaded DisplayObjects from the advanceable
DisplayObjects list.
- /// - Run the GC collector
+ /// - Execute all timers
+ /// - Reset the next Random number
+ /// - Advance all advanceable DisplayObjects in reverse-placement order
+ /// - Cleanup key listeners
+ /// - Process all queued actions
+ /// - Remove unloaded DisplayObjects from the advanceable
+ /// DisplayObjects list.
+ /// - Run the GC collector
void advanceMovie();
/// 0-based!! delegates to originating root movie
@@ -384,7 +387,7 @@
/// TODO: drop this method. currently used by gprocessor.
void goto_frame(size_t target_frame_number)
{
- getRootMovie()->goto_frame(target_frame_number);
+ _rootMovie->goto_frame(target_frame_number);
}
void display();
@@ -392,9 +395,9 @@
/// Delegate to originating root movie
//
/// TODO: drop ?
- void set_play_state(MovieClip::play_state s)
+ void set_play_state(MovieClip::PlayState s)
{
- getRootMovie()->set_play_state(s);
+ _rootMovie->setPlayState(s);
}
/// Notify still loaded DisplayObject listeners for key events
@@ -1028,7 +1031,7 @@
//
/// We keep a pointer to the base MovieClip class
/// to avoid having to replicate all of the base class
- /// interface to the movie_instance class definition
+ /// interface to the Movie class definition
Levels _movies;
typedef std::map<int, DisplayObject*> Childs;
@@ -1039,7 +1042,7 @@
/// The root movie. This is initially the same as getLevel(0) but might
/// change during the run. It will be used to setup and retrive initial
/// stage size
- boost::intrusive_ptr<movie_instance> _rootMovie;
+ boost::intrusive_ptr<Movie> _rootMovie;
/// This function should return TRUE iff any action triggered
/// by the event requires redraw, see \ref events_handling for
@@ -1083,11 +1086,11 @@
/// Put the given movie at the given level
//
/// @param movie
- /// The movie_instance to store at the given level.
+ /// The Movie to store at the given level.
/// Will be stored in an intrusive_ptr.
/// Its depth will be set to <num>+DisplayObject::staticDepthOffset and
/// its name to _level<num>
- void setLevel(unsigned int num, boost::intrusive_ptr<movie_instance>
movie);
+ void setLevel(unsigned int num, boost::intrusive_ptr<Movie> movie);
/// Return the global Key object
//
=== modified file 'libcore/parser/BitmapMovieDefinition.cpp'
--- a/libcore/parser/BitmapMovieDefinition.cpp 2009-04-07 12:34:43 +0000
+++ b/libcore/parser/BitmapMovieDefinition.cpp 2009-04-15 12:27:37 +0000
@@ -18,67 +18,27 @@
//
#include "smart_ptr.h" // GNASH_USE_GC
-#include "BitmapMovieInstance.h"
+#include "BitmapMovie.h"
#include "BitmapMovieDefinition.h"
#include "fill_style.h"
#include "Geometry.h" // for class path and class edge
#include "render.h" // for ::display
#include "GnashImage.h"
#include "log.h"
-#include "Shape.h"
+#include "Bitmap.h"
namespace gnash {
-DisplayObject*
-BitmapMovieDefinition::createDisplayObject(DisplayObject* parent, int id)
+Movie*
+BitmapMovieDefinition::createMovie(DisplayObject* parent)
{
-
- // It's possible for this to fail.
- if (!_bitmap.get()) return 0;
-
- if (!_shape.get()) _shape.reset(new DynamicShape);
-
- // Set its boundaries
- _shape->setBounds(_framesize);
-
- // Add the bitmap fill style (fill style 0)
-
- SWFMatrix mat;
- mat.set_scale(1.0/20, 1.0/20); // bitmap fills get SWFMatrix reversed
- fill_style bmFill(_bitmap.get(), mat);
- const size_t fillLeft = _shape->add_fill_style(bmFill);
-
- // Define a rectangle filled with the bitmap style
-
- // We use one twip for each pixel in the image
- // The DisplayObject will be scaled * 20
- // when placed in BitmapMovieInstance's DisplayList
- boost::int32_t w = _framesize.width();
- boost::int32_t h = _framesize.height();
-
- IF_VERBOSE_PARSE(
- log_parse(_("Creating a shape_definition wrapping a %g x %g
bitmap"), w, h);
- );
-
- Path bmPath(w, h, fillLeft, 0, 0, false);
- bmPath.drawLineTo(w, 0);
- bmPath.drawLineTo(0, 0);
- bmPath.drawLineTo(0, h);
- bmPath.drawLineTo(w, h);
-
- // Add the path
-
- _shape->add_path(bmPath);
-
- return new Shape(_shape, parent, id);
+ return new BitmapMovie(this, parent);
}
-BitmapMovieDefinition::BitmapMovieDefinition(
- std::auto_ptr<GnashImage> image,
+BitmapMovieDefinition::BitmapMovieDefinition(std::auto_ptr<GnashImage> image,
const std::string& url)
:
_version(6),
- // GnashImage size is in pixels
_framesize(0, 0, image->width()*20, image->height()*20),
_framecount(1),
_framerate(12),
@@ -86,7 +46,14 @@
_bytesTotal(image->size()),
_bitmap(render::createBitmapInfo(image))
{
- // Do not create DefineShapeTag now (why?)
+}
+
+DisplayObject*
+BitmapMovieDefinition::createDisplayObject(DisplayObject* parent, int id) const
+{
+ /// What should we do if construction of the bitmap fails?
+ if (!_bitmap.get()) return 0;
+ return new Bitmap(this, parent, id);
}
#ifdef GNASH_USE_GC
=== modified file 'libcore/parser/BitmapMovieDefinition.h'
--- a/libcore/parser/BitmapMovieDefinition.h 2009-04-07 09:19:54 +0000
+++ b/libcore/parser/BitmapMovieDefinition.h 2009-04-15 12:27:37 +0000
@@ -21,7 +21,6 @@
#include "smart_ptr.h" // GNASH_USE_GC
#include "movie_definition.h" // for inheritance
#include "rect.h" // for composition
-#include "BitmapMovieInstance.h" // for create_movie_instance
#include "BitmapInfo.h" // for destructor visibility by intrusive_ptr
#include "DynamicShape.h" // for destructor visibility by intrusive_ptr
#include "GnashImage.h"
@@ -37,7 +36,7 @@
/// A "movie" definition for a bitmap file
//
-/// The create_movie_instance function will return a BitmapMovieInstance
+/// The createMovie function will return a BitmapMovie
///
class BitmapMovieDefinition : public movie_definition
{
@@ -58,7 +57,7 @@
BitmapMovieDefinition(std::auto_ptr<GnashImage> image,
const std::string& url);
- virtual DisplayObject* createDisplayObject(DisplayObject*, int);
+ virtual DisplayObject* createDisplayObject(DisplayObject*, int) const;
virtual int get_version() const {
return _version;
@@ -72,11 +71,11 @@
return std::ceil(twipsToPixels(_framesize.height()));
}
- virtual size_t get_frame_count() const {
+ virtual size_t get_frame_count() const {
return _framecount;
}
- virtual float get_frame_rate() const {
+ virtual float get_frame_rate() const {
return _framerate;
}
@@ -84,10 +83,6 @@
return _framesize;
}
- virtual const rect& get_bound() const {
- return _framesize;
- }
-
/// Return number of bytes loaded
//
/// Since no progressive load is implemented yet
@@ -105,11 +100,8 @@
return _bytesTotal;
}
- /// Create a playable movie_instance from this def.
- virtual movie_instance* create_movie_instance(DisplayObject* parent=0)
- {
- return new BitmapMovieInstance(this, parent);
- }
+ /// Create a playable Movie from this def.
+ virtual Movie* createMovie(DisplayObject* parent=0);
virtual const std::string& get_url() const {
return _url;
@@ -124,7 +116,7 @@
return 1;
}
- BitmapInfo* getBitmap() const {
+ const BitmapInfo* bitmap() const {
return _bitmap.get();
}
@@ -138,7 +130,7 @@
/// - bitmap (_bitmap)
///
void markReachableResources() const;
-#endif // GNASH_USE_GC
+#endif
private:
@@ -151,9 +143,6 @@
size_t _bytesTotal;
boost::intrusive_ptr<BitmapInfo> _bitmap;
-
- boost::shared_ptr<DynamicShape> _shape;
-
};
} // namespace gnash
=== modified file 'libcore/parser/SWFMovieDefinition.cpp'
--- a/libcore/parser/SWFMovieDefinition.cpp 2009-04-08 11:48:21 +0000
+++ b/libcore/parser/SWFMovieDefinition.cpp 2009-04-16 10:00:54 +0000
@@ -25,19 +25,16 @@
#include "smart_ptr.h" // GNASH_USE_GC
#include "SWFMovieDefinition.h"
#include "movie_definition.h" // for inheritance
-#include "MovieClip.h" // for ??
#include "zlib_adapter.h"
#include "IOChannel.h" // for use
#include "SWFStream.h"
#include "GnashImageJpeg.h"
#include "RunInfo.h"
#include "Font.h"
+#include "VM.h"
#include "log.h"
-#include "MovieClip.h"
-#include "movie_instance.h"
+#include "SWFMovie.h"
#include "swf/TagLoadersTable.h"
-#include "movie_root.h"
-#include "VM.h" // for assertions
#include "GnashException.h" // for parser exception
#include "ControlTag.h"
#include "sound_definition.h" // for sound_sample
@@ -67,6 +64,10 @@
namespace gnash
{
+namespace {
+ template<typename T> void markMappedResources(const T& t);
+}
+
MovieLoader::MovieLoader(SWFMovieDefinition& md)
:
_movie_def(md),
@@ -187,16 +188,11 @@
SWFMovieDefinition::SWFMovieDefinition(const RunInfo& runInfo)
:
// FIXME: use a class-static TagLoadersTable for SWFMovieDefinition
-#ifdef USE_SWFTREE
- _metadata(),
-#endif
_tag_loaders(SWF::TagLoadersTable::getInstance()),
m_frame_rate(30.0f),
m_frame_count(0u),
m_version(0),
_frames_loaded(0u),
- _frames_loaded_mutex(),
- _frame_reached_condition(),
_waiting_for_frame(0),
m_loading_sound_stream(-1),
m_file_length(0),
@@ -226,7 +222,8 @@
//assert(m_jpeg_in->get() == NULL);
}
-void SWFMovieDefinition::addDisplayObject(int id, SWF::DefinitionTag* c)
+void
+SWFMovieDefinition::addDisplayObject(int id, SWF::DefinitionTag* c)
{
assert(c);
boost::mutex::scoped_lock lock(_dictionaryMutex);
@@ -234,7 +231,7 @@
}
SWF::DefinitionTag*
-SWFMovieDefinition::getDefinitionTag(int id)
+SWFMovieDefinition::getDefinitionTag(int id) const
{
boost::mutex::scoped_lock lock(_dictionaryMutex);
@@ -247,13 +244,15 @@
return ch.get(); // mm... why don't we return the boost::intrusive_ptr?
}
-void SWFMovieDefinition::add_font(int font_id, Font* f)
+void
+SWFMovieDefinition::add_font(int font_id, Font* f)
{
assert(f);
m_fonts.insert(std::make_pair(font_id, boost::intrusive_ptr<Font>(f)));
}
-Font* SWFMovieDefinition::get_font(int font_id) const
+Font*
+SWFMovieDefinition::get_font(int font_id) const
{
FontMap::const_iterator it = m_fonts.find(font_id);
@@ -277,9 +276,9 @@
}
BitmapInfo*
-SWFMovieDefinition::getBitmap(int id)
+SWFMovieDefinition::getBitmap(int id) const
{
- Bitmaps::iterator it = _bitmaps.find(id);
+ Bitmaps::const_iterator it = _bitmaps.find(id);
if (it == _bitmaps.end()) return 0;
return it->second.get();
@@ -293,10 +292,11 @@
}
-sound_sample* SWFMovieDefinition::get_sound_sample(int id)
+sound_sample*
+SWFMovieDefinition::get_sound_sample(int id) const
{
- SoundSampleMap::iterator it = m_sound_samples.find(id);
- if ( it == m_sound_samples.end() ) return NULL;
+ SoundSampleMap::const_iterator it = m_sound_samples.find(id);
+ if ( it == m_sound_samples.end() ) return 0;
boost::intrusive_ptr<sound_sample> ch = it->second;
#ifndef GNASH_USE_GC
@@ -431,10 +431,6 @@
// should call this only once
assert( ! _loader.started() );
- // The VM is needed by the parser
- // to allocate swf_function objects !
- assert ( VM::isInitialized() );
-
// should call readHeader before this
assert(_str.get());
@@ -466,7 +462,7 @@
// 1-based frame number
bool
-SWFMovieDefinition::ensure_frame_loaded(size_t framenum)
+SWFMovieDefinition::ensure_frame_loaded(size_t framenum) const
{
boost::mutex::scoped_lock lock(_frames_loaded_mutex);
@@ -484,10 +480,10 @@
return ( framenum <= _frames_loaded );
}
-movie_instance*
-SWFMovieDefinition::create_movie_instance(DisplayObject* parent)
+Movie*
+SWFMovieDefinition::createMovie(DisplayObject* parent)
{
- return new movie_instance(this, parent);
+ return new SWFMovie(this, parent);
}
@@ -511,9 +507,9 @@
}
boost::intrusive_ptr<SWF::DefinitionTag>
-CharacterDictionary::getDisplayObject(int id)
+CharacterDictionary::getDisplayObject(int id) const
{
- CharacterIterator it = _map.find(id);
+ CharacterConstIterator it = _map.find(id);
if ( it == _map.end() )
{
IF_VERBOSE_PARSE(
@@ -529,7 +525,6 @@
CharacterDictionary::addDisplayObject(int id,
boost::intrusive_ptr<SWF::DefinitionTag> c)
{
- //log_debug(_("CharacterDictionary: add char %d"), id);
_map[id] = c;
}
@@ -851,7 +846,8 @@
}
bool
-SWFMovieDefinition::get_labeled_frame(const std::string& label, size_t&
frame_number)
+SWFMovieDefinition::get_labeled_frame(const std::string& label,
+ size_t& frame_number) const
{
boost::mutex::scoped_lock lock(_namedFramesMutex);
NamedFrameMap::const_iterator it = _namedFrames.find(label);
@@ -864,37 +860,17 @@
void
SWFMovieDefinition::markReachableResources() const
{
- for (FontMap::const_iterator i=m_fonts.begin(), e=m_fonts.end(); i!=e;
++i)
- {
- i->second->setReachable();
- }
-
- for (Bitmaps::const_iterator i = _bitmaps.begin(), e = _bitmaps.end();
- i != e; ++i)
- {
- i->second->setReachable();
- }
-
- for (SoundSampleMap::const_iterator i=m_sound_samples.begin(),
e=m_sound_samples.end(); i!=e; ++i)
- {
- i->second->setReachable();
- }
-
- // TODO: turn this into a markExportedResources()
+ markMappedResources(m_fonts);
+ markMappedResources(_bitmaps);
+ markMappedResources(m_sound_samples);
+
{
boost::mutex::scoped_lock lock(_exportedResourcesMutex);
- for (ExportMap::const_iterator i=_exportedResources.begin(),
- e=_exportedResources.end(); i!=e; ++i)
- {
- i->second->setReachable();
- }
+ markMappedResources(_exportedResources);
}
- for (ImportVect::const_iterator i=m_import_source_movies.begin(),
- e=m_import_source_movies.end(); i!=e; ++i)
- {
- (*i)->setReachable();
- }
+ std::for_each(m_import_source_movies.begin(), m_import_source_movies.end(),
+ boost::mem_fn(&movie_definition::setReachable));
boost::mutex::scoped_lock lock(_dictionaryMutex);
_dictionary.markReachableResources();
@@ -947,4 +923,20 @@
}
}
+namespace {
+
+template<typename T>
+void markMappedResources(const T& t)
+{
+ typedef typename
+ RemovePointer<typename T::value_type::second_type>::value_type
+ contained_type;
+
+ std::for_each(t.begin(), t.end(),
+ boost::bind(&contained_type::setReachable,
+ boost::bind(SecondElement<typename T::value_type>(), _1)));
+}
+
+}
+
} // namespace gnash
=== modified file 'libcore/parser/SWFMovieDefinition.h'
--- a/libcore/parser/SWFMovieDefinition.h 2009-04-07 12:46:29 +0000
+++ b/libcore/parser/SWFMovieDefinition.h 2009-04-15 09:08:37 +0000
@@ -27,7 +27,6 @@
#endif
#include "smart_ptr.h" // GNASH_USE_GC
-#include "fontlib.h"
#include "GnashImageJpeg.h"
#include "IOChannel.h"
#include "movie_definition.h" // for inheritance
@@ -52,7 +51,7 @@
class SWFStream;
class movie_root;
class MovieClip;
- class movie_instance;
+ class SWFMovie;
namespace SWF {
class TagLoadersTable;
}
@@ -130,7 +129,7 @@
//
/// returns a NULL if the id is unknown.
///
- boost::intrusive_ptr<SWF::DefinitionTag> getDisplayObject(int id);
+ boost::intrusive_ptr<SWF::DefinitionTag> getDisplayObject(int id) const;
/// Add a Character assigning it the given id
//
@@ -173,7 +172,7 @@
/// Immutable definition of a SWF movie's contents.
//
/// It cannot be played directly, and does not hold
-/// current state; for that you need to call create_movie_instance()
+/// current state; for that you need to call createMovie()
/// to get a movie instance
///
class SWFMovieDefinition : public movie_definition
@@ -250,43 +249,41 @@
/// \brief
/// Return a DisplayObject from the dictionary
- /// NOTE: call add_ref() on the return or put in a
boost::intrusive_ptr<>
- /// TODO: return a boost::intrusive_ptr<> directly...
- ///
- SWF::DefinitionTag* getDefinitionTag(int DisplayObject_id);
+ SWF::DefinitionTag* getDefinitionTag(int DisplayObject_id) const;
// See dox in movie_definition
//
// locks _namedFramesMutex
//
- bool get_labeled_frame(const std::string& label, size_t& frame_number);
+ bool get_labeled_frame(const std::string& label, size_t& frame_number)
+ const;
void add_font(int font_id, Font* f);
- Font* get_font(int font_id) const;
+ Font* get_font(int font_id) const;
Font* get_font(const std::string& name, bool bold, bool italic) const;
// See dox in movie_definition.h
- BitmapInfo* getBitmap(int DisplayObject_id);
+ BitmapInfo* getBitmap(int DisplayObject_id) const;
// See dox in movie_definition.h
void addBitmap(int DisplayObject_id, boost::intrusive_ptr<BitmapInfo>
im);
// See dox in movie_definition.h
- sound_sample* get_sound_sample(int DisplayObject_id);
-
- // See dox in movie_definition.h
- virtual void add_sound_sample(int DisplayObject_id, sound_sample*
sam);
-
- // See dox in movie_definition.h
- virtual void set_loading_sound_stream_id(int id) {
m_loading_sound_stream = id; }
-
- // See dox in movie_definition.h
- int get_loading_sound_stream_id() { return m_loading_sound_stream; }
-
- // See dox in movie_definition.h
- void addControlTag(ControlTag* tag)
+ sound_sample* get_sound_sample(int DisplayObject_id) const;
+
+ // See dox in movie_definition.h
+ virtual void add_sound_sample(int DisplayObject_id, sound_sample* sam);
+
+ // See dox in movie_definition.h
+ virtual void set_loading_sound_stream_id(int id) {
m_loading_sound_stream = id; }
+
+ // See dox in movie_definition.h
+ int get_loading_sound_stream_id() const { return
m_loading_sound_stream; }
+
+ // See dox in movie_definition.h
+ void addControlTag(SWF::ControlTag* tag)
{
assert(tag);
boost::mutex::scoped_lock lock(_frames_loaded_mutex);
@@ -318,7 +315,7 @@
}
// See dox in movie_definition.h
- JpegImageInput* get_jpeg_loader()
+ JpegImageInput* get_jpeg_loader() const
{
return m_jpeg_in.get();
}
@@ -362,7 +359,7 @@
/// Ensure that frame number 'framenum' (1-based offset)
/// has been loaded (load on demand).
///
- bool ensure_frame_loaded(size_t framenum);
+ bool ensure_frame_loaded(size_t framenum) const;
/// Read and parse all the SWF stream (blocking until load is finished)
//
@@ -381,27 +378,16 @@
///
/// TOCHECK:
/// The _root reference of the newly created movie_root
- /// will be set to a newly created movie_instance.
+ /// will be set to a newly created Movie.
///
- movie_instance* create_movie_instance(DisplayObject* parent=0);
+ Movie* createMovie(DisplayObject* parent=0);
- virtual DisplayObject* createDisplayObject(DisplayObject*, int) {
+ virtual DisplayObject* createDisplayObject(DisplayObject*, int) const {
return 0;
}
virtual const std::string& get_url() const { return _url; }
- const rect& get_bound() const {
- // It is required that get_bound() is implemented in DisplayObject
definition
- // classes. However, it makes no sense to call it for movie interfaces.
- // get_bound() is currently only used by DisplayObject which normally
- // is used only shape DisplayObject definitions. See DefinitionTag.h to
learn
- // why it is virtual anyway.
- abort(); // should not be called
- static rect unused;
- return unused;
- }
-
#ifdef USE_SWFTREE
// These methods attach the contents of the METADATA tag
@@ -484,14 +470,14 @@
mutable boost::mutex _frames_loaded_mutex;
/// A semaphore to signal load of a specific frame
- boost::condition _frame_reached_condition;
+ mutable boost::condition _frame_reached_condition;
/// Set this to trigger signaling of loaded frame
//
/// Make sure you _frames_loaded_mutex is locked
/// when accessing this member !
///
- size_t _waiting_for_frame;
+ mutable size_t _waiting_for_frame;
/// Number bytes loaded / parsed
unsigned long _bytes_loaded;
@@ -583,4 +569,4 @@
} // namespace gnash
-#endif // GNASH_MOVIE_DEF_IMPL_H
+#endif
=== modified file 'libcore/parser/movie_definition.h'
--- a/libcore/parser/movie_definition.h 2009-04-07 13:13:16 +0000
+++ b/libcore/parser/movie_definition.h 2009-04-15 05:33:51 +0000
@@ -23,7 +23,7 @@
/// multiple instances.
///
/// A Movie definition is defined by the gnash::movie_definition class.
-/// A Movie instance is defined by the gnash::movie_instance class.
+/// A Movie instance is defined by the gnash::Movie class.
///
/// A Movie instance exposes the ActionScript
/// Object base interface (gnash::as_object),
@@ -38,7 +38,7 @@
/// SWFMovieDefinition class, being the top-level definition of
/// a movie (the one with a CharacterDictionary in it).
///
-/// Also note that gnash::movie_instance is a subclass of gnash::MovieClip,
+/// Also note that gnash::Movie is a subclass of gnash::MovieClip,
/// being the instance of a gnash::sprite_definition.
///
///
@@ -62,9 +62,11 @@
// Forward declarations
namespace gnash {
class BitmapInfo;
- class movie_instance;
+ class Movie;
class MovieClip;
- class ControlTag;
+ namespace SWF {
+ class ControlTag;
+ }
class Font;
class ExportableResource;
class sound_sample;
@@ -96,7 +98,7 @@
class movie_definition : public SWF::DefinitionTag
{
public:
- typedef std::vector<ControlTag*> PlayList;
+ typedef std::vector<SWF::ControlTag*> PlayList;
virtual int get_version() const = 0;
virtual float get_width_pixels() const = 0;
@@ -121,18 +123,18 @@
/// Create a movie instance from a def.
//
/// Not all movie definitions allow creation of
- /// movie_instance. In particular, sprite_definition
+ /// Movie. In particular, sprite_definition
/// can only create MovieClip, so will return NULL
/// from this method.
///
/// The default implementation returns NULL.
///
/// Override this method for any definition that is
- /// able to be instanciated as a movie_instance.
+ /// able to be instanciated as a Movie.
/// SWFMovieDefinition is one such example, future examples
/// should include jpeg_movie_def and similar..
///
- virtual movie_instance* create_movie_instance(DisplayObject*
/*parent*/=0)
+ virtual Movie* createMovie(DisplayObject* /*parent*/=0)
{
return NULL;
}
@@ -195,7 +197,7 @@
/// @return NULL if no DisplayObject with the given ID is found
/// (this is the default)
///
- virtual DefinitionTag* getDefinitionTag(int /*id*/)
+ virtual DefinitionTag* getDefinitionTag(int /*id*/) const
{
return NULL;
}
@@ -215,7 +217,8 @@
///
/// @return true if a frame with that label was found, false otherwise
///
- virtual bool get_labeled_frame(const std::string& /*label*/, size_t&
/*frame_number*/)
+ virtual bool get_labeled_frame(const std::string& /*label*/,
+ size_t& /*frame_number*/) const
{
return false;
}
@@ -276,7 +279,7 @@
/// TODO: take an auto_ptr.
/// NOTE: the default implementation just let the ControlTag leak.
///
- virtual void addControlTag(ControlTag* /*c*/)
+ virtual void addControlTag(SWF::ControlTag* /*c*/)
{
}
@@ -314,7 +317,7 @@
///
/// NOTE: ownership of the returned object is NOT transferred
///
- virtual JpegImageInput* get_jpeg_loader()
+ virtual JpegImageInput* get_jpeg_loader() const
{
return NULL;
}
@@ -332,7 +335,7 @@
///
/// The default implementation returns 0.
///
- virtual BitmapInfo* getBitmap(int /*DisplayObject_id*/)
+ virtual BitmapInfo* getBitmap(int /*DisplayObject_id*/) const
{
return 0;
}
@@ -354,7 +357,7 @@
///
/// The default implementation always returns NULL
///
- virtual sound_sample* get_sound_sample(int /*DisplayObject_id*/)
+ virtual sound_sample* get_sound_sample(int /*DisplayObject_id*/) const
{
return NULL;
}
@@ -385,7 +388,7 @@
///
/// @returns -1 if no sound stream is being currently loading
///
- virtual int get_loading_sound_stream_id()
+ virtual int get_loading_sound_stream_id() const
{
return -1;
}
@@ -428,7 +431,7 @@
///
/// The default implementation is to always return true.
///
- virtual bool ensure_frame_loaded(size_t /*framenum*/) {
+ virtual bool ensure_frame_loaded(size_t /*framenum*/) const {
return true;
}
=== modified file 'libcore/parser/sprite_definition.cpp'
--- a/libcore/parser/sprite_definition.cpp 2009-04-08 11:48:21 +0000
+++ b/libcore/parser/sprite_definition.cpp 2009-04-16 10:00:54 +0000
@@ -40,7 +40,7 @@
namespace gnash {
DisplayObject*
-sprite_definition::createDisplayObject(DisplayObject* parent, int id)
+sprite_definition::createDisplayObject(DisplayObject* parent, int id) const
{
#ifdef DEBUG_REGISTER_CLASS
log_debug(_("Instantiating sprite_def %p"), (void*)this);
@@ -167,7 +167,7 @@
bool
sprite_definition::get_labeled_frame(const std::string& label,
- size_t& frame_number)
+ size_t& frame_number) const
{
NamedFrameMap::const_iterator it = _namedFrames.find(label);
if ( it == _namedFrames.end() ) return false;
@@ -189,19 +189,6 @@
read(in, runInfo);
}
-sprite_definition::sprite_definition(movie_definition& m)
- :
- // FIXME: use a class-static TagLoadersTable for sprite_definition
- _tag_loaders(SWF::TagLoadersTable::getInstance()),
- m_movie_def(m),
- m_frame_count(1),
- m_loading_frame(1),
- registeredClass(0),
- _loadingSoundStream(-1)
-{
-}
-
-
/*
* This function is not inlined to avoid having to include as_function.h
* from sprite_definition.h. We need as_function.h for visibility of
=== modified file 'libcore/parser/sprite_definition.h'
--- a/libcore/parser/sprite_definition.h 2009-04-08 11:48:21 +0000
+++ b/libcore/parser/sprite_definition.h 2009-04-16 10:00:54 +0000
@@ -66,17 +66,6 @@
sprite_definition(movie_definition& m, SWFStream& in,
const RunInfo& runInfo);
- /// \brief
- /// Create an empty sprite
- //
- /// A sprite definition consists of a series control tags.
- ///
- /// @param m
- /// the Top-Level movie_definition this sprite is read
- /// from (not a sprite_definition!)
- sprite_definition(movie_definition& m);
-
-
/// Destructor, releases playlist data
~sprite_definition();
@@ -93,7 +82,7 @@
void registerClass(as_function* the_class);
/// Get the Class registered to this definition.
- as_function* getRegisteredClass()
+ as_function* getRegisteredClass() const
{
return registeredClass.get();
}
@@ -160,7 +149,7 @@
}
/// Delegate call to associated root movie
- virtual BitmapInfo* getBitmap(int id)
+ virtual BitmapInfo* getBitmap(int id) const
{
return m_movie_def.getBitmap(id);
}
@@ -174,7 +163,7 @@
}
/// Delegate call to associated root movie
- virtual sound_sample* get_sound_sample(int id)
+ virtual sound_sample* get_sound_sample(int id) const
{
return m_movie_def.get_sound_sample(id);
}
@@ -195,7 +184,7 @@
}
// See dox in movie_definition.h
- virtual int get_loading_sound_stream_id()
+ virtual int get_loading_sound_stream_id() const
{
return _loadingSoundStream;
}
@@ -227,7 +216,7 @@
/// Get a SWF::DefinitionTag from this Sprite's root movie
/// CharacterDictionary.
///
- virtual SWF::DefinitionTag* getDefinitionTag(int id)
+ virtual SWF::DefinitionTag* getDefinitionTag(int id) const
{
return m_movie_def.getDefinitionTag(id);
}
@@ -243,7 +232,8 @@
// the parent movie's display list.
//
// overloads from SWF::DefinitionTag
- virtual DisplayObject* createDisplayObject(DisplayObject* parent, int
id);
+ virtual DisplayObject* createDisplayObject(DisplayObject* parent, int
id)
+ const;
private:
@@ -275,7 +265,7 @@
// See dox in movie_definition.h
- virtual void addControlTag(ControlTag* c)
+ virtual void addControlTag(SWF::ControlTag* c)
{
m_playlist[m_loading_frame].push_back(c);
}
@@ -284,7 +274,8 @@
virtual void add_frame_name(const std::string& name);
// See dox in movie_definition
- bool get_labeled_frame(const std::string& label, size_t& frame_number);
+ bool get_labeled_frame(const std::string& label, size_t& frame_number)
+ const;
/// frame_number is 0-based
const PlayList* getPlaylist(size_t frame_number) const
@@ -307,7 +298,7 @@
/// Ensure framenum frames of this sprite
/// have been loaded.
///
- virtual bool ensure_frame_loaded(size_t framenum)
+ virtual bool ensure_frame_loaded(size_t framenum) const
{
// TODO: return false on timeout
while ( m_loading_frame < framenum )
@@ -322,17 +313,6 @@
return true;
}
- const rect& get_bound() const {
- // It is required that get_bound() is implemented in DisplayObject
definition
- // classes. However, it makes no sense to call it for sprite definitions.
- // get_bound() is currently only used by DisplayObject which normally
- // is used only shape DisplayObject definitions. See SWF::DefinitionTag.h
to learn
- // why it is virtual anyway.
- abort(); // should not be called
- static rect unused;
- return unused;
- }
-
/// \brief
/// The constructor to use for setting up the interface
/// for new instances of this sprite
=== modified file 'libcore/swf/ControlTag.h'
--- a/libcore/swf/ControlTag.h 2009-02-25 22:33:03 +0000
+++ b/libcore/swf/ControlTag.h 2009-04-15 06:41:11 +0000
@@ -15,24 +15,34 @@
// 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_EXECUTE_TAG_H
-#define GNASH_EXECUTE_TAG_H
+#ifndef GNASH_CONTROL_TAG_H
+#define GNASH_CONTROL_TAG_H
#include <cassert>
-namespace gnash {
-
// Forward declarations
-class MovieClip;
-class DisplayList;
+namespace gnash {
+ class MovieClip;
+ class DisplayList;
+}
+
+namespace gnash {
+namespace SWF {
/// Control tags are swf tags that control the operation of the movie.
//
-/// Essentially, these are the events associated with a frame.
+/// These are the events associated with a frame.
///
class ControlTag
{
public:
+
+ /// Type of ControlTag
+ enum Type
+ {
+ TAG_ACTION = 1 << 0,
+ TAG_DLIST = 1 << 1
+ };
virtual ~ControlTag()
{
@@ -63,10 +73,10 @@
};
+} // namespace SWF
} // namespace gnash
-
-#endif // GNASH_EXECUTE_TAG_H
+#endif
// Local Variables:
=== modified file 'libcore/swf/DefineButtonTag.cpp'
--- a/libcore/swf/DefineButtonTag.cpp 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/DefineButtonTag.cpp 2009-04-16 10:00:54 +0000
@@ -415,9 +415,9 @@
DisplayObject*
-DefineButtonTag::createDisplayObject(DisplayObject* parent, int id)
+DefineButtonTag::createDisplayObject(DisplayObject* parent, int id) const
{
- DisplayObject* ch = new Button(*this, parent, id);
+ DisplayObject* ch = new Button(this, parent, id);
return ch;
}
=== modified file 'libcore/swf/DefineButtonTag.h'
--- a/libcore/swf/DefineButtonTag.h 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/DefineButtonTag.h 2009-04-16 10:00:54 +0000
@@ -23,7 +23,6 @@
#include "smart_ptr.h" // GNASH_USE_GC
#include "DefinitionTag.h"
#include "sound_definition.h"
-#include "rect.h" // for get_bound
#include "SWFMatrix.h" // for composition
#include "cxform.h" // for composition
#include "action_buffer.h" // for composition of ButtonAction
@@ -193,24 +192,14 @@
virtual ~DefineButtonTag();
/// Create a mutable instance of our definition.
- DisplayObject* createDisplayObject(DisplayObject* parent, int id);
+ DisplayObject* createDisplayObject(DisplayObject* parent, int id) const;
- const rect& get_bound() const {
- // It is required that get_bound() is implemented in
DisplayObject
- // definition classes. However, button DisplayObject definitions do
- // not have shape definitions themselves. Instead, they hold a list
- // of DefineShapeTag. get_bound() is currently only used
- // by DisplayObject which normally is used only shape DisplayObject
- // definitions. See DefinitionTag.h to learn why it is virtual anyway.
- // get_button_bound() is used for buttons.
- abort(); // should not be called
- static rect unused;
- return unused;
- }
-
/// Access the ButtonRecords directly. Used for modifying the
/// Cxform by a DefineButtonCxform tag.
ButtonRecords& buttonRecords() { return _buttonRecords; }
+
+ /// Read-only access to the ButtonRecords directly.
+ const ButtonRecords& buttonRecords() const { return _buttonRecords; }
/// Does this button have an associated DefineButtonSoundTag?
bool hasSound() const { return (_soundTag.get()); }
=== modified file 'libcore/swf/DefineEditTextTag.cpp'
--- a/libcore/swf/DefineEditTextTag.cpp 2009-04-03 09:48:13 +0000
+++ b/libcore/swf/DefineEditTextTag.cpp 2009-04-15 09:08:37 +0000
@@ -39,7 +39,7 @@
}
DisplayObject*
-DefineEditTextTag::createDisplayObject(DisplayObject* parent, int id)
+DefineEditTextTag::createDisplayObject(DisplayObject* parent, int id) const
{
// Resolve the font, if possible
getFont();
=== modified file 'libcore/swf/DefineEditTextTag.h'
--- a/libcore/swf/DefineEditTextTag.h 2009-04-07 12:34:43 +0000
+++ b/libcore/swf/DefineEditTextTag.h 2009-04-15 09:08:37 +0000
@@ -65,9 +65,9 @@
static void loader(SWFStream& in, TagType tag, movie_definition& m,
const RunInfo& r);
- const rect& get_bound() const { return _rect; }
+ const rect& bounds() const { return _rect; }
- DisplayObject* createDisplayObject(DisplayObject* parent, int id);
+ DisplayObject* createDisplayObject(DisplayObject* parent, int id) const;
/// Return a reference to the default text associated
/// with this EditText definition.
@@ -92,16 +92,6 @@
return _maxChars;
}
- /// Set boundaries of this textfield
- //
- /// This method is used for dynamic textfields
- /// (actionscript created)
- ///
- void set_bounds(const rect& bounds)
- {
- _rect = bounds;
- }
-
/// Get right margin in twips
boost::uint16_t rightMargin() const {
return _rightMargin;
@@ -123,24 +113,11 @@
return _textHeight;
}
- /// Set height of font in twips.
- //
- /// Used by dynamically created textfields.
- ///
- void setFontHeight(boost::uint16_t h) {
- _textHeight = h;
- }
-
/// Get color of the text
const rgba& color() const {
return _color;
}
- /// Set color of the text
- void setTextColor(const rgba& col) {
- _color = col;
- }
-
/// \brief
/// Get extra space between lines (in twips).
//
@@ -184,7 +161,7 @@
bool noSelect() const
{
- return _noSelect;
+ return _noSelect;
}
/// Return true if HTML was allowed by definition
=== modified file 'libcore/swf/DefineMorphShapeTag.cpp'
--- a/libcore/swf/DefineMorphShapeTag.cpp 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/DefineMorphShapeTag.cpp 2009-04-16 10:00:54 +0000
@@ -55,7 +55,7 @@
}
DisplayObject*
-DefineMorphShapeTag::createDisplayObject(DisplayObject* parent, int id)
+DefineMorphShapeTag::createDisplayObject(DisplayObject* parent, int id) const
{
return new MorphShape(this, parent, id);
}
=== modified file 'libcore/swf/DefineMorphShapeTag.h'
--- a/libcore/swf/DefineMorphShapeTag.h 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/DefineMorphShapeTag.h 2009-04-16 10:00:54 +0000
@@ -48,7 +48,8 @@
virtual ~DefineMorphShapeTag() {}
- virtual DisplayObject* createDisplayObject(DisplayObject* parent, int
id);
+ virtual DisplayObject* createDisplayObject(DisplayObject* parent, int
id)
+ const;
virtual void display(const MorphShape& inst) const;
@@ -60,10 +61,6 @@
return _shape2;
}
- virtual const rect& get_bound() const {
- return _bounds;
- }
-
private:
DefineMorphShapeTag(SWFStream& in, SWF::TagType tag, movie_definition& md);
=== modified file 'libcore/swf/DefineShapeTag.cpp'
--- a/libcore/swf/DefineShapeTag.cpp 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/DefineShapeTag.cpp 2009-04-16 10:00:54 +0000
@@ -64,7 +64,7 @@
}
DisplayObject*
-DefineShapeTag::createDisplayObject(DisplayObject* parent, int id)
+DefineShapeTag::createDisplayObject(DisplayObject* parent, int id) const
{
return new Shape(this, parent, id);
}
=== modified file 'libcore/swf/DefineShapeTag.h'
--- a/libcore/swf/DefineShapeTag.h 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/DefineShapeTag.h 2009-04-16 10:00:54 +0000
@@ -40,10 +40,11 @@
virtual void display(const DisplayObject& inst) const;
// Create a Shape DisplayObject.
- virtual DisplayObject* createDisplayObject(DisplayObject* parent, int
id);
+ virtual DisplayObject* createDisplayObject(DisplayObject* parent, int
id)
+ const;
/// Get cached bounds of this shape.
- const rect& get_bound() const { return _shape.getBounds(); }
+ const rect& bounds() const { return _shape.getBounds(); }
virtual bool pointTestLocal(boost::int32_t x, boost::int32_t y,
const SWFMatrix& wm) const;
=== modified file 'libcore/swf/DefineTextTag.cpp'
--- a/libcore/swf/DefineTextTag.cpp 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/DefineTextTag.cpp 2009-04-16 10:00:54 +0000
@@ -40,7 +40,7 @@
}
DisplayObject*
-DefineTextTag::createDisplayObject(DisplayObject* parent, int id)
+DefineTextTag::createDisplayObject(DisplayObject* parent, int id) const
{
return new StaticText(this, parent, id);
}
@@ -109,10 +109,10 @@
DefineTextTag::display(const StaticText& inst) const
{
- const bool useEmbeddedGlyphs = true;
+ SWFMatrix mat = inst.getWorldMatrix();
+ mat.concatenate(_matrix);
- TextRecord::displayRecords(_matrix, inst, _textRecords,
- useEmbeddedGlyphs);
+ TextRecord::displayRecords(mat, inst.get_world_cxform(), _textRecords);
}
=== modified file 'libcore/swf/DefineTextTag.h'
--- a/libcore/swf/DefineTextTag.h 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/DefineTextTag.h 2009-04-16 10:00:54 +0000
@@ -52,7 +52,7 @@
/// Draw the string.
void display(const StaticText& inst) const;
- const rect& get_bound() const {
+ const rect& bounds() const {
// TODO: There is a _matrix field in the definition(!) that's
// currently ignored. Don't know if it needs to be transformed...
return _rect;
@@ -67,7 +67,8 @@
bool extractStaticText(std::vector<const TextRecord*>& to, size_t& size)
const;
- virtual DisplayObject* createDisplayObject(DisplayObject* parent, int id);
+ virtual DisplayObject* createDisplayObject(DisplayObject* parent, int id)
+ const;
private:
@@ -88,7 +89,7 @@
void read(SWFStream& in, movie_definition& m, TagType tag);
- std::vector<TextRecord> _textRecords;
+ TextRecord::TextRecords _textRecords;
};
/// Parse a DefineText2Tag.
=== modified file 'libcore/swf/DefineVideoStreamTag.cpp'
--- a/libcore/swf/DefineVideoStreamTag.cpp 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/DefineVideoStreamTag.cpp 2009-04-16 10:00:54 +0000
@@ -133,7 +133,7 @@
}
DisplayObject*
-DefineVideoStreamTag::createDisplayObject(DisplayObject* parent, int id)
+DefineVideoStreamTag::createDisplayObject(DisplayObject* parent, int id) const
{
DisplayObject* ch = new Video(this, parent, id);
return ch;
@@ -148,17 +148,17 @@
void
DefineVideoStreamTag::getEncodedFrameSlice(boost::uint32_t from,
- boost::uint32_t to, EmbeddedFrames& ret)
+ boost::uint32_t to, EmbeddedFrames& ret) const
{
assert(from<=to);
boost::mutex::scoped_lock lock(_video_mutex);
// It's assumed that frame numbers are in order.
- EmbeddedFrames::iterator lower = std::lower_bound(
+ EmbeddedFrames::const_iterator lower = std::lower_bound(
_video_frames.begin(), _video_frames.end(), from, FrameFinder());
- EmbeddedFrames::iterator upper = std::upper_bound(
+ EmbeddedFrames::const_iterator upper = std::upper_bound(
lower, _video_frames.end(), to, FrameFinder());
// This copies a pointer to the encoded video frames; the actual
=== modified file 'libcore/swf/DefineVideoStreamTag.h'
--- a/libcore/swf/DefineVideoStreamTag.h 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/DefineVideoStreamTag.h 2009-04-16 10:00:54 +0000
@@ -83,7 +83,7 @@
~DefineVideoStreamTag();
- DisplayObject* createDisplayObject(DisplayObject* parent, int id);
+ DisplayObject* createDisplayObject(DisplayObject* parent, int id) const;
/// Read tag SWF::DEFINEVIDEOSTREAM
//
@@ -107,7 +107,7 @@
movie_definition& m);
/// Return local video bounds in twips
- const rect& get_bound() const
+ const rect& bounds() const
{
return m_bound;
}
@@ -117,7 +117,7 @@
/// May return NULL if there's no embedded video
/// (ActionScript created definition - new Video)
///
- media::VideoInfo* getVideoInfo() { return _videoInfo.get(); }
+ media::VideoInfo* getVideoInfo() const { return _videoInfo.get(); }
/// Get a slice of encoded video frames
//
@@ -136,7 +136,7 @@
/// are 0,3,6
///
void getEncodedFrameSlice(boost::uint32_t from, boost::uint32_t to,
- std::vector<media::EncodedVideoFrame*>& ret);
+ std::vector<media::EncodedVideoFrame*>& ret) const;
void addVideoFrameTag(std::auto_ptr<media::EncodedVideoFrame> frame);
@@ -191,7 +191,8 @@
/// Bounds of the video, as read from the DEFINEVIDEOSTREAM tag.
rect m_bound;
- boost::mutex _video_mutex;
+ // Mutable for locking in const member functions.
+ mutable boost::mutex _video_mutex;
EmbeddedFrames _video_frames;
=== modified file 'libcore/swf/DefinitionTag.h'
--- a/libcore/swf/DefinitionTag.h 2009-04-07 12:45:25 +0000
+++ b/libcore/swf/DefinitionTag.h 2009-04-15 09:08:37 +0000
@@ -38,27 +38,20 @@
namespace gnash {
namespace SWF {
-/// Immutable data representing the template of a movie element.
-//
-/// This is not really a public interface. It's here so it
-/// can be mixed into movie_definition and sprite_definition,
-/// without using multiple inheritance.
-///
+/// Immutable data representing the definition of a movie display element.
class DefinitionTag : public ExportableResource, boost::noncopyable
{
public:
virtual ~DefinitionTag() {};
- /// Should stick the result in a boost::intrusive_ptr immediately.
+ /// Create a DisplayObject with the given parent and id
//
- /// default is to make a DisplayObject
- ///
+ /// Calling this function creates a new DisplayObject from the
+ /// DefinitionTag and adds it as a child of the specified parent
+ /// DisplayObject.
virtual DisplayObject* createDisplayObject(DisplayObject* parent,
- int id) = 0;
-
- // Declared as virtual here because DisplayObject needs access to it
- virtual const rect& get_bound() const = 0;
+ int id) const = 0;
};
=== modified file 'libcore/swf/DoInitActionTag.h'
--- a/libcore/swf/DoInitActionTag.h 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/DoInitActionTag.h 2009-04-16 10:00:54 +0000
@@ -41,9 +41,9 @@
public:
DoInitActionTag(SWFStream& in, movie_definition& md, int cid)
- :
- _buf(md),
- _cid(cid)
+ :
+ _buf(md),
+ _cid(cid)
{
read(in);
}
=== modified file 'libcore/swf/SetBackgroundColorTag.h'
--- a/libcore/swf/SetBackgroundColorTag.h 2009-03-24 10:56:52 +0000
+++ b/libcore/swf/SetBackgroundColorTag.h 2009-04-16 10:00:54 +0000
@@ -84,10 +84,7 @@
void execute(MovieClip* m, DisplayList& /*dlist*/) const
{
- float current_alpha = m->get_background_alpha();
- rgba newcolor = m_color; // to avoid making m_color mutable
- newcolor.m_a = frnd(current_alpha * 255.0f);
- m->set_background_color(newcolor);
+ m->set_background_color(m_color);
}
void execute_state(MovieClip* m, DisplayList& dlist) const
=== modified file 'libcore/swf/TextRecord.cpp'
--- a/libcore/swf/TextRecord.cpp 2009-04-08 08:58:27 +0000
+++ b/libcore/swf/TextRecord.cpp 2009-04-09 06:29:33 +0000
@@ -144,22 +144,15 @@
// Render the given glyph records.
void
-TextRecord::displayRecords(const SWFMatrix& this_mat,
- const DisplayObject& inst, const std::vector<TextRecord>& records,
- bool embedded)
+TextRecord::displayRecords(const SWFMatrix& mat, const cxform& cx,
+ const TextRecords& records, bool embedded)
{
- SWFMatrix mat = inst.getWorldMatrix();
- mat.concatenate(this_mat);
-
- cxform cx = inst.get_world_cxform();
- const SWFMatrix base_matrix = mat;
-
// Starting positions.
float x = 0.0f;
float y = 0.0f;
- for (std::vector<TextRecord>::const_iterator i = records.begin(),
+ for (TextRecords::const_iterator i = records.begin(),
e = records.end(); i !=e; ++i)
{
@@ -189,7 +182,7 @@
boost::int16_t startX = x; // for the underline, if any
- rgba textColor = cx.transform(rec.color());
+ const rgba textColor = cx.transform(rec.color());
for (Glyphs::const_iterator j = rec.glyphs().begin(),
je = rec.glyphs().end(); j != je; ++j)
@@ -199,15 +192,11 @@
const int index = ge.index;
- mat = base_matrix;
- mat.concatenate_translation(x, y);
- mat.concatenate_scale(scale, scale);
+ SWFMatrix m = mat;
+ m.concatenate_translation(x, y);
+ m.concatenate_scale(scale, scale);
- if (index == -1)
- {
-#ifdef GNASH_DEBUG_TEXT_RENDERING
- log_error(_("invalid glyph (-1)"));
-#endif
+ if (index == -1) {
#ifdef DRAW_INVALID_GLYPHS_AS_EMPTY_BOXES
// The EM square is 1024x1024, but usually isn't filled up.
@@ -219,25 +208,21 @@
// square is not hard-coded anymore but can be
// queried from the font class
//
- static const std::vector<point> emptyCharBox =
boost::assign::list_of
- (point(32, 32))
- (point(480, 32))
- (point(480, -656))
- (point(32, -656))
- (point(32,32));
- render::drawLine(emptyCharBox, textColor, mat);
+ static const std::vector<point> emptyCharBox =
+ boost::assign::list_of (point(32, 32))
+ (point(480, 32))
+ (point(480, -656))
+ (point(32, -656))
+ (point(32,32));
+ render::drawLine(emptyCharBox, textColor, m);
#endif
}
- else
- {
+ else {
ShapeRecord* glyph = fnt->get_glyph(index, embedded);
// Draw the DisplayObject using the filled outline.
- if (glyph)
- {
- render::drawGlyph(*glyph, textColor, mat);
- }
+ if (glyph) render::drawGlyph(*glyph, textColor, m);
}
x += ge.advance;
}
@@ -252,7 +237,7 @@
// This will only be known if a glyph was actually found,
// or would be the size of the empty box (arbitrary size)
//
- boost::int16_t endX = (int)x; // -
rec.m_glyphs.back().m_glyph_advance + (480.0*scale);
+ boost::int16_t endX = static_cast<boost::int16_t>(x);
// The underline is made to be some pixels below the baseline (0)
// and scaled so it's further as font size increases.
@@ -264,7 +249,7 @@
(point(startX, posY))
(point(endX, posY));
- render::drawLine(underline, textColor, base_matrix);
+ render::drawLine(underline, textColor, mat);
}
}
}
=== modified file 'libcore/swf/TextRecord.h'
--- a/libcore/swf/TextRecord.h 2009-04-07 11:14:10 +0000
+++ b/libcore/swf/TextRecord.h 2009-04-09 06:17:15 +0000
@@ -23,10 +23,10 @@
#include <vector>
namespace gnash {
- class DisplayObject;
class movie_definition;
class SWFStream;
class SWFMatrix;
+ class cxform;
class Font;
}
@@ -43,6 +43,8 @@
{
public:
+ typedef std::vector<TextRecord> TextRecords;
+
struct GlyphEntry
{
int index;
@@ -86,10 +88,8 @@
bool read(SWFStream& in, movie_definition& m, int glyphBits,
int advanceBits, TagType tag);
- static void displayRecords(const SWFMatrix& this_mat,
- const DisplayObject& inst,
- const std::vector<SWF::TextRecord>& records,
- bool useEmbeddedGlyphs);
+ static void displayRecords(const SWFMatrix& mat, const cxform& cx,
+ const TextRecords& records, bool embedded = true);
const Glyphs& glyphs() const {
return _glyphs;
=== renamed file 'libcore/swf.cpp' => 'libcore/swf/swf.cpp'
=== renamed file 'libcore/swf.h' => 'libcore/swf/swf.h'
=== modified file 'libcore/swf/tag_loaders.cpp'
--- a/libcore/swf/tag_loaders.cpp 2009-04-08 11:48:21 +0000
+++ b/libcore/swf/tag_loaders.cpp 2009-04-16 10:00:54 +0000
@@ -27,7 +27,6 @@
#include "action.h"
#include "action_buffer.h"
#include "Font.h"
-#include "fontlib.h"
#include "log.h"
#include "Geometry.h"
#include "SWFStream.h"
=== modified file 'libcore/swf_event.h'
--- a/libcore/swf_event.h 2009-02-25 22:33:03 +0000
+++ b/libcore/swf_event.h 2009-04-08 10:58:37 +0000
@@ -72,7 +72,7 @@
/// (by PlaceObject tag in this design)
/// and may be shared between multiple swf_events
///
- action_buffer& m_action_buffer;
+ const action_buffer& m_action_buffer;
/// Can't assign to an swf_event
void operator=(const swf_event& /*s*/);
=== modified file 'libcore/vm/ASHandlers.cpp'
--- a/libcore/vm/ASHandlers.cpp 2009-04-03 09:51:28 +0000
+++ b/libcore/vm/ASHandlers.cpp 2009-04-14 16:13:21 +0000
@@ -75,13 +75,6 @@
#endif
}
-// Define this to have WaitForFrame actions really
-// wait for target frame (and never skip actions)
-// See:
-// http://sswf.sourceforge.net/SWFalexref.html#action_wait_for_frame
-//
-#undef REALLY_WAIT_ON_WAIT_FOR_FRAME
-
namespace gnash {
namespace SWF { // gnash::SWF
@@ -506,7 +499,7 @@
DisplayObject* tgtch = env.get_target();
MovieClip* tgt = tgtch ? tgtch->to_movie() : 0;
- if ( tgt ) tgt->set_play_state(MovieClip::PLAY);
+ if ( tgt ) tgt->setPlayState(MovieClip::PLAYSTATE_PLAY);
else log_debug(_("ActionPlay: as_environment target is null or not a
sprite"));
}
@@ -522,7 +515,7 @@
DisplayObject* tgtch = env.get_target();
MovieClip* tgt = tgtch ? tgtch->to_movie() : 0;
- if ( tgt ) tgt->set_play_state(MovieClip::STOP);
+ if ( tgt ) tgt->setPlayState(MovieClip::PLAYSTATE_STOP);
else log_debug(_("ActionStop: as_environment target is null or not a
sprite"));
}
@@ -662,10 +655,6 @@
}
// Actually *wait* for target frame, and never skip any action
-#ifdef REALLY_WAIT_ON_WAIT_FOR_FRAME
- target_sprite->get_movie_definition()->ensure_frame_loaded(framenum);
- assert(target_sprite->get_loaded_frames() >= framenum);
-#endif
size_t lastloaded = target_sprite->get_loaded_frames();
if ( lastloaded < framenum )
@@ -1985,11 +1974,6 @@
return;
}
-#ifdef REALLY_WAIT_ON_WAIT_FOR_FRAME
- target_sprite->get_movie_definition()->ensure_frame_loaded(framenum);
- assert(target_sprite->get_loaded_frames() >= framenum);
-#endif
-
size_t lastloaded = target_sprite->get_loaded_frames();
if ( lastloaded < framenum )
{
@@ -2555,7 +2539,8 @@
// frame is shown in stop mode.
unsigned char play_flag = code[pc + 3];
- MovieClip::play_state state = play_flag ? MovieClip::PLAY :
MovieClip::STOP;
+ const MovieClip::PlayState state =
+ play_flag ? MovieClip::PLAYSTATE_PLAY : MovieClip::PLAYSTATE_STOP;
std::string target_frame = env.pop().to_string();
std::string target_path;
@@ -2590,7 +2575,7 @@
return;
}
target_sprite->goto_frame(frame_number);
- target_sprite->set_play_state(state);
+ target_sprite->setPlayState(state);
}
else
{
=== modified file 'libcore/vm/VM.cpp'
--- a/libcore/vm/VM.cpp 2009-03-04 20:30:04 +0000
+++ b/libcore/vm/VM.cpp 2009-04-16 10:00:54 +0000
@@ -26,7 +26,7 @@
#include "smart_ptr.h" // GNASH_USE_GC
#include "builtin_function.h"
#include "movie_definition.h"
-#include "movie_instance.h"
+#include "Movie.h"
#include "movie_root.h"
#include "Global.h"
#include "rc.h" //for overriding default version string with rcfile
=== added file 'macros/python.m4'
--- a/macros/python.m4 1970-01-01 00:00:00 +0000
+++ b/macros/python.m4 2009-04-16 00:11:19 +0000
@@ -0,0 +1,139 @@
+dnl
+dnl Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+AC_DEFUN([GNASH_PATH_PYTHON],
+[
+
+ dnl Look for the header
+ AC_ARG_WITH(python_incl, AC_HELP_STRING([--with-python-incl], [directory
where libpython header is (w/out the python/ prefix)]),
with_python_incl=${withval})
+ AC_CACHE_VAL(ac_cv_path_python_incl,[
+ if test x"${with_python_incl}" != x ; then
+ if test -f ${with_python_incl}/python/python.h ; then
+ ac_cv_path_python_incl="`(cd ${with_python_incl}; pwd)`"
+ else
+ AC_MSG_ERROR([${with_python_incl} directory doesn't contain
python/python.h])
+ fi
+ fi
+ ])
+
+ # Look for the python-config script
+ pythonconfig=""
+ AC_PATH_PROG(pythonconfig, python-config, ,[${pathlist}])
+
+ dnl If the path hasn't been specified, go look for it.
+ if test x"${ac_cv_path_python_incl}" = x; then
+ if test x"${pythonconfig}" != "x"; then
+ ac_cv_path_python_incl="`${pythonconfig} --include`"
+ else
+ for i in $incllist; do
+ if test -f $i/pythonrun.h; then
+ ac_cv_path_python_incl="-I$i"
+ break
+ fi
+ done
+ fi
+
+ if test x"${ac_cv_path_python_incl}" = x ; then
+ AC_CHECK_HEADERS(pythonrun.h)
+ fi
+
+ AC_MSG_CHECKING([for libpython header])
+ if test x"${ac_cv_path_python_incl}" != x ; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+
+
+ if test x"${ac_cv_path_python_incl}" != x"/usr/include"; then
+ ac_cv_path_python_incl="${ac_cv_path_python_incl}"
+ else
+ ac_cv_path_python_incl=""
+ fi
+
+ dnl Look for the library
+ AC_ARG_WITH(python_lib, AC_HELP_STRING([--with-python-lib], [directory where
python library is]), with_python_lib=${withval})
+ AC_CACHE_VAL(ac_cv_path_python_lib,[
+ if test x"${with_python_lib}" != x ; then # {
+ if test -f ${with_python_lib}/libpython.a -o -f
${with_python_lib}/libpython.${shlibext}; then # {
+ ac_cv_path_python_lib="-L`(cd ${with_python_lib}; pwd)`"
+ else # }{
+ AC_MSG_ERROR([${with_python_lib} directory doesn't contain libpython.])
+ fi # }
+ fi # }
+ ])
+
+ dnl If the path hasn't been specified, go look for it.
+ if test x"${ac_cv_path_python_lib}" = x; then # {
+ if test x"${pythonconfig}" != "x" -a x"${darwin}" = xno; then # {
+ dnl python-config gives us way to many libraries, which create nasty
linking
+ dnl dependancy issue, so we strip them off here. The real dependencies
are
+ dnl are taken care of by other config tests.
+ ac_cv_path_python_lib=`${pythonconfig} --libs`
+ else # }{
+ AC_MSG_CHECKING([for libpython library])
+ for i in $libslist; do # {
+ if test -f $i/libpython.a -o -f $i/libpython.${shlibext}; then # {
+ if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then # {
+ ac_cv_path_python_lib="-L$i -lpython"
+ AC_MSG_RESULT(${ac_cv_path_python_lib})
+ break
+ else # }{
+ ac_cv_path_python_lib="-lpython2.5"
+ AC_MSG_RESULT(yes)
+ break
+ fi # }
+ fi # }
+ done # }
+ if test x"${ac_cv_path_python_lib}" = x; then # {
+ AC_MSG_RESULT(no)
+ fi # }
+ fi # }
+
+ fi # }
+
+ if test x"${ac_cv_path_python_incl}" != x ; then
+ PYTHON_CFLAGS="${ac_cv_path_python_incl}"
+ else
+ PYTHON_CFLAGS=""
+ fi
+
+ if test x"${ac_cv_path_python_lib}" != x ; then
+ PYTHON_LIBS="${ac_cv_path_python_lib}"
+ else
+ PYTHON_LIBS=""
+ fi
+
+ if test -n "$PYTHON_LIBS"; then
+ AC_DEFINE(HAS_PYTHON, [1], [Define this if you want to enable python
usage])
+ has_python=yes
+ else
+ has_python=no
+ fi
+
+ AC_PATH_PROG(PYTHON, python, ,[${pathlist}])
+
+ AC_SUBST(PYTHON_CFLAGS)
+ AC_SUBST(PYTHON_LIBS)
+])
+
+# Local Variables:
+# c-basic-offset: 2
+# tab-width: 2
+# indent-tabs-mode: nil
+# End:
=== added file 'packaging/README'
--- a/packaging/README 1970-01-01 00:00:00 +0000
+++ b/packaging/README 2009-04-14 19:15:30 +0000
@@ -0,0 +1,59 @@
+Packaging is relatively complex, especially when supporting multiple
+packaging systems. Each platform works the same, only the names are
+changed. Each packaging system has a single top level Makefile target
+that does the entire process, which can be time consuming. Each of the
+other targets break the entire process into stages which make it much
+easier to debug, or redo only one stage of the entire process.
+
+For these targets to work correct, your build must be able to survive
+"make distcheck".
+
+xpi - Build a binary XPI package for Mozilla/Firefox
+snapshot - Build a binary tarball package for any distribution
+deb - Build a binary Debian/Ubuntu package
+rpm - Build a binary Redhat/Mandriva package
+ipkg - Build a binary IKG package
+alp - Build a binary package for the Access Linux Platform
+
+snapshot-src: is the primary target used to build the source directory
+ with the correct name. This target uses the internal
+ Automake target "distdir" to make the distribution
+ directory. This always names the sub directory created
+ to hold the distribution files "gnash-trunk". Snapshot-src
+ then renames the sub directory to be gnash-revno, and
+ modifies the configure.ac file in the subdirectory to
+ have the correct version number. All packaging targets
+ start by calling snapshot-src.
+
+
+-configure: this target configures the package with the appropriate flags
+ in a _build subdirectory in the snapshot distribution sub
+ directory created by snapshot-src. Each package format
+ often requires a different set of configure options,
+ although some options are common, like setting --prefix=/usr.
+
+-build: this target builds the package in the _build sub
+ directory.
+
+-install: this target installs the fresh build and sets DESTDIR so
+ all the files get installed in temporary directory as we
+ don't want to stomp on any preinstalled Gnash on our
+ build machine.
+
+-bundle: this target uses the files from the temporary
+ installation directory to make the actual package in the
+ correct format. This often involves copying files from
+ the source packaging directories, and other tweaks to
+ create the package correctly.
+
+RPM
+ All RPMs are built using rpmbuild. Although rpmbuild is
+ primarily used to build packages in one pass via "-ba", it is
+ possible to run the different phases seperately, which makes
+ debugging easier.
+
+ The version in the gnash.spec is editied to be consistant.
+
+DEB
+ All DEBs are built using dpkg-buildpackage. The version in the
+ changelog is editied to be consistant.
=== modified file 'packaging/deb.am'
--- a/packaging/deb.am 2009-02-25 22:33:03 +0000
+++ b/packaging/deb.am 2009-04-14 19:15:30 +0000
@@ -16,32 +16,21 @@
#
# Build a Debian/Ubuntu .deb GNU/Linux package
-deb debian: dist $(srcdir)/packaging/debian/rules
- now=`date "+%Y%m%d"`; \
- snapshot_dir="gnash-$(RELEASE)$${now}"; \
- rm -rf gnash-${VERSION}; \
- tar jxf gnash-${VERSION}.tar.gz; \
- cp -fr $(srcdir)/packaging/debian gnash-$(RELEASE}${VERSION}/; \
- (cd gnash-$(RELEASE)${VERSION}; dpkg-buildpackage)
+
+deb: snapshot-src snapshot-deb
# Build a .deb snapshot, which means we have to munge the date
# into the proper files to build a package with the version in
# all the right places. This involves editing the debian/changelog
# file. Configure.ac is edited by the snapshot target.
-snapshot-deb: distdir snapshot
- -now=`date "+%Y%m%d"`; \
- pkgname="gnash-${RELEASE}$${now}"; \
- snapshot_dir="gnash-${RELEASE}$${now}"; \
- snapshot_tar="$${pkgname}.tar.gz"; \
- if test -d "gnash-trunk"; then \
- mv -f gnash-trunk $${snapshot_dir}; \
- fi; \
+snapshot-deb:
+ snapshot_dir=$(SNAPSHOT_DIR); \
mkdir -p $${snapshot_dir}/debian; \
cp -rfp $(srcdir)/packaging/debian/* $${snapshot_dir}/debian/; \
if test -e $${snapshot_dir}/debian/changelog; then \
mv -f $${snapshot_dir}/debian/changelog
$${snapshot_dir}/debian/changelog.orig; \
- sed -e "s:trunk:trunk$${now}:" $${snapshot_dir}/debian/changelog.orig
> $${snapshot_dir}/debian/changelog; \
+ sed -e "s:trunk:$(BRANCH_REVNO)$(BRANCH_NICK):"
$${snapshot_dir}/debian/changelog.orig > $${snapshot_dir}/debian/changelog; \
fi; \
- (cd $${snapshot_dir}; dpkg-buildpackage -rfakeroot -j6)
+ (cd $${snapshot_dir}; dpkg-buildpackage -rfakeroot)
.PHONY : deb debian snapshot-deb
=== modified file 'packaging/redhat/gnash.spec'
--- a/packaging/redhat/gnash.spec 2009-02-17 03:18:15 +0000
+++ b/packaging/redhat/gnash.spec 2009-04-15 16:13:42 +0000
@@ -14,18 +14,31 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{_target_cpu}
BuildRequires: libpng-devel libjpeg-devel libogg-devel
-BuildRequires: gtk2-devel libX11-devel libXt-devel glib2-devel
+BuildRequires: gtk2-devel glib2-devel
BuildRequires: atk-devel pango-devel
BuildRequires: agg-devel boost-devel curl-devel libXt-devel
-BuildRequires: xorg-x11-proto-devel SDL-devel
+BuildRequires: SDL-devel
+# YellowDog doesn't ship ffmpeg
%if %{distribution} != "ydl6"
BuildRequires: ffmpeg-devel
%endif
+# Mandriva uses different names for the X11 library packages
+%if %{distribution} != "fc10"
+BuildRequires: libx11_6-devel libxt_6-devel
+%else
+BuildRequires: libX11-devel libXt-devel xorg-x11-proto-devel
+%endif
# Installation requirements
-Requires: libpng libjpeg libogg
-Requires: gtk2 libX11 libXt glib2 atk pango
-Requires: agg boost libcurl libXt SDL
+Requires: libpng libjpeg libogg gtk2 glib2 atk pango
+# Mandriva uses differ names for the X11 library packages
+%if %{distribution} != "fc10"
+Requires: libx11_6 libxt_6
+%else
+Requires: libX11 libXt
+%endif
+Requires: agg boost libcurl SDL
+# YellowDog doesn't ship ffmpeg
%if %{distribution} != "ydl6"
Requires: ffmpeg
%endif
@@ -139,7 +152,7 @@
$SOUND $GUI \
$RENDERER \
--disable-dependency-tracking \
- --disable-testsuites \
+ --disable-testsuite \
--disable-rpath \
--with-plugindir=%{_libdir}/mozilla/plugins
@@ -167,7 +180,7 @@
%install
strip gui/.libs/*-gnash
-strip utilities/.libs/dumpshm utilities/.libs/g* utilities/.libs/soldumper
utilities/.libs/flvdumper utilities/.libs/rtmpget cygnal/.libs/cygnal
+strip utilities/.libs/dumpshm utilities/.libs/g* utilities/.libs/soldumper
utilities/.libs/flvdumper cygnal/.libs/cygnal
rm -rf $RPM_BUILD_ROOT
make install install-plugins DESTDIR=$RPM_BUILD_ROOT
rm $RPM_BUILD_ROOT%{_libdir}/gnash/*.*a
@@ -208,7 +221,6 @@
%{_bindir}/soldumper
%{_bindir}/flvdumper
%{_bindir}/dumpshm
-%{_bindir}/rtmpget
%{_bindir}/cygnal
%{_libdir}/gnash/*.so*
%{_libdir}/mozilla/plugins/*.so
=== modified file 'packaging/rpm.am'
--- a/packaging/rpm.am 2009-02-25 22:33:03 +0000
+++ b/packaging/rpm.am 2009-04-14 19:15:30 +0000
@@ -22,37 +22,48 @@
# rpmbuild -rcfile=$(srcdir)/packaging/redhat/rpmrc:/usr/lib/rpm/rpmrc \
# -ba --target=geode-olpc /usr/src/redhat/SPECS/gnash.spec
-RPMBUILD_FLAGS = --clean --rmsource --rmspec
+RPMBUILD_FLAGS = # --clean --rmsource --rmspec
-spec: $(srcdir)/packaging/redhat/gnash.spec
$(srcdir)/packaging/redhat/klash.spec
+gnash.spec spec: $(srcdir)/packaging/redhat/gnash.spec
@echo "Editing the version in the spec file ..."
- address@hidden "+%Y%m%d"`; \
- pkgname="gnash-trunk_$${now}"; \
- snapshot_tar="$${pkgname}.tar.gz"; \
- sed -e "s/Version.*/Version: $(RELEASE)$${now}/"
$(srcdir)/packaging/redhat/gnash.spec > gnash.spec; \
- sed -e "s/Version.*/Version: $(RELEASE)$${now}/"
$(srcdir)/packaging/redhat/klash.spec > klash.spec;
+ sed -e "s/Version.*/Version: $(BRANCH_REVNO)_$(BRANCH_NICK)/"
$(srcdir)/packaging/redhat/gnash.spec > gnash.spec;
# Build an Redhat/Fedora .rpm package
# We do this by using the source snapshot that we know is 'distclean'.
# After copying the source tarball to where rpmbuild expects it,
# we can then build the binary package.
# older versions of Fedora used /usr/src/redhat/{SOURCES, BUILD} for
-# everything, but the newer version appears to use one's hone directory
+# everything, but the newer version appears to use one's home directory
# instead, so now you don't have to be root to build rpm packages.
-rpm redhat rpm-gnash: snapshot spec
- address@hidden "+%Y%m%d"`; \
- pkgname="gnash-trunk_$${now}"; \
- snapshot_tar="$${pkgname}.tar.gz"; \
- cp $${snapshot_tar} $${HOME}/rpmbuild/SOURCES/
+
+# Do the entire process to build an RPM package
+rpm: spec snapshot-src rpm-setup rpm-gnash
+
+# build everything in one pass using rpmbuild
+rpm-gnash:
rpmbuild -ba $(RPMBUILD_FLAGS) gnash.spec
+# configure the build directory, which we do by executing only the %prep stage,
+# which doesn't actually run configure
+rpm-configure:
+ rpmbuild -bp $(RPMBUILD_FLAGS) gnash.spec
+
+# compile the build, which we do by executing only the %build stage, which
+# runs configure as the first step.
+rpm-build:
+ rpmbuild -bc --short-circuit $(RPMBUILD_FLAGS) gnash.spec
+
+# install the build, which we do by executing only the %install stage, which
+# also builds the actual rpms
+rpm-install:
+ rpmbuild -bi --short-circuit $(RPMBUILD_FLAGS) gnash.spec
+
+rpm-setup:
+ cp $(SNAPSHOT_TAR) $${HOME}/rpmbuild/SOURCES/
+
# build klash and the konqueror plugin as a sepaate step.
-rpm-klash: snapshot spec
- address@hidden "+%Y%m%d"`; \
- pkgname="gnash-trunk_$${now}"; \
- snapshot_tar="$${pkgname}.tar.gz"; \
- cp $${snapshot_tar} $${HOME}/rpmbuild/SOURCES/
- rpmbuild -ba $(RPMBUILD_FLAGS) klash.spec
+rpm-klash:
+ rpmbuild -ba $(RPMBUILD_FLAGS) glash.spec
.PHONY : rpm redhat rpm-klash
=== modified file 'packaging/snapshot.am'
--- a/packaging/snapshot.am 2009-02-25 22:33:03 +0000
+++ b/packaging/snapshot.am 2009-04-16 03:02:46 +0000
@@ -16,59 +16,66 @@
#
NOW = `date "+%Y%m%d"`
+
# for snapshots, this should always be something like trunk or head
# for an official release, it should be unset
-RELEASE = trunk_
+
+#bzr version-info --custom --template='#define BRANCH_REVNO {revno}\n#define
BRANCH_NICK {branch_nick}\n'
# these is the directories where the snapshot gets built. Sources are
# in the top level, the build goes in a _build subdirectory
-SNAPSHOT_DIR = gnash-${RELEASE}${NOW}
-SNAPSHOT_BUILD = gnash-${RELEASE}${NOW}/_build
-SNAPSHOT_TMP = /tmp/gnash-${RELEASE}$(NOW)
+SNAPSHOT_DIR = gnash-${BRANCH_REVNO}_$(BRANCH_NICK)
+SNAPSHOT_BUILD = gnash-${BRANCH_REVNO}_$(BRANCH_NICK)/_build
+SNAPSHOT_NAME = $(SNAPSHOT_DIR)
+# this is the name of the actual tarball
+SNAPSHOT_TAR = gnash-$(BRANCH_REVNO)_$(BRANCH_NICK).tar.gz
+# this is the temporary directory used for DESTDIR
+SNAPSHOT_TMP = /tmp/$(SNAPSHOT_DIR)
+
+# extract info from bazar
#
# build a binary snapshot from of Gnash for systems we don't have
# packaging support for.
#
+# Do the entire process to build a binary tarball
+snapshot: snapshot-src snapshot-configure snapshot-build snapshot-install
snapshot-bundle
+
# start by creating the initial tarball using the dist-bzip2 target.
# This uses the default version for Gnash. which is 'trunk'. So we
# rename it to the dir we want to stay clear. Then we change the default
-# version from 'trunk' to a date stamped version of trunk, like
-# '20080202trunk'
-snapshot: distdir
- address@hidden "+%Y%m%d"`; \
- pkgname="gnash-${RELEASE}$${now}"; \
- snapshot_dir="gnash-${RELEASE}$${now}"; \
- snapshot_tar="$${pkgname}.tar.gz"; \
- if test -d $${snapshot_dir}; then \
- rm -fr $${snapshot_dir}; \
- fi; \
- mv -f gnash-trunk $${snapshot_dir}; \
- if test ! -f $${snapshot_dir}/configure.ac.orig; then \
- mv -f $${snapshot_dir}/configure.ac
$${snapshot_dir}/configure.ac.orig; \
- sed -e "s/AC_INIT(gnash, trunk)/AC_INIT(gnash, trunk-$${now})/" \
- $${snapshot_dir}/configure.ac.orig > $${snapshot_dir}/configure.ac;
\
- cd $${snapshot_dir} ; ./autogen.sh; cd .. ;\
- fi; \
- tar zcvf $${snapshot_tar} --exclude=$${snapshot_dir}/autom4te.cache \
- --exclude=$${snapshot_dir}/configure.ac.orig $${snapshot_dir}
-# $(RM) -fr $${snapshot_dir}
+# version from 'trunk' to a date stamped version of trunk.
+snapshot-src: distdir
+ snapshot_tar="$(SNAPSHOT_NAME).tar.gz"; \
+ if test -d $(SNAPSHOT_DIR); then \
+ rm -fr $(SNAPSHOT_DIR); \
+ fi; \
+ mv -f gnash-trunk $(SNAPSHOT_DIR); \
+ if test ! -f $(SNAPSHOT_DIR)/configure.ac.orig; then \
+ mv -f $(SNAPSHOT_DIR)/configure.ac $(SNAPSHOT_DIR)/configure.ac.orig;
\
+ sed -e "s/AC_INIT(gnash, trunk)/AC_INIT(gnash,
$(BRANCH_REVNO)-$(BRANCH_NICK))/" \
+ $(SNAPSHOT_DIR)/configure.ac.orig > $(SNAPSHOT_DIR)/configure.ac; \
+ cd $(SNAPSHOT_DIR) ; ./autogen.sh; cd .. ;\
+ fi; \
+ tar zcvf $${snapshot_tar} --exclude=$(SNAPSHOT_DIR)/autom4te.cache \
+ --exclude=$(SNAPSHOT_DIR)/configure.ac.orig $(SNAPSHOT_DIR)
+# $(RM) -fr $(SNAPSHOT_DIR)
-snapshot-configure: snapshot
+snapshot-configure:
address@hidden "+%Y%m%d"`; \
- pkgname="gnash-${RELEASE}$${now}"; \
- snapshot_dir="$${pkgname}"; \
- snapshot_build="$${snapshot_dir}/_build"; \
- if test ! -d $${snapshot_build}; then \
- $(MKINSTALLDIRS) $${snapshot_build}; \
+ pkgname="gnash-${BRANCH_REVNO}-$(BRANCH_NICK)"; \
+ snapshot_dir=$(SNAPSHOT_DIR); \
+ snapshot_build="$(SNAPSHOT_DIR)/_build"; \
+ if test ! -d $(SNAPSHOT_BUILD); then \
+ $(MKINSTALLDIRS) $(SNAPSHOT_BUILD); \
fi; \
if test -d /usr/local/mozilla-firefox/plugins; then \
plugindir=/usr/local/mozilla-firefox/plugins; \
else \
plugindir=/usr/lib/mozilla/plugins; \
fi; \
- cd $${snapshot_build}; ../configure \
+ cd $(SNAPSHOT_BUILD); ../configure \
$(SNAPSHOT_CONFIGURE_FLAGS) \
--disable-dependency-tracking\
--disable-rpath \
@@ -81,31 +88,19 @@
# --with-extensions=all
# --enable-gui=all
-snapshot-build: # snapshot-configure
- address@hidden "+%Y%m%d"`; \
- pkgname="gnash-${RELEASE}$${now}"; \
- snapshot_dir="$${pkgname}"; \
- snapshot_build="$${snapshot_dir}/_build"; \
- $(MAKE) $(AM_MAKEFLAGS) -C $${snapshot_build}; \
- $(MAKE) $(AM_MAKEFLAGS) -C $${snapshot_build}/doc/C info man html
+snapshot-build:
+ $(MAKE) $(AM_MAKEFLAGS) -C $(SNAPSHOT_BUILD)
+ $(MAKE) $(AM_MAKEFLAGS) -C $(SNAPSHOT_BUILD)/doc/C info man html
# Install a package. Afterwards we link to the prebuilt man pages incase
# DocBook and DocBook2X aren't installed on this machine.
-snapshot-install: #snapshot-build
- now=`date "+%Y%m%d"`; \
- snapshot_dir="gnash-${RELEASE}$${now}"; \
- snapshot_build="$${snapshot_dir}/_build"; \
- snapshot_dest="/tmp/gnash_${RELEASE}$${now}-tmp"; \
- $(MAKE) $(AM_MAKEFLAGS) -C $${snapshot_build} install
DESTDIR=$${snapshot_dest}
+snapshot-install:
+ $(MAKE) $(AM_MAKEFLAGS) -C $(SNAPSHOT_BUILD) install
DESTDIR=$(SNAPSHOT_TMP)
# We only want to bundle an installed gnash, so all the linker paths are
# correct
-snapshot-bundle: snapshot snapshot-build snapshot-install
- address@hidden "+%Y%m%d"`; \
- pkgname="gnash-trunk_$${now}"; \
- snapshot_dest="/tmp/$${pkgname}"; \
- snapshot_tmp="/tmp/$${pkgname}-tmp"; \
- snapshot_tar="$${snapshot_tmp}-$(host_cpu)-$(host_os).tar.gz"; \
+snapshot-bundle:
+ snapshot_tar="$(SNAPSHOT_TMP)-$(host_cpu)-$(host_os).tar.gz"; \
if test ! -d $${snapshot_tmp}; then \
$(mkinstalldirs) $${snapshot_tmp}; \
fi; \
@@ -123,11 +118,11 @@
strip $${snapshot_tmp}/bin/dumpshm; \
strip $${snapshot_tmp}/bin/flvdumper; \
strip $${snapshot_tmp}/bin/rtmpget; \
- tar zcvCf /tmp $${snapshot_tar} $${pkgname}
+ tar zcvCf /tmp $${snapshot_tar} $(SNAPSHOT_NAME)
snapshot-clean:
address@hidden -fr snapshot-* $(SNAPSHOT_BUILD) $(SNAPSHOT_TMP)
gnash*$(VERSION)*.ipk
-.PHONY : snapshot snapshot-build snapshot-install snapshot-clean
+.PHONY : snapshot snapshot-build snapshot-install snapshot-clean snapshot-src
=== modified file 'packaging/xpi.am'
--- a/packaging/xpi.am 2009-02-25 22:33:03 +0000
+++ b/packaging/xpi.am 2009-04-16 03:57:36 +0000
@@ -31,7 +31,6 @@
--disable-testsuite \
--enable-xpcom \
--enable-media=ffmpeg \
- --enable-jemalloc \
--enable-gui=gtk \
--prefix=/usr \
--mandir=/usr/share/man \
@@ -39,7 +38,28 @@
--with-npapi-plugindir=/usr/lib/mozilla/plugins
# Do the entire process to build an xpi package
-xpi: snapshot xpi-configure snapshot-build snapshot-install
+xpi: snapshot-src xpi-configure xpi-build xpi-install xpi-bundle
+
+# just use the default snapshot build process
+xpi-build: snapshot-build
+# just use the default snapshot installation process
+xpi-install: snapshot-install
+
+# configure the xpi build. snapshot needs to have been run already. If you
wish the
+# automatic dependency checking, use the 'xpi' target instead, as this is
meant only
+# to be called directly when debugging package building. We statically link the
+# executable so the executables don't have to find any of the gnash libraries
at
+# runtime. This way you can have multiple versions of Gnash installed, and
they all
+# use the appropriate libraries for each build.
+xpi-configure:
+ if test ! -d $(SNAPSHOT_BUILD); then \
+ $(MKINSTALLDIRS) $(SNAPSHOT_BUILD); \
+ fi; \
+ (cd $(SNAPSHOT_BUILD); ../configure \
+ --enable-static \
+ --disable-shared \
+ $(CONFIG_OPTS))
+ cp bzrversion.h $(SNAPSHOT_BUILD)
# build the xpi package bundle. snapshot-build and snapshot-install need to
# have been run already. If you wish the automatic dependency checking, use
@@ -52,41 +72,22 @@
# have to reconfigure to enable shared libraries to be built, and then rebuild
# the plugins and the xpcom support as dynamically loadable modules.
xpi-bundle:
- address@hidden "+%Y%m%d"`; \
- pkgname="gnash-${RELEASE}$${now}"; \
- snapshot_dir="gnash-${RELEASE}$${now}"; \
- snapshot_build="$${snapshot_dir}/_build"; \
- snapshot_dest="/tmp/gnash_${RELEASE}$${now}-tmp"; \
- snapshot_xpi="/tmp/gnash_${RELEASE}$${now}-pkg"; \
+ snapshot_dest="/tmp/$(SNAPSHOT_NAME)"; \
+ snapshot_dir="/tmp/$(SNAPSHOT_DIR)"; \
+ snapshot_xpi="/tmp/$(SNAPSHOT_NAME)-tmp"; \
mkdir -p $${snapshot_xpi}/plugins; \
for i in install.rdf; do \
cp -fr $(srcdir)/packaging/xpi/$$i $${snapshot_xpi}; \
done; \
- strip $${snapshot_dest}/$(bindir)/gtk-gnash; \
- cd $${snapshot_build}; ../configure --enable-shared $(CONFIG_OPTS); \
+ strip $${snapshot_dest}/usr/bin/gtk-gnash; \
+ cd $(SNAPSHOT_BUILD); ../configure --enable-shared $(CONFIG_OPTS); \
$(MAKE) $(AM_MAKEFLAGS) -C plugin clean install-plugin
DESTDIR=$${snapshot_dest}; \
$(MAKE) $(AM_MAKEFLAGS) -C plugin/xpcom all install-pkglib
DESTDIR=$${snapshot_dest}; \
cp -fr $${snapshot_dest}/usr/lib/mozilla/plugins/libgnashplugin.so
$${snapshot_xpi}/plugins; \
cp -fr $${snapshot_dest}/usr/lib/mozilla/plugins/extensions/*.xpt
$${snapshot_xpi}/plugins; \
cp -fr $${snapshot_dest}/usr/lib/mozilla/plugins/extensions/*.so
$${snapshot_xpi}/plugins; \
cp -fr $${snapshot_dest}/usr/bin/gtk-gnash $${snapshot_xpi}; \
- (cd $${snapshot_xpi}; $(ZIP) -r /tmp/$${snapshot_dir}.xpi *);
-
-# configure the xpi build. snapshot needs to have been run already. If you
wish the
-# automatic dependency checking, use the 'xpi' target instead, as this is
meant only
-# to be called directly when debugging package building.
-xpi-configure:
- address@hidden "+%Y%m%d"`; \
- pkgname="gnash-${RELEASE}$${now}"; \
- snapshot_dir="$${pkgname}"; \
- snapshot_build="$${snapshot_dir}/_build"; \
- if test ! -d $${snapshot_build}; then \
- $(MKINSTALLDIRS) $${snapshot_build}; \
- fi; \
- cd $${snapshot_build}; ../configure \
- --enable-static \
- --disable-shared \
- $(CONFIG_OPTS)
+ (cd $${snapshot_xpi}; $(ZIP) -r $${snapshot_dir}.xpi *);
# remove files left from package building
xpi-clean:
=== modified file 'plugin/Makefile.am'
--- a/plugin/Makefile.am 2009-02-25 22:33:03 +0000
+++ b/plugin/Makefile.am 2009-04-16 03:02:46 +0000
@@ -123,6 +123,11 @@
endif # NPAPI
endif # WIN32
+if XPCOM
+ PKGLIB = install-pkglib
+else
+ PKGLIB =
+endif
test_perms:
@if test ! -w $(DESTDIR)$(plugindir); then \
echo "WARNING: Improper permissions for $(DESTDIR)$(plugindir)!"; \
@@ -137,7 +142,7 @@
if !WIN32
if NPAPI
-install-plugin: $(plugin_LTLIBRARIES)
+install-plugin: $(plugin_LTLIBRARIES) $(PKGLIB) install-plugins
@test -d "$(DESTDIR)$(plugindir)" || $(mkinstalldirs)
"$(DESTDIR)$(plugindir)"
@echo "Installing plugin to $(DESTDIR)$(plugindir)"
@if test -d .libs; then \
@@ -154,7 +159,7 @@
: # do nothing
endif # WIN32
-install-plugins: install-plugin
+install-plugins: install-plugin $(PKGLIB)
$(MAKE) -C klash install-plugins
$(MAKE) -C klash4 install-plugins
$(MAKE) -C win32 install-plugins
=== modified file 'plugin/win32/plugin.cpp'
--- a/plugin/win32/plugin.cpp 2009-02-25 22:33:03 +0000
+++ b/plugin/win32/plugin.cpp 2009-04-15 05:33:51 +0000
@@ -480,12 +480,12 @@
md->completeLoad();
DBG("Movie loaded.\n");
- std::auto_ptr<gnash::movie_instance> mr(md->create_movie_instance());
+ std::auto_ptr<gnash::Movie> mr(md->createMovie());
mr->setVariables(_flashVars);
root.setRootMovie(mr.release());
root.set_display_viewport(0, 0, _width, _height);
root.set_background_alpha(1.0f);
- gnash::movie_instance* mi = root.getRootMovie();
+ gnash::Movie* mi = root.getRootMovie();
DBG("Movie instance created.\n");
ShowWindow(_window, SW_SHOW);
=== modified file 'plugin/xpcom/Makefile.am'
--- a/plugin/xpcom/Makefile.am 2009-02-25 22:33:03 +0000
+++ b/plugin/xpcom/Makefile.am 2009-04-16 03:02:46 +0000
@@ -61,8 +61,8 @@
EXT_DIR = "`dirname
$(FIREFOX_PLUGINS)/extensions/{2b70f2b1-fc72-4734-bb81-4eb2a7713e49}`"
-install-pkglib: $(pkglib_LTLIBRARIES)
- @test -d "$(DESTDIR)/$(EXT_DIR)" || $(mkinstalldirs)
"$(DESTDIR)/$(EXT_DIR)"
+install-plugin install-pkglib: $(pkglib_LTLIBRARIES)
+ @test -d "$(DESTDIR)$(EXT_DIR)" || $(mkinstalldirs)
"$(DESTDIR)$(EXT_DIR)"
@if test -d .libs; then \
cp -f .libs/libgnashcomponent.so*
$(DESTDIR)$(EXT_DIR)/libgnashcomponent.so; \
cp -f iGnashComponent.xpt $(DESTDIR)$(EXT_DIR)/iGnashComponent.xpt; \
=== modified file 'pythonmodule/Makefile.am'
--- a/pythonmodule/Makefile.am 2009-02-27 06:46:40 +0000
+++ b/pythonmodule/Makefile.am 2009-04-16 00:11:19 +0000
@@ -17,14 +17,14 @@
AUTOMAKE_OPTIONS =
-if ENABLE_GNASH_PYTHON_MODULE
+if USE_PYTHON
pkglib_LTLIBRARIES = libgnashpython.la gnash.la
EXTRA_DIST = gnashPythonExample.py
-BOOSTPYTHON_LIBS = -lboost_python
-BOOSTPYTHON_CFLAGS = -I/usr/include/python2.5
+BOOSTPYTHON_LIBS = -lboost_python $(PYTHON_LIBS)
+BOOSTPYTHON_CFLAGS = $(PYTHON_CFLAGS)
libgnashpython_la_SOURCES = \
gnashpython.cpp \
@@ -40,7 +40,7 @@
$(BOOST_LIBS) \
$(PTHREAD_LIBS) \
$(NULL)
-
+
libgnashpython_la_CPPFLAGS = \
-I$(top_srcdir)/libcore \
-I$(top_srcdir)/libcore/parser \
=== modified file 'pythonmodule/gnashpython.cpp'
--- a/pythonmodule/gnashpython.cpp 2009-04-06 10:16:59 +0000
+++ b/pythonmodule/gnashpython.cpp 2009-04-15 05:33:51 +0000
@@ -21,7 +21,7 @@
#include "URL.h"
#include "noseek_fd_adapter.h"
#include "movie_definition.h"
-#include "movie_instance.h"
+#include "Movie.h"
#include "movie_root.h"
#include "MovieClip.h"
#include "gnash.h"
@@ -186,7 +186,7 @@
_movieDef->completeLoad();
_movieDef->ensure_frame_loaded(_movieDef->get_frame_count());
- std::auto_ptr<movie_instance> mi ( _movieDef->create_movie_instance() );
+ std::auto_ptr<Movie> mi ( _movieDef->createMovie() );
// Finally, place the root movie on the stage ...
_movieRoot->setRootMovie( mi.release() );
=== modified file 'pythonmodule/gnashpython.h'
--- a/pythonmodule/gnashpython.h 2009-04-06 10:16:59 +0000
+++ b/pythonmodule/gnashpython.h 2009-04-15 05:33:51 +0000
@@ -183,7 +183,7 @@
boost::uint32_t width() { return _character->get_width(); }
- bool visible() { return _character->isVisible(); }
+ bool visible() { return _character->visible(); }
void advance() { _character->advance(); }
=== modified file 'testsuite/DummyCharacter.h'
--- a/testsuite/DummyCharacter.h 2009-04-04 15:35:18 +0000
+++ b/testsuite/DummyCharacter.h 2009-04-15 05:33:51 +0000
@@ -20,7 +20,7 @@
#include "InteractiveObject.h" // for inheritance
#include "rect.h" // for composition
-#include "movie_instance.h" // for create_movie_instance
+#include "Movie.h" // for createMovie
#include "snappingrange.h" // for InvalidatedRanges typedef (don't like it)
#include <string>
=== modified file 'testsuite/DummyMovieDefinition.h'
--- a/testsuite/DummyMovieDefinition.h 2009-04-03 09:29:19 +0000
+++ b/testsuite/DummyMovieDefinition.h 2009-04-15 05:33:51 +0000
@@ -18,9 +18,9 @@
#ifndef GNASH_DUMMYMOVIEDEFINITION_H
#define GNASH_DUMMYMOVIEDEFINITION_H
-#include "movie_definition.h" // for inheritance
+#include "SWFMovieDefinition.h" // for inheritance
#include "rect.h" // for composition
-#include "movie_instance.h" // for create_movie_instance
+#include "SWFMovie.h" // for createMovie
#include <string>
#include <memory> // for auto_ptr
@@ -35,11 +35,11 @@
/// methods of movie_definition by returning user-defined
/// values for version/size/frame rate etc..
///
-/// The create_movie_instance function will return the same
+/// The createMovie function will return the same
/// object created by createEmptyMovieClip() calls
/// (an empty movieclip... still to be designed)
///
-class DummyMovieDefinition : public movie_definition
+class DummyMovieDefinition : public SWFMovieDefinition
{
int _version;
rect _framesize;
@@ -50,7 +50,7 @@
public:
- virtual DisplayObject* createDisplayObject(DisplayObject*, int /* id
*/) { return 0; }
+ virtual DisplayObject* createDisplayObject(DisplayObject*, int /* id */) {
return 0; }
/// Default constructor
@@ -64,8 +64,9 @@
/// - 0 bytes (for get_bytes_loaded()/get_bytes_total())
/// - empty url
///
- DummyMovieDefinition()
+ DummyMovieDefinition(const RunInfo& ri)
:
+ SWFMovieDefinition(ri),
_version(6),
_framesize(0, 0, 640*20, 480*20),
_framecount(1),
@@ -81,8 +82,9 @@
/// All but the target version will be initialized
/// exactly as with the default constructor.
///
- DummyMovieDefinition(int version)
+ DummyMovieDefinition(const RunInfo& ri, int version)
:
+ SWFMovieDefinition(ri),
_version(version),
_framesize(0, 0, 640*20, 480*20),
_framecount(1),
@@ -92,6 +94,10 @@
{
}
+ virtual bool ensure_frame_loaded(size_t) const {
+ return true;
+ }
+
virtual int get_version() const {
return _version;
}
@@ -116,10 +122,6 @@
return _framesize;
}
- virtual const rect& get_bound() const {
- return _framesize;
- }
-
virtual size_t get_bytes_loaded() const {
return 0;
}
@@ -129,9 +131,9 @@
}
/// Create a playable movie instance from a def.
- virtual movie_instance* create_movie_instance(DisplayObject*
parent=NULL)
+ virtual Movie* createMovie(DisplayObject* parent=NULL)
{
- return new movie_instance(this, parent);
+ return new SWFMovie(this, parent);
}
virtual const PlayList& get_playlist(size_t frame_number) const
=== modified file 'testsuite/MovieTester.cpp'
--- a/testsuite/MovieTester.cpp 2009-04-04 10:37:03 +0000
+++ b/testsuite/MovieTester.cpp 2009-04-15 05:33:51 +0000
@@ -23,7 +23,7 @@
#include "URL.h"
#include "noseek_fd_adapter.h"
#include "movie_definition.h"
-#include "movie_instance.h"
+#include "Movie.h"
#include "movie_root.h"
#include "MovieClip.h"
#include "gnash.h" // for create_movie and create_library_movie and for
gnash::key namespace
@@ -143,7 +143,7 @@
dbglogfile.setVerbosity(1);
- std::auto_ptr<movie_instance> mi ( _movie_def->create_movie_instance()
);
+ std::auto_ptr<Movie> mi ( _movie_def->createMovie() );
// Set _movie before calling ::render
_movie = mi.get();
@@ -613,7 +613,7 @@
MovieTester::restart()
{
_movie_root->clear(); // restart();
- _movie = _movie_def->create_movie_instance();
+ _movie = _movie_def->createMovie();
_movie_root->setRootMovie(_movie);
// Set _movie before calling ::render
=== modified file 'testsuite/MovieTester.h'
--- a/testsuite/MovieTester.h 2009-04-03 09:18:40 +0000
+++ b/testsuite/MovieTester.h 2009-04-14 17:49:58 +0000
@@ -29,7 +29,7 @@
#include "GnashKey.h"
#include "sound_handler.h" // for creating the "test" sound handlers
#include "render_handler.h" // for dtor visibility by auto_ptr
-#include "movie_instance.h"
+#include "Movie.h"
#include "ManualClock.h" // for composition
#include "RunInfo.h" // For initialization.
@@ -317,7 +317,7 @@
gnash::movie_definition* _movie_def;
- gnash::movie_instance* _movie;
+ gnash::Movie* _movie;
boost::shared_ptr<sound::sound_handler> _sound_handler;
=== modified file 'testsuite/actionscript.all/MovieClip.as'
--- a/testsuite/actionscript.all/MovieClip.as 2009-03-03 16:26:50 +0000
+++ b/testsuite/actionscript.all/MovieClip.as 2009-04-09 11:39:48 +0000
@@ -115,15 +115,15 @@
#endif
#if OUTPUT_VERSION == 6
- check_totals(891); // SWF6
+ check_totals(894); // SWF6
#endif
#if OUTPUT_VERSION == 7
- check_totals(908); // SWF7
+ check_totals(911); // SWF7
#endif
#if OUTPUT_VERSION >= 8
- check_totals(1000); // SWF8+
+ check_totals(1003); // SWF8+
#endif
play();
@@ -131,7 +131,7 @@
#if OUTPUT_VERSION < 6
note("WARNING: it has been reported that adobe flash player version 9 fails a
few tests here.");
-note(" We belive those are actually adobe player bugs since older
versions ");
+note(" We believe those are actually adobe player bugs since older
versions ");
note(" of the player are reported to pass all tests. If you have
another idea ");
note(" we'd be glad to hear from you, just check the testcase source
code.");
note();
@@ -516,6 +516,7 @@
check_equals(mc2_mc.getBytesTotal(), 0);
check_equals(mc2.getBytesLoaded(), 0);
check_equals(mc2.getBytesTotal(), 0);
+check_equals(mc2._url, _root._url);
xcheck(!mc2.hasOwnProperty('_parent'));
@@ -929,6 +930,10 @@
check_equals(_root.copy1.getDepth(), 63);
check_equals(_root.copy1._x, 100);
+duplicateMovieClip(_root, "copy88", -1000);
+check_equals(typeof(_root.getBytesLoaded()), "number");
+check_equals(copy88.getBytesLoaded(), undefined);
+
#if OUTPUT_VERSION == 6
// SWF7 and higher removed duplicateMovieClip method of MovieClip class
_root.original.duplicateMovieClip("copy2", 64);
=== modified file 'testsuite/libcore.all/AsValueTest.cpp'
--- a/testsuite/libcore.all/AsValueTest.cpp 2009-03-17 12:32:36 +0000
+++ b/testsuite/libcore.all/AsValueTest.cpp 2009-04-15 05:33:51 +0000
@@ -105,15 +105,18 @@
// Initialize gnash lib
gnashInit();
+
+ RunInfo runInfo("");
// Create a bogus movie with swf version 7 support
- boost::intrusive_ptr<movie_definition> md ( new DummyMovieDefinition(7) );
+ boost::intrusive_ptr<movie_definition> md(
+ new DummyMovieDefinition(runInfo, 7));
+
ManualClock clock;
- RunInfo runInfo("");
movie_root stage(*md, clock, runInfo);
- movie_instance* root = md->create_movie_instance();
+ Movie* root = md->createMovie();
stage.setRootMovie(root);
// run the tests
=== modified file 'testsuite/libcore.all/ClassSizes.cpp'
--- a/testsuite/libcore.all/ClassSizes.cpp 2009-04-07 16:32:11 +0000
+++ b/testsuite/libcore.all/ClassSizes.cpp 2009-04-14 17:49:58 +0000
@@ -32,6 +32,20 @@
#include "Button.h"
#include "MorphShape.h"
#include "Shape.h"
+#include "TextField.h"
+#include "SWFStream.h"
+#include "swf/DefineFontAlignZonesTag.h"
+#include "swf/DefineShapeTag.h"
+#include "swf/DefineButtonCxformTag.h"
+#include "swf/CSMTextSettingsTag.h"
+#include "swf/DefineFontTag.h"
+#include "swf/DefineTextTag.h"
+#include "swf/PlaceObject2Tag.h"
+#include "swf/RemoveObjectTag.h"
+#include "swf/DoActionTag.h"
+#include "swf/DoInitActionTag.h"
+#include "swf/DefineEditTextTag.h"
+#include "swf/SetBackgroundColorTag.h"
#include <iostream>
#include <sstream>
@@ -43,42 +57,35 @@
#include "check.h"
+#include <boost/preprocessor/seq/for_each.hpp>
+
using namespace gnash;
using namespace std;
using namespace boost;
+using namespace gnash::SWF;
+
+#define SIZE(x, _, t) \
+ std::cout << BOOST_PP_STRINGIZE(t)": " << (sizeof(t)) << "\n";
+
+// Add types in brackets to this macro to have their size printed.
+#define TYPES \
+(int) (float) (long) (double) \
+(Property*) (auto_ptr<Property>) (scoped_ptr<Property>) \
+(shared_ptr<Property>) (intrusive_ptr<as_object>) (GcResource) \
+(rgba) (SWFMatrix) (rect) (line_style) (fill_style) (cxform) \
+(as_value) \
+(DynamicShape)(ShapeRecord)(TextRecord) \
+(Property) (PropertyList) \
+(DefinitionTag) (DefineTextTag) (DefineFontTag) (DefineMorphShapeTag) \
+(as_object) \
+(DisplayObject) (StaticText) (MorphShape) (Shape) \
+(InteractiveObject) (MovieClip) (TextField) (Button) (Movie) \
+(movie_root)
int
main(int /*argc*/, char** /*argv*/)
{
- std::cout << "sizeof(int): " << (sizeof(int)) << std::endl;
- std::cout << "sizeof(float): " << (sizeof(float)) << std::endl;
-
- std::cout << "sizeof(long): " << (sizeof(long)) << std::endl;
- std::cout << "sizeof(double): " << (sizeof(double)) << std::endl;
-
- std::cout << "sizeof(as_value): " << (sizeof(as_value)) << std::endl;
-
- std::cout << "sizeof(Property): " << (sizeof(Property)) << std::endl;
- std::cout << "sizeof(Property*): " << (sizeof(Property*)) << std::endl;
- std::cout << "sizeof(PropertyList): " << (sizeof(PropertyList)) <<
std::endl;
- std::cout << "sizeof(auto_ptr<PropertyList>): " <<
(sizeof(auto_ptr<PropertyList>)) << std::endl;
- std::cout << "sizeof(scoped_ptr<PropertyList>): " <<
(sizeof(scoped_ptr<PropertyList>)) << std::endl;
-
- std::cout << "sizeof(GcResource): " << (sizeof(GcResource)) <<
std::endl;
- std::cout << "sizeof(as_object): " << (sizeof(as_object)) << std::endl;
- std::cout << "sizeof(DisplayObject): " << (sizeof(DisplayObject)) <<
std::endl;
- std::cout << "sizeof(MovieClip): " << (sizeof(MovieClip)) << std::endl;
-
- std::cout << "sizeof(rgba): " << (sizeof(rgba)) << std::endl;
- std::cout << "sizeof(line_style): " << (sizeof(line_style)) <<
std::endl;
- std::cout << "sizeof(fill_style): " << (sizeof(fill_style)) <<
std::endl;
- std::cout << "sizeof(SWFMatrix): " << (sizeof(SWFMatrix)) << std::endl;
- std::cout << "sizeof(movie_root): " << (sizeof(movie_root)) <<
std::endl;
-
- std::cout << "sizeof(ShapeRecord): " << (sizeof(SWF::ShapeRecord)) <<
std::endl;
- std::cout << "sizeof(StaticText): " << (sizeof(StaticText)) <<
std::endl;
- std::cout << "sizeof(MorphShape): " << (sizeof(MorphShape)) <<
std::endl;
- std::cout << "sizeof(Shape): " << (sizeof(Shape)) << std::endl;
- std::cout << "sizeof(Button): " << (sizeof(Button)) << std::endl;
+ std::cout << "Gnash class sizes:\n";
+ BOOST_PP_SEQ_FOR_EACH(SIZE, _, TYPES)
}
=== modified file 'testsuite/libcore.all/DisplayListTest.cpp'
--- a/testsuite/libcore.all/DisplayListTest.cpp 2009-04-03 09:48:13 +0000
+++ b/testsuite/libcore.all/DisplayListTest.cpp 2009-04-15 05:33:51 +0000
@@ -47,16 +47,17 @@
// Initialize gnash lib
gnashInit();
+
+ RunInfo ri("");
// Initialize a VM
- boost::intrusive_ptr<movie_definition> md5 ( new
DummyMovieDefinition(5) );
- boost::intrusive_ptr<movie_definition> md6 ( new
DummyMovieDefinition(6) );
+ boost::intrusive_ptr<movie_definition> md5(new DummyMovieDefinition(ri,
5));
+ boost::intrusive_ptr<movie_definition> md6(new DummyMovieDefinition(ri,
6));
ManualClock clock;
- RunInfo ri("");
movie_root stage(*md5, clock, ri);
- movie_instance* root = md5->create_movie_instance();
+ Movie* root = md5->createMovie();
stage.setRootMovie( root );
DisplayList dlist1;
=== modified file 'testsuite/libcore.all/PropertyListTest.cpp'
--- a/testsuite/libcore.all/PropertyListTest.cpp 2009-02-25 22:33:03
+0000
+++ b/testsuite/libcore.all/PropertyListTest.cpp 2009-04-15 05:33:51
+0000
@@ -53,18 +53,21 @@
// Initialize gnash lib
gnashInit();
- boost::intrusive_ptr<movie_definition> md5 ( new
DummyMovieDefinition(5) );
- boost::intrusive_ptr<movie_definition> md7 ( new
DummyMovieDefinition(7) );
+ // We don't care about the base URL.
+ RunInfo runInfo("");
+
+ boost::intrusive_ptr<movie_definition> md5(
+ new DummyMovieDefinition(runInfo, 5));
+ boost::intrusive_ptr<movie_definition> md7(
+ new DummyMovieDefinition(runInfo, 7));
// TODO: test both SWF5 and SWF7 as they are different !!
ManualClock clock;
- // We don't care about the base URL.
- RunInfo runInfo("");
movie_root root(*md5, clock, runInfo);
- root.setRootMovie( md5->create_movie_instance() );
+ root.setRootMovie( md5->createMovie() );
VM& vm = root.getVM();
=== modified file 'testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp'
--- a/testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp 2009-04-03
09:29:19 +0000
+++ b/testsuite/misc-ming.all/ButtonEventsTest-Runner.cpp 2009-04-09
11:41:59 +0000
@@ -306,7 +306,7 @@
}
// last advance should not restart the loop (it's in STOP mode)
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
check_equals(root->get_current_frame(), 6);
}
=== modified file 'testsuite/misc-ming.all/DefineEditTextTest-Runner.cpp'
--- a/testsuite/misc-ming.all/DefineEditTextTest-Runner.cpp 2009-04-03
09:29:19 +0000
+++ b/testsuite/misc-ming.all/DefineEditTextTest-Runner.cpp 2009-04-09
11:41:59 +0000
@@ -46,7 +46,7 @@
assert(root);
check_equals(root->get_frame_count(), 5);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
for (int i=0; i<30; ++i)
=== modified file
'testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp'
--- a/testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp
2009-04-03 09:29:19 +0000
+++ b/testsuite/misc-ming.all/DefineEditTextVariableNameTest-Runner.cpp
2009-04-09 11:41:59 +0000
@@ -43,7 +43,7 @@
assert(root);
check_equals(root->get_frame_count(), 14);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
const DisplayObject* mc1 = tester.findDisplayItemByName(*root, "mc1");
@@ -59,12 +59,12 @@
for (unsigned f=root->get_current_frame(); f<root->get_frame_count()-1;
++f)
{
check_equals(root->get_current_frame(), f);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
tester.advance();
}
// does stop() on last frame
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
check_equals(root->get_current_frame(), root->get_frame_count()-1);
}
=== modified file 'testsuite/misc-ming.all/DefineTextTest-Runner.cpp'
--- a/testsuite/misc-ming.all/DefineTextTest-Runner.cpp 2009-04-03 09:29:19
+0000
+++ b/testsuite/misc-ming.all/DefineTextTest-Runner.cpp 2009-04-09 11:41:59
+0000
@@ -48,7 +48,7 @@
assert(root);
check_equals(root->get_frame_count(), 3);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
rgba white(255,255,255,255);
=== modified file 'testsuite/misc-ming.all/RollOverOutTest-Runner.cpp'
--- a/testsuite/misc-ming.all/RollOverOutTest-Runner.cpp 2009-04-03
09:29:19 +0000
+++ b/testsuite/misc-ming.all/RollOverOutTest-Runner.cpp 2009-04-15
05:33:51 +0000
@@ -46,7 +46,7 @@
assert(root);
check_equals(root->get_frame_count(), 4);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
tester.advance(); // advance to the second frame.
@@ -56,9 +56,9 @@
const DisplayObject* mc2 = tester.findDisplayItemByName(*root,
"square2");
check(mc2);
- check_equals(mc1->isVisible(), true);
- check_equals(mc2->isVisible(), false);
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(mc1->visible(), true);
+ check_equals(mc2->visible(), false);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
check_equals(root->get_current_frame(), 1);
// we're in stop mode, so advance should not advance anything
@@ -73,7 +73,7 @@
tester.movePointerTo(60, 60);
tester.advance();
check_equals(root->get_current_frame(), 2);
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
tester.advance();
check_equals(root->get_current_frame(), 2);
=== modified file 'testsuite/misc-ming.all/SpriteButtonEventsTest-Runner.cpp'
--- a/testsuite/misc-ming.all/SpriteButtonEventsTest-Runner.cpp 2009-04-03
09:29:19 +0000
+++ b/testsuite/misc-ming.all/SpriteButtonEventsTest-Runner.cpp 2009-04-09
11:41:59 +0000
@@ -269,7 +269,7 @@
}
// last advance should not restart the loop (it's in STOP mode)
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
check_equals(root->get_current_frame(), 4);
}
=== modified file 'testsuite/misc-ming.all/Video-EmbedSquareTestRunner.cpp'
--- a/testsuite/misc-ming.all/Video-EmbedSquareTestRunner.cpp 2009-04-03
09:29:19 +0000
+++ b/testsuite/misc-ming.all/Video-EmbedSquareTestRunner.cpp 2009-04-09
11:41:59 +0000
@@ -89,7 +89,7 @@
// Frame X
tester.advance();
int framenum = root->get_current_frame();
- cout << "---- Pixel checking in frame " << framenum+1
<< " play state " << root->get_play_state() << endl;
+ cout << "---- Pixel checking in frame " << framenum+1
<< " play state " << root->getPlayState() << endl;
int i = (framenum-1)*10;
@@ -111,7 +111,7 @@
if ( framenum == framecount-2 )
{
// check we're playing, or we'll never get to
next loop...
- check_equals(root->get_play_state(),
MovieClip::PLAY);
+ check_equals(root->getPlayState(),
MovieClip::PLAYSTATE_PLAY);
break;
}
@@ -123,11 +123,11 @@
// Check the color in (5,5) - should be yellow. Well, anything
// but white or transparent.
check_pixel(5, 5, 2, yellow, 5);
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
tester.click();
// Sanity check
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
tester.advance();
=== modified file 'testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp'
--- a/testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp 2009-04-03
09:29:19 +0000
+++ b/testsuite/misc-ming.all/attachMovieLoopingTestRunner.cpp 2009-04-09
11:41:59 +0000
@@ -46,7 +46,7 @@
assert(root);
check_equals(root->get_frame_count(), 2);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
check(! tester.findDisplayItemByDepth(*root, 70) );
=== modified file 'testsuite/misc-ming.all/attachMovieTestRunner.cpp'
--- a/testsuite/misc-ming.all/attachMovieTestRunner.cpp 2009-04-03 09:29:19
+0000
+++ b/testsuite/misc-ming.all/attachMovieTestRunner.cpp 2009-04-09 11:41:59
+0000
@@ -49,7 +49,7 @@
as_value tmp;
check_equals(root->get_frame_count(), 5);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
check(! tester.findDisplayItemByDepth(*root, 70) );
=== modified file 'testsuite/misc-ming.all/intervalTestRunner.cpp'
--- a/testsuite/misc-ming.all/intervalTestRunner.cpp 2009-04-03 09:29:19
+0000
+++ b/testsuite/misc-ming.all/intervalTestRunner.cpp 2009-04-09 11:41:59
+0000
@@ -51,13 +51,13 @@
check_equals(root->get_frame_count(), 2);
check_equals(root->get_current_frame(), 0);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
tester.advanceClock(50); // "sleep" 50 milliseconds
tester.advance(); // execute actions in second frame frame
check_equals(root->get_current_frame(), 1);
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
// Now timers are set and counters initialized
=== modified file 'testsuite/misc-ming.all/loadMovieTest.c'
--- a/testsuite/misc-ming.all/loadMovieTest.c 2009-02-25 22:33:03 +0000
+++ b/testsuite/misc-ming.all/loadMovieTest.c 2009-04-15 11:24:05 +0000
@@ -134,6 +134,9 @@
//" _root.note(this+'.onUnload called');"
//"};"
"_level0.coverart.onMouseDown = function() {"
+ "t = this.createEmptyMovieClip('tc', 8);"
+ "_root.check(tc instanceof MovieClip);"
+ "_root.check(t instanceof MovieClip);"
//" _root.note('_url is '+this._url);"
" var lastUrlComponent =
this._url.substring(this._url.lastIndexOf('/')+1);"
//" _root.note('last component of _url is '+lastUrlComponent);"
@@ -145,7 +148,7 @@
" if ( Key.isDown(Key.SHIFT) ) { "
" trace('SHIFT-click on coverart...');"
//" _root.note('SHIFT-click on coverart...');"
- " _root.totals(18, '"__FILE__"');"
+ " _root.totals(26, '"__FILE__"');"
" _root.END_OF_TEST = true;"
" }"
" else _root.note('2 tests run');"
=== modified file 'testsuite/misc-ming.all/loadMovieTestRunner.cpp'
--- a/testsuite/misc-ming.all/loadMovieTestRunner.cpp 2009-04-03 09:29:19
+0000
+++ b/testsuite/misc-ming.all/loadMovieTestRunner.cpp 2009-04-14 13:14:27
+0000
@@ -106,8 +106,8 @@
DisplayObject* coverartch =
const_cast<DisplayObject*>(tester->findDisplayItemByName(*root, "coverart"));
MovieClip* coverart = coverartch->to_movie();
check(coverart);
- url = coverart->get_movie_definition()->get_url();
- check_equals(coverart->get_movie_definition()->get_url(),
baseURL.str());
+ url = coverart->get_root()->url();
+ check_equals(coverart->get_root()->url(), baseURL.str());
// Check scribbling on the empty canvas
checkScribbling();
@@ -121,7 +121,7 @@
coverartch =
const_cast<DisplayObject*>(tester->findDisplayItemByName(*root, "coverart"));
check(coverart != coverartch->to_movie());
coverart = coverartch->to_movie();
- check_equals(coverart->get_movie_definition()->get_url(),
lynchURL.str());
+ check_equals(coverart->get_root()->url(), lynchURL.str());
tester->depressMouseButton();
// Check scribbling on the lynch
@@ -139,7 +139,7 @@
usleep(500); // give it some time... TODO: drop this test and use a
self-containment instead
coverartch =
const_cast<DisplayObject*>(tester->findDisplayItemByName(*root, "coverart"));
coverart = coverartch->to_movie();
- check_equals(coverart->get_movie_definition()->get_url(),
greenURL.str());
+ check_equals(coverart->get_root()->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 ?)
@@ -158,7 +158,7 @@
usleep(500); // give it some time... TODO: drop this test and use a
self-containment instead
coverartch =
const_cast<DisplayObject*>(tester->findDisplayItemByName(*root, "coverart"));
coverart = coverartch->to_movie();
- check_equals(coverart->get_movie_definition()->get_url(),
offspringURL.str());
+ check_equals(coverart->get_root()->url(), offspringURL.str());
// Check scribbling on the offspring
checkScribbling();
=== modified file 'testsuite/misc-ming.all/loop_test-Runner.cpp'
--- a/testsuite/misc-ming.all/loop_test-Runner.cpp 2009-04-03 09:29:19
+0000
+++ b/testsuite/misc-ming.all/loop_test-Runner.cpp 2009-04-09 11:41:59
+0000
@@ -104,7 +104,7 @@
// Let's break if we stopped, as we'll print totals() thus
// enlarging invalidated bounds too ...
- if (root->get_play_state() == MovieClip::STOP) break;
+ if (root->getPlayState() == MovieClip::PLAYSTATE_STOP) break;
// Compute 1-based currentFrame
size_t currentFrame = root->get_current_frame()+1;
=== modified file 'testsuite/misc-ming.all/loop_test2runner.cpp'
--- a/testsuite/misc-ming.all/loop_test2runner.cpp 2009-04-03 09:29:19
+0000
+++ b/testsuite/misc-ming.all/loop_test2runner.cpp 2009-04-09 11:41:59
+0000
@@ -70,7 +70,7 @@
// FRAME 1 (start)
check_equals(root->get_frame_count(), 4);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
check_equals(root->getDisplayList().size(), 1); // dejagnu clip
invalidated = tester.getInvalidatedRanges();
@@ -79,7 +79,7 @@
tester.advance(); // FRAME 2, place DisplayObjects (black on top)
invalidated = tester.getInvalidatedRanges();
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 1);
check_equals(root->getDisplayList().size(), 3); // dejagnu + red square
+ black square
@@ -97,7 +97,7 @@
tester.advance(); // FRAME 3, depth-swap the two DisplayObjects
invalidated = tester.getInvalidatedRanges();
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 2);
check_equals(root->getDisplayList().size(), 3); // dejagnu + red square
+ black square
@@ -116,7 +116,7 @@
tester.advance(); // FRAME 4, jump to frame 2 and stop
invalidated = tester.getInvalidatedRanges();
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
check_equals(root->get_current_frame(), 1);
check_equals(root->getDisplayList().size(), 3); // dejagnu + red square
+ black square
=== modified file 'testsuite/misc-ming.all/masks_testrunner.cpp'
--- a/testsuite/misc-ming.all/masks_testrunner.cpp 2009-04-03 09:29:19
+0000
+++ b/testsuite/misc-ming.all/masks_testrunner.cpp 2009-04-09 11:41:59
+0000
@@ -52,7 +52,7 @@
// FRAME 1 (start)
check_equals(root->get_frame_count(), 6);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
check_equals(root->getDisplayList().size(), 1); // dejagnu clip
invalidated = tester.getInvalidatedRanges();
@@ -61,7 +61,7 @@
// FRAME 2 -- masks at different depth ranges
tester.advance();
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
check_equals(root->get_current_frame(), 1); // 0-based
check_equals(root->getDisplayList().size(), 9);
root->getDisplayList().dump();
=== modified file 'testsuite/misc-ming.all/registerClassTestRunner.cpp'
--- a/testsuite/misc-ming.all/registerClassTestRunner.cpp 2009-04-03
09:29:19 +0000
+++ b/testsuite/misc-ming.all/registerClassTestRunner.cpp 2009-04-09
11:41:59 +0000
@@ -46,7 +46,7 @@
assert(root);
check_equals(root->get_frame_count(), 6);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
check(! tester.findDisplayItemByDepth(*root, 71) );
=== modified file 'testsuite/misc-ming.all/replace_buttons1test_runner.cpp'
--- a/testsuite/misc-ming.all/replace_buttons1test_runner.cpp 2009-04-03
09:29:19 +0000
+++ b/testsuite/misc-ming.all/replace_buttons1test_runner.cpp 2009-04-09
11:41:59 +0000
@@ -61,7 +61,7 @@
// FRAME 1 (start)
check_equals(root->get_frame_count(), 4);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
check_equals(root->getDisplayList().size(), 1); // dejagnu clip
invalidated = tester.getInvalidatedRanges();
@@ -70,7 +70,7 @@
tester.advance(); // FRAME 2, place DisplayObject
invalidated = tester.getInvalidatedRanges();
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 1);
check_equals(root->getDisplayList().size(), 2); // dejagnu + red square
@@ -92,7 +92,7 @@
tester.advance(); // FRAME 3, replace DisplayObject
invalidated = tester.getInvalidatedRanges();
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 2);
check_equals(root->getDisplayList().size(), 2); // dejagnu + red square
@@ -120,7 +120,7 @@
tester.advance(); // FRAME 4, jump to frame 2 and stop
invalidated = tester.getInvalidatedRanges();
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
check_equals(root->get_current_frame(), 1);
check_equals(root->getDisplayList().size(), 2); // dejagnu + red square
=== modified file 'testsuite/misc-ming.all/replace_shapes1test_runner.cpp'
--- a/testsuite/misc-ming.all/replace_shapes1test_runner.cpp 2009-04-03
09:29:19 +0000
+++ b/testsuite/misc-ming.all/replace_shapes1test_runner.cpp 2009-04-09
11:41:59 +0000
@@ -62,7 +62,7 @@
// FRAME 1 (start)
check_equals(root->get_frame_count(), 4);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
check_equals(root->getDisplayList().size(), 1); // dejagnu clip
invalidated = tester.getInvalidatedRanges();
@@ -71,7 +71,7 @@
tester.advance(); // FRAME 2, place DisplayObject
invalidated = tester.getInvalidatedRanges();
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 1);
check_equals(root->getDisplayList().size(), 2); // dejagnu + red char
@@ -93,7 +93,7 @@
tester.advance(); // FRAME 3, replace DisplayObject
invalidated = tester.getInvalidatedRanges();
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 2);
check_equals(root->getDisplayList().size(), 2); // dejagnu + green char
@@ -119,7 +119,7 @@
tester.advance(); // FRAME 4, jump to frame 2 and stop
invalidated = tester.getInvalidatedRanges();
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
check_equals(root->get_current_frame(), 1);
check_equals(root->getDisplayList().size(), 2); // dejagnu + red char
=== modified file 'testsuite/misc-ming.all/replace_sprites1test_runner.cpp'
--- a/testsuite/misc-ming.all/replace_sprites1test_runner.cpp 2009-04-03
09:29:19 +0000
+++ b/testsuite/misc-ming.all/replace_sprites1test_runner.cpp 2009-04-09
11:41:59 +0000
@@ -61,7 +61,7 @@
// FRAME 1 (start)
check_equals(root->get_frame_count(), 4);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
check_equals(root->getDisplayList().size(), 1); // dejagnu clip
invalidated = tester.getInvalidatedRanges();
@@ -70,7 +70,7 @@
tester.advance(); // FRAME 2, place DisplayObject
invalidated = tester.getInvalidatedRanges();
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 1);
check_equals(root->getDisplayList().size(), 2); // dejagnu + red square
@@ -92,7 +92,7 @@
tester.advance(); // FRAME 3, replace DisplayObject
invalidated = tester.getInvalidatedRanges();
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 2);
check_equals(root->getDisplayList().size(), 2); // dejagnu + red square
@@ -118,7 +118,7 @@
tester.advance(); // FRAME 4, jump to frame 2 and stop
invalidated = tester.getInvalidatedRanges();
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
check_equals(root->get_current_frame(), 1);
check_equals(root->getDisplayList().size(), 2); // dejagnu + red square
=== modified file 'testsuite/misc-ming.all/root_stop_testrunner.cpp'
--- a/testsuite/misc-ming.all/root_stop_testrunner.cpp 2009-04-03 09:29:19
+0000
+++ b/testsuite/misc-ming.all/root_stop_testrunner.cpp 2009-04-09 11:41:59
+0000
@@ -46,56 +46,56 @@
check_equals(root->get_frame_count(), 2);
check_equals(root->get_current_frame(), 0);
- check_equals(root->get_play_state(), MovieClip::STOP);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
const DisplayObject* ch = tester.findDisplayItemByName(*root,
"mc_in_root");
check(ch);
const MovieClip* mc = dynamic_cast<const MovieClip*>(ch);
check(mc);
check_equals(mc->get_current_frame(), 0);
- check_equals(mc->get_play_state(), MovieClip::PLAY);
+ check_equals(mc->getPlayState(), MovieClip::PLAYSTATE_PLAY);
tester.advance();
check_equals(root->get_current_frame(), 0); // we were in stop mode
check_equals(mc->get_current_frame(), 1);
- check_equals(root->get_play_state(), MovieClip::STOP);
- check_equals(mc->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
+ check_equals(mc->getPlayState(), MovieClip::PLAYSTATE_PLAY);
tester.advance();
check_equals(root->get_current_frame(), 0); // we were in stop mode
check_equals(mc->get_current_frame(), 2);
- check_equals(root->get_play_state(), MovieClip::STOP);
- check_equals(mc->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_STOP);
+ check_equals(mc->getPlayState(), MovieClip::PLAYSTATE_PLAY);
tester.advance();
check_equals(root->get_current_frame(), 0); // we were in stop mode
check_equals(mc->get_current_frame(), 0);
- check_equals(root->get_play_state(), MovieClip::PLAY);
- check_equals(mc->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
+ check_equals(mc->getPlayState(), MovieClip::PLAYSTATE_PLAY);
tester.advance();
check_equals(root->get_current_frame(), 1);
check_equals(mc->get_current_frame(), 1);
- check_equals(root->get_play_state(), MovieClip::PLAY);
- check_equals(mc->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
+ check_equals(mc->getPlayState(), MovieClip::PLAYSTATE_PLAY);
tester.advance();
check_equals(root->get_current_frame(), 0); // looped
check_equals(mc->get_current_frame(), 2);
- check_equals(root->get_play_state(), MovieClip::PLAY);
- check_equals(mc->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
+ check_equals(mc->getPlayState(), MovieClip::PLAYSTATE_PLAY);
tester.advance();
check_equals(root->get_current_frame(), 1);
check_equals(mc->get_current_frame(), 0);
- check_equals(root->get_play_state(), MovieClip::PLAY);
- check_equals(mc->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
+ check_equals(mc->getPlayState(), MovieClip::PLAYSTATE_PLAY);
tester.advance();
check_equals(root->get_current_frame(), 0); // looped again
check_equals(mc->get_current_frame(), 1);
- check_equals(root->get_play_state(), MovieClip::PLAY);
- check_equals(mc->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
+ check_equals(mc->getPlayState(), MovieClip::PLAYSTATE_PLAY);
return 0;
}
=== modified file 'testsuite/misc-ming.all/simple_loop_testrunner.cpp'
--- a/testsuite/misc-ming.all/simple_loop_testrunner.cpp 2009-04-03
09:29:19 +0000
+++ b/testsuite/misc-ming.all/simple_loop_testrunner.cpp 2009-04-09
11:41:59 +0000
@@ -65,7 +65,7 @@
// FRAME 1/4 (start)
check_equals(root->get_frame_count(), 4);
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
check_equals(root->getDisplayList().size(), 0); // no chars
invalidated = tester.getInvalidatedRanges();
@@ -75,7 +75,7 @@
tester.advance(); // FRAME 2/4
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 1);
check_equals(root->getDisplayList().size(), 1);
check( tester.findDisplayItemByDepth(*root,
2+DisplayObject::staticDepthOffset) );
@@ -84,7 +84,7 @@
tester.advance(); // FRAME 3/4
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 2);
check_equals(root->getDisplayList().size(), 2);
check( tester.findDisplayItemByDepth(*root,
2+DisplayObject::staticDepthOffset) );
@@ -94,7 +94,7 @@
tester.advance(); // FRAME 4/4
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 3);
check_equals(root->getDisplayList().size(), 3);
check( tester.findDisplayItemByDepth(*root,
2+DisplayObject::staticDepthOffset) );
@@ -105,7 +105,7 @@
tester.advance(); // FRAME 1/4 (loop back)
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 0);
check_equals(root->getDisplayList().size(), 0);
invalidated = tester.getInvalidatedRanges();
@@ -113,7 +113,7 @@
tester.advance(); // FRAME 2/4
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 1);
check_equals(root->getDisplayList().size(), 1);
check( tester.findDisplayItemByDepth(*root,
2+DisplayObject::staticDepthOffset) );
@@ -122,7 +122,7 @@
tester.advance(); // FRAME 3/4
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 2);
check_equals(root->getDisplayList().size(), 2);
check( tester.findDisplayItemByDepth(*root,
2+DisplayObject::staticDepthOffset) );
@@ -132,7 +132,7 @@
tester.advance(); // FRAME 4/4
- check_equals(root->get_play_state(), MovieClip::PLAY);
+ check_equals(root->getPlayState(), MovieClip::PLAYSTATE_PLAY);
check_equals(root->get_current_frame(), 3);
check_equals(root->getDisplayList().size(), 3);
check( tester.findDisplayItemByDepth(*root,
2+DisplayObject::staticDepthOffset) );
=== modified file 'utilities/processor.cpp'
--- a/utilities/processor.cpp 2009-04-01 12:26:49 +0000
+++ b/utilities/processor.cpp 2009-04-15 05:33:51 +0000
@@ -464,7 +464,7 @@
md->completeLoad();
- std::auto_ptr<movie_instance> mi ( md->create_movie_instance() );
+ std::auto_ptr<Movie> mi ( md->createMovie() );
m.setRootMovie( mi.release() );
if ( quitrequested ) // setRootMovie would execute actions in first frame
@@ -545,7 +545,7 @@
fprintf(stderr, "Kicking movie after %g seconds in STOP mode,
kick ct = %d\n", waitforadvance, kick_count);
fflush(stderr);
m.goto_frame(last_frame + 1);
- m.set_play_state(gnash::MovieClip::PLAY);
+ m.set_play_state(gnash::MovieClip::PLAYSTATE_PLAY);
kick_count++;
if (kick_count > 10) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/avm2 r9705: Merge from trunk.,
Benjamin Wolsey <=