gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r11247: Make the renderer no longer


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11247: Make the renderer no longer a singleton. It is now part of the RunResources
Date: Mon, 13 Jul 2009 12:43:39 +0200
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 11247
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2009-07-13 12:43:39 +0200
message:
  Make the renderer no longer a singleton. It is now part of the RunResources
  for a single Gnash run, and must be set before parsing.
  
  Rename RunInfo to RunResources to reflect what it does.
  
  Most complications arise from the use of BitmapInfos stored in the
  renderers. Without these, there would be no need to use the renderer during
  parsing, and it could theoretically be passed to movie_root::display()
  and externally owned. However, as AS from SWF version 8 needs a renderer
  to draw to an internal buffer (not necessarily the same one as the main
  renderer), it also makes sense to have it in the RunResources.
  
  This will break GUIs that I can't test, and others are only provisionally
  changed so that they compile and run. Updates from their authors are
  welcome. The depth parameter to GUIs is replaced with the RunInfo reference.
  This removes functionality from the SDL gui (though the bit depth parameter
  passed to all Guis and used only in the SDL one is hard-coded in Player.cpp 
and
  never changed). It can be restored either using an environment
  variable (preferred) or adding the bit depth to the RunResources.
  
  It should be relatively easy to select the renderer at runtime now.
renamed:
  backend/render_handler.h => backend/Renderer.h
  backend/render_handler_agg.cpp => backend/Renderer_agg.cpp
  backend/render_handler_agg.h => backend/Renderer_agg.h
  backend/render_handler_agg_bitmap.h => backend/Renderer_agg_bitmap.h
  backend/render_handler_agg_style.h => backend/Renderer_agg_style.h
  backend/render_handler_cairo.cpp => backend/Renderer_cairo.cpp
  backend/render_handler_cairo.h => backend/Renderer_cairo.h
  backend/render_handler_ogl.cpp => backend/Renderer_ogl.cpp
  backend/render_handler_ogl.h => backend/Renderer_ogl.h
  libcore/RunInfo.h => libcore/RunResources.h
  libcore/render.cpp => backend/ProxyRenderer.cpp
  libcore/render.h => backend/ProxyRenderer.h
modified:
  backend/Makefile.am
  cygnal/cvm.cpp
  gui/GuiKde4.cpp
  gui/Kde4Glue.h
  gui/Kde4GlueAgg.cpp
  gui/Kde4GlueAgg.h
  gui/Kde4GlueCairo.cpp
  gui/Kde4GlueCairo.h
  gui/Kde4GlueOgl.cpp
  gui/Kde4GlueOgl.h
  gui/Kde4Gui.cpp
  gui/Kde4Gui.h
  gui/NullGui.h
  gui/Player.cpp
  gui/Player.h
  gui/aos4.cpp
  gui/aos4_agg_glue.cpp
  gui/aos4_agg_glue.h
  gui/aos4_cairo_glue.cpp
  gui/aos4_cairo_glue.h
  gui/aos4_glue.h
  gui/aos4sup.h
  gui/aqua.cpp
  gui/aqua_glue.h
  gui/aqua_ogl_glue.cpp
  gui/aqua_ogl_glue.h
  gui/aquasup.h
  gui/dump.cpp
  gui/dump.h
  gui/fb.cpp
  gui/fbsup.h
  gui/fltk.cpp
  gui/fltk_glue_agg.cpp
  gui/fltk_glue_agg.h
  gui/fltk_glue_cairo.cpp
  gui/fltk_glue_cairo.h
  gui/fltksup.h
  gui/gtk.cpp
  gui/gtk_canvas.cpp
  gui/gtk_canvas.h
  gui/gtk_glue.h
  gui/gtk_glue_agg.cpp
  gui/gtk_glue_agg.h
  gui/gtk_glue_agg_xv.cpp
  gui/gtk_glue_agg_xv.h
  gui/gtk_glue_cairo.cpp
  gui/gtk_glue_cairo.h
  gui/gtk_glue_gtkglext.cpp
  gui/gtk_glue_gtkglext.h
  gui/gtksup.h
  gui/gui.cpp
  gui/gui.h
  gui/gui_aos4.cpp
  gui/gui_aqua.cpp
  gui/gui_dump.cpp
  gui/gui_fb.cpp
  gui/gui_fltk.cpp
  gui/gui_gtk.cpp
  gui/gui_kde.cpp
  gui/gui_riscos.cpp
  gui/gui_sdl.cpp
  gui/kde.cpp
  gui/kde_glue.h
  gui/kde_glue_agg.cpp
  gui/kde_glue_agg.h
  gui/kde_glue_opengl.cpp
  gui/kde_glue_opengl.h
  gui/kdesup.h
  gui/pythonmod/gnash-view.cpp
  gui/riscos.cpp
  gui/riscos_glue.h
  gui/riscos_glue_agg.cpp
  gui/riscos_glue_agg.h
  gui/riscossup.h
  gui/sdl.cpp
  gui/sdl_agg_glue.cpp
  gui/sdl_agg_glue.h
  gui/sdl_cairo_glue.cpp
  gui/sdl_cairo_glue.h
  gui/sdl_glue.h
  gui/sdl_ogl_glue.cpp
  gui/sdl_ogl_glue.h
  gui/sdlsup.h
  libcore/Bitmap.cpp
  libcore/Bitmap.h
  libcore/BitmapInfo.h
  libcore/Button.cpp
  libcore/Button.h
  libcore/DisplayList.cpp
  libcore/DisplayList.h
  libcore/DisplayObject.cpp
  libcore/DisplayObject.h
  libcore/DynamicShape.cpp
  libcore/DynamicShape.h
  libcore/FreetypeGlyphsProvider.cpp
  libcore/InteractiveObject.h
  libcore/Makefile.am
  libcore/MorphShape.cpp
  libcore/MorphShape.h
  libcore/MovieClip.cpp
  libcore/MovieClip.h
  libcore/MovieFactory.h
  libcore/Shape.cpp
  libcore/Shape.h
  libcore/StaticText.cpp
  libcore/StaticText.h
  libcore/TextField.cpp
  libcore/TextField.h
  libcore/Video.cpp
  libcore/Video.h
  libcore/asobj/LoadableObject.cpp
  libcore/asobj/MovieClipLoader.cpp
  libcore/asobj/NetConnection_as.cpp
  libcore/asobj/NetStream_as.cpp
  libcore/asobj/flash/media/Sound_as.cpp
  libcore/asobj/flash/net/SharedObject_as.cpp
  libcore/asobj/flash/system/System_as.cpp
  libcore/fill_style.cpp
  libcore/fill_style.h
  libcore/fontlib.cpp
  libcore/gnash.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/SWFParser.cpp
  libcore/parser/SWFParser.h
  libcore/parser/sound_definition.cpp
  libcore/parser/sound_definition.h
  libcore/parser/sprite_definition.cpp
  libcore/parser/sprite_definition.h
  libcore/styles.cpp
  libcore/styles.h
  libcore/swf/CSMTextSettingsTag.cpp
  libcore/swf/CSMTextSettingsTag.h
  libcore/swf/DefineButtonCxformTag.cpp
  libcore/swf/DefineButtonCxformTag.h
  libcore/swf/DefineButtonSoundTag.cpp
  libcore/swf/DefineButtonSoundTag.h
  libcore/swf/DefineButtonTag.cpp
  libcore/swf/DefineButtonTag.h
  libcore/swf/DefineEditTextTag.cpp
  libcore/swf/DefineEditTextTag.h
  libcore/swf/DefineFontAlignZonesTag.cpp
  libcore/swf/DefineFontAlignZonesTag.h
  libcore/swf/DefineFontNameTag.h
  libcore/swf/DefineFontTag.cpp
  libcore/swf/DefineFontTag.h
  libcore/swf/DefineMorphShapeTag.cpp
  libcore/swf/DefineMorphShapeTag.h
  libcore/swf/DefineSceneAndFrameLabelDataTag.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/DoABCTag.h
  libcore/swf/DoActionTag.h
  libcore/swf/DoInitActionTag.h
  libcore/swf/PlaceObject2Tag.cpp
  libcore/swf/PlaceObject2Tag.h
  libcore/swf/RemoveObjectTag.cpp
  libcore/swf/RemoveObjectTag.h
  libcore/swf/ScriptLimitsTag.h
  libcore/swf/SetBackgroundColorTag.h
  libcore/swf/ShapeRecord.cpp
  libcore/swf/ShapeRecord.h
  libcore/swf/StartSoundTag.cpp
  libcore/swf/StartSoundTag.h
  libcore/swf/StreamSoundBlockTag.cpp
  libcore/swf/StreamSoundBlockTag.h
  libcore/swf/SymbolClassTag.h
  libcore/swf/TagLoadersTable.h
  libcore/swf/TextRecord.cpp
  libcore/swf/TextRecord.h
  libcore/swf/VideoFrameTag.cpp
  libcore/swf/VideoFrameTag.h
  libcore/swf/tag_loaders.cpp
  libcore/swf/tag_loaders.h
  libcore/vm/ASHandlers.cpp
  libcore/vm/VM.h
  plugin/win32/plugin.h
  testsuite/DummyCharacter.h
  testsuite/DummyMovieDefinition.h
  testsuite/MovieTester.cpp
  testsuite/MovieTester.h
  testsuite/libcore.all/AsValueTest.cpp
  testsuite/libcore.all/DisplayListTest.cpp
  testsuite/libcore.all/Makefile.am
  testsuite/libcore.all/PropertyListTest.cpp
  utilities/processor.cpp
  backend/Renderer.h
  backend/Renderer_agg.cpp
  backend/Renderer_agg.h
  backend/Renderer_agg_bitmap.h
  backend/Renderer_agg_style.h
  backend/Renderer_cairo.cpp
  backend/Renderer_cairo.h
  backend/Renderer_ogl.cpp
  libcore/RunResources.h
  backend/ProxyRenderer.cpp
  backend/ProxyRenderer.h
    ------------------------------------------------------------
    revno: 11243.1.1
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-07-10 17:13:16 +0200
    message:
      Pass render_handler to all display() functions. Fake a non-singleton
      render_handler in RunInfo (should be relatively easy to make genuinely
      reentrant).
    modified:
      libcore/Bitmap.cpp
      libcore/Bitmap.h
      libcore/Button.cpp
      libcore/Button.h
      libcore/DisplayList.cpp
      libcore/DisplayList.h
      libcore/DisplayObject.cpp
      libcore/DisplayObject.h
      libcore/DynamicShape.cpp
      libcore/DynamicShape.h
      libcore/InteractiveObject.h
      libcore/MorphShape.cpp
      libcore/MorphShape.h
      libcore/MovieClip.cpp
      libcore/MovieClip.h
      libcore/RunInfo.h
      libcore/Shape.cpp
      libcore/Shape.h
      libcore/StaticText.cpp
      libcore/StaticText.h
      libcore/TextField.cpp
      libcore/TextField.h
      libcore/Video.cpp
      libcore/Video.h
      libcore/movie_root.cpp
      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/TextRecord.cpp
      libcore/swf/TextRecord.h
    ------------------------------------------------------------
    revno: 11243.1.2
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-07-10 17:44:55 +0200
    message:
      Fix some last build problems, rename render_handler to Renderer.
    renamed:
      backend/render_handler.h => backend/Renderer.h
      backend/render_handler_agg.cpp => backend/Renderer_agg.cpp
      backend/render_handler_agg.h => backend/Renderer_agg.h
      backend/render_handler_agg_bitmap.h => backend/Renderer_agg_bitmap.h
      backend/render_handler_agg_style.h => backend/Renderer_agg_style.h
      backend/render_handler_cairo.h => backend/Renderer_cairo.h
      backend/render_handler_ogl.cpp => backend/Renderer_ogl.cpp
      backend/render_handler_ogl.h => backend/Renderer_ogl.h
    modified:
      backend/Makefile.am
      backend/render_handler_cairo.cpp
      gui/Kde4Glue.h
      gui/Kde4GlueAgg.cpp
      gui/Kde4GlueAgg.h
      gui/Kde4GlueCairo.cpp
      gui/Kde4GlueCairo.h
      gui/Kde4GlueOgl.cpp
      gui/Kde4GlueOgl.h
      gui/Kde4Gui.cpp
      gui/aos4.cpp
      gui/aos4_agg_glue.cpp
      gui/aos4_agg_glue.h
      gui/aos4_cairo_glue.cpp
      gui/aos4_cairo_glue.h
      gui/aos4_glue.h
      gui/aos4sup.h
      gui/aqua.cpp
      gui/aqua_glue.h
      gui/aqua_ogl_glue.cpp
      gui/aqua_ogl_glue.h
      gui/dump.cpp
      gui/dump.h
      gui/fb.cpp
      gui/fltk.cpp
      gui/fltk_glue_agg.cpp
      gui/fltk_glue_agg.h
      gui/fltk_glue_cairo.cpp
      gui/fltk_glue_cairo.h
      gui/gtk.cpp
      gui/gtk_canvas.cpp
      gui/gtk_canvas.h
      gui/gtk_glue.h
      gui/gtk_glue_agg.cpp
      gui/gtk_glue_agg.h
      gui/gtk_glue_agg_xv.cpp
      gui/gtk_glue_agg_xv.h
      gui/gtk_glue_cairo.cpp
      gui/gtk_glue_cairo.h
      gui/gtk_glue_gtkglext.cpp
      gui/gtk_glue_gtkglext.h
      gui/gui.cpp
      gui/gui.h
      gui/kde.cpp
      gui/kde_glue.h
      gui/kde_glue_agg.cpp
      gui/kde_glue_agg.h
      gui/kde_glue_opengl.cpp
      gui/kde_glue_opengl.h
      gui/pythonmod/gnash-view.cpp
      gui/riscos.cpp
      gui/riscos_glue.h
      gui/riscos_glue_agg.cpp
      gui/riscos_glue_agg.h
      gui/sdl.cpp
      gui/sdl_agg_glue.cpp
      gui/sdl_agg_glue.h
      gui/sdl_cairo_glue.cpp
      gui/sdl_cairo_glue.h
      gui/sdl_glue.h
      gui/sdl_ogl_glue.cpp
      gui/sdl_ogl_glue.h
      libcore/Bitmap.cpp
      libcore/Bitmap.h
      libcore/BitmapInfo.h
      libcore/Button.cpp
      libcore/Button.h
      libcore/DisplayList.cpp
      libcore/DisplayList.h
      libcore/DisplayObject.cpp
      libcore/DisplayObject.h
      libcore/DynamicShape.cpp
      libcore/DynamicShape.h
      libcore/InteractiveObject.h
      libcore/MorphShape.cpp
      libcore/MorphShape.h
      libcore/MovieClip.cpp
      libcore/MovieClip.h
      libcore/RunInfo.h
      libcore/Shape.cpp
      libcore/Shape.h
      libcore/StaticText.cpp
      libcore/StaticText.h
      libcore/TextField.cpp
      libcore/TextField.h
      libcore/Video.cpp
      libcore/Video.h
      libcore/gnash.h
      libcore/impl.cpp
      libcore/movie_root.cpp
      libcore/movie_root.h
      libcore/render.cpp
      libcore/render.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/TextRecord.cpp
      libcore/swf/TextRecord.h
      plugin/win32/plugin.h
      testsuite/MovieTester.cpp
      testsuite/MovieTester.h
      backend/Renderer.h
      backend/Renderer_agg.cpp
      backend/Renderer_agg.h
      backend/Renderer_agg_bitmap.h
      backend/Renderer_agg_style.h
      backend/Renderer_cairo.h
      backend/Renderer_ogl.cpp
    ------------------------------------------------------------
    revno: 11243.1.3
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-07-10 17:56:01 +0200
    message:
      Fix testsuite, don't crash when there's no renderer.
    modified:
      libcore/Bitmap.cpp
      testsuite/DummyCharacter.h
    ------------------------------------------------------------
    revno: 11243.1.4
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Fri 2009-07-10 18:03:50 +0200
    message:
      Really fix the testsuite.
    modified:
      testsuite/DummyCharacter.h
    ------------------------------------------------------------
    revno: 11243.1.5
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Sat 2009-07-11 13:17:57 +0200
    message:
      Don't use renderer singleton in parsing.
    modified:
      libcore/swf/tag_loaders.cpp
    ------------------------------------------------------------
    revno: 11243.1.6
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Sat 2009-07-11 13:25:42 +0200
    message:
      Clean up headers.
    modified:
      libcore/Bitmap.cpp
      libcore/DynamicShape.cpp
      libcore/DynamicShape.h
      libcore/MorphShape.cpp
      libcore/MovieClip.cpp
      libcore/TextField.h
      libcore/parser/BitmapMovieDefinition.cpp
      libcore/swf/ShapeRecord.cpp
      libcore/swf/TextRecord.cpp
    ------------------------------------------------------------
    revno: 11243.1.7
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Sat 2009-07-11 14:03:50 +0200
    message:
      Pass RunInfo to more tags when parsing.
    modified:
      libcore/fill_style.cpp
      libcore/fill_style.h
      libcore/styles.cpp
      libcore/styles.h
      libcore/swf/DefineFontTag.cpp
      libcore/swf/DefineFontTag.h
      libcore/swf/DefineMorphShapeTag.cpp
      libcore/swf/DefineMorphShapeTag.h
      libcore/swf/DefineShapeTag.cpp
      libcore/swf/DefineShapeTag.h
      libcore/swf/ShapeRecord.cpp
      libcore/swf/ShapeRecord.h
    ------------------------------------------------------------
    revno: 11243.1.8
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Sat 2009-07-11 14:06:51 +0200
    message:
      Get the agg renderer to build.
    modified:
      backend/Renderer_agg.cpp
    ------------------------------------------------------------
    revno: 11243.1.9
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 08:14:01 +0200
    message:
      Fix OGL build.
    modified:
      backend/Renderer_ogl.cpp
    ------------------------------------------------------------
    revno: 11243.1.10
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 09:07:26 +0200
    message:
      Drop render.h include, move code to backend for new ProxyRenderer.
    renamed:
      libcore/render.cpp => backend/ProxyRenderer.cpp
      libcore/render.h => backend/ProxyRenderer.h
    modified:
      libcore/Bitmap.h
      libcore/DisplayObject.cpp
      libcore/DynamicShape.cpp
      libcore/FreetypeGlyphsProvider.cpp
      libcore/Makefile.am
      libcore/RunInfo.h
      libcore/TextField.cpp
      libcore/Video.cpp
      libcore/fontlib.cpp
      libcore/gnash.h
      libcore/impl.cpp
      libcore/movie_root.cpp
      libcore/parser/BitmapMovieDefinition.cpp
      libcore/parser/BitmapMovieDefinition.h
      libcore/styles.cpp
      libcore/swf/DefineMorphShapeTag.cpp
      libcore/swf/DefineShapeTag.cpp
      libcore/swf/TextRecord.cpp
      libcore/swf/tag_loaders.cpp
      backend/ProxyRenderer.cpp
    ------------------------------------------------------------
    revno: 11243.1.11
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 09:07:59 +0200
    message:
      Const correct...
    renamed:
      backend/render_handler_cairo.cpp => backend/Renderer_cairo.cpp
    modified:
      backend/Renderer.h
      backend/Renderer_agg.cpp
      backend/Renderer_ogl.cpp
      backend/Renderer_cairo.cpp
    ------------------------------------------------------------
    revno: 11243.1.12
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 09:13:32 +0200
    message:
      Cleanup the TestingRenderer code.
    modified:
      testsuite/MovieTester.cpp
      testsuite/MovieTester.h
    ------------------------------------------------------------
    revno: 11243.1.13
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 10:06:09 +0200
    message:
      Rename RunInfo to RunResources.
    renamed:
      libcore/RunInfo.h => libcore/RunResources.h
    modified:
      cygnal/cvm.cpp
      gui/Player.cpp
      gui/Player.h
      gui/pythonmod/gnash-view.cpp
      libcore/Makefile.am
      libcore/MovieFactory.h
      libcore/asobj/LoadableObject.cpp
      libcore/asobj/NetConnection_as.cpp
      libcore/asobj/flash/net/SharedObject_as.cpp
      libcore/asobj/flash/text/TextSnapshot_as.cpp
      libcore/asobj/flash/text/TextSnapshot_as.h
      libcore/fill_style.cpp
      libcore/fill_style.h
      libcore/gnash.h
      libcore/impl.cpp
      libcore/movie_root.cpp
      libcore/movie_root.h
      libcore/parser/SWFMovieDefinition.cpp
      libcore/parser/SWFMovieDefinition.h
      libcore/parser/SWFParser.cpp
      libcore/parser/SWFParser.h
      libcore/parser/sound_definition.h
      libcore/parser/sprite_definition.cpp
      libcore/parser/sprite_definition.h
      libcore/styles.cpp
      libcore/styles.h
      libcore/swf/CSMTextSettingsTag.cpp
      libcore/swf/CSMTextSettingsTag.h
      libcore/swf/DefineButtonCxformTag.cpp
      libcore/swf/DefineButtonCxformTag.h
      libcore/swf/DefineButtonSoundTag.cpp
      libcore/swf/DefineButtonSoundTag.h
      libcore/swf/DefineButtonTag.cpp
      libcore/swf/DefineButtonTag.h
      libcore/swf/DefineEditTextTag.cpp
      libcore/swf/DefineEditTextTag.h
      libcore/swf/DefineFontAlignZonesTag.cpp
      libcore/swf/DefineFontAlignZonesTag.h
      libcore/swf/DefineFontNameTag.h
      libcore/swf/DefineFontTag.cpp
      libcore/swf/DefineFontTag.h
      libcore/swf/DefineMorphShapeTag.cpp
      libcore/swf/DefineMorphShapeTag.h
      libcore/swf/DefineSceneAndFrameLabelDataTag.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/DoABCTag.h
      libcore/swf/DoActionTag.h
      libcore/swf/DoInitActionTag.h
      libcore/swf/PlaceObject2Tag.cpp
      libcore/swf/PlaceObject2Tag.h
      libcore/swf/RemoveObjectTag.cpp
      libcore/swf/RemoveObjectTag.h
      libcore/swf/ScriptLimitsTag.h
      libcore/swf/SetBackgroundColorTag.h
      libcore/swf/ShapeRecord.cpp
      libcore/swf/ShapeRecord.h
      libcore/swf/StartSoundTag.cpp
      libcore/swf/StartSoundTag.h
      libcore/swf/StreamSoundBlockTag.cpp
      libcore/swf/StreamSoundBlockTag.h
      libcore/swf/SymbolClassTag.h
      libcore/swf/TagLoadersTable.h
      libcore/swf/VideoFrameTag.cpp
      libcore/swf/VideoFrameTag.h
      libcore/swf/tag_loaders.cpp
      libcore/swf/tag_loaders.h
      libcore/vm/VM.h
      testsuite/DummyMovieDefinition.h
      testsuite/MovieTester.cpp
      testsuite/MovieTester.h
      testsuite/libcore.all/AsValueTest.cpp
      testsuite/libcore.all/DisplayListTest.cpp
      testsuite/libcore.all/PropertyListTest.cpp
      utilities/processor.cpp
      libcore/RunResources.h
    ------------------------------------------------------------
    revno: 11243.1.14
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 10:26:55 +0200
    message:
      Use _renderer member.
    modified:
      gui/gui.cpp
    ------------------------------------------------------------
    revno: 11243.1.15
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 10:27:41 +0200
    message:
      Forward declaration.
    modified:
      gui/Kde4Glue.h
    ------------------------------------------------------------
    revno: 11243.1.16
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 11:04:26 +0200
    message:
      Rename runInfo to runResources.
    modified:
      libcore/Bitmap.cpp
      libcore/Button.cpp
      libcore/MovieClip.cpp
      libcore/MovieFactory.h
      libcore/asobj/LoadableObject.cpp
      libcore/asobj/MovieClipLoader.cpp
      libcore/asobj/NetConnection_as.cpp
      libcore/asobj/NetStream_as.cpp
      libcore/asobj/flash/media/Sound_as.cpp
      libcore/asobj/flash/system/System_as.cpp
      libcore/impl.cpp
      libcore/movie_root.cpp
      libcore/movie_root.h
      libcore/parser/SWFMovieDefinition.cpp
      libcore/parser/SWFMovieDefinition.h
      libcore/parser/SWFParser.cpp
      libcore/parser/SWFParser.h
      libcore/parser/sound_definition.cpp
      libcore/parser/sound_definition.h
      libcore/parser/sprite_definition.cpp
      libcore/parser/sprite_definition.h
      libcore/swf/StartSoundTag.cpp
      libcore/swf/StreamSoundBlockTag.cpp
      libcore/vm/ASHandlers.cpp
      testsuite/MovieTester.cpp
      testsuite/MovieTester.h
      testsuite/libcore.all/AsValueTest.cpp
      testsuite/libcore.all/PropertyListTest.cpp
      utilities/processor.cpp
    ------------------------------------------------------------
    revno: 11243.1.17
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 11:15:53 +0200
    message:
      Test one.
    modified:
      cygnal/cvm.cpp
      gui/GuiKde4.cpp
      gui/Kde4Gui.cpp
      gui/Kde4Gui.h
      gui/NullGui.h
      gui/Player.cpp
      gui/Player.h
      gui/aos4.cpp
      gui/aos4sup.h
      gui/aqua.cpp
      gui/aquasup.h
      gui/dump.cpp
      gui/dump.h
      gui/fb.cpp
      gui/fbsup.h
      gui/fltk.cpp
      gui/fltksup.h
      gui/gtk.cpp
      gui/gtk_canvas.cpp
      gui/gtk_canvas.h
      gui/gtksup.h
      gui/gui.cpp
      gui/gui.h
      gui/gui_aos4.cpp
      gui/gui_aqua.cpp
      gui/gui_dump.cpp
      gui/gui_fb.cpp
      gui/gui_fltk.cpp
      gui/gui_gtk.cpp
      gui/gui_kde.cpp
      gui/gui_riscos.cpp
      gui/gui_sdl.cpp
      gui/kde.cpp
      gui/kdesup.h
      gui/pythonmod/gnash-view.cpp
      gui/riscos.cpp
      gui/riscossup.h
      gui/sdl.cpp
      gui/sdlsup.h
    ------------------------------------------------------------
    revno: 11243.1.18
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 11:30:28 +0200
    message:
      Don't initialize Gui until the RunInfo is populated.
    modified:
      gui/Player.cpp
    ------------------------------------------------------------
    revno: 11243.1.19
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 11:38:06 +0200
    message:
      Don't rename getTextRunInfo to getTextRunResources, though.
    modified:
      libcore/asobj/flash/text/TextSnapshot_as.cpp
      libcore/asobj/flash/text/TextSnapshot_as.h
    ------------------------------------------------------------
    revno: 11243.1.20
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 11:39:21 +0200
    message:
      Allow creation of BitmapMovies with no bitmap (this can happen if no
      renderer is supplied).
    modified:
      libcore/parser/BitmapMovieDefinition.cpp
    ------------------------------------------------------------
    revno: 11243.1.21
    committer: Benjamin Wolsey <address@hidden>
    branch nick: test
    timestamp: Mon 2009-07-13 12:00:05 +0200
    message:
      Fix testsuite.
    modified:
      testsuite/libcore.all/Makefile.am
=== modified file 'backend/Makefile.am'
--- a/backend/Makefile.am       2009-04-06 20:29:42 +0000
+++ b/backend/Makefile.am       2009-07-10 15:44:55 +0000
@@ -55,12 +55,12 @@
        $(NULL)
 
 noinst_HEADERS = \
-       render_handler.h \
-       render_handler_agg.h \
-       render_handler_agg_bitmap.h \
-       render_handler_agg_style.h \
-       render_handler_cairo.h \
-       render_handler_ogl.h \
+       Renderer.h \
+       Renderer_agg.h \
+       Renderer_agg_bitmap.h \
+       Renderer_agg_style.h \
+       Renderer_cairo.h \
+       Renderer_ogl.h \
         PathParser.h
 
 # bin_PROGRAMS = gnash
@@ -71,7 +71,7 @@
 if HAVE_OPENGL
 noinst_LTLIBRARIES += libgnashogl.la
 #plugins_LTLIBRARIES += libgnashogl.la
-libgnashogl_la_SOURCES = render_handler_ogl.cpp PathParser.cpp
+libgnashogl_la_SOURCES = Renderer_ogl.cpp PathParser.cpp
 #libgnashogl_la_LDFLAGS = -module -avoid-version -no-undefined
 libgnashogl_la_LDFLAGS =
 libgnashogl_la_LIBADD = $(OPENGL_LIBS)
@@ -82,7 +82,7 @@
 if HAVE_AGG
 noinst_LTLIBRARIES += libgnashagg.la
 #plugins_LTLIBRARIES += libgnashagg.la
-libgnashagg_la_SOURCES = render_handler_agg.cpp 
+libgnashagg_la_SOURCES = Renderer_agg.cpp 
 #libgnashagg_la_LDFLAGS = -module -avoid-version -no-undefined
 libgnashagg_la_LIBADD = $(AGG_LIBS)
 endif
@@ -92,7 +92,7 @@
 if HAVE_CAIRO
 noinst_LTLIBRARIES += libgnashcairo.la
 # plugins_LTLIBRARIES += libgnashcairo.la
-libgnashcairo_la_SOURCES = render_handler_cairo.cpp PathParser.cpp
+libgnashcairo_la_SOURCES = Renderer_cairo.cpp PathParser.cpp
 #libgnashcairo_la_LDFLAGS = -module -avoid-version -no-undefined
 libgnashcairo_la_LIBADD = $(CAIRO_LIBS)
 endif

=== renamed file 'libcore/render.cpp' => 'backend/ProxyRenderer.cpp'
--- a/libcore/render.cpp        2009-04-20 17:20:47 +0000
+++ b/backend/ProxyRenderer.cpp 2009-07-13 07:07:26 +0000
@@ -18,7 +18,6 @@
 
 // Based on original by Willem Kokke <address@hidden> 2003
 
-#include "render.h"
 #include "GnashImage.h"
 #include "BitmapInfo.h"
 
@@ -33,16 +32,16 @@
 #include <memory>
 
 namespace gnash {
-static render_handler* s_render_handler = NULL;
+static Renderer* s_Renderer = NULL;
 
-void set_render_handler(render_handler* r)
+void set_Renderer(Renderer* r)
 {
-       s_render_handler = r;
+       s_Renderer = r;
 }
 
-render_handler* get_render_handler()
+Renderer* get_Renderer()
 {
-       return s_render_handler;
+       return s_Renderer;
 }
 
 
@@ -66,7 +65,7 @@
        BitmapInfo* createBitmapInfo(std::auto_ptr<GnashImage> im)
        {
        
-        if (!s_render_handler)
+        if (!s_Renderer)
         {
             return new bogus_bi;
         }
@@ -81,7 +80,7 @@
             case GNASH_IMAGE_RGB:
             case GNASH_IMAGE_RGBA:
             {
-                return s_render_handler->createBitmapInfo(im);
+                return s_Renderer->createBitmapInfo(im);
             }
         }
 
@@ -91,8 +90,8 @@
        void drawVideoFrame(GnashImage* frame, const SWFMatrix* mat,
             const rect* bounds, bool smooth)
     {
-               if (s_render_handler) {
-            return s_render_handler->drawVideoFrame(frame, mat, bounds, 
smooth);
+               if (s_Renderer) {
+            return s_Renderer->drawVideoFrame(frame, mat, bounds, smooth);
         }
        }
 
@@ -109,16 +108,16 @@
 #ifdef DEBUG_RENDER_CALLS
                GNASH_REPORT_FUNCTION;
 #endif
-               if (s_render_handler)
+               if (s_Renderer)
                {
-                       s_render_handler->begin_display(
+                       s_Renderer->begin_display(
                                background_color, viewport_x0, viewport_y0,
                                viewport_width, viewport_height,
                                x0, x1, y0, y1);
                }
 //                     else
 //                     {
-//                             log_error("begin_display called, but no 
render_handler was registered by the app!\n");
+//                             log_error("begin_display called, but no 
Renderer was registered by the app!\n");
 //                     }
        }
 
@@ -128,7 +127,7 @@
 #ifdef DEBUG_RENDER_CALLS
                GNASH_REPORT_FUNCTION;
 #endif
-               if (s_render_handler) s_render_handler->end_display();
+               if (s_Renderer) s_Renderer->end_display();
        }
 
 
@@ -137,7 +136,7 @@
 #ifdef DEBUG_RENDER_CALLS
                GNASH_REPORT_FUNCTION;
 #endif
-               if (s_render_handler) s_render_handler->drawLine(coords, color, 
mat);
+               if (s_Renderer) s_Renderer->drawLine(coords, color, mat);
 }
 
 
@@ -147,7 +146,7 @@
 #ifdef DEBUG_RENDER_CALLS
                GNASH_REPORT_FUNCTION;
 #endif
-               if (s_render_handler) s_render_handler->draw_poly(corners, 
corner_count,
+               if (s_Renderer) s_Renderer->draw_poly(corners, corner_count,
     fill, outline, mat, masked);
 }
 
@@ -159,7 +158,7 @@
 #ifdef DEBUG_RENDER_CALLS
                GNASH_REPORT_FUNCTION;
 #endif
-               if (s_render_handler) s_render_handler->drawShape(shape, cx, 
worldMat);
+               if (s_Renderer) s_Renderer->drawShape(shape, cx, worldMat);
 }
 
 void drawGlyph(const SWF::ShapeRecord& rec, const rgba& color, 
@@ -168,27 +167,27 @@
 #ifdef DEBUG_RENDER_CALLS
                GNASH_REPORT_FUNCTION;
 #endif
-               if (s_render_handler) s_render_handler->drawGlyph(rec, color, 
mat);
+               if (s_Renderer) s_Renderer->drawGlyph(rec, color, mat);
 }
 
 bool bounds_in_clipping_area(const rect& bounds) {
        return bounds_in_clipping_area(bounds.getRange());
-  if (s_render_handler) 
-    return s_render_handler->bounds_in_clipping_area(bounds);
+  if (s_Renderer) 
+    return s_Renderer->bounds_in_clipping_area(bounds);
   else
     return true;
 }
 
 bool bounds_in_clipping_area(const InvalidatedRanges& ranges) {
-  if (s_render_handler) 
-    return s_render_handler->bounds_in_clipping_area(ranges);
+  if (s_Renderer) 
+    return s_Renderer->bounds_in_clipping_area(ranges);
   else
     return true;
        }
 
 bool bounds_in_clipping_area(const geometry::Range2d<float>& bounds) {
-  if (s_render_handler) 
-    return s_render_handler->bounds_in_clipping_area(bounds);
+  if (s_Renderer) 
+    return s_Renderer->bounds_in_clipping_area(bounds);
   else
     return true;
        }
@@ -201,7 +200,7 @@
 #ifdef DEBUG_RENDER_CALLS
                GNASH_REPORT_FUNCTION;
 #endif
-               if (s_render_handler) s_render_handler->begin_submit_mask();
+               if (s_Renderer) s_Renderer->begin_submit_mask();
        }
 
        void    end_submit_mask()
@@ -209,7 +208,7 @@
 #ifdef DEBUG_RENDER_CALLS
                GNASH_REPORT_FUNCTION;
 #endif
-               if (s_render_handler) s_render_handler->end_submit_mask();
+               if (s_Renderer) s_Renderer->end_submit_mask();
        }
 
        void    disable_mask()
@@ -217,7 +216,7 @@
 #ifdef DEBUG_RENDER_CALLS
                GNASH_REPORT_FUNCTION;
 #endif
-               if (s_render_handler) s_render_handler->disable_mask();
+               if (s_Renderer) s_Renderer->disable_mask();
        }
 }
 

=== renamed file 'libcore/render.h' => 'backend/ProxyRenderer.h'
--- a/libcore/render.h  2009-04-07 14:32:06 +0000
+++ b/backend/ProxyRenderer.h   2009-07-13 07:07:26 +0000
@@ -23,7 +23,7 @@
 #define GNASH_RENDER_H
 
 #include "gnash.h"
-#include "render_handler.h"
+#include "Renderer.h"
 #include "dsodefs.h"
 
 // Forward declarations
@@ -38,16 +38,16 @@
 namespace gnash {
 
        /// Return currently registered render handler
-       render_handler* get_render_handler();
+       Renderer*       get_Renderer();
 
        /// Rendering operations 
        //
        /// Takes care of calling the currently registered
-       /// gnash::render_handler or fallback on a default
+       /// gnash::Renderer or fallback on a default
        /// behaviour if no renderer is registered
        ///
        /// NOTE: A cleaner implementation would be implementing
-       ///       the default behaviour in the render_handler class
+       ///       the default behaviour in the Renderer class
        ///       itself, rather then making it an "abstract" class.
        ///       Anyway, having proxy calls turned out to be somewhat
        ///       useful while tracking rendering calls, to have a central
@@ -56,28 +56,28 @@
        ///
        namespace render
        {
-               /// See render_handler::create_bitmap_info_rgb (in 
backend/render_handler.h)
+               /// See Renderer::create_bitmap_info_rgb (in backend/Renderer.h)
                BitmapInfo* createBitmapInfo(std::auto_ptr<GnashImage> im);
 
-               /// See render_handler::drawVideoFrame (in 
backend/render_handler.h)
+               /// See Renderer::drawVideoFrame (in backend/Renderer.h)
                void drawVideoFrame(GnashImage* frame, const SWFMatrix* mat,
                 const rect* bounds, bool smooth);
 
-               /// See render_handler::begin_display (in 
backend/render_handler.h)
+               /// See Renderer::begin_display (in backend/Renderer.h)
                void    begin_display(
                        const rgba& background_color,
                        int viewport_x0, int viewport_y0,
                        int viewport_width, int viewport_height,
                        float x0, float x1, float y0, float y1);
 
-               /// See render_handler::end_display (in 
backend/render_handler.h)
+               /// See Renderer::end_display (in backend/Renderer.h)
                void    end_display();
 
-               /// See render_handler::draw_line_strip (in 
backend/render_handler.h)
+               /// See Renderer::draw_line_strip (in backend/Renderer.h)
                void drawLine(const std::vector<point>& coords, const rgba& 
color,
                 const SWFMatrix& mat);
 
-               /// See render_handler::draw_poly (in backend/render_handler.h)
+               /// See Renderer::draw_poly (in backend/Renderer.h)
                DSOEXPORT void  draw_poly(const point* corners, int 
corner_count,
                                const rgba& fill, const rgba& outline, const 
SWFMatrix& mat,
                                bool masked);
@@ -85,22 +85,22 @@
         void drawShape(const SWF::ShapeRecord& shape, const cxform& cx,
                 const SWFMatrix& worldMat);
       
-               /// See render_handler::draw_glyph (in backend/render_handler.h)
+               /// See Renderer::draw_glyph (in backend/Renderer.h)
                void drawGlyph(const SWF::ShapeRecord& rec, const rgba& color,
                 const SWFMatrix& mat);
 
-               /// See render_handler::bounds_in_clipping_area (in 
backend/render_handler.h)
+               /// See Renderer::bounds_in_clipping_area (in 
backend/Renderer.h)
                bool bounds_in_clipping_area(const rect& bounds);
                bool bounds_in_clipping_area(const InvalidatedRanges& ranges);
                bool bounds_in_clipping_area(const geometry::Range2d<float>& 
bounds);
                                
-               /// See render_handler::begin_submit_mask (in 
backend/render_handler.h)
+               /// See Renderer::begin_submit_mask (in backend/Renderer.h)
                void    begin_submit_mask();
 
-               /// See render_handler::end_submit_mask (in 
backend/render_handler.h)
+               /// See Renderer::end_submit_mask (in backend/Renderer.h)
                void    end_submit_mask();
 
-               /// See render_handler::disable_mask (in 
backend/render_handler.h)
+               /// See Renderer::disable_mask (in backend/Renderer.h)
                void    disable_mask();
 
        }       // end namespace render

=== renamed file 'backend/render_handler.h' => 'backend/Renderer.h'
--- a/backend/render_handler.h  2009-04-20 17:20:47 +0000
+++ b/backend/Renderer.h        2009-07-13 07:07:59 +0000
@@ -21,7 +21,7 @@
 #ifndef RENDER_HANDLER_H
 #define RENDER_HANDLER_H
 
-/// \page render_handler_intro Render handler introduction
+/// \page Renderer_intro Render handler introduction
 ///
 /// Information for writing new render handlers.
 ///
@@ -189,22 +189,22 @@
 
 /// Base class for render handlers.
 //
-/// You must define a subclass of render_handler, and pass an
-/// instance to set_render_handler() *before* any SWF parsing begins.
+/// You must define a subclass of Renderer, and pass an
+/// instance to set_Renderer() *before* any SWF parsing begins.
 ///
-/// For more info see page \ref render_handler_intro.
+/// For more info see page \ref Renderer_intro.
 /// 
 ///
-class DSOEXPORT render_handler
+class DSOEXPORT Renderer
 {
 public:
 
-    render_handler()
+    Renderer()
         :
         _quality(QUALITY_HIGH)
     {}
 
-    virtual ~render_handler() {}
+    virtual ~Renderer() {}
 
     /// ==================================================================
     /// Interfaces for adjusting renderer output.
@@ -457,7 +457,7 @@
     /// the nearest pixel is returned.
     /// The function returns false when the coordinates are outside the 
     /// main frame buffer.
-    virtual bool getPixel(rgba& /*color_return*/, int /*x*/, int /*y*/)
+    virtual bool getPixel(rgba& /*color_return*/, int /*x*/, int /*y*/) const
     {
 
         log_debug("getPixel() not implemented for this renderer");
@@ -477,7 +477,7 @@
     /// This implementation is provided for simplicity. Renderers should
     /// implement a specialized version for better performance.
     virtual bool getAveragePixel(rgba& color_return, int x, int y, 
-        unsigned int radius)
+        unsigned int radius) const
     {
     
         assert(radius>0); 
@@ -566,7 +566,7 @@
     /// Kept in parallel with movie_root's setting.
     Quality _quality;
 
-}; // class render_handler
+}; // class Renderer
 
 
 

=== renamed file 'backend/render_handler_agg.cpp' => 'backend/Renderer_agg.cpp'
--- a/backend/render_handler_agg.cpp    2009-04-20 17:20:47 +0000
+++ b/backend/Renderer_agg.cpp  2009-07-13 07:07:59 +0000
@@ -19,7 +19,7 @@
 // INDUNET GmbH (www.indunet.it)
 
 
-/// A render_handler that uses the Anti-Grain Geometry Toolkit (antigrain.com)
+/// A Renderer that uses the Anti-Grain Geometry Toolkit (antigrain.com)
 /// and renders directly to a buffer (for example to the framebuffer). This 
 /// backend is *completely* independent of any hardware. It can be used for
 /// rendering to the Linux FrameBuffer device, or be blitted inside a 
@@ -117,8 +117,8 @@
 #include "RGBA.h"
 #include "GnashImage.h"
 #include "log.h"
-#include "render_handler.h"
-#include "render_handler_agg.h" 
+#include "Renderer.h"
+#include "Renderer_agg.h" 
 #include "Range2d.h"
 #include "swf/DefineMorphShapeTag.h" 
 #include "swf/ShapeRecord.h" 
@@ -163,8 +163,8 @@
 #include <agg_gradient_lut.h>
 #include <agg_alpha_mask_u8.h>
 
-#include "render_handler_agg_bitmap.h"
-#include "render_handler_agg_style.h"
+#include "Renderer_agg_bitmap.h"
+#include "Renderer_agg_style.h"
 
 #include <boost/scoped_array.hpp>
 #include <boost/bind.hpp>
@@ -577,7 +577,7 @@
 
 // Real AGG handler
 template <class PixelFormat>
-class render_handler_agg : public render_handler_agg_base
+class Renderer_agg : public Renderer_agg_base
 {
   
 public:
@@ -664,7 +664,7 @@
     } 
 
   // Constructor
-  render_handler_agg(int bits_per_pixel)
+  Renderer_agg(int bits_per_pixel)
       :
       xres(1),
       yres(1),
@@ -971,7 +971,7 @@
 
         cur_bounds.expand_to_transformed_rect(worldMat, shape.getBounds());
                 
-        if (!render_handler::bounds_in_clipping_area(cur_bounds))
+        if (!Renderer::bounds_in_clipping_area(cur_bounds))
         {
             return; // no need to draw
         }        
@@ -1346,7 +1346,7 @@
           }
 
           sh.add_bitmap(dynamic_cast<const agg_bitmap_info*> 
-            (fill_styles[fno].get_bitmap_info()), m, cx, 
+            (fill_styles[fno].get_bitmap_info(*this)), m, cx, 
             (fill_type==SWF::FILL_TILED_BITMAP) ||
             (fill_type==SWF::FILL_TILED_BITMAP_HARD),
             smooth);
@@ -1988,7 +1988,7 @@
     return false;
   }
 
-  bool getPixel(rgba& color_return, int x, int y) {
+  bool getPixel(rgba& color_return, int x, int y) const {
   
     if ((x<0) || (y<0) || (x>=xres) || (y>=yres))
       return false;
@@ -2091,7 +2091,7 @@
 }
 
 
-DSOEXPORT render_handler_agg_base*  create_render_handler_agg(const char 
*pixelformat)
+DSOEXPORT Renderer_agg_base*  create_Renderer_agg(const char *pixelformat)
 {
 
   if (!pixelformat) return NULL;
@@ -2103,42 +2103,42 @@
   
 #ifdef PIXELFORMAT_RGB555  
   if (!strcmp(pixelformat, "RGB555"))
-    return new render_handler_agg<agg::pixfmt_rgb555_pre> (16); // yep, 16!
+    return new Renderer_agg<agg::pixfmt_rgb555_pre> (16); // yep, 16!
   
   else
 #endif   
 #ifdef PIXELFORMAT_RGB565  
   if (!strcmp(pixelformat, "RGB565") || !strcmp(pixelformat, "RGBA16"))
-    return new render_handler_agg<agg::pixfmt_rgb565_pre> (16); 
+    return new Renderer_agg<agg::pixfmt_rgb565_pre> (16); 
   else 
 #endif   
 #ifdef PIXELFORMAT_RGB24  
   if (!strcmp(pixelformat, "RGB24"))
-    return new render_handler_agg<agg::pixfmt_rgb24_pre> (24);    
+    return new Renderer_agg<agg::pixfmt_rgb24_pre> (24);    
   else 
 #endif   
 #ifdef PIXELFORMAT_BGR24  
   if (!strcmp(pixelformat, "BGR24"))
-    return new render_handler_agg<agg::pixfmt_bgr24_pre> (24);
+    return new Renderer_agg<agg::pixfmt_bgr24_pre> (24);
   else 
 #endif   
 #ifdef PIXELFORMAT_RGBA32 
   if (!strcmp(pixelformat, "RGBA32"))
-    return new render_handler_agg<agg::pixfmt_rgba32_pre> (32);
+    return new Renderer_agg<agg::pixfmt_rgba32_pre> (32);
   else 
 #endif   
 #ifdef PIXELFORMAT_BGRA32  
   if (!strcmp(pixelformat, "BGRA32"))
-    return new render_handler_agg<agg::pixfmt_bgra32_pre> (32);
+    return new Renderer_agg<agg::pixfmt_bgra32_pre> (32);
 #endif   
 #ifdef PIXELFORMAT_RGBA32 
   if (!strcmp(pixelformat, "ARGB32"))
-    return new render_handler_agg<agg::pixfmt_argb32_pre> (32);
+    return new Renderer_agg<agg::pixfmt_argb32_pre> (32);
   else 
 #endif   
 #ifdef PIXELFORMAT_BGRA32  
   if (!strcmp(pixelformat, "ABGR32"))
-    return new render_handler_agg<agg::pixfmt_abgr32_pre> (32);
+    return new Renderer_agg<agg::pixfmt_abgr32_pre> (32);
         
   else 
 #endif

=== renamed file 'backend/render_handler_agg.h' => 'backend/Renderer_agg.h'
--- a/backend/render_handler_agg.h      2009-02-25 22:33:03 +0000
+++ b/backend/Renderer_agg.h    2009-07-10 15:44:55 +0000
@@ -24,7 +24,7 @@
 namespace gnash {
 
 // Base class to shield GUIs from AGG's pixelformat classes 
-class render_handler_agg_base : public render_handler
+class Renderer_agg_base : public Renderer
 {
 private:
 
@@ -32,10 +32,10 @@
   
 public:
   
-  render_handler_agg_base() : _testBuffer(0) { }  
+  Renderer_agg_base() : _testBuffer(0) { }  
 
   // virtual classes should have virtual destructors
-  virtual ~render_handler_agg_base() {}
+  virtual ~Renderer_agg_base() {}
   
   // these methods need to be accessed from outside:
   virtual void init_buffer(unsigned char *mem, int size, int x, int y, int 
rowstride)=0;
@@ -63,8 +63,8 @@
 /// If the given pixelformat is unsupported, or any other error
 /// occurs, NULL is returned.
 ///
-DSOEXPORT render_handler_agg_base*
-  create_render_handler_agg(const char *pixelformat);
+DSOEXPORT Renderer_agg_base*
+  create_Renderer_agg(const char *pixelformat);
   
 /// Detect pixel format based on bit mask. If the pixel format is unknown,
 /// NULL is returned. Note that a successfully detected pixel format does

=== renamed file 'backend/render_handler_agg_bitmap.h' => 
'backend/Renderer_agg_bitmap.h'
--- a/backend/render_handler_agg_bitmap.h       2009-02-25 22:33:03 +0000
+++ b/backend/Renderer_agg_bitmap.h     2009-07-10 15:44:55 +0000
@@ -18,7 +18,7 @@
 #ifndef BACKEND_RENDER_HANDLER_AGG_BITMAP_H
 #define BACKEND_RENDER_HANDLER_AGG_BITMAP_H
 
-// This include file used only to make render_handler_agg more readable.
+// This include file used only to make Renderer_agg more readable.
 
 namespace gnash {
 

=== renamed file 'backend/render_handler_agg_style.h' => 
'backend/Renderer_agg_style.h'
--- a/backend/render_handler_agg_style.h        2009-04-15 12:27:37 +0000
+++ b/backend/Renderer_agg_style.h      2009-07-10 15:44:55 +0000
@@ -18,7 +18,7 @@
 #ifndef BACKEND_RENDER_HANDLER_AGG_STYLE_H
 #define BACKEND_RENDER_HANDLER_AGG_STYLE_H
 
-// This include file used only to make render_handler_agg more readable.
+// This include file used only to make Renderer_agg more readable.
 
 
 // TODO: Instead of re-creating AGG fill styles again and again, they should

=== renamed file 'backend/render_handler_cairo.cpp' => 
'backend/Renderer_cairo.cpp'
--- a/backend/render_handler_cairo.cpp  2009-04-15 13:10:54 +0000
+++ b/backend/Renderer_cairo.cpp        2009-07-13 07:07:59 +0000
@@ -36,7 +36,7 @@
 
 #include <cairo/cairo.h>
 #include <boost/scoped_array.hpp>
-#include "render_handler.h"
+#include "Renderer.h"
 #include "GnashImage.h"
 #include <cmath>
 #include "PathParser.h"
@@ -402,13 +402,13 @@
 };
 
 
-class DSOEXPORT render_handler_cairo: public render_handler
+class DSOEXPORT Renderer_cairo: public Renderer
 {
   typedef std::vector<Path> PathVec;
   typedef std::vector<const Path*> PathPtrVec;
 public:
 
-  render_handler_cairo()
+  Renderer_cairo()
     : _video_bufsize(0),
       _drawing_mask(false)
   {    
@@ -416,7 +416,7 @@
     cairo_matrix_init_scale(&_stage_mat, 1/20.0f, 1/20.0f);
   }
   
-  ~render_handler_cairo()
+  ~Renderer_cairo()
   {
   }
 
@@ -1051,7 +1051,7 @@
     }   
   }
   
-  bool getPixel(rgba& color_return, int x, int y)
+  bool getPixel(rgba& color_return, int x, int y) const
   {
     if (x < 0 || y < 0) {
       return false;
@@ -1091,7 +1091,7 @@
   InvalidatedRanges _invalidated_ranges;
   cairo_matrix_t _stage_mat;
     
-}; // class render_handler_cairo
+}; // class Renderer_cairo
 
 
 
@@ -1103,17 +1103,17 @@
 namespace cairo
 {
 
-DSOEXPORT render_handler*
+DSOEXPORT Renderer*
 create_handler()
 // Factory.
 {
-       return new render_handler_cairo();
+       return new Renderer_cairo();
 }
 
 DSOEXPORT void
-set_context(render_handler* handler, cairo_t* context)
+set_context(Renderer* handler, cairo_t* context)
 {
-  render_handler_cairo* cairo_handler = 
static_cast<render_handler_cairo*>(handler);
+  Renderer_cairo* cairo_handler = static_cast<Renderer_cairo*>(handler);
   cairo_handler->set_context(context);
 }
 

=== renamed file 'backend/render_handler_cairo.h' => 'backend/Renderer_cairo.h'
--- a/backend/render_handler_cairo.h    2009-02-25 22:33:03 +0000
+++ b/backend/Renderer_cairo.h  2009-07-10 15:44:55 +0000
@@ -20,7 +20,7 @@
 #define BACKEND_RENDER_HANDLER_CAIRO_H
 
 #include <cairo/cairo.h>
-#include "render_handler.h"
+#include "Renderer.h"
 
 namespace gnash {
 namespace renderer {
@@ -29,10 +29,10 @@
 namespace cairo {
 
 /// Create a render handler
-gnash::render_handler* create_handler();
+gnash::Renderer* create_handler();
 
 /// Make sure to call this before starting display
-void set_context(render_handler* handler, cairo_t* context);
+void set_context(Renderer* handler, cairo_t* context);
 
 } // namespace gnash::renderer::cairo
 } // namespace gnash::renderer

=== renamed file 'backend/render_handler_ogl.cpp' => 'backend/Renderer_ogl.cpp'
--- a/backend/render_handler_ogl.cpp    2009-04-15 13:10:54 +0000
+++ b/backend/Renderer_ogl.cpp  2009-07-13 07:07:59 +0000
@@ -23,7 +23,7 @@
 #include <cstring>
 #include <cmath>
 
-#include "render_handler.h"
+#include "Renderer.h"
 #include "swf/ShapeRecord.h"
 #include "gnash.h"
 #include "RGBA.h"
@@ -38,12 +38,12 @@
 #  include <Windows.h>
 #endif
 
-#include "render_handler_ogl.h"
+#include "Renderer_ogl.h"
 
 #include <boost/utility.hpp>
 #include <boost/bind.hpp>
 
-/// \file render_handler_ogl.cpp
+/// \file Renderer_ogl.cpp
 /// \brief The OpenGL renderer and related code.
 ///
 /// So how does this thing work?
@@ -584,10 +584,10 @@
 
 
 
-class DSOEXPORT render_handler_ogl : public render_handler, boost::noncopyable
+class DSOEXPORT Renderer_ogl : public Renderer, boost::noncopyable
 {
 public: 
-  render_handler_ogl()
+  Renderer_ogl()
     : _xscale(1.0),
       _yscale(1.0),
       _drawing_mask(false)
@@ -639,7 +639,7 @@
   
   }
   
-  ~render_handler_ogl()
+  ~Renderer_ogl()
   {
   }
   
@@ -998,7 +998,7 @@
 
     // Call add_paths for each mask.
     std::for_each(_masks.begin(), _masks.end(),
-      boost::bind(&render_handler_ogl::add_paths, this, _1));    
+      boost::bind(&Renderer_ogl::add_paths, this, _1));    
           
     glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP);
     glStencilFunc(GL_EQUAL, _masks.size(), _masks.size());
@@ -1229,8 +1229,9 @@
         case SWF::FILL_FOCAL_GRADIENT:
         {
                     
-          const bitmap_info_ogl* binfo =
-              static_cast<const 
bitmap_info_ogl*>(style.need_gradient_bitmap());       
+          const bitmap_info_ogl* binfo = static_cast<const bitmap_info_ogl*>(
+                      style.need_gradient_bitmap(*this));       
+
           SWFMatrix m = style.getGradientMatrix();
           
           binfo->apply(m, bitmap_info_ogl::WRAP_CLAMP); 
@@ -1240,8 +1241,8 @@
         case SWF::FILL_TILED_BITMAP_HARD:
         case SWF::FILL_TILED_BITMAP:
         {
-            const bitmap_info_ogl* binfo =
-                static_cast<const bitmap_info_ogl*>(style.get_bitmap_info());
+            const bitmap_info_ogl* binfo = static_cast<const bitmap_info_ogl*>(
+                    style.get_bitmap_info(*this));
 
           binfo->apply(style.getBitmapMatrix(), bitmap_info_ogl::WRAP_REPEAT);
           break;
@@ -1251,8 +1252,8 @@
         // smooth=true;
         case SWF::FILL_CLIPPED_BITMAP_HARD:
         {     
-          const bitmap_info_ogl* binfo =
-              dynamic_cast<const bitmap_info_ogl*>(style.get_bitmap_info());
+          const bitmap_info_ogl* binfo = dynamic_cast<const bitmap_info_ogl*>(
+                  style.get_bitmap_info(*this));
           
           assert(binfo);
 
@@ -1700,7 +1701,7 @@
   }
 
 #ifdef OSMESA_TESTING
-  bool getPixel(rgba& color_out, int x, int y)
+  bool getPixel(rgba& color_out, int x, int y) const
   {  
     return _offscreen->getPixel(color_out, x, y);
   }
@@ -1740,12 +1741,12 @@
 #ifdef OSMESA_TESTING
   std::auto_ptr<OSRenderMesa> _offscreen;
 #endif
-}; // class render_handler_ogl
+}; // class Renderer_ogl
   
-render_handler* create_render_handler_ogl(bool init)
+Renderer* create_Renderer_ogl(bool init)
 // Factory.
 {
-  render_handler_ogl* renderer = new render_handler_ogl;
+  Renderer_ogl* renderer = new Renderer_ogl;
   if (init) {
     renderer->init();
   }

=== renamed file 'backend/render_handler_ogl.h' => 'backend/Renderer_ogl.h'
=== modified file 'cygnal/cvm.cpp'
--- a/cygnal/cvm.cpp    2009-06-15 16:27:26 +0000
+++ b/cygnal/cvm.cpp    2009-07-13 09:15:53 +0000
@@ -108,7 +108,7 @@
 };
 
 static boost::intrusive_ptr<gnash::movie_definition> play_movie(
-        const std::string& filename, const RunInfo& runInfo);
+        const std::string& filename, const RunResources& runResources);
 
 static bool s_do_output = false;
 static bool s_stop_on_errors = true;
@@ -362,11 +362,11 @@
             e = infiles.end(); i != e; ++i)
     {
 
-        RunInfo runInfo(*i);
-        runInfo.setSoundHandler(soundHandler);
+        RunResources runResources(*i);
+        runResources.setSoundHandler(soundHandler);
 
            boost::intrusive_ptr<gnash::movie_definition> m =
-            play_movie(*i, runInfo);
+            play_movie(*i, runResources);
            if (!m) {
                if (s_stop_on_errors) {
                    // Fail.
@@ -395,7 +395,7 @@
 //
 // Return the movie definition.
 boost::intrusive_ptr<gnash::movie_definition>
-play_movie(const std::string& filename, const RunInfo& runInfo)
+play_movie(const std::string& filename, const RunResources& runResources)
 {
     boost::intrusive_ptr<gnash::movie_definition> md;
 
@@ -407,7 +407,7 @@
       {
          std::auto_ptr<IOChannel> in (
                  noseek_fd_adapter::make_stream(fileno(stdin)) );
-         md = gnash::MovieFactory::makeMovie(in, filename, runInfo, false);
+         md = gnash::MovieFactory::makeMovie(in, filename, runResources, 
false);
       }
       else
       {
@@ -424,7 +424,7 @@
              log_debug(_("%s appended to local sandboxes"), path.c_str());
 #endif
          }
-         md = gnash::MovieFactory::makeMovie(url, runInfo, NULL, false);
+         md = gnash::MovieFactory::makeMovie(url, runResources, NULL, false);
       }
     }
     catch (GnashException& ge)
@@ -448,7 +448,7 @@
 
     // Use a clock advanced at every iteration to match exact FPS speed.
     ManualClock cl;
-    gnash::movie_root m(*md, cl, runInfo);
+    gnash::movie_root m(*md, cl, runResources);
     
     // Register processor to receive ActionScript events (Mouse, Stage
     // System etc).

=== modified file 'gui/GuiKde4.cpp'
--- a/gui/GuiKde4.cpp   2009-02-25 22:33:03 +0000
+++ b/gui/GuiKde4.cpp   2009-07-13 09:15:53 +0000
@@ -31,12 +31,12 @@
 namespace gnash {
 
 #ifdef GUI_KDE4
-std::auto_ptr<Gui> createKDE4Gui(unsigned long windowid, float scale, bool 
do_loop, unsigned int bit_depth)
+std::auto_ptr<Gui> createKDE4Gui(unsigned long windowid, float scale, bool 
do_loop, RunResources& r)
 {
-       return std::auto_ptr<Gui>(new Kde4Gui(windowid, scale, do_loop, 
bit_depth));
+       return std::auto_ptr<Gui>(new Kde4Gui(windowid, scale, do_loop, r));
 }
 #else // ! GUI_KDE4
-std::auto_ptr<Gui> createKDE4Gui(unsigned long , float , bool , unsigned int )
+std::auto_ptr<Gui> createKDE4Gui(unsigned long , float, bool, 
RunResourcesfloat , bool , unsigned int )
 {
        throw GnashException("Support for KDE4 gui was not compiled in");
 }

=== modified file 'gui/Kde4Glue.h'
--- a/gui/Kde4Glue.h    2009-05-22 21:29:17 +0000
+++ b/gui/Kde4Glue.h    2009-07-13 08:27:41 +0000
@@ -26,6 +26,9 @@
 #include <QWidget>
 #include "snappingrange.h"
 
+namespace gnash {
+    class Renderer;
+}
 
 namespace gnash
 {
@@ -38,7 +41,7 @@
     virtual bool init(int argc, char **argv[]) = 0;
 
     virtual void prepDrawingArea(QWidget *drawing_area) = 0;
-    virtual render_handler* createRenderHandler() = 0;
+    virtual Renderer* createRenderHandler() = 0;
     virtual void render() = 0;
     virtual void render(const QRect& updateRect) = 0;
     virtual void setInvalidatedRegions(const InvalidatedRanges& /* ranges */) 
{}

=== modified file 'gui/Kde4GlueAgg.cpp'
--- a/gui/Kde4GlueAgg.cpp       2009-05-22 21:29:17 +0000
+++ b/gui/Kde4GlueAgg.cpp       2009-07-10 15:44:55 +0000
@@ -21,8 +21,8 @@
 #endif
 
 #include "Kde4GlueAgg.h"
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 #include <QImage>
 #include <QRect>
 
@@ -74,8 +74,8 @@
 
     _offscreenbuf.reset(new unsigned char[bufsize]);
 
-    render_handler_agg_base * renderer =
-      static_cast<render_handler_agg_base *>(_renderer);
+    Renderer_agg_base * renderer =
+      static_cast<Renderer_agg_base *>(_renderer);
 
     renderer->init_buffer(_offscreenbuf.get(), bufsize, _width, _height,
       width*((_bpp+7)/8));
@@ -108,10 +108,10 @@
 }
 
 
-render_handler*
+Renderer*
 Kde4AggGlue::createRenderHandler()
 {
-    _renderer = create_render_handler_agg("BGRA32");
+    _renderer = create_Renderer_agg("BGRA32");
 
     if ( ! _renderer )
     {

=== modified file 'gui/Kde4GlueAgg.h'
--- a/gui/Kde4GlueAgg.h 2009-02-25 22:33:03 +0000
+++ b/gui/Kde4GlueAgg.h 2009-07-10 15:44:55 +0000
@@ -43,7 +43,7 @@
     
     bool init(int argc, char **argv[]);
     void prepDrawingArea(QWidget *drawing_area);
-    render_handler* createRenderHandler();
+    Renderer* createRenderHandler();
     void initBuffer(int width, int height);
     void resize(int width, int height);
     void render();
@@ -53,7 +53,7 @@
     int _width;
     int _height;
     boost::scoped_array<unsigned char> _offscreenbuf;
-    render_handler* _renderer; // We don't own this pointer.
+    Renderer* _renderer; // We don't own this pointer.
     std::auto_ptr<QImage> _image;
     std::auto_ptr<QPainter> _painter;
 };

=== modified file 'gui/Kde4GlueCairo.cpp'
--- a/gui/Kde4GlueCairo.cpp     2009-06-28 18:57:46 +0000
+++ b/gui/Kde4GlueCairo.cpp     2009-07-10 15:44:55 +0000
@@ -21,8 +21,8 @@
 #endif
 
 #include "Kde4GlueCairo.h"
-#include "render_handler.h"
-#include "render_handler_cairo.h"
+#include "Renderer.h"
+#include "Renderer_cairo.h"
 #include <QRect>
 
 namespace gnash
@@ -136,7 +136,7 @@
 
 
 
-render_handler*
+Renderer*
 Kde4CairoGlue::createRenderHandler()
 {
     _renderer = renderer::cairo::create_handler();

=== modified file 'gui/Kde4GlueCairo.h'
--- a/gui/Kde4GlueCairo.h       2009-06-28 18:57:46 +0000
+++ b/gui/Kde4GlueCairo.h       2009-07-10 15:44:55 +0000
@@ -46,7 +46,7 @@
     bool init(int argc, char **argv[]);
     void initBuffer(int width, int height);
     void prepDrawingArea(QWidget *drawing_area);
-    render_handler* createRenderHandler();
+    Renderer* createRenderHandler();
     void render();
     void render(const QRect& updateRect);
     void resize(int width, int height);
@@ -55,7 +55,7 @@
     int _width;
     int _height;
     boost::scoped_array<unsigned char> _offscreenbuf;
-    render_handler* _renderer; // We don't own this pointer.
+    Renderer* _renderer; // We don't own this pointer.
     std::auto_ptr<QImage> _image;
     std::auto_ptr<QPainter> _painter;
 

=== modified file 'gui/Kde4GlueOgl.cpp'
--- a/gui/Kde4GlueOgl.cpp       2009-06-28 18:55:05 +0000
+++ b/gui/Kde4GlueOgl.cpp       2009-07-10 15:44:55 +0000
@@ -21,7 +21,7 @@
 #endif
 
 #include "Kde4GlueOgl.h"
-#include "render_handler.h"
+#include "Renderer.h"
 #include <QRect>
 #include <QGLWidget>
 
@@ -71,10 +71,10 @@
 }
 
 
-render_handler*
+Renderer*
 Kde4OglGlue::createRenderHandler()
 {
-    _renderer = create_render_handler_ogl();
+    _renderer = create_Renderer_ogl();
 
     if ( ! _renderer )
     {

=== modified file 'gui/Kde4GlueOgl.h'
--- a/gui/Kde4GlueOgl.h 2009-06-28 18:55:05 +0000
+++ b/gui/Kde4GlueOgl.h 2009-07-10 15:44:55 +0000
@@ -43,14 +43,14 @@
     
     bool init(int argc, char **argv[]);
     void prepDrawingArea(QWidget *drawing_area);
-    render_handler* createRenderHandler();
+    Renderer* createRenderHandler();
     void render();
     void render(const QRect& updateRect);
 
   private:
     int _width;
     int _height;
-    render_handler* _renderer; // We don't own this pointer.
+    Renderer* _renderer; // We don't own this pointer.
 };
 
 

=== modified file 'gui/Kde4Gui.cpp'
--- a/gui/Kde4Gui.cpp   2009-04-13 15:08:49 +0000
+++ b/gui/Kde4Gui.cpp   2009-07-13 09:15:53 +0000
@@ -62,8 +62,8 @@
 #include "gui.h"
 #include "Kde4Gui.h"
 #include "klash4.moc"
-#include "render_handler.h"
-#include "utility.h" // for pixelsToTwips 
+#include "Renderer.h"
+#include "RunResources.h" 
 
 // Macro for using gettext strings where Qt expects QStrings
 #define _q(Str) QString::fromUtf8(_(Str))
@@ -75,8 +75,8 @@
 namespace gnash 
 {
 
-Kde4Gui::Kde4Gui(unsigned long xid, float scale, bool loop, unsigned int depth)
- : Gui(xid, scale, loop, depth)
+Kde4Gui::Kde4Gui(unsigned long xid, float scale, bool loop, RunResources& r)
+ : Gui(xid, scale, loop, r)
 {
 }
 
@@ -153,16 +153,20 @@
 
     _glue.prepDrawingArea(_drawingWidget);
 
-    _renderer = _glue.createRenderHandler();
+    _renderer.reset(_glue.createRenderHandler());
 
-    if ( ! _renderer ) {
+    if (!_renderer.get()) {
         return false;
     }
 
     _validbounds.setTo(0, 0, _width, _height);
     _glue.initBuffer(_width, _height);
     
-    set_render_handler(_renderer);
+    log_debug("Setting renderer");
+
+    _runResources.setRenderer(_renderer);
+    
+    log_debug("Set renderer");
    
     return true;
 }

=== modified file 'gui/Kde4Gui.h'
--- a/gui/Kde4Gui.h     2009-06-28 19:00:56 +0000
+++ b/gui/Kde4Gui.h     2009-07-13 09:15:53 +0000
@@ -122,7 +122,7 @@
 {
 
 public:
-    Kde4Gui(unsigned long xid, float scale, bool loop, unsigned int depth);
+    Kde4Gui(unsigned long xid, float scale, bool loop, RunResources& r);
     virtual ~Kde4Gui();
     virtual bool init(int argc, char **argv[]);
     virtual bool createWindow(const char* windowtitle, int width, int height);

=== modified file 'gui/NullGui.h'
--- a/gui/NullGui.h     2009-02-25 22:33:03 +0000
+++ b/gui/NullGui.h     2009-07-13 09:15:53 +0000
@@ -33,9 +33,9 @@
 
 public: 
 
-       NullGui(bool do_loop)
+       NullGui(bool do_loop, RunResources& r)
                :
-               Gui(0,0,do_loop,0),
+               Gui(0,0,do_loop, r),
                _timeout(0),
                _quit(false)
        {}

=== modified file 'gui/Player.cpp'
--- a/gui/Player.cpp    2009-06-19 18:46:22 +0000
+++ b/gui/Player.cpp    2009-07-13 09:30:28 +0000
@@ -236,7 +236,7 @@
     }
     else
     {
-        _gui.reset(new NullGui(_doLoop));
+        _gui.reset(new NullGui(_doLoop, *_runResources));
     }
 
     _gui->setMaxAdvances(_maxAdvances);
@@ -253,9 +253,9 @@
 boost::intrusive_ptr<movie_definition>
 Player::load_movie()
 {
-    /// The RunInfo must be initialized by this point to provide resources
+    /// The RunResources must be initialized by this point to provide resources
     /// for parsing.
-    assert(_runInfo.get());
+    assert(_runResources.get());
 
     boost::intrusive_ptr<gnash::movie_definition> md;
 
@@ -276,7 +276,7 @@
         {
             std::auto_ptr<IOChannel> in (
                     noseek_fd_adapter::make_stream(fileno(stdin)));
-            md = MovieFactory::makeMovie(in, _url, *_runInfo, false);
+            md = MovieFactory::makeMovie(in, _url, *_runResources, false);
         }
         else
         {
@@ -296,7 +296,7 @@
             }
 
             // _url should be always set at this point...
-            md = MovieFactory::makeMovie(url, *_runInfo, _url.c_str(),
+            md = MovieFactory::makeMovie(url, *_runResources, _url.c_str(),
                     false);
         }
     } catch (const GnashException& er) {
@@ -325,7 +325,6 @@
     init_logfile();
     init_media();
     init_sound();
-    init_gui();
    
     // gnash.cpp should check that a filename is supplied.
     assert (!infile.empty());
@@ -347,6 +346,29 @@
         _url = infile;
     }
 
+    // These flags are here so we can construct
+    // the correct URL for base url later.
+    // If the URL class was not immutable we could do something smarter...
+    bool hasOverriddenBaseUrl=false;
+    std::string overriddenBaseUrl;
+
+    URL baseURL = hasOverriddenBaseUrl ? URL(overriddenBaseUrl, URL(_baseurl))
+                                       : URL(_baseurl);
+
+    /// The RunResources should be populated before parsing.
+    _runResources.reset(new RunResources(baseURL.str()));
+    _runResources->setSoundHandler(_soundHandler);
+
+    boost::shared_ptr<SWF::TagLoadersTable> loaders(new 
SWF::TagLoadersTable());
+    addDefaultLoaders(*loaders);
+    _runResources->setTagLoaders(loaders);
+
+    std::auto_ptr<NamingPolicy> np(new IncrementalRename(_baseurl));
+    boost::shared_ptr<StreamProvider> sp(new StreamProvider(np));
+
+    _runResources->setStreamProvider(sp);
+    
+    init_gui();
 
     // Initialize gui (we need argc/argv for this)
     // note that this will also initialize the renderer
@@ -357,15 +379,10 @@
         return EXIT_FAILURE;
     }
 
-    // Parse querystring (before FlashVars, see 
testsuite/misc-ming.all/FlashVarsTest*)
+    // Parse querystring (before FlashVars, see
+    // testsuite/misc-ming.all/FlashVarsTest*)
     setFlashVars(URL(_url).querystring());
-
-    // These flags are here so we can construct
-    // the correct URL for base url later.
-    // If the URL class was not immutable we could do something smarter...
-    bool hasOverriddenBaseUrl=false;
-    std::string overriddenBaseUrl;
-
+    
     // Parse parameters
     StringNoCaseEqual noCaseCompare;
     for ( std::map<std::string,std::string>::const_iterator it=params.begin(),
@@ -385,21 +402,6 @@
         }
     }
 
-    URL baseURL = hasOverriddenBaseUrl ? URL(overriddenBaseUrl, URL(_baseurl))
-                                       : URL(_baseurl);
-
-    /// The RunInfo should be populated before parsing.
-    _runInfo.reset(new RunInfo(baseURL.str()));
-    _runInfo->setSoundHandler(_soundHandler);
-
-    boost::shared_ptr<SWF::TagLoadersTable> loaders(new 
SWF::TagLoadersTable());
-    addDefaultLoaders(*loaders);
-    _runInfo->setTagLoaders(loaders);
-
-    std::auto_ptr<NamingPolicy> np(new IncrementalRename(_baseurl));
-    boost::shared_ptr<StreamProvider> sp(new StreamProvider(np));
-
-    _runInfo->setStreamProvider(sp);
 
     // Load the actual movie.
     _movieDef = load_movie();
@@ -435,7 +437,7 @@
     // Now that we know about movie size, create gui window.
     _gui->createWindow(_url.c_str(), _width, _height);
 
-    movie_root root(*_movieDef, _gui->getClock(), *_runInfo);
+    movie_root root(*_movieDef, _gui->getClock(), *_runResources);
 
     _callbacksHandler.reset(new CallbacksHandler(*_gui, *this)); 
     
@@ -712,46 +714,46 @@
 Player::getGui()
 {
 #ifdef GUI_GTK
-    return createGTKGui(_windowID, _scale, _doLoop, _bitDepth);
+    return createGTKGui(_windowID, _scale, _doLoop, *_runResources);
 #endif
 
 #ifdef GUI_KDE3
-    return createKDEGui(_windowID, _scale, _doLoop, _bitDepth);
+    return createKDEGui(_windowID, _scale, _doLoop, *_runResources);
 #endif
 
 #ifdef GUI_KDE4
-    return createKDE4Gui(_windowID, _scale, _doLoop, _bitDepth);
+    return createKDE4Gui(_windowID, _scale, _doLoop, *_runResources);
 #endif
 
 #ifdef GUI_SDL
-    return createSDLGui(_windowID, _scale, _doLoop, _bitDepth);
+    return createSDLGui(_windowID, _scale, _doLoop, *_runResources);
 #endif
 
 #ifdef GUI_AQUA
-    return createAQUAGui(_windowID, _scale, _doLoop, _bitDepth);
+    return createAQUAGui(_windowID, _scale, _doLoop, *_runResources);
 #endif
 
 #ifdef GUI_RISCOS
-    return createRISCOSGui(_windowID, _scale, _doLoop, _bitDepth);
+    return createRISCOSGui(_windowID, _scale, _doLoop, *_runResources);
 #endif
 
 #ifdef GUI_FLTK
-    return createFLTKGui(_windowID, _scale, _doLoop, _bitDepth);
+    return createFLTKGui(_windowID, _scale, _doLoop, *_runResources);
 #endif
 
 #ifdef GUI_FB
-    return createFBGui(_windowID, _scale, _doLoop, _bitDepth);
+    return createFBGui(_windowID, _scale, _doLoop, *_runResources);
 #endif
 
 #ifdef GUI_AOS4
-    return createAOS4Gui(_windowID, _scale, _doLoop, _bitDepth);
+    return createAOS4Gui(_windowID, _scale, _doLoop, *_runResources);
 #endif
 
 #ifdef GUI_DUMP
-    return createDumpGui(_windowID, _scale, _doLoop, _bitDepth);
+    return createDumpGui(_windowID, _scale, _doLoop, *_runResources);
 #endif
 
-    return std::auto_ptr<Gui>(new NullGui(_doLoop));
+    return std::auto_ptr<Gui>(new NullGui(_doLoop, *_runResources));
 }
 
 Player::~Player()

=== modified file 'gui/Player.h'
--- a/gui/Player.h      2009-02-25 22:33:03 +0000
+++ b/gui/Player.h      2009-07-13 09:15:53 +0000
@@ -30,7 +30,7 @@
 #include "movie_definition.h" // for visibility of movie_definition destructor
 #include "smart_ptr.h" // for intrusive_ptr holding of top-level movie
 #include "movie_root.h" // for Abstract callbacks
-#include "RunInfo.h" // for passing handlers and other data to the core.
+#include "RunResources.h" // for passing handlers and other data to the core.
 
 #include <string>
 #include <boost/shared_ptr.hpp>
@@ -250,10 +250,10 @@
     /// Initialization / destruction order is important here.
     //
     /// some sound_samples are destroyed in the dtor of SWFMovieDefinition,
-    /// which is called by the Gui's dtor. This means that the RunInfo
+    /// which is called by the Gui's dtor. This means that the RunResources
     /// and sound::sound_handler must still be alive. Initializing them
     /// later ensures that this is the case. It is still a good idea to
-    /// initialize _gui after _runInfo.
+    /// initialize _gui after _runResources.
     //
     /// Moreover, _movieDef (the SWFMovieDefinition) would also prevent
     /// destruction of a SWFMovieDefinition if it is not initialized after
@@ -261,7 +261,7 @@
     //
     /// @todo   This is hairy, and the core should be sorted out so that
     ///         sound_sample knows about its sound::sound_handler without
-    ///         needing a RunInfo.
+    ///         needing a RunResources.
     boost::shared_ptr<sound::sound_handler> _soundHandler;
 
        std::auto_ptr<media::MediaHandler> _mediaHandler;
@@ -270,9 +270,9 @@
     //
     /// This must be kept alive for the entire lifetime of the movie_root
     /// (currently: of the Gui).
-    std::auto_ptr<RunInfo> _runInfo;
+    std::auto_ptr<RunResources> _runResources;
 
-    /// This must be initialized after _runInfo
+    /// This must be initialized after _runResources
        std::auto_ptr<Gui> _gui;
 
     std::string _url;

=== modified file 'gui/aos4.cpp'
--- a/gui/aos4.cpp      2009-06-28 17:11:37 +0000
+++ b/gui/aos4.cpp      2009-07-13 09:15:53 +0000
@@ -73,8 +73,8 @@
 namespace gnash
 {
 
-AOS4Gui::AOS4Gui(unsigned long xid, float scale, bool loop, unsigned int depth)
- : Gui(xid, scale, loop, depth),
+AOS4Gui::AOS4Gui(unsigned long xid, float scale, bool loop, RunResources& r)
+ : Gui(xid, scale, loop, r),
    _timeout(0),
    _core_trap(true)
 {
@@ -622,7 +622,7 @@
 
     _glue.prepDrawingArea(_width, _height);
 
-    set_render_handler(_renderer);
+    set_Renderer(_renderer);
 
        struct Window *_window = _glue.getWindow();
 

=== modified file 'gui/aos4_agg_glue.cpp'
--- a/gui/aos4_agg_glue.cpp     2009-06-28 17:11:37 +0000
+++ b/gui/aos4_agg_glue.cpp     2009-07-10 15:44:55 +0000
@@ -21,8 +21,8 @@
 #include "gnash.h"
 #include "log.h"
 #undef ACTION_END
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 #include <cerrno>
 #include <ostream>
 
@@ -91,24 +91,24 @@
 }
 
 
-render_handler*
+Renderer*
 AOS4AggGlue::createRenderHandler(int bpp)
 {
     _bpp = bpp;
 
     switch (_bpp) {
       case 32:
-        _agg_renderer = create_render_handler_agg("RGBA32");
+        _agg_renderer = create_Renderer_agg("RGBA32");
         _btype        = BLITT_ARGB32;
         _ftype           = RGBFB_R8G8B8;
         break;
       case 24:
-        _agg_renderer = create_render_handler_agg("RGB24");
+        _agg_renderer = create_Renderer_agg("RGB24");
         _btype        = BLITT_RGB24;
         _ftype                   = RGBFB_R8G8B8;
         break;
       case 16:
-        _agg_renderer = create_render_handler_agg("RGBA16");
+        _agg_renderer = create_Renderer_agg("RGBA16");
         _btype        = BLITT_CHUNKY;
         _ftype           = RGBFB_R5G6B5;
         break;
@@ -119,13 +119,13 @@
     return _agg_renderer;
 }
 
-render_handler*
+Renderer*
 AOS4AggGlue::createRenderHandler()
 {
 //    GNASH_REPORT_FUNCTION;
     _bpp = 24;
 
-    _agg_renderer = create_render_handler_agg("RGB24");
+    _agg_renderer = create_Renderer_agg("RGB24");
     _btype        = BLITT_RGB24;
 
     return _agg_renderer;
@@ -267,7 +267,7 @@
     // Only the AGG renderer has the function init_buffer, which is *not* part 
of
     // the renderer api. It allows us to change the renderers movie size (and 
buffer
     // address) during run-time.
-    render_handler_agg_base *renderer = static_cast<render_handler_agg_base 
*>(_agg_renderer);
+    Renderer_agg_base *renderer = static_cast<Renderer_agg_base 
*>(_agg_renderer);
     renderer->init_buffer(_offscreenbuf, bufsize, width, height, 
width*((_bpp+7)/8));
 
        struct RenderInfo ri;

=== modified file 'gui/aos4_agg_glue.h'
--- a/gui/aos4_agg_glue.h       2009-06-03 20:34:33 +0000
+++ b/gui/aos4_agg_glue.h       2009-07-10 15:44:55 +0000
@@ -18,8 +18,8 @@
 #include "aos4_glue.h"
 #include "gnash.h"
 #undef ACTION_END
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 
 #include <proto/intuition.h>
 #include <proto/graphics.h>
@@ -41,8 +41,8 @@
            virtual ~AOS4AggGlue();
 
        bool                     init(int argc, char **argv[]);
-           render_handler      *createRenderHandler(int depth);
-       render_handler  *createRenderHandler();
+           Renderer    *createRenderHandler(int depth);
+       Renderer        *createRenderHandler();
            bool                         prepDrawingArea(int width, int height);
            void                         render();
        void                     render(int minx, int miny, int maxx, int maxy);
@@ -57,7 +57,7 @@
        geometry::Range2d<int> _validbounds;
            std::vector< geometry::Range2d<int> > _drawbounds;
        unsigned char           *_offscreenbuf;
-           render_handler      *_agg_renderer;
+           Renderer    *_agg_renderer;
        struct Window           *_window;
        struct Screen           *_screen;
                bool                             _fullscreen;

=== modified file 'gui/aos4_cairo_glue.cpp'
--- a/gui/aos4_cairo_glue.cpp   2009-06-30 18:39:26 +0000
+++ b/gui/aos4_cairo_glue.cpp   2009-07-10 15:44:55 +0000
@@ -21,8 +21,8 @@
 #include "gnash.h"
 #include "log.h"
 #undef ACTION_END
-#include "render_handler.h"
-#include "render_handler_cairo.h"
+#include "Renderer.h"
+#include "Renderer_cairo.h"
 #include <cerrno>
 #include <ostream>
 
@@ -97,7 +97,7 @@
 }
 
 
-render_handler*
+Renderer*
 AOS4CairoGlue::createRenderHandler(int depth)
 {
 //    GNASH_REPORT_FUNCTION;
@@ -128,7 +128,7 @@
     return _cairo_renderer;
 }
 
-render_handler*
+Renderer*
 AOS4CairoGlue::createRenderHandler()
 {
     _bpp = 24;

=== modified file 'gui/aos4_cairo_glue.h'
--- a/gui/aos4_cairo_glue.h     2009-06-30 18:39:26 +0000
+++ b/gui/aos4_cairo_glue.h     2009-07-10 15:44:55 +0000
@@ -18,8 +18,8 @@
 #include "aos4_glue.h"
 #include "gnash.h"
 #undef ACTION_END
-#include "render_handler.h"
-#include "render_handler_cairo.h"
+#include "Renderer.h"
+#include "Renderer_cairo.h"
 
 #include <proto/intuition.h>
 #include <proto/graphics.h>
@@ -43,8 +43,8 @@
            virtual ~AOS4CairoGlue();
 
        bool                             init(int argc, char **argv[]);
-           render_handler              *createRenderHandler(int depth);
-       render_handler          *createRenderHandler();
+           Renderer            *createRenderHandler(int depth);
+       Renderer                *createRenderHandler();
            bool                                 prepDrawingArea(int width, int 
height);
            void                                 render();
        void                             render(int minx, int miny, int maxx, 
int maxy);
@@ -61,7 +61,7 @@
                cairo_surface_t         *_cairo_surface;
                cairo_t                 *_cairo_handle;
        unsigned char           *_offscreenbuf;
-           render_handler      *_cairo_renderer;
+           Renderer    *_cairo_renderer;
        struct Window           *_window;
        struct Screen           *_screen;
                bool                             _fullscreen;

=== modified file 'gui/aos4_glue.h'
--- a/gui/aos4_glue.h   2009-05-19 20:18:37 +0000
+++ b/gui/aos4_glue.h   2009-07-10 15:44:55 +0000
@@ -31,8 +31,8 @@
     virtual bool init(int argc, char **argv[]) = 0;
 
     virtual bool prepDrawingArea(int width, int height) = 0;
-    virtual render_handler* createRenderHandler(int depth) = 0;
-    virtual render_handler* createRenderHandler() = 0;
+    virtual Renderer* createRenderHandler(int depth) = 0;
+    virtual Renderer* createRenderHandler() = 0;
     virtual void render() = 0;
   protected:
     int _bpp;

=== modified file 'gui/aos4sup.h'
--- a/gui/aos4sup.h     2009-06-28 15:49:26 +0000
+++ b/gui/aos4sup.h     2009-07-13 09:15:53 +0000
@@ -58,8 +58,8 @@
 #define End TAG_END
 
 #undef ACTION_END
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 
 static struct TimeVal os4timer_starttime;
 
@@ -69,7 +69,7 @@
 class AOS4Gui : public Gui
 {
 public:
-    AOS4Gui(unsigned long xid, float scale, bool loop, unsigned int depth);
+    AOS4Gui(unsigned long xid, float scale, bool loop, RunResources& r);
     virtual ~AOS4Gui();
     virtual bool init(int argc, char **argv[]);
     virtual bool createWindow(const char *title, int width, int height);

=== modified file 'gui/aqua.cpp'
--- a/gui/aqua.cpp      2009-02-25 22:33:03 +0000
+++ b/gui/aqua.cpp      2009-07-13 09:15:53 +0000
@@ -33,7 +33,7 @@
 #include "log.h"
 #include "movie_root.h"
 
-#include "render_handler.h"
+#include "Renderer.h"
 
 #include <Carbon/Carbon.h>
 
@@ -57,8 +57,8 @@
 }
   
        
-AquaGui::AquaGui(unsigned long xid, float scale, bool loop, unsigned int depth)
-       : Gui(xid, scale, loop, depth),
+AquaGui::AquaGui(unsigned long xid, float scale, bool loop, RunResources& r)
+       : Gui(xid, scale, loop, r),
           _advance_timer(NULL)
 {
 }
@@ -121,7 +121,7 @@
     _renderer = _glue.createRenderHandler();
     if(!_renderer)return false;
 
-    set_render_handler(_renderer);
+    set_Renderer(_renderer);
     return true;
 
 }

=== modified file 'gui/aqua_glue.h'
--- a/gui/aqua_glue.h   2009-02-25 22:33:03 +0000
+++ b/gui/aqua_glue.h   2009-07-10 15:44:55 +0000
@@ -32,7 +32,7 @@
     virtual ~AquaGlue() { }
     virtual bool init(int argc, char **argv[]) = 0;
     virtual bool prepDrawingArea(int width, int height, AGLDrawable drawable) 
= 0;
-    virtual render_handler* createRenderHandler() = 0;
+    virtual Renderer* createRenderHandler() = 0;
     virtual void render() = 0;
   protected:
     int _bpp;

=== modified file 'gui/aqua_ogl_glue.cpp'
--- a/gui/aqua_ogl_glue.cpp     2009-02-25 22:33:03 +0000
+++ b/gui/aqua_ogl_glue.cpp     2009-07-10 15:44:55 +0000
@@ -83,10 +83,10 @@
     return ret; 
 }
 
-render_handler* AquaOglGlue::createRenderHandler()
+Renderer* AquaOglGlue::createRenderHandler()
 {
 //    GNASH_REPORT_FUNCTION;
-    render_handler* renderer = create_render_handler_ogl();
+    Renderer* renderer = create_Renderer_ogl();
 #ifdef FIX_I810_LOD_BIAS
     glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 
_tex_lod_bias);
 #endif

=== modified file 'gui/aqua_ogl_glue.h'
--- a/gui/aqua_ogl_glue.h       2009-02-25 22:33:03 +0000
+++ b/gui/aqua_ogl_glue.h       2009-07-10 15:44:55 +0000
@@ -33,7 +33,7 @@
     virtual ~AquaOglGlue();
 
     bool init(int argc, char ***argv);
-    render_handler* createRenderHandler();
+    Renderer* createRenderHandler();
     bool prepDrawingArea(int width, int height, AGLDrawable drawable);
     void setInvalidatedRegions(const InvalidatedRanges& /* ranges */);
     void render();

=== modified file 'gui/aquasup.h'
--- a/gui/aquasup.h     2009-02-25 22:33:03 +0000
+++ b/gui/aquasup.h     2009-07-13 09:15:53 +0000
@@ -57,7 +57,7 @@
 #endif
        
        public:
-       AquaGui(unsigned long xid, float scale, bool loop, unsigned int depth);
+       AquaGui(unsigned long xid, float scale, bool loop, RunResources& r);
     virtual ~AquaGui();
     virtual bool init(int argc, char ***argv);
     virtual void setCursor(gnash_cursor_type newcursor);

=== modified file 'gui/dump.cpp'
--- a/gui/dump.cpp      2009-02-25 22:33:03 +0000
+++ b/gui/dump.cpp      2009-07-13 10:43:39 +0000
@@ -31,9 +31,10 @@
 #include "gui.h"
 #include "rc.h"
 #include "sound_handler.h"
-#include "render_handler.h"
+#include "Renderer.h"
 #include "VM.h"
 #include "GnashSleep.h"
+#include "RunResources.h"
 
 #include <iostream>
 #include <string>
@@ -62,7 +63,7 @@
 #endif
 
 #include "dump.h"
-#include "render_handler_agg.h"
+#include "Renderer_agg.h"
 
 namespace gnash 
 {
@@ -80,8 +81,8 @@
 
 // TODO:  Let user decide bits-per-pixel
 // TODO:  let user decide colorspace (see also _bpp above!)
-DumpGui::DumpGui(unsigned long xid, float scale, bool loop, unsigned int 
depth) :
-    Gui(xid, scale, loop, depth),
+DumpGui::DumpGui(unsigned long xid, float scale, bool loop, RunResources& r) :
+    Gui(xid, scale, loop, r),
     _agg_renderer(NULL),
     _offscreenbuf(NULL),
     _offscreenbuf_size(-1),
@@ -140,8 +141,8 @@
 #endif
 
     init_dumpfile();
-    _agg_renderer = create_render_handler_agg(_pixelformat.c_str());
-    set_render_handler(_agg_renderer);
+    _agg_renderer = create_Renderer_agg(_pixelformat.c_str());
+    _runResources.setRenderer(boost::shared_ptr<Renderer>(_agg_renderer));
 
     return true;
 }
@@ -311,7 +312,7 @@
             log_error("Could not allocate %i bytes for offscreen buffer: %s",
                   newBufferSize, e.what());
                   
-              // TODO: what to do here? An assertion in render_handler_agg.cpp
+              // TODO: what to do here? An assertion in Renderer_agg.cpp
               // fails if we just return.
               return;
         }
@@ -320,7 +321,7 @@
 
     }
 
-    static_cast<render_handler_agg_base *> (_agg_renderer)->init_buffer
+    static_cast<Renderer_agg_base *> (_agg_renderer)->init_buffer
         (_offscreenbuf.get(),
          _offscreenbuf_size,
          _width,

=== modified file 'gui/dump.h'
--- a/gui/dump.h        2009-02-25 22:33:03 +0000
+++ b/gui/dump.h        2009-07-13 09:15:53 +0000
@@ -35,7 +35,7 @@
 class DSOEXPORT DumpGui : public Gui
 {
  public:
-    DumpGui(unsigned long xid, float scale, bool loop, unsigned int depth);
+    DumpGui(unsigned long xid, float scale, bool loop, RunResources& r);
     ~DumpGui();
     void beforeRendering();
     bool createMenu() { return true; }
@@ -64,7 +64,7 @@
     void writeFrame();
 
 private:
-    render_handler *_agg_renderer;      /* pointer to AGG renderer */
+    Renderer *_agg_renderer;      /* pointer to AGG renderer */
 
     // A buffer to hold the actual image data. A boost::scoped_array
     // is destroyed on reset and when it goes out of scope (including on

=== modified file 'gui/fb.cpp'
--- a/gui/fb.cpp        2009-07-01 15:34:48 +0000
+++ b/gui/fb.cpp        2009-07-13 10:43:39 +0000
@@ -87,9 +87,10 @@
 #include "fbsup.h"
 #include "log.h"
 #include "movie_root.h"
+#include "RunResources.h"
 
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 #include "GnashSleep.h" // for gnashSleep
 
 #include <linux/input.h>    // for /dev/input/event*
@@ -164,12 +165,8 @@
 
 //---------------
 
-FBGui::FBGui() : Gui()
-{
-}
-
-FBGui::FBGui(unsigned long xid, float scale, bool loop, unsigned int depth)
-  : Gui(xid, scale, loop, depth)
+FBGui::FBGui(unsigned long xid, float scale, bool loop, RunResources& r)
+  : Gui(xid, scale, loop, r)
 {
   fd      = -1;
   fbmem   = NULL;
@@ -299,7 +296,7 @@
   int _bpp = var_screeninfo.bits_per_pixel;
   int _size = fix_screeninfo.smem_len;   // TODO: should recalculate!  
   unsigned char *_mem;
-  render_handler_agg_base *agg_handler;
+  Renderer_agg_base *agg_handler;
   
   m_stage_width = _width;
   m_stage_height = _height;
@@ -336,16 +333,16 @@
   );
 
   if (pixelformat) {    
-    agg_handler = create_render_handler_agg(pixelformat);      
+    agg_handler = create_Renderer_agg(pixelformat);      
   } else {
     fatal_error("The pixel format of your framebuffer could not be detected.");
     return false;
   }
 
   assert(agg_handler!=NULL);
-  _renderer = agg_handler;
+  _renderer.reset(agg_handler);
 
-  set_render_handler(agg_handler);
+  _runResources.setRenderer(boost::shared_ptr<Renderer>(_renderer));
   
   m_rowsize = var_screeninfo.xres_virtual*((_bpp+7)/8);
   

=== modified file 'gui/fbsup.h'
--- a/gui/fbsup.h       2009-06-29 19:13:26 +0000
+++ b/gui/fbsup.h       2009-07-13 10:43:39 +0000
@@ -189,8 +189,7 @@
        int valid_y(int y);
                
        public:
-               FBGui();
-               FBGui(unsigned long xid, float scale, bool loop, unsigned int 
depth);
+               FBGui(unsigned long xid, float scale, bool loop, RunResources& 
r);
     virtual ~FBGui();
     virtual bool init(int argc, char ***argv);
     virtual bool createWindow(const char* title, int width, int height);

=== modified file 'gui/fltk.cpp'
--- a/gui/fltk.cpp      2009-02-25 22:33:03 +0000
+++ b/gui/fltk.cpp      2009-07-13 10:43:39 +0000
@@ -38,8 +38,9 @@
 #include "gnash.h"
 #include "gui.h"
 #include "VM.h"
+#include "RunResources.h"
 
-#include "render_handler.h"
+#include "Renderer.h"
 
 using namespace std;
 using namespace fltk;
@@ -50,9 +51,9 @@
 {
 
 
-FltkGui::FltkGui(unsigned long xid, float scale, bool loop, unsigned int depth)
+FltkGui::FltkGui(unsigned long xid, float scale, bool loop, RunResources& r)
   : Window(0, 0),
-    Gui(xid, scale, loop, depth),
+    Gui(xid, scale, loop, r),
     _menu_height(_xid ? 0 : 20)
 {
 }
@@ -254,9 +255,9 @@
     createMenu();
     end();
 
-    _renderer = _glue->createRenderHandler();
-    if ( ! _renderer ) return false;
-    set_render_handler(_renderer);
+    _renderer.reset(_glue->createRenderHandler());
+    if (!_renderer.get()) return false;
+    _runResources.setRenderer(_renderer);
 
     _glue->initBuffer(width, height);
 

=== modified file 'gui/fltk_glue_agg.cpp'
--- a/gui/fltk_glue_agg.cpp     2009-02-25 22:33:03 +0000
+++ b/gui/fltk_glue_agg.cpp     2009-07-10 15:44:55 +0000
@@ -26,8 +26,8 @@
 #include "fltk_glue_agg.h"
 #include "gnash.h"
 
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 
 using namespace std;
 
@@ -43,10 +43,10 @@
 {
 }
 
-render_handler*
+Renderer*
 FltkAggGlue::createRenderHandler()
 {
-    _renderer = create_render_handler_agg("RGB24");
+    _renderer = create_Renderer_agg("RGB24");
     return _renderer;
 }
 
@@ -71,8 +71,8 @@
     // Only the AGG renderer has the function init_buffer, which is *not* part 
of
     // the renderer api. It allows us to change the renderers movie size (and 
buffer
     // address) during run-time.
-    render_handler_agg_base * renderer =
-      static_cast<render_handler_agg_base *>(_renderer);
+    Renderer_agg_base * renderer =
+      static_cast<Renderer_agg_base *>(_renderer);
     renderer->init_buffer(_offscreenbuf, bufsize, width, height, 
       width*((_bpp+7)/8));
 

=== modified file 'gui/fltk_glue_agg.h'
--- a/gui/fltk_glue_agg.h       2009-02-25 22:33:03 +0000
+++ b/gui/fltk_glue_agg.h       2009-07-10 15:44:55 +0000
@@ -28,8 +28,8 @@
 #include "log.h"
 #include "gui.h"
 
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 
 using namespace fltk;
 
@@ -42,7 +42,7 @@
       ~FltkAggGlue();
      // resize(int width, int height);
       void draw();
-      render_handler* createRenderHandler();
+      Renderer* createRenderHandler();
       void initBuffer(int width, int height);
       void resize(int width, int height);
       void render(geometry::Range2d<int>& bounds);
@@ -53,7 +53,7 @@
       int _height;
       int _stride;
       unsigned char* _offscreenbuf;
-      render_handler* _renderer;
+      Renderer* _renderer;
       //Rectangle _bounds;
       geometry::Range2d<int> _drawbounds;
       geometry::Range2d<int> _validbounds;

=== modified file 'gui/fltk_glue_cairo.cpp'
--- a/gui/fltk_glue_cairo.cpp   2009-02-25 22:33:03 +0000
+++ b/gui/fltk_glue_cairo.cpp   2009-07-10 15:44:55 +0000
@@ -34,8 +34,8 @@
 #include <fltk/layout.h>
 #include <fltk/Cursor.h>
 
-#include "render_handler.h"
-#include "render_handler_cairo.h"
+#include "Renderer.h"
+#include "Renderer_cairo.h"
 
 #include "fltksup.h"
 #include "fltk_glue_cairo.h"
@@ -43,7 +43,7 @@
 #include "log.h"
 #include "gui.h"
 
-//#include "render_handler.h"
+//#include "Renderer.h"
 
 using namespace std;
 //using namespace fltk;
@@ -62,7 +62,7 @@
     delete [] _offscreenbuf;
 }
 
-render_handler*
+Renderer*
 FltkCairoGlue::createRenderHandler()
 {
     _renderer = renderer::cairo::create_handler();
@@ -101,7 +101,7 @@
     renderer::cairo::set_handle(_cairo_handle);
 
     if (firstTime) {
-      set_render_handler(_renderer);
+      set_Renderer(_renderer);
       firstTime = false;
     }
 

=== modified file 'gui/fltk_glue_cairo.h'
--- a/gui/fltk_glue_cairo.h     2009-02-25 22:33:03 +0000
+++ b/gui/fltk_glue_cairo.h     2009-07-10 15:44:55 +0000
@@ -54,7 +54,7 @@
       ~FltkCairoGlue();
      // resize(int width, int height);
       void draw();
-      render_handler* createRenderHandler();
+      Renderer* createRenderHandler();
       void initBuffer(int width, int height);
       void resize(int width, int height);
       void invalidateRegion(const rect& bounds);
@@ -63,7 +63,7 @@
       int _height;
       int _stride;
       unsigned char* _offscreenbuf;
-      render_handler* _renderer;
+      Renderer* _renderer;
       cairo_surface_t *_cairo_surface;
       cairo_t         *_cairo_handle;
 };

=== modified file 'gui/fltksup.h'
--- a/gui/fltksup.h     2009-02-25 22:33:03 +0000
+++ b/gui/fltksup.h     2009-07-13 09:15:53 +0000
@@ -41,7 +41,7 @@
 class FltkGui : public fltk::Window, public Gui
 {
 public:
-    FltkGui(unsigned long xid, float scale, bool loop, unsigned int depth);
+    FltkGui(unsigned long xid, float scale, bool loop, RunResources& r);
 
     virtual ~FltkGui();
     virtual bool init(int argc, char **argv[]);

=== modified file 'gui/gtk.cpp'
--- a/gui/gtk.cpp       2009-06-16 14:54:59 +0000
+++ b/gui/gtk.cpp       2009-07-13 09:15:53 +0000
@@ -28,7 +28,8 @@
 #include "rc.h"
 #include "gtksup.h"
 #include "sound_handler.h"
-#include "render_handler.h"
+#include "Renderer.h"
+#include "RunResources.h"
 #include "VM.h"
 #include "lirc.h"
 #include "gnash.h" // Quality
@@ -135,9 +136,9 @@
 {
 }
 
-GtkGui::GtkGui(unsigned long xid, float scale, bool loop, unsigned int depth)
+GtkGui::GtkGui(unsigned long xid, float scale, bool loop, RunResources& r)
        :
-       Gui(xid, scale, loop, depth)
+       Gui(xid, scale, loop, r)
 #ifdef GUI_HILDON
        ,_hildon_program(0)
 #endif
@@ -245,10 +246,10 @@
 #ifdef BUILD_CANVAS
     _renderer = gnash_canvas_get_renderer(GNASH_CANVAS(_canvas));
 #else
-    _renderer = _glue->createRenderHandler();
-    if ( ! _renderer ) return false;
-    set_render_handler(_renderer);
+    _renderer.reset(_glue->createRenderHandler());
+    if (!_renderer.get()) return false;
 #endif
+    _runResources.setRenderer(_renderer);
 
     // The first time stop() was called, stopHook() might not have had a chance
     // to do anything, because GTK+ wasn't garanteed to be initialised.

=== modified file 'gui/gtk_canvas.cpp'
--- a/gui/gtk_canvas.cpp        2009-06-04 16:52:25 +0000
+++ b/gui/gtk_canvas.cpp        2009-07-13 09:15:53 +0000
@@ -22,6 +22,7 @@
 #endif
 
 #include "gtk_canvas.h"
+#include "Renderer.h"
 
 #include "rc.h"
 #include "log.h"
@@ -46,7 +47,7 @@
        GtkDrawingArea base_instance;
 
     std::auto_ptr<gnash::GtkGlue> glue;
-    gnash::render_handler *renderer;
+    boost::shared_ptr<gnash::Renderer> renderer;
 };
 
 G_DEFINE_TYPE(GnashCanvas, gnash_canvas, GTK_TYPE_DRAWING_AREA)
@@ -87,7 +88,7 @@
 {
     GNASH_REPORT_FUNCTION;
 
-    canvas->renderer = NULL;
+    canvas->renderer.reset();
 
     gtk_widget_set_double_buffered(GTK_WIDGET(canvas), FALSE);
 
@@ -107,7 +108,7 @@
 
     gnash::log_debug("gnash_canvas_size_allocate %d %d", allocation->width, 
allocation->height);
 
-    if (canvas->renderer != NULL)
+    if (canvas->renderer.get())
         canvas->glue->setRenderHandlerSize(allocation->width, 
allocation->height);
     
     GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
@@ -187,8 +188,7 @@
     GNASH_REPORT_FUNCTION;
     GnashCanvas *canvas = GNASH_CANVAS(widget);
 
-    canvas->renderer = canvas->glue->createRenderHandler();
-    set_render_handler(canvas->renderer);
+    canvas->renderer.reset(canvas->glue->createRenderHandler());
 
     canvas->glue->setRenderHandlerSize(widget->allocation.width,
                                         widget->allocation.height);
@@ -239,7 +239,7 @@
     canvas->glue->beforeRendering();
 }
 
-gnash::render_handler *
+boost::shared_ptr<gnash::Renderer>
 gnash_canvas_get_renderer(GnashCanvas *canvas)
 {
     return canvas->renderer;

=== modified file 'gui/gtk_canvas.h'
--- a/gui/gtk_canvas.h  2009-04-24 08:02:41 +0000
+++ b/gui/gtk_canvas.h  2009-07-13 09:15:53 +0000
@@ -21,10 +21,11 @@
 #define GNASH_GTK_CANVAS_H
 
 #include <gtk/gtkdrawingarea.h>
+#include <boost/shared_ptr.hpp>
 
 // Forward declarations.
 namespace gnash {
-    class render_handler;
+    class Renderer;
 }
 
 G_BEGIN_DECLS
@@ -48,7 +49,7 @@
 
 void             gnash_canvas_setup                 (GnashCanvas *canvas, int 
argc, char **argv[]);
 void             gnash_canvas_before_rendering      (GnashCanvas *canvas);
-gnash::render_handler  *gnash_canvas_get_renderer   (GnashCanvas *canvas);
+boost::shared_ptr<gnash::Renderer>  gnash_canvas_get_renderer   (GnashCanvas 
*canvas);
 
 G_END_DECLS
 

=== modified file 'gui/gtk_glue.h'
--- a/gui/gtk_glue.h    2009-02-25 22:33:03 +0000
+++ b/gui/gtk_glue.h    2009-07-10 15:44:55 +0000
@@ -34,7 +34,7 @@
     virtual bool init(int argc, char **argv[]) = 0;
 
     virtual void prepDrawingArea(GtkWidget *drawing_area) = 0;
-    virtual render_handler* createRenderHandler() = 0;
+    virtual Renderer* createRenderHandler() = 0;
     virtual void setRenderHandlerSize(int /*width*/, int /*height*/) {}
     virtual void render() = 0;
     

=== modified file 'gui/gtk_glue_agg.cpp'
--- a/gui/gtk_glue_agg.cpp      2009-02-25 22:33:03 +0000
+++ b/gui/gtk_glue_agg.cpp      2009-07-10 15:44:55 +0000
@@ -30,8 +30,8 @@
 
 #include "gnash.h"
 #include "log.h"
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 #include "gtk_glue_agg.h"
 
 namespace gnash
@@ -66,7 +66,7 @@
     gtk_widget_set_double_buffered(_drawing_area, FALSE);
 }
 
-render_handler*
+Renderer*
 GtkAggGlue::createRenderHandler()
 {
     GdkVisual* wvisual = gdk_drawable_get_visual(_drawing_area->window);
@@ -85,7 +85,7 @@
 
     gdk_image_destroy(tmpimage);
 
-    _agg_renderer = create_render_handler_agg(pixelformat);
+    _agg_renderer = create_Renderer_agg(pixelformat);
     return _agg_renderer;
 }
 
@@ -110,7 +110,7 @@
     _offscreenbuf = gdk_image_new (GDK_IMAGE_FASTEST, visual, width,
                                    height);
 
-       static_cast<render_handler_agg_base *>(_agg_renderer)->init_buffer(
+       static_cast<Renderer_agg_base *>(_agg_renderer)->init_buffer(
         (unsigned char*) _offscreenbuf->mem,
         _offscreenbuf->bpl * _offscreenbuf->height,
         _offscreenbuf->width,

=== modified file 'gui/gtk_glue_agg.h'
--- a/gui/gtk_glue_agg.h        2009-02-25 22:33:03 +0000
+++ b/gui/gtk_glue_agg.h        2009-07-10 15:44:55 +0000
@@ -37,7 +37,7 @@
 
     bool init(int argc, char **argv[]);
     void prepDrawingArea(GtkWidget *drawing_area);
-    render_handler* createRenderHandler();
+    Renderer* createRenderHandler();
     void setRenderHandlerSize(int width, int height);
     void beforeRendering();
     void render();
@@ -46,7 +46,7 @@
 
   private:
     GdkImage* _offscreenbuf;
-    render_handler *_agg_renderer;
+    Renderer *_agg_renderer;
 };
 
 } // namespace gnash

=== modified file 'gui/gtk_glue_agg_xv.cpp'
--- a/gui/gtk_glue_agg_xv.cpp   2009-06-03 16:08:31 +0000
+++ b/gui/gtk_glue_agg_xv.cpp   2009-07-10 15:44:55 +0000
@@ -30,8 +30,8 @@
 
 #include "gnash.h"
 #include "log.h"
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 #include "Movie.h"
 #include "movie_root.h"
 #include "gtk_glue_agg_xv.h"
@@ -102,10 +102,10 @@
     gtk_widget_set_double_buffered(_drawing_area, FALSE);
 }
 
-render_handler*
+Renderer*
 GtkAggXvGlue::createRenderHandler()
 {
-    _agg_renderer = 
create_render_handler_agg(findPixelFormat(_xv_format).c_str());
+    _agg_renderer = create_Renderer_agg(findPixelFormat(_xv_format).c_str());
     return _agg_renderer;
 }
 
@@ -131,7 +131,7 @@
         
         if (_xv_format.type == XvRGB) {
             // init renderer to write directly to xv_image
-            static_cast<render_handler_agg_base *>(_agg_renderer)->init_buffer
+            static_cast<Renderer_agg_base *>(_agg_renderer)->init_buffer
                   ((unsigned char*) _xv_image->data, _xv_image->data_size,
                   _movie_width, _movie_height, _xv_image->pitches[0]);
     
@@ -147,8 +147,8 @@
 
            _offscreenbuf.reset(new unsigned char[bufsize]);
            
-           render_handler_agg_base * renderer =
-             static_cast<render_handler_agg_base *>(_agg_renderer);
+           Renderer_agg_base * renderer =
+             static_cast<Renderer_agg_base *>(_agg_renderer);
            renderer->init_buffer(_offscreenbuf.get(), bufsize, _movie_width,
                                  _movie_height, _stride);
 

=== modified file 'gui/gtk_glue_agg_xv.h'
--- a/gui/gtk_glue_agg_xv.h     2009-02-25 22:33:03 +0000
+++ b/gui/gtk_glue_agg_xv.h     2009-07-10 15:44:55 +0000
@@ -45,7 +45,7 @@
 
     bool init(int argc, char **argv[]);
     void prepDrawingArea(GtkWidget *drawing_area);
-    render_handler* createRenderHandler();
+    Renderer* createRenderHandler();
     void beforeRendering();
     void render();
     void render(int minx, int miny, int maxx, int maxy);
@@ -66,7 +66,7 @@
 
     /// This will be used in case of RGB->YUV conversion.
     boost::scoped_array<boost::uint8_t> _offscreenbuf;
-    render_handler *_agg_renderer;
+    Renderer *_agg_renderer;
     size_t _stride;
 
     /// If the hardware accepts RGB, then Agg will render directly into this.

=== modified file 'gui/gtk_glue_cairo.cpp'
--- a/gui/gtk_glue_cairo.cpp    2009-06-27 08:32:24 +0000
+++ b/gui/gtk_glue_cairo.cpp    2009-07-10 15:44:55 +0000
@@ -16,7 +16,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 #include "gtk_glue_cairo.h"
-#include "render_handler_cairo.h"
+#include "Renderer_cairo.h"
 
 #if GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 8
 # include "gtk_cairo_create.h"
@@ -53,7 +53,7 @@
     gtk_widget_set_double_buffered(_drawing_area, FALSE);
 }
 
-render_handler*
+Renderer*
 GtkCairoGlue::createRenderHandler()
 {
     _renderer = renderer::cairo::create_handler();

=== modified file 'gui/gtk_glue_cairo.h'
--- a/gui/gtk_glue_cairo.h      2009-02-25 22:33:03 +0000
+++ b/gui/gtk_glue_cairo.h      2009-07-10 15:44:55 +0000
@@ -33,7 +33,7 @@
 
     bool init(int argc, char ***argv);
     void prepDrawingArea(GtkWidget *drawing_area);
-    render_handler* createRenderHandler();
+    Renderer* createRenderHandler();
     void beforeRendering();
     void render();
     void render(int minx, int miny, int maxx, int maxy);
@@ -45,7 +45,7 @@
 
     cairo_t     *_cairo_handle;
     cairo_t     *_cairo_offscreen;
-    render_handler* _renderer;
+    Renderer* _renderer;
     GdkImage*       _image;
 };
 

=== modified file 'gui/gtk_glue_gtkglext.cpp'
--- a/gui/gtk_glue_gtkglext.cpp 2009-02-25 22:33:03 +0000
+++ b/gui/gtk_glue_gtkglext.cpp 2009-07-10 15:44:55 +0000
@@ -102,7 +102,7 @@
                                  NULL, TRUE, GDK_GL_RGBA_TYPE);
 }
 
-render_handler*
+Renderer*
 GtkGlExtGlue::createRenderHandler()
 {
 //    GNASH_REPORT_FUNCTION;
@@ -112,7 +112,7 @@
     // Attach our OpenGL context to the drawing_area.
     gdk_gl_drawable_make_current(gldrawable, glcontext);
 
-    render_handler* renderer = create_render_handler_ogl();
+    Renderer* renderer = create_Renderer_ogl();
 
 #ifdef FIX_I810_LOD_BIAS
     glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 
_tex_lod_bias);

=== modified file 'gui/gtk_glue_gtkglext.h'
--- a/gui/gtk_glue_gtkglext.h   2009-02-25 22:33:03 +0000
+++ b/gui/gtk_glue_gtkglext.h   2009-07-10 15:44:55 +0000
@@ -40,7 +40,7 @@
 
     bool init(int argc, char **argv[]);
     void prepDrawingArea(GtkWidget *drawing_area);
-    render_handler* createRenderHandler();
+    Renderer* createRenderHandler();
     void render();
     void render(int /*minx*/, int /*miny*/, int /*maxx*/, int /*maxy*/) { 
render(); };
     void configure(GtkWidget *const widget, GdkEventConfigure *const event);

=== modified file 'gui/gtksup.h'
--- a/gui/gtksup.h      2009-06-16 14:54:59 +0000
+++ b/gui/gtksup.h      2009-07-13 09:15:53 +0000
@@ -53,7 +53,7 @@
     /// For the Gtk GUI FD listener, whatever that might be for.
     typedef bool (*callback_t)(void*, int, void *data);
 
-    GtkGui(unsigned long xid, float scale, bool loop, unsigned int depth);
+    GtkGui(unsigned long xid, float scale, bool loop, RunResources& r);
     
     virtual ~GtkGui();
     

=== modified file 'gui/gui.cpp'
--- a/gui/gui.cpp       2009-06-16 14:54:59 +0000
+++ b/gui/gui.cpp       2009-07-13 09:15:53 +0000
@@ -23,8 +23,7 @@
 
 #include "MovieClip.h"
 #include "gui.h"
-#include "render.h"  // debug
-#include "render_handler.h"
+#include "Renderer.h"
 #include "sound_handler.h"
 #include "movie_root.h"
 #include "VM.h"
@@ -75,14 +74,13 @@
 
 namespace gnash {
 
-Gui::Gui() :
+Gui::Gui(RunResources& r) :
     _loop(true),
     _xid(0),
     _width(1),
     _height(1),
-    _depth(16),
+    _runResources(r),
     _interval(0),
-    _renderer(NULL),
     _redraw_flag(true),
     _fullscreen(false),
     _mouseShown(true),
@@ -120,15 +118,14 @@
 
 }
 
-Gui::Gui(unsigned long xid, float scale, bool loop, unsigned int depth)
+Gui::Gui(unsigned long xid, float scale, bool loop, RunResources& r)
        :
     _loop(loop),
     _xid(xid),
     _width(1),
     _height(1),
-    _depth(depth),
+    _runResources(r),
     _interval(0),
-    _renderer(NULL),
     _redraw_flag(true),
     _fullscreen(false),
     _mouseShown(true),
@@ -169,7 +166,6 @@
 {
     if ( _movieDef.get() ) log_debug("~Gui - _movieDef refcount: %d", 
_movieDef->get_ref_count());
 
-    delete _renderer;
 #ifdef GNASH_FPS_DEBUG
     if ( fps_timer_interval ) {
         std::cerr << "Total frame advances/drops: "
@@ -390,7 +386,7 @@
        //scaleMode, valign, halign);
 
        // TODO: have a generic set_matrix ?
-       if ( _renderer ) {
+       if (_renderer.get()) {
                _renderer->set_scale(_xscale, _yscale);
                _renderer->set_translation(_xoffset, _yoffset);
        }
@@ -439,7 +435,7 @@
     assert (_stage);
     // @todo since we registered the sound handler, shouldn't we know
     //       already what it is ?!
-    sound::sound_handler* s = _stage->runInfo().soundHandler();
+    sound::sound_handler* s = _stage->runResources().soundHandler();
 
     if (!s) return;
 
@@ -785,7 +781,7 @@
                // show invalidated region using a red rectangle
                // (Flash debug style)
                IF_DEBUG_REGION_UPDATES (
-               if ( ! changed_ranges.isWorld() )
+               if (_renderer.get() && !changed_ranges.isWorld())
                {
                
                        for (size_t rno = 0; rno < changed_ranges.size(); 
rno++) {
@@ -807,7 +803,7 @@
                                corners[3].x = xmin;
                                corners[3].y = ymax;
                                SWFMatrix no_transform;
-                               gnash::render::draw_poly(corners, 4,
+                               _renderer->draw_poly(corners, 4,
                                        rgba(0,0,0,0), rgba(255,0,0,255), 
no_transform, false);
                                        
                        }
@@ -834,7 +830,7 @@
         assert (_stage);
         // @todo since we registered the sound handler, shouldn't we know
         //       already what it is ?!
-        sound::sound_handler* s = _stage->runInfo().soundHandler();
+        sound::sound_handler* s = _stage->runResources().soundHandler();
         if ( s ) s->unpause();
 
         log_debug("Starting virtual clock");
@@ -857,7 +853,7 @@
 
     // @todo since we registered the sound handler, shouldn't we know
     //       already what it is ?!
-    sound::sound_handler* s = _stage->runInfo().soundHandler();
+    sound::sound_handler* s = _stage->runResources().soundHandler();
     if ( s ) s->pause();
 
     log_debug("Pausing virtual clock");
@@ -881,7 +877,7 @@
 
         // @todo since we registered the sound handler, shouldn't we know
         //       already what it is ?!
-       sound::sound_handler* s = _stage->runInfo().soundHandler();
+       sound::sound_handler* s = _stage->runResources().soundHandler();
        if ( s ) s->pause();
         _stopped = true;
 
@@ -912,7 +908,7 @@
 
     // @todo since we registered the sound handler, shouldn't we know
     //       already what it is ?!
-    sound::sound_handler* s = _stage->runInfo().soundHandler();
+    sound::sound_handler* s = _stage->runResources().soundHandler();
     if ( s ) s->unpause();
     _started = true;
     

=== modified file 'gui/gui.h'
--- a/gui/gui.h 2009-06-16 14:54:59 +0000
+++ b/gui/gui.h 2009-07-13 09:15:53 +0000
@@ -25,6 +25,7 @@
 #include "rect.h"  // for composition
 #include "snappingrange.h"  // for InvalidatedRanges
 #include "GnashKey.h" // for gnash::key::code type
+#include "Renderer.h" // for gnash::key::code type
 #include "smart_ptr.h"
 #include "VirtualClock.h"
 #include "SystemClock.h"
@@ -61,7 +62,7 @@
 // Forward declarations
 namespace gnash
 {
-    class render_handler;
+    class RunResources;
     class movie_root;
     class movie_definition;
 }
@@ -390,7 +391,7 @@
 protected:
 
     /// Default constructor. Initialises members to safe defaults.
-    Gui();
+    Gui(RunResources& r);
 
     /** \brief
      * Expanded constructor for more control over member values.
@@ -406,7 +407,7 @@
      *
      * @param depth Colour depth to be used in the client area of our window.
      */
-    Gui(unsigned long xid, float scale, bool loop, unsigned int depth);
+    Gui(unsigned long xid, float scale, bool loop, RunResources& r);
 
     /// Determines if playback should restart after the movie ends.
     bool            _loop;
@@ -427,13 +428,13 @@
     int             _height;
 
     /// Desired colour depth in bits.
-    int             _depth;
+    RunResources& _runResources;
 
     /// Main loop interval: the time between successive advance_movie calls.
     unsigned int    _interval;
 
     /// The handler which is called to update the client area of our window.
-    render_handler* _renderer;
+    boost::shared_ptr<Renderer> _renderer;
 
     /// Signals that the next frame must be re-rendered completely because the
     /// window size did change.
@@ -533,16 +534,16 @@
 };
 
 /// Named constructors
-std::auto_ptr<Gui> createGTKGui(unsigned long xid, float scale, bool loop, 
unsigned int depth);
-std::auto_ptr<Gui> createKDEGui(unsigned long xid, float scale, bool loop, 
unsigned int depth);
-std::auto_ptr<Gui> createKDE4Gui(unsigned long xid, float scale, bool loop, 
unsigned int depth);
-std::auto_ptr<Gui> createSDLGui(unsigned long xid, float scale, bool loop, 
unsigned int depth);
-std::auto_ptr<Gui> createFLTKGui(unsigned long xid, float scale, bool loop, 
unsigned int depth);
-std::auto_ptr<Gui> createFBGui(unsigned long xid, float scale, bool loop, 
unsigned int depth);
-std::auto_ptr<Gui> createAQUAGui(unsigned long xid, float scale, bool loop, 
unsigned int depth);
-std::auto_ptr<Gui> createRISCOSGui(unsigned long xid, float scale, bool loop, 
unsigned int depth);
-std::auto_ptr<Gui> createAOS4Gui(unsigned long xid, float scale, bool loop, 
unsigned int depth);
-std::auto_ptr<Gui> createDumpGui(unsigned long xid, float scale, bool loop, 
unsigned int depth);
+std::auto_ptr<Gui> createGTKGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
+std::auto_ptr<Gui> createKDEGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
+std::auto_ptr<Gui> createKDE4Gui(unsigned long xid, float scale, bool loop, 
RunResources& r);
+std::auto_ptr<Gui> createSDLGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
+std::auto_ptr<Gui> createFLTKGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
+std::auto_ptr<Gui> createFBGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
+std::auto_ptr<Gui> createAQUAGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
+std::auto_ptr<Gui> createRISCOSGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
+std::auto_ptr<Gui> createAOS4Gui(unsigned long xid, float scale, bool loop, 
RunResources& r);
+std::auto_ptr<Gui> createDumpGui(unsigned long xid, float scale, bool loop, 
RunResources& r);
 
  
 } // end of gnash namespace

=== modified file 'gui/gui_aos4.cpp'
--- a/gui/gui_aos4.cpp  2009-05-19 20:18:37 +0000
+++ b/gui/gui_aos4.cpp  2009-07-13 09:15:53 +0000
@@ -31,12 +31,12 @@
 namespace gnash {
 
 #ifdef GUI_AOS4
-std::auto_ptr<Gui> createAOS4Gui(unsigned long windowid, float scale, bool 
do_loop, unsigned int bit_depth)
+std::auto_ptr<Gui> createAOS4Gui(unsigned long windowid, float scale, bool 
do_loop, RunResources& r)
 {
-       return std::auto_ptr<Gui>(new AOS4Gui(windowid, scale, do_loop, 
bit_depth));
+       return std::auto_ptr<Gui>(new AOS4Gui(windowid, scale, do_loop, r));
 }
 #else // ! GUI_AOS4
-std::auto_ptr<Gui> createAOS4Gui(unsigned long , float , bool , unsigned int )
+std::auto_ptr<Gui> createAOS4Gui(unsigned long , float, bool, 
RunResourcesfloat , bool , unsigned int )
 {
        throw GnashException("Support for AOS4 gui was not compiled in");
 }

=== modified file 'gui/gui_aqua.cpp'
--- a/gui/gui_aqua.cpp  2009-02-25 22:33:03 +0000
+++ b/gui/gui_aqua.cpp  2009-07-13 09:15:53 +0000
@@ -31,12 +31,12 @@
 namespace gnash {
 
 #ifdef GUI_AQUA
-std::auto_ptr<Gui> createAQUAGui(unsigned long windowid, float scale, bool 
do_loop, unsigned int bit_depth)
+std::auto_ptr<Gui> createAQUAGui(unsigned long windowid, float scale, bool 
do_loop, RunResources& r)
 {
-       return std::auto_ptr<Gui>(new AquaGui(windowid, scale, do_loop, 
bit_depth));
+       return std::auto_ptr<Gui>(new AquaGui(windowid, scale, do_loop, r));
 }
 #else // ! GUI_AQUA
-std::auto_ptr<Gui> createAQUAGui(unsigned long , float , bool , unsigned int )
+std::auto_ptr<Gui> createAQUAGui(unsigned long , float, bool, 
RunResourcesfloat , bool , unsigned int )
 {
        throw GnashException("Support for AQUA gui was not compiled in");
 }

=== modified file 'gui/gui_dump.cpp'
--- a/gui/gui_dump.cpp  2009-02-25 22:33:03 +0000
+++ b/gui/gui_dump.cpp  2009-07-13 09:15:53 +0000
@@ -31,12 +31,12 @@
 namespace gnash {
 
 #ifdef GUI_DUMP
-std::auto_ptr<Gui> createDumpGui(unsigned long windowid, float scale, bool 
do_loop, unsigned int bit_depth)
+std::auto_ptr<Gui> createDumpGui(unsigned long windowid, float scale, bool 
do_loop, RunResources& r)
 {
-       return std::auto_ptr<Gui>(new DumpGui(windowid, scale, do_loop, 
bit_depth));
+       return std::auto_ptr<Gui>(new DumpGui(windowid, scale, do_loop, r));
 }
 #else // ! GUI_DUMP
-std::auto_ptr<Gui> createDumpGui(unsigned long , float , bool , unsigned int )
+std::auto_ptr<Gui> createDumpGui(unsigned long , float, bool, 
RunResourcesfloat , bool , unsigned int )
 {
        throw GnashException("Support for DUMP gui was not compiled in");
 }

=== modified file 'gui/gui_fb.cpp'
--- a/gui/gui_fb.cpp    2009-02-25 22:33:03 +0000
+++ b/gui/gui_fb.cpp    2009-07-13 09:15:53 +0000
@@ -31,12 +31,12 @@
 namespace gnash {
 
 #ifdef GUI_FB
-std::auto_ptr<Gui> createFBGui(unsigned long windowid, float scale, bool 
do_loop, unsigned int bit_depth)
+std::auto_ptr<Gui> createFBGui(unsigned long windowid, float scale, bool 
do_loop, RunResources& r)
 {
-       return std::auto_ptr<Gui>(new FBGui(windowid, scale, do_loop, 
bit_depth));
+       return std::auto_ptr<Gui>(new FBGui(windowid, scale, do_loop, r));
 }
 #else // ! GUI_FB
-std::auto_ptr<Gui> createFBGui(unsigned long , float , bool , unsigned int )
+std::auto_ptr<Gui> createFBGui(unsigned long , float, bool, RunResourcesfloat 
, bool , unsigned int )
 {
        throw GnashException("Support for FB gui was not compiled in");
 }

=== modified file 'gui/gui_fltk.cpp'
--- a/gui/gui_fltk.cpp  2009-02-25 22:33:03 +0000
+++ b/gui/gui_fltk.cpp  2009-07-13 09:15:53 +0000
@@ -31,12 +31,12 @@
 namespace gnash {
 
 #ifdef GUI_FLTK
-std::auto_ptr<Gui> createFLTKGui(unsigned long windowid, float scale, bool 
do_loop, unsigned int bit_depth)
+std::auto_ptr<Gui> createFLTKGui(unsigned long windowid, float scale, bool 
do_loop, RunResources& r)
 {
-       return std::auto_ptr<Gui>(new FltkGui(windowid, scale, do_loop, 
bit_depth));
+       return std::auto_ptr<Gui>(new FltkGui(windowid, scale, do_loop, r));
 }
 #else // ! GUI_FLTK
-std::auto_ptr<Gui> createFLTKGui(unsigned long , float , bool , unsigned int )
+std::auto_ptr<Gui> createFLTKGui(unsigned long , float, bool, 
RunResourcesfloat , bool , unsigned int )
 {
        throw GnashException("Support for FLTK gui was not compiled in");
 }

=== modified file 'gui/gui_gtk.cpp'
--- a/gui/gui_gtk.cpp   2009-02-25 22:33:03 +0000
+++ b/gui/gui_gtk.cpp   2009-07-13 09:15:53 +0000
@@ -32,12 +32,12 @@
 namespace gnash {
 
 #ifdef GUI_GTK
-std::auto_ptr<Gui> createGTKGui(unsigned long windowid, float scale, bool 
do_loop, unsigned int bit_depth)
+std::auto_ptr<Gui> createGTKGui(unsigned long windowid, float scale, bool 
do_loop, RunResources& r)
 {
-       return std::auto_ptr<Gui>(new GtkGui(windowid, scale, do_loop, 
bit_depth));
+       return std::auto_ptr<Gui>(new GtkGui(windowid, scale, do_loop, r));
 }
 #else // ! GUI_GTK
-std::auto_ptr<Gui> createGTKGui(unsigned long , float , bool , unsigned int )
+std::auto_ptr<Gui> createGTKGui(unsigned long , float, bool, RunResourcesfloat 
, bool , unsigned int )
 {
        throw GnashException("Support for GTK gui was not compiled in");
 }

=== modified file 'gui/gui_kde.cpp'
--- a/gui/gui_kde.cpp   2009-02-25 22:33:03 +0000
+++ b/gui/gui_kde.cpp   2009-07-13 09:15:53 +0000
@@ -31,12 +31,12 @@
 namespace gnash {
 
 #ifdef GUI_KDE3
-std::auto_ptr<Gui> createKDEGui(unsigned long windowid, float scale, bool 
do_loop, unsigned int bit_depth)
+std::auto_ptr<Gui> createKDEGui(unsigned long windowid, float scale, bool 
do_loop, RunResources& r)
 {
-       return std::auto_ptr<Gui>(new KdeGui(windowid, scale, do_loop, 
bit_depth));
+       return std::auto_ptr<Gui>(new KdeGui(windowid, scale, do_loop, r));
 }
 #else // ! GUI_KDE3
-std::auto_ptr<Gui> createKDEGui(unsigned long , float , bool , unsigned int )
+std::auto_ptr<Gui> createKDEGui(unsigned long , float, bool, RunResourcesfloat 
, bool , unsigned int )
 {
        throw GnashException("Support for KDE gui was not compiled in");
 }

=== modified file 'gui/gui_riscos.cpp'
--- a/gui/gui_riscos.cpp        2009-02-25 22:33:03 +0000
+++ b/gui/gui_riscos.cpp        2009-07-13 09:15:53 +0000
@@ -31,12 +31,12 @@
 namespace gnash {
 
 #ifdef GUI_RISCOS
-std::auto_ptr<Gui> createRISCOSGui(unsigned long windowid, float scale, bool 
do_loop, unsigned int bit_depth)
+std::auto_ptr<Gui> createRISCOSGui(unsigned long windowid, float scale, bool 
do_loop, RunResources& r)
 {
-       return std::auto_ptr<Gui>(new RiscosGui(windowid, scale, do_loop, 
bit_depth));
+       return std::auto_ptr<Gui>(new RiscosGui(windowid, scale, do_loop, r));
 }
 #else // ! GUI_RISCOS
-std::auto_ptr<Gui> createRISCOSGui(unsigned long , float , bool , unsigned int 
)
+std::auto_ptr<Gui> createRISCOSGui(unsigned long , float, bool, 
RunResourcesfloat , bool , unsigned int )
 {
        throw GnashException("Support for RISCOS gui was not compiled in");
 }

=== modified file 'gui/gui_sdl.cpp'
--- a/gui/gui_sdl.cpp   2009-02-25 22:33:03 +0000
+++ b/gui/gui_sdl.cpp   2009-07-13 09:15:53 +0000
@@ -31,12 +31,12 @@
 namespace gnash {
 
 #ifdef GUI_SDL
-std::auto_ptr<Gui> createSDLGui(unsigned long windowid, float scale, bool 
do_loop, unsigned int bit_depth)
+std::auto_ptr<Gui> createSDLGui(unsigned long windowid, float scale, bool 
do_loop, RunResources& r)
 {
-       return std::auto_ptr<Gui>(new SDLGui(windowid, scale, do_loop, 
bit_depth));
+       return std::auto_ptr<Gui>(new SDLGui(windowid, scale, do_loop, r));
 }
 #else // ! GUI_SDL
-std::auto_ptr<Gui> createSDLGui(unsigned long , float , bool , unsigned int )
+std::auto_ptr<Gui> createSDLGui(unsigned long , float, bool, RunResourcesfloat 
, bool , unsigned int )
 {
        throw GnashException("Support for SDL gui was not compiled in");
 }

=== modified file 'gui/kde.cpp'
--- a/gui/kde.cpp       2009-03-17 12:01:42 +0000
+++ b/gui/kde.cpp       2009-07-13 10:43:39 +0000
@@ -56,8 +56,8 @@
 }
 
 
-KdeGui::KdeGui(unsigned long xid, float scale, bool loop, unsigned int depth)
- : Gui(xid, scale, loop, depth)
+KdeGui::KdeGui(unsigned long xid, float scale, bool loop, RunResources& r)
+ : Gui(xid, scale, loop, r)
 {
 }
 
@@ -100,7 +100,7 @@
     
     _width = width;
     _height = height;
-    set_render_handler(_renderer);
+    _runResources.setRenderer(boost::shared_ptr<Renderer>(_renderer));
     
     return true;
 }

=== modified file 'gui/kde_glue.h'
--- a/gui/kde_glue.h    2009-02-25 22:33:03 +0000
+++ b/gui/kde_glue.h    2009-07-10 15:44:55 +0000
@@ -39,7 +39,7 @@
     virtual bool init(int argc, char **argv[]) = 0;
 
     virtual void prepDrawingArea(QWidget *drawing_area) = 0;
-    virtual render_handler* createRenderHandler() = 0;
+    virtual Renderer* createRenderHandler() = 0;
     virtual void render() = 0;
     virtual void setInvalidatedRegions(const InvalidatedRanges& /* ranges */) 
{}
     virtual void resize(int, int) {}

=== modified file 'gui/kde_glue_agg.cpp'
--- a/gui/kde_glue_agg.cpp      2009-02-25 22:33:03 +0000
+++ b/gui/kde_glue_agg.cpp      2009-07-10 15:44:55 +0000
@@ -31,8 +31,8 @@
 #include <qcolor.h>
 #endif
 #include "kde_glue_agg.h"
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 
 namespace gnash
 {
@@ -85,8 +85,8 @@
     // Only the AGG renderer has the function init_buffer, which is *not* part 
of
     // the renderer api. It allows us to change the renderers movie size (and 
buffer
     // address) during run-time.
-    render_handler_agg_base * renderer =
-      static_cast<render_handler_agg_base *>(_renderer);
+    Renderer_agg_base * renderer =
+      static_cast<Renderer_agg_base *>(_renderer);
     renderer->init_buffer(_offscreenbuf.get(), bufsize, width, height,
       width*((_bpp+7)/8));
 
@@ -146,11 +146,11 @@
 }
 
 
-render_handler*
+Renderer*
 KdeAggGlue::createRenderHandler()
 {
     // QT requires the use of this pixel format...
-    _renderer = create_render_handler_agg("BGRA32");
+    _renderer = create_Renderer_agg("BGRA32");
     if ( ! _renderer )
     {
         throw GnashException("Could not create AGG renderer with pixelformat 
BGRA32");

=== modified file 'gui/kde_glue_agg.h'
--- a/gui/kde_glue_agg.h        2009-02-25 22:33:03 +0000
+++ b/gui/kde_glue_agg.h        2009-07-10 15:44:55 +0000
@@ -40,7 +40,7 @@
     
     bool init(int argc, char **argv[]);
     void prepDrawingArea(QWidget *drawing_area);
-    render_handler* createRenderHandler();
+    Renderer* createRenderHandler();
     void initBuffer(int width, int height);
     void resize(int width, int height);
     void render();
@@ -50,7 +50,7 @@
     int _width;
     int _height;
     boost::scoped_array<unsigned char> _offscreenbuf;
-    render_handler* _renderer; // We don't own this pointer.
+    Renderer* _renderer; // We don't own this pointer.
     geometry::Range2d<int> _validbounds;
     std::vector< geometry::Range2d<int> > _drawbounds;
     std::auto_ptr<QImage> _qimage;

=== modified file 'gui/kde_glue_opengl.cpp'
--- a/gui/kde_glue_opengl.cpp   2009-02-25 22:33:03 +0000
+++ b/gui/kde_glue_opengl.cpp   2009-07-10 15:44:55 +0000
@@ -58,11 +58,11 @@
     _drawing_area = drawing_area;
 }
 
-render_handler*
+Renderer*
 KdeOpenGLGlue::createRenderHandler()
 {
 //    GNASH_REPORT_FUNCTION;
-    render_handler* renderer = create_render_handler_ogl();
+    Renderer* renderer = create_Renderer_ogl();
 
 #ifdef FIX_I810_LOD_BIAS
     glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 
_tex_lod_bias);

=== modified file 'gui/kde_glue_opengl.h'
--- a/gui/kde_glue_opengl.h     2009-02-25 22:33:03 +0000
+++ b/gui/kde_glue_opengl.h     2009-07-10 15:44:55 +0000
@@ -31,7 +31,7 @@
     
     bool init(int argc, char **argv[]);
     void prepDrawingArea(QWidget *drawing_area);
-    render_handler* createRenderHandler();
+    Renderer* createRenderHandler();
     void render();
   private:
 #ifdef FIX_I810_LOD_BIAS

=== modified file 'gui/kdesup.h'
--- a/gui/kdesup.h      2009-02-25 22:33:03 +0000
+++ b/gui/kdesup.h      2009-07-13 09:15:53 +0000
@@ -84,7 +84,7 @@
 {
 
 public:
-    KdeGui(unsigned long xid, float scale, bool loop, unsigned int depth);
+    KdeGui(unsigned long xid, float scale, bool loop, RunResources& r);
     virtual ~KdeGui();
     virtual bool init(int argc, char **argv[]);
     virtual bool createWindow(const char* windowtitle, int width, int height);

=== modified file 'gui/pythonmod/gnash-view.cpp'
--- a/gui/pythonmod/gnash-view.cpp      2009-06-15 14:46:41 +0000
+++ b/gui/pythonmod/gnash-view.cpp      2009-07-13 09:15:53 +0000
@@ -29,10 +29,10 @@
 #include "VM.h"
 #include "movie_definition.h"
 #include "movie_root.h" // for Abstract callbacks
-#include "render_handler.h"
+#include "Renderer.h"
 #include "sound_handler.h"
 #include "MediaHandler.h"
-#include "RunInfo.h" // for passing handlers and other data to the core.
+#include "RunResources.h" // for passing handlers and other data to the core.
 #include "VirtualClock.h"
 #include "SystemClock.h"
 #include "smart_ptr.h"
@@ -64,7 +64,7 @@
     //
     /// This must be kept alive for the entire lifetime of the movie_root
     /// (currently: of the Gui).
-    std::auto_ptr<gnash::RunInfo> run_info;
+    std::auto_ptr<gnash::RunResources> run_info;
 
     std::auto_ptr<gnash::movie_definition> movie_definition;
     boost::intrusive_ptr<gnash::Movie> movie;
@@ -269,7 +269,7 @@
     if( view->stage.get() != NULL) {
        view->stage->set_display_viewport(0, 0, allocation->width, 
allocation->height);
 
-        gnash::render_handler *renderer = 
gnash_canvas_get_renderer(view->canvas);
+        gnash::Renderer *renderer = gnash_canvas_get_renderer(view->canvas);
         float xscale = allocation->width / 
view->movie_definition->get_width_pixels();
         float yscale = allocation->height / 
view->movie_definition->get_height_pixels();
                renderer->set_scale(xscale, yscale);
@@ -432,8 +432,8 @@
 
     gnash::URL url(uri);
 
-    // The RunInfo should be populated before parsing.
-    view->run_info.reset(new gnash::RunInfo(url.str()));
+    // The RunResources should be populated before parsing.
+    view->run_info.reset(new gnash::RunResources(url.str()));
     view->run_info->setSoundHandler(view->sound_handler);
 
     std::auto_ptr<gnash::NamingPolicy> np(new gnash::IncrementalRename(url));
@@ -484,7 +484,7 @@
 
     // @todo since we registered the sound handler, shouldn't we know
     //       already what it is ?!
-    gnash::sound::sound_handler* s = view->stage->runInfo().soundHandler();
+    gnash::sound::sound_handler* s = 
view->stage->runResources().soundHandler();
     if ( s ) s->unpause();
     
     gnash::log_debug("Starting virtual clock");
@@ -509,7 +509,7 @@
     gnash::InvalidatedRanges changed_ranges;
     changed_ranges.setWorld();
 
-    gnash::render_handler *renderer = gnash_canvas_get_renderer(view->canvas);
+    gnash::Renderer *renderer = gnash_canvas_get_renderer(view->canvas);
     renderer->set_invalidated_regions(changed_ranges);
     gdk_window_invalidate_rect(GTK_WIDGET(view->canvas)->window, NULL, false);
 

=== modified file 'gui/riscos.cpp'
--- a/gui/riscos.cpp    2009-02-25 22:33:03 +0000
+++ b/gui/riscos.cpp    2009-07-13 09:15:53 +0000
@@ -25,7 +25,7 @@
 #include "gui.h"
 #include "rc.h"
 #include "riscossup.h"
-#include "render_handler.h"
+#include "Renderer.h"
 #include "log.h"
 
 //#include <iostream>
@@ -39,8 +39,8 @@
       wimp_close_down(_task);
 }
 
-RiscosGui::RiscosGui(unsigned long xid, float scale, bool loop, unsigned int 
depth)
- : Gui(xid, scale, loop, depth), _task((wimp_t)0), _window((wimp_w)0),
+RiscosGui::RiscosGui(unsigned long xid, float scale, bool loop, RunResources& 
r)
+ : Gui(xid, scale, loop, r), _task((wimp_t)0), _window((wimp_w)0),
    _quit(false), _timeout(0), m_draw_minx(0), m_draw_miny(0),
    m_draw_maxx(0), m_draw_maxy(0), _screen_height(480), _screen_width(640)
 {
@@ -107,7 +107,7 @@
 #endif
 
     _renderer = glue.createRenderHandler();
-    set_render_handler(_renderer);
+    set_Renderer(_renderer);
     // hack?
     _renderer->set_scale(1.0f, 1.0f);
 

=== modified file 'gui/riscos_glue.h'
--- a/gui/riscos_glue.h 2009-02-25 22:33:03 +0000
+++ b/gui/riscos_glue.h 2009-07-10 15:44:55 +0000
@@ -28,7 +28,7 @@
     virtual bool init(int argc, char **argv[]) = 0;
 
     virtual void prepFramebuffer(void *framebuffer, int width, int height) = 0;
-    virtual render_handler* createRenderHandler() = 0;
+    virtual Renderer* createRenderHandler() = 0;
     virtual void setRenderHandlerSize(int /*width*/, int /*height*/) { };
     virtual void render(int /* x */, int /* y */) = 0;
     virtual void render(int x, int y, int /*minx*/, int /*miny*/, int 
/*maxx*/, int /*maxy*/)

=== modified file 'gui/riscos_glue_agg.cpp'
--- a/gui/riscos_glue_agg.cpp   2009-02-25 22:33:03 +0000
+++ b/gui/riscos_glue_agg.cpp   2009-07-10 15:44:55 +0000
@@ -22,8 +22,8 @@
 
 #include "gnash.h"
 #include "log.h"
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 #include "riscos_glue_agg.h"
 
 namespace gnash
@@ -61,10 +61,10 @@
     _fbheight = height;
 }
 
-render_handler*
+Renderer*
 RiscosAggGlue::createRenderHandler()
 {
-  _agg_renderer = create_render_handler_agg("RGB24");
+  _agg_renderer = create_Renderer_agg("RGB24");
   return _agg_renderer;
 }
 
@@ -107,7 +107,7 @@
   // Only the AGG renderer has the function init_buffer, which is *not* part
   // of the renderer api. It allows us to change the renderers movie size
   // (and buffer address) during run-time.
-  static_cast<render_handler_agg_base *>(_agg_renderer)->init_buffer(
+  static_cast<Renderer_agg_base *>(_agg_renderer)->init_buffer(
          _offscreenbuf,
          _offscreenbuf_size,
          _width,

=== modified file 'gui/riscos_glue_agg.h'
--- a/gui/riscos_glue_agg.h     2009-02-25 22:33:03 +0000
+++ b/gui/riscos_glue_agg.h     2009-07-10 15:44:55 +0000
@@ -29,7 +29,7 @@
 
     bool init(int argc, char **argv[]);
     void prepFramebuffer(void *framebuffer, int width, int height);
-    render_handler* createRenderHandler();
+    Renderer* createRenderHandler();
     void setRenderHandlerSize(int width, int height);
     void render(int x, int y);
     void render(int x, int y, int minx, int miny, int maxx, int maxy);
@@ -38,7 +38,7 @@
   private:
     unsigned char *_offscreenbuf;
     int _offscreenbuf_size;
-    render_handler *_agg_renderer;
+    Renderer *_agg_renderer;
     int _width, _height, _bpp;
 };
 

=== modified file 'gui/riscossup.h'
--- a/gui/riscossup.h   2009-02-25 22:33:03 +0000
+++ b/gui/riscossup.h   2009-07-13 09:15:53 +0000
@@ -40,7 +40,7 @@
 class RiscosGui : public Gui
 {
  public:
-    RiscosGui(unsigned long xid, float scale, bool loop, unsigned int depth);
+    RiscosGui(unsigned long xid, float scale, bool loop, RunResources& r);
     virtual ~RiscosGui();
     virtual bool init(int argc, char **argv[]);
     virtual bool createWindow(int width, int height);

=== modified file 'gui/sdl.cpp'
--- a/gui/sdl.cpp       2009-05-19 21:24:34 +0000
+++ b/gui/sdl.cpp       2009-07-13 10:43:39 +0000
@@ -39,15 +39,16 @@
 #include "log.h"
 #include "sdlsup.h"
 #include "Range2d.h" // for Intersection of inv bounds
-#include "render_handler.h" // for setInvalidatedRegions
+#include "Renderer.h" // for setInvalidatedRegions
+#include "RunResources.h"
 
 using namespace std;
 
 namespace gnash 
 {
 
-SDLGui::SDLGui(unsigned long xid, float scale, bool loop, unsigned int depth)
- : Gui(xid, scale, loop, depth),
+SDLGui::SDLGui(unsigned long xid, float scale, bool loop, RunResources& r)
+ : Gui(xid, scale, loop, r),
    _timeout(0),
    _core_trap(true)
 {
@@ -185,7 +186,7 @@
 
     _glue.init(argc, argv);
 
-    _renderer = _glue.createRenderHandler(_depth);
+    _renderer.reset(_glue.createRenderHandler(32));
     if ( ! _renderer ) return false;
 
     return true;
@@ -211,7 +212,7 @@
 
     _glue.prepDrawingArea(_width, _height, sdl_flags);
 
-    set_render_handler(_renderer);
+    _runResources.setRenderer(boost::shared_ptr<Renderer>(_renderer));
 
     SDL_WM_SetCaption( title, title);
 

=== modified file 'gui/sdl_agg_glue.cpp'
--- a/gui/sdl_agg_glue.cpp      2009-05-19 08:19:31 +0000
+++ b/gui/sdl_agg_glue.cpp      2009-07-10 15:44:55 +0000
@@ -19,8 +19,8 @@
 
 #include "sdl_agg_glue.h"
 #include "log.h"
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 #include <cerrno>
 #include <ostream>
 
@@ -56,7 +56,7 @@
 }
 
 
-render_handler*
+Renderer*
 SdlAggGlue::createRenderHandler(int bpp)
 {
 //    GNASH_REPORT_FUNCTION;
@@ -65,13 +65,13 @@
 
     switch (_bpp) {
       case 32:
-        _agg_renderer = create_render_handler_agg("RGBA32");
+        _agg_renderer = create_Renderer_agg("RGBA32");
         break;
       case 24:
-        _agg_renderer = create_render_handler_agg("RGB24");
+        _agg_renderer = create_Renderer_agg("RGB24");
         break;
       case 16:
-        _agg_renderer = create_render_handler_agg("RGBA16");
+        _agg_renderer = create_Renderer_agg("RGBA16");
         break;
       default:
         log_error (_("AGG's bit depth must be 16, 24 or 32 bits, not %d."), 
_bpp);
@@ -134,8 +134,8 @@
     // Only the AGG renderer has the function init_buffer, which is *not* part 
of
     // the renderer api. It allows us to change the renderers movie size (and 
buffer
     // address) during run-time.
-    render_handler_agg_base * renderer =
-      static_cast<render_handler_agg_base *>(_agg_renderer);
+    Renderer_agg_base * renderer =
+      static_cast<Renderer_agg_base *>(_agg_renderer);
     renderer->init_buffer(_offscreenbuf, bufsize, width, height,
       width*((_bpp+7)/8));
 

=== modified file 'gui/sdl_agg_glue.h'
--- a/gui/sdl_agg_glue.h        2009-05-19 08:19:31 +0000
+++ b/gui/sdl_agg_glue.h        2009-07-10 15:44:55 +0000
@@ -30,7 +30,7 @@
     virtual ~SdlAggGlue();
 
     bool init(int argc, char **argv[]);
-    render_handler* createRenderHandler(int depth);
+    Renderer* createRenderHandler(int depth);
     void setInvalidatedRegions(const InvalidatedRanges& ranges);
     bool prepDrawingArea(int width, int height, boost::uint32_t sdl_flags);
     boost::uint32_t maskFlags(boost::uint32_t sdl_flags);
@@ -40,7 +40,7 @@
     SDL_Surface     *_sdl_surface;
     unsigned char   *_offscreenbuf;
     SDL_Surface     *_screen;
-    render_handler  *_agg_renderer;
+    Renderer  *_agg_renderer;
     
     geometry::Range2d<int> _validbounds;
     std::vector< geometry::Range2d<int> > _drawbounds;

=== modified file 'gui/sdl_cairo_glue.cpp'
--- a/gui/sdl_cairo_glue.cpp    2009-05-19 23:29:52 +0000
+++ b/gui/sdl_cairo_glue.cpp    2009-07-10 15:44:55 +0000
@@ -17,7 +17,7 @@
 
 #include "sdl_cairo_glue.h"
 #include "log.h"
-#include "render_handler_cairo.h"
+#include "Renderer_cairo.h"
 
 using namespace std;
 
@@ -48,7 +48,7 @@
 }
 
 
-render_handler*
+Renderer*
 SdlCairoGlue::createRenderHandler(int depth)
 {
 //    GNASH_REPORT_FUNCTION;

=== modified file 'gui/sdl_cairo_glue.h'
--- a/gui/sdl_cairo_glue.h      2009-05-19 23:29:52 +0000
+++ b/gui/sdl_cairo_glue.h      2009-07-10 15:44:55 +0000
@@ -22,7 +22,7 @@
 
 // Forward declarations
 namespace gnash {
-    class render_handler;
+    class Renderer;
 }
 
 namespace gnash
@@ -35,7 +35,7 @@
     virtual ~SdlCairoGlue();
 
     bool init(int argc, char **argv[]);
-    render_handler* createRenderHandler( int depth);
+    Renderer* createRenderHandler( int depth);
     void setInvalidatedRegions(const InvalidatedRanges& ranges);
     bool prepDrawingArea(int width, int height, boost::uint32_t sdl_flags);
     boost::uint32_t maskFlags(boost::uint32_t sdl_flags);
@@ -46,7 +46,7 @@
     SDL_Surface     *_sdl_surface;
     unsigned char   *_render_image;
     SDL_Surface     *_screen;
-    render_handler  *_renderer;
+    Renderer  *_renderer;
 };
 
 }

=== modified file 'gui/sdl_glue.h'
--- a/gui/sdl_glue.h    2009-05-19 08:19:31 +0000
+++ b/gui/sdl_glue.h    2009-07-10 15:44:55 +0000
@@ -31,7 +31,7 @@
     
     virtual void setInvalidatedRegions(const InvalidatedRanges& ranges) = 0;
     virtual bool prepDrawingArea(int width, int height, boost::uint32_t 
sdl_flags) = 0;
-    virtual render_handler* createRenderHandler(int depth) = 0;
+    virtual Renderer* createRenderHandler(int depth) = 0;
     virtual void render() = 0;
   protected:
     int _bpp;

=== modified file 'gui/sdl_ogl_glue.cpp'
--- a/gui/sdl_ogl_glue.cpp      2009-05-19 08:19:31 +0000
+++ b/gui/sdl_ogl_glue.cpp      2009-07-10 15:44:55 +0000
@@ -62,14 +62,14 @@
 }
 
 
-render_handler*
+Renderer*
 SdlOglGlue::createRenderHandler(int depth)
 {
 //    GNASH_REPORT_FUNCTION;
 
     _bpp = depth;
 
-    render_handler* renderer = create_render_handler_ogl();
+    Renderer* renderer = create_Renderer_ogl();
 
 #ifdef FIX_I810_LOD_BIAS
     glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 
_tex_lod_bias);
@@ -100,7 +100,7 @@
 
       // 32-bit color etc, for getting dest alpha,
       // for MULTIPASS_ANTIALIASING (see
-      // render_handler_ogl.cpp).
+      // Renderer_ogl.cpp).
       SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
       SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
       SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);

=== modified file 'gui/sdl_ogl_glue.h'
--- a/gui/sdl_ogl_glue.h        2009-05-19 08:19:31 +0000
+++ b/gui/sdl_ogl_glue.h        2009-07-10 15:44:55 +0000
@@ -29,7 +29,7 @@
     virtual ~SdlOglGlue();
 
     bool init(int argc, char ***argv);
-    render_handler* createRenderHandler( int depth);
+    Renderer* createRenderHandler( int depth);
     void setInvalidatedRegions(const InvalidatedRanges& ranges);
     bool prepDrawingArea(int width, int height, boost::uint32_t sdl_flags);
     void render();

=== modified file 'gui/sdlsup.h'
--- a/gui/sdlsup.h      2009-05-19 09:09:44 +0000
+++ b/gui/sdlsup.h      2009-07-13 09:15:53 +0000
@@ -47,7 +47,7 @@
 class SDLGui : public Gui
 {
 public:
-    SDLGui(unsigned long xid, float scale, bool loop, unsigned int depth);
+    SDLGui(unsigned long xid, float scale, bool loop, RunResources& r);
     virtual ~SDLGui();
     virtual bool init(int argc, char **argv[]);
     virtual bool createWindow(const char *title, int width, int height);

=== modified file 'libcore/Bitmap.cpp'
--- a/libcore/Bitmap.cpp        2009-04-15 12:27:37 +0000
+++ b/libcore/Bitmap.cpp        2009-07-13 09:04:26 +0000
@@ -19,8 +19,12 @@
 #include "Bitmap.h"
 #include "flash/display/BitmapData_as.h"
 #include "GnashImage.h"
+#include "fill_style.h"
 #include "DynamicShape.h"
 #include "rect.h"
+#include "Renderer.h"
+#include "VM.h"
+#include "movie_root.h"
 
 namespace gnash {
 
@@ -74,12 +78,12 @@
 }
 
 void
-Bitmap::display()
+Bitmap::display(Renderer& renderer)
 {
     /// Don't display cleared Bitmaps.
     if (!_def && !_bitmapData) return;
 
-    _shape.display(*this);
+    _shape.display(renderer, *this);
     clear_invalidated();
 }
 
@@ -124,7 +128,8 @@
         }
     }
 
-    _bitmapInfo = render::createBitmapInfo(im);
+    Renderer* renderer = _vm.getRoot().runResources().renderer();
+    if (renderer) _bitmapInfo = renderer->createBitmapInfo(im);
 
 }
 

=== modified file 'libcore/Bitmap.h'
--- a/libcore/Bitmap.h  2009-04-15 12:27:37 +0000
+++ b/libcore/Bitmap.h  2009-07-13 07:07:26 +0000
@@ -22,7 +22,6 @@
 #include "DisplayObject.h" 
 #include "BitmapInfo.h"
 #include "flash/display/BitmapData_as.h"
-#include "render.h"
 #include "BitmapMovieDefinition.h"
 #include "DynamicShape.h"
 
@@ -62,7 +61,7 @@
 
     virtual void add_invalidated_bounds(InvalidatedRanges& ranges, bool force);
 
-    virtual void display();
+    virtual void display(Renderer& renderer);
 
     virtual rect getBounds() const;
 

=== modified file 'libcore/BitmapInfo.h'
--- a/libcore/BitmapInfo.h      2009-02-25 22:33:03 +0000
+++ b/libcore/BitmapInfo.h      2009-07-10 15:44:55 +0000
@@ -24,7 +24,7 @@
 
 namespace gnash {
 
-/// Your render_handler creates BitmapInfos for gnash.  You
+/// Your Renderer creates BitmapInfos for gnash.  You
 /// need to subclass BitmapInfo in order to add the
 /// information and functionality your app needs to render
 /// using textures.

=== modified file 'libcore/Button.cpp'
--- a/libcore/Button.cpp        2009-07-07 14:56:59 +0000
+++ b/libcore/Button.cpp        2009-07-13 09:04:26 +0000
@@ -391,7 +391,7 @@
 
 
 void
-Button::display()
+Button::display(Renderer& renderer)
 {
 
     DisplayObjects actChars;
@@ -400,8 +400,10 @@
     // TODO: by keeping chars sorted by depth we'd avoid the sort on display
     std::sort(actChars.begin(), actChars.end(), charDepthLessThen);
 
-    std::for_each(actChars.begin(), actChars.end(),
-            std::mem_fun(&DisplayObject::display)); 
+    for (DisplayObjects::iterator it = actChars.begin(), e = actChars.end();
+            it != e; ++it) {
+        (*it)->display(renderer);
+    }
 
     clear_invalidated();
 }
@@ -520,7 +522,7 @@
         if (!_def->hasSound()) break;
 
         // Check if there is a sound handler
-        sound::sound_handler* s = _vm.getRoot().runInfo().soundHandler();
+        sound::sound_handler* s = _vm.getRoot().runResources().soundHandler();
         if (!s) break;
 
         int bi; // button sound array index [0..3]

=== modified file 'libcore/Button.h'
--- a/libcore/Button.h  2009-06-03 10:17:39 +0000
+++ b/libcore/Button.h  2009-07-10 15:44:55 +0000
@@ -91,7 +91,7 @@
        // called from keypress listener only
        bool on_event(const event_id& id);
 
-       void display();
+       void display(Renderer& renderer);
        
        void set_current_state(MouseState new_state);
 

=== modified file 'libcore/DisplayList.cpp'
--- a/libcore/DisplayList.cpp   2009-06-02 12:38:45 +0000
+++ b/libcore/DisplayList.cpp   2009-07-10 15:44:55 +0000
@@ -20,7 +20,7 @@
 #include "smart_ptr.h" // GNASH_USE_GC
 #include "DisplayList.h"
 #include "log.h"
-#include "render.h"
+#include "Renderer.h"
 #include "StringPredicates.h"
 #include "MovieClip.h"
 
@@ -648,7 +648,7 @@
 // Display the referenced DisplayObjects. Lower depths
 // are obscured by higher depths.
 void
-DisplayList::display()
+DisplayList::display(Renderer& renderer)
 {
     testInvariant();
 
@@ -664,17 +664,17 @@
         DisplayObject* mask = ch->getMask();
         if (mask && ch->visible() && ! mask->unloaded())
         {
-            render::begin_submit_mask();
+            renderer.begin_submit_mask();
             
-            if (mask->boundsInClippingArea()) mask->display();
+            if (mask->boundsInClippingArea(renderer)) mask->display(renderer);
             else mask->omit_display();
               
-            render::end_submit_mask();
+            renderer.end_submit_mask();
             
-            if (ch->boundsInClippingArea()) ch->display();
+            if (ch->boundsInClippingArea(renderer)) ch->display(renderer);
             else ch->omit_display();
               
-            render::disable_mask();
+            renderer.disable_mask();
             
             continue;
         }
@@ -707,27 +707,27 @@
         // Discard useless masks
         while (!clipDepthStack.empty() && (depth > clipDepthStack.top())) {
             clipDepthStack.pop();
-            render::disable_mask();
+            renderer.disable_mask();
         }
 
         // Push a new mask to the masks stack
        if (ch->isMaskLayer()) {
             int clipDepth = ch->get_clip_depth();
             clipDepthStack.push(clipDepth);
-            render::begin_submit_mask();
+            renderer.begin_submit_mask();
         }
         
-        if (ch->boundsInClippingArea()) ch->display();        
+        if (ch->boundsInClippingArea(renderer)) ch->display(renderer);
         else ch->omit_display();
         
         // Notify the renderer that mask drawing has finished.
-        if (ch->isMaskLayer()) render::end_submit_mask();
+        if (ch->isMaskLayer()) renderer.end_submit_mask();
     } 
 
     // Discard any remaining masks
     while (!clipDepthStack.empty()) {
         clipDepthStack.pop();
-        render::disable_mask();
+        renderer.disable_mask();
     }
     
     

=== modified file 'libcore/DisplayList.h'
--- a/libcore/DisplayList.h     2009-06-15 14:07:12 +0000
+++ b/libcore/DisplayList.h     2009-07-10 15:44:55 +0000
@@ -40,6 +40,7 @@
 
 namespace gnash {
        class cxform;
+       class Renderer;
 }
 
 namespace gnash {
@@ -243,7 +244,7 @@
        /// \brief
        /// Display the referenced DisplayObjects.
        /// Lower depths are obscured by higher depths.
-       void display();
+       void display(Renderer& renderer);
        
        void omit_display();
 

=== modified file 'libcore/DisplayObject.cpp'
--- a/libcore/DisplayObject.cpp 2009-06-04 07:14:23 +0000
+++ b/libcore/DisplayObject.cpp 2009-07-13 07:07:26 +0000
@@ -30,7 +30,6 @@
 #include "VM.h" // for do_mouse_drag (to be moved in movie_root)
 #include "fn_call.h" // for shared ActionScript getter-setters
 #include "GnashException.h" 
-#include "render.h"  // for bounds_in_clipping_area()
 #include "ExecutableCode.h"
 #include "namedStrings.h"
 #include "gnash.h" // Quality
@@ -1423,12 +1422,12 @@
 
 
 bool 
-DisplayObject::boundsInClippingArea() const 
+DisplayObject::boundsInClippingArea(Renderer& renderer) const 
 {
   rect mybounds = getBounds();
   getWorldMatrix().transform(mybounds);
   
-  return gnash::render::bounds_in_clipping_area( mybounds.getRange() );  
+  return renderer.bounds_in_clipping_area(mybounds.getRange());  
 }
 
 #ifdef USE_SWFTREE

=== modified file 'libcore/DisplayObject.h'
--- a/libcore/DisplayObject.h   2009-06-03 10:17:39 +0000
+++ b/libcore/DisplayObject.h   2009-07-10 15:44:55 +0000
@@ -53,6 +53,7 @@
     class movie_definition;
     class StaticText;
     class InteractiveObject;
+    class Renderer;
     namespace SWF {
         class TextRecord;
     }
@@ -417,7 +418,7 @@
     /// Render the DisplayObject.
     //
     /// All DisplayObjects must have a display() function.
-       virtual void display() = 0;
+       virtual void display(Renderer& renderer) = 0;
 
     /// Search for StaticText objects
     //
@@ -828,7 +829,7 @@
     /// There is no need to do any rendering for this DisplayObject when this 
     /// function returns false because the renderer will not change any pixels
     /// in the area where this DisplayObject is placed.    
-    bool boundsInClippingArea() const; 
+    bool boundsInClippingArea(Renderer& renderer) const; 
 
     /// Return full path to this object, in slash notation
     //

=== modified file 'libcore/DynamicShape.cpp'
--- a/libcore/DynamicShape.cpp  2009-07-08 16:19:10 +0000
+++ b/libcore/DynamicShape.cpp  2009-07-13 07:07:26 +0000
@@ -16,7 +16,9 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 #include "DynamicShape.h"
-#include "render.h"
+#include "fill_style.h"
+#include "Renderer.h"
+#include "DisplayObject.h"
 
 #include <vector>
 
@@ -42,9 +44,9 @@
 }
 
 void
-DynamicShape::display(const DisplayObject& inst) const
+DynamicShape::display(Renderer& renderer, const DisplayObject& inst) const
 {
-    render::drawShape(_shape, inst.get_world_cxform(), inst.getWorldMatrix());
+    renderer.drawShape(_shape, inst.get_world_cxform(), inst.getWorldMatrix());
 }
 
 void

=== modified file 'libcore/DynamicShape.h'
--- a/libcore/DynamicShape.h    2009-04-28 15:22:32 +0000
+++ b/libcore/DynamicShape.h    2009-07-11 11:25:42 +0000
@@ -20,12 +20,13 @@
 #ifndef GNASH_DYNAMIC_SHAPE_H
 #define GNASH_DYNAMIC_SHAPE_H
 
-#include "fill_style.h"
 #include "styles.h" 
 #include "ShapeRecord.h"
 
 namespace gnash {
     class DisplayObject;
+    class Renderer;
+    class fill_style;
 }
 
 namespace gnash {
@@ -83,7 +84,7 @@
     }
 
     /// Display a DynamicShape object.
-    void display(const DisplayObject& inst) const;
+    void display(Renderer& renderer, const DisplayObject& inst) const;
 
        /// Set current line style and start a new path.
        //

=== modified file 'libcore/FreetypeGlyphsProvider.cpp'
--- a/libcore/FreetypeGlyphsProvider.cpp        2009-04-07 18:14:07 +0000
+++ b/libcore/FreetypeGlyphsProvider.cpp        2009-07-13 07:07:26 +0000
@@ -24,7 +24,6 @@
 #include "smart_ptr.h" // for intrusive_ptr
 #include "GnashImage.h" // for create_alpha
 #include "GnashException.h"
-#include "render.h"
 #include "ShapeRecord.h"
 #include "log.h"
 

=== modified file 'libcore/InteractiveObject.h'
--- a/libcore/InteractiveObject.h       2009-05-25 12:11:10 +0000
+++ b/libcore/InteractiveObject.h       2009-07-10 15:44:55 +0000
@@ -52,7 +52,7 @@
     virtual ~InteractiveObject() {}
 
     /// Render this InteractiveObject
-    virtual void display() = 0;
+    virtual void display(Renderer& renderer) = 0;
 
     /// Whether the DisplayObject can handle a mouse event.
     //

=== modified file 'libcore/Makefile.am'
--- a/libcore/Makefile.am       2009-06-15 14:46:41 +0000
+++ b/libcore/Makefile.am       2009-07-13 08:06:09 +0000
@@ -120,7 +120,6 @@
        fontlib.cpp \
        impl.cpp \
        LoadVariablesThread.cpp \
-       render.cpp \
        SWFStream.cpp \
        styles.cpp \
        Timers.cpp \
@@ -165,7 +164,6 @@
        StaticText.h \
        LoadVariablesThread.h \
        SWFMovie.h \
-       render.h \
        SWFStream.h \
        MovieLibrary.h \
        swf/tag_loaders.h \
@@ -231,7 +229,7 @@
        rect.h \
        GnashKey.h \
        Movie.h \
-       RunInfo.h \
+       RunResources.h \
        gnash.h \
        DisplayObjectContainer.h \
        DisplayObject.h \

=== modified file 'libcore/MorphShape.cpp'
--- a/libcore/MorphShape.cpp    2009-04-07 14:32:06 +0000
+++ b/libcore/MorphShape.cpp    2009-07-11 11:25:42 +0000
@@ -19,7 +19,6 @@
 
 #include "MorphShape.h"
 #include "VM.h"
-#include "fill_style.h"
 #include "swf/ShapeRecord.h"
 #include "Geometry.h"
 #include "SWFMatrix.h"
@@ -62,10 +61,10 @@
 }
 
 void  
-MorphShape::display()
+MorphShape::display(Renderer& renderer)
 {
     morph();
-    _def->display(*this); 
+    _def->display(renderer, *this); 
     clear_invalidated();
 }
 

=== modified file 'libcore/MorphShape.h'
--- a/libcore/MorphShape.h      2009-04-08 08:35:37 +0000
+++ b/libcore/MorphShape.h      2009-07-10 15:44:55 +0000
@@ -26,6 +26,10 @@
 #include <cassert>
 
 namespace gnash {
+    class Renderer;
+}
+
+namespace gnash {
 
 /// A DisplayObject that tweens between two shapes.
 //
@@ -49,7 +53,7 @@
     MorphShape(const SWF::DefineMorphShapeTag* const def, 
             DisplayObject* parent, int id);
 
-       virtual void display();
+       virtual void display(Renderer& renderer);
 
     virtual rect getBounds() const;
     

=== modified file 'libcore/MovieClip.cpp'
--- a/libcore/MovieClip.cpp     2009-07-09 07:26:49 +0000
+++ b/libcore/MovieClip.cpp     2009-07-13 09:04:26 +0000
@@ -53,7 +53,6 @@
 #include "Object.h" // for getObjectInterface
 #include "DynamicShape.h" // for composition
 #include "namedStrings.h"
-#include "fill_style.h" // for beginGradientFill
 #include "styles.h" // for cap_style_e and join_style_e enums
 #include "PlaceObject2Tag.h" 
 #include "NetStream_as.h"
@@ -1350,7 +1349,8 @@
         return false;
 }
 
-void MovieClip::display()
+void
+MovieClip::display(Renderer& renderer)
 {
 
     // Note: 
@@ -1362,11 +1362,11 @@
     
     // render drawable (ActionScript generated graphics)
     _drawable.finalize();
-    _drawable.display(*this);
+    _drawable.display(renderer, *this);
     
     
     // descend the display list
-    _displayList.display();
+    _displayList.display(renderer);
      
     clear_invalidated();
 }
@@ -2225,7 +2225,7 @@
         const movie_root& mr = _vm.getRoot();
 
         boost::intrusive_ptr<movie_definition> md(
-            MovieFactory::makeMovie(url, mr.runInfo(), NULL, true, postdata));
+            MovieFactory::makeMovie(url, mr.runResources(), NULL, true, 
postdata));
 
         if (!md)
         {
@@ -2299,7 +2299,7 @@
     // (down by getStream, that is)
     
     const movie_root& mr = _vm.getRoot();
-    URL url(urlstr, mr.runInfo().baseURL());
+    URL url(urlstr, mr.runResources().baseURL());
 
     std::string postdata;
     
@@ -2308,7 +2308,7 @@
 
     try 
     {
-        const StreamProvider& sp = _vm.getRoot().runInfo().streamProvider();
+        const StreamProvider& sp = 
_vm.getRoot().runResources().streamProvider();
         
         if (sendVarsMethod == METHOD_POST)
         {
@@ -2634,7 +2634,7 @@
 {
     if ( m_sound_stream_id == -1 ) return; // nothing to do
 
-    sound::sound_handler* handler = _vm.getRoot().runInfo().soundHandler();
+    sound::sound_handler* handler = 
_vm.getRoot().runResources().soundHandler();
     if (handler)
     {
         handler->stop_sound(m_sound_stream_id);

=== modified file 'libcore/MovieClip.h'
--- a/libcore/MovieClip.h       2009-06-16 05:42:44 +0000
+++ b/libcore/MovieClip.h       2009-07-10 15:44:55 +0000
@@ -299,7 +299,7 @@
     bool goto_labeled_frame(const std::string& label);
         
     /// Display (render?) this Sprite/MovieClip, unless invisible
-    void display();
+    void display(Renderer& renderer);
     
     void omit_display();
 

=== modified file 'libcore/MovieFactory.h'
--- a/libcore/MovieFactory.h    2009-06-15 15:47:34 +0000
+++ b/libcore/MovieFactory.h    2009-07-13 09:04:26 +0000
@@ -26,7 +26,7 @@
 
 namespace gnash {
     class IOChannel;
-    class RunInfo;
+    class RunResources;
     class movie_definition;
     class URL;
 }
@@ -62,8 +62,8 @@
     /// @param url
     /// The URL to load the movie from.
     ///
-    /// @param runInfo
-    /// A RunInfo containing resources needed for parsing, such as the
+    /// @param runResources
+    /// A RunResources containing resources needed for parsing, such as the
     /// base URL for the run, the sound::sound_handler, and a StreamProvider.
     ///
     /// @param real_url
@@ -83,7 +83,7 @@
     /// If not NULL, use POST method (only valid for HTTP).
     /// NOTE: when POSTing, the movies library won't be used.
     static DSOEXPORT movie_definition* makeMovie(const URL& url,
-        const RunInfo& runInfo, const char* real_url = NULL,
+        const RunResources& runResources, const char* real_url = NULL,
         bool startLoaderThread = true, const std::string* postdata = NULL);
     
     /// Load a movie from an already opened stream.
@@ -100,8 +100,8 @@
     /// movie definition. This is required as it can not be
     /// derived from the IOChannel.
     ///
-    /// @param runInfo
-    /// A RunInfo containing resources needed for parsing, such as the
+    /// @param runResources
+    /// A RunResources containing resources needed for parsing, such as the
     /// base URL for the run, the sound::sound_handler, and a StreamProvider.
     ///
     /// @param startLoaderThread
@@ -111,7 +111,7 @@
     /// is initialized. Initializing the VirtualMachine requires a target
     /// SWF version, which can be found in the SWF header.
     static DSOEXPORT movie_definition* makeMovie(std::auto_ptr<IOChannel> in,
-            const std::string& url, const RunInfo& runInfo,
+            const std::string& url, const RunResources& runResources,
             bool startLoaderThread);
 };
 

=== renamed file 'libcore/RunInfo.h' => 'libcore/RunResources.h'
--- a/libcore/RunInfo.h 2009-06-15 12:30:59 +0000
+++ b/libcore/RunResources.h    2009-07-13 08:06:09 +0000
@@ -1,4 +1,4 @@
-// RunInfo.h    Hold external and per-run resources for Gnash core.
+// RunResources.h    Hold external and per-run resources for Gnash core.
 // 
 //   Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
 // 
@@ -22,16 +22,14 @@
 
 #include "TagLoadersTable.h"
 #include "StreamProvider.h"
+#include "Renderer.h"
+#include "sound_handler.h"
+
 #include <string>
 #include <boost/shared_ptr.hpp>
 
 namespace gnash {
 
-// Forward declarations
-namespace sound {
-    class sound_handler;
-}
-
 /// Class to group together per-run and external resources for Gnash
 //
 /// This holds the following resources:
@@ -41,16 +39,16 @@
 /// This must be kept alive for the entire duration of a run (presently
 /// until the last SWFMovieDefinition has been destroyed).
 /// @todo Check the lifetime and update documentation if it changes.
-/// @todo   Add render_handler, MediaHandler.
-class RunInfo
+/// @todo   Add MediaHandler.
+class RunResources
 {
 public:
 
-    /// Constructs a RunInfo instance with an immutable base URL.
+    /// Constructs a RunResources instance with an immutable base URL.
     //
     /// @param baseURL  The base URL for the run. This cannot be changed after
     ///                 construction.
-    RunInfo(const std::string& baseURL)
+    RunResources(const std::string& baseURL)
         :
         _baseURL(baseURL)
     {
@@ -99,13 +97,20 @@
         return _soundHandler.get();
     }
 
+    void setRenderer(boost::shared_ptr<Renderer> r) {
+        _renderer = r;
+    }
+
+    Renderer* renderer() const {
+        return _renderer.get();
+    }
+
     /// Set the loader functions for SWF parsing.
     //
     /// This must be present before parsing.
     /// It is a pointer to const so that the same table can be shared between
     /// simultaneous runs if desired.
-    void setTagLoaders(boost::shared_ptr<const SWF::TagLoadersTable> loaders)
-    {
+    void setTagLoaders(boost::shared_ptr<const SWF::TagLoadersTable> loaders) {
         _tagLoaders = loaders;
     }
 
@@ -123,6 +128,8 @@
 
     boost::shared_ptr<sound::sound_handler> _soundHandler;
 
+    boost::shared_ptr<Renderer> _renderer;
+
     boost::shared_ptr<const SWF::TagLoadersTable> _tagLoaders;
 
 };

=== modified file 'libcore/Shape.cpp'
--- a/libcore/Shape.cpp 2009-04-14 07:33:24 +0000
+++ b/libcore/Shape.cpp 2009-07-10 15:44:55 +0000
@@ -52,10 +52,10 @@
 }
 
 void  
-Shape::display()
+Shape::display(Renderer& renderer)
 {
-    if (_def) _def->display(*this);
-    else _shape->display(*this);
+    if (_def) _def->display(renderer, *this);
+    else _shape->display(renderer, *this);
     clear_invalidated();
 }
 

=== modified file 'libcore/Shape.h'
--- a/libcore/Shape.h   2009-04-14 07:33:24 +0000
+++ b/libcore/Shape.h   2009-07-10 15:44:55 +0000
@@ -55,7 +55,7 @@
            assert(_def);
        }
 
-       virtual void display();
+       virtual void display(Renderer& renderer);
 
     virtual rect getBounds() const {
         return _def ? _def->bounds() : _shape->getBounds();

=== modified file 'libcore/StaticText.cpp'
--- a/libcore/StaticText.cpp    2009-04-07 17:48:48 +0000
+++ b/libcore/StaticText.cpp    2009-07-10 15:44:55 +0000
@@ -55,9 +55,9 @@
 
 
 void  
-StaticText::display()
+StaticText::display(Renderer& renderer)
 {
-    _def->display(*this);
+    _def->display(renderer, *this);
     clear_invalidated();
 }
 

=== modified file 'libcore/StaticText.h'
--- a/libcore/StaticText.h      2009-04-14 07:33:24 +0000
+++ b/libcore/StaticText.h      2009-07-10 15:44:55 +0000
@@ -66,7 +66,7 @@
     virtual StaticText* getStaticText(std::vector<const SWF::TextRecord*>& to,
             size_t& numChars);
 
-       virtual void display();
+       virtual void display(Renderer& renderer);
 
     void setSelected(size_t pos, bool selected) {
         _selectedText.set(pos, selected);

=== modified file 'libcore/TextField.cpp'
--- a/libcore/TextField.cpp     2009-07-06 15:56:10 +0000
+++ b/libcore/TextField.cpp     2009-07-13 07:07:26 +0000
@@ -24,7 +24,6 @@
 #include "utf8.h"
 #include "log.h"
 #include "swf/DefineEditTextTag.h"
-#include "render.h"
 #include "movie_definition.h" // to extract version info
 #include "MovieClip.h"
 #include "TextField.h"
@@ -272,7 +271,7 @@
 }
 
 void
-TextField::show_cursor(const SWFMatrix& mat)
+TextField::show_cursor(Renderer& renderer, const SWFMatrix& mat)
 {
     boost::uint16_t x = static_cast<boost::uint16_t>(m_xcursor);
     boost::uint16_t y = static_cast<boost::uint16_t>(m_ycursor);
@@ -282,11 +281,11 @@
         (point(x, y))
         (point(x, y + h));
     
-    render::drawLine(box, rgba(0,0,0,255), mat);
+    renderer.drawLine(box, rgba(0,0,0,255), mat);
 }
 
 void
-TextField::display()
+TextField::display(Renderer& renderer)
 {
 
     registerTextVariable();
@@ -325,7 +324,7 @@
     log_debug("rendering a Pol composed by corners %s", _bounds);
 #endif
 
-        render::draw_poly(&coords.front(), 4, backgroundColor, 
+        renderer.draw_poly(&coords.front(), 4, backgroundColor, 
                 borderColor, wmat, true);
         
     }
@@ -341,10 +340,10 @@
         m.concatenate_translation(_bounds.get_x_min(), _bounds.get_y_min()); 
     }
     
-    SWF::TextRecord::displayRecords(m, get_world_cxform(), _textRecords,
-            _embedFonts);
+    SWF::TextRecord::displayRecords(renderer, m, get_world_cxform(),
+            _textRecords, _embedFonts);
 
-    if (m_has_focus) show_cursor(wmat);
+    if (m_has_focus) show_cursor(renderer, wmat);
     
     clear_invalidated();
 }

=== modified file 'libcore/TextField.h'
--- a/libcore/TextField.h       2009-06-09 12:22:18 +0000
+++ b/libcore/TextField.h       2009-07-11 11:25:42 +0000
@@ -20,7 +20,6 @@
 
 #include "InteractiveObject.h" // for inheritance
 #include "styles.h" // for line_style
-#include "fill_style.h"
 #include "Range2d.h"
 #include "rect.h" // for inlines
 #include "Font.h" // for visibility of font add_ref/drop_ref
@@ -161,7 +160,7 @@
                string_table::key nsname = 0);
 
        /// Draw the dynamic string.
-       void    display();
+       void display(Renderer& renderer);
 
        void add_invalidated_bounds(InvalidatedRanges& ranges, bool force);
 
@@ -601,7 +600,7 @@
 
        bool m_has_focus;
        size_t m_cursor;
-       void show_cursor(const SWFMatrix& mat);
+       void show_cursor(Renderer& renderer, const SWFMatrix& mat);
        float m_xcursor;
        float m_ycursor;
 

=== modified file 'libcore/Video.cpp'
--- a/libcore/Video.cpp 2009-06-17 15:33:51 +0000
+++ b/libcore/Video.cpp 2009-07-13 07:07:26 +0000
@@ -24,7 +24,6 @@
 #include "fn_call.h"
 #include "as_value.h"
 #include "NetStream_as.h"
-#include "render.h"
 #include "Range2d.h"
 #include "builtin_function.h" // for getter/setter properties
 #include "movie_root.h"
@@ -134,7 +133,7 @@
 }
 
 void
-Video::display()
+Video::display(Renderer& renderer)
 {
        // if m_def is NULL we've been constructed by 'new Video', in this
        // case I think display() would never be invoked on us...
@@ -146,7 +145,7 @@
        GnashImage* img = getVideoFrame();
        if (img)
        {
-               gnash::render::drawVideoFrame(img, &m, &bounds, _smoothing);
+               renderer.drawVideoFrame(img, &m, &bounds, _smoothing);
        }
 
        clear_invalidated();

=== modified file 'libcore/Video.h'
--- a/libcore/Video.h   2009-04-15 09:08:37 +0000
+++ b/libcore/Video.h   2009-07-10 15:44:55 +0000
@@ -67,7 +67,7 @@
        /// Register this video instance as a live DisplayObject
        virtual void stagePlacementCallback(as_object* initObj = 0);
 
-       void display();
+       void display(Renderer& renderer);
 
        // For sure isActionScriptReferenceable...
        bool wantsInstanceName() const

=== modified file 'libcore/asobj/LoadableObject.cpp'
--- a/libcore/asobj/LoadableObject.cpp  2009-07-01 07:10:36 +0000
+++ b/libcore/asobj/LoadableObject.cpp  2009-07-13 09:04:26 +0000
@@ -88,7 +88,7 @@
     /// All objects get a loaded member, set to false.
     target.set_member(NSV::PROP_LOADED, false);
 
-    const RunInfo& ri = _vm.getRoot().runInfo();
+    const RunResources& ri = _vm.getRoot().runResources();
        URL url(urlstr, ri.baseURL());
 
        std::auto_ptr<IOChannel> str;
@@ -176,7 +176,7 @@
     // when loading is complete.
        set_member(NSV::PROP_LOADED, false);
 
-    const RunInfo& ri = _vm.getRoot().runInfo();
+    const RunResources& ri = _vm.getRoot().runResources();
        URL url(urlstr, ri.baseURL());
 
     // Checks whether access is allowed.

=== modified file 'libcore/asobj/MovieClipLoader.cpp'
--- a/libcore/asobj/MovieClipLoader.cpp 2009-06-03 16:05:40 +0000
+++ b/libcore/asobj/MovieClipLoader.cpp 2009-07-13 09:04:26 +0000
@@ -154,7 +154,7 @@
     
     movie_root& mr = _vm.getRoot();
 
-       URL url(url_str, mr.runInfo().baseURL());
+       URL url(url_str, mr.runResources().baseURL());
        
 #if GNASH_DEBUG
        log_debug(_(" resolved url: %s"), url.str());

=== modified file 'libcore/asobj/NetConnection_as.cpp'
--- a/libcore/asobj/NetConnection_as.cpp        2009-06-17 17:45:55 +0000
+++ b/libcore/asobj/NetConnection_as.cpp        2009-07-13 09:04:26 +0000
@@ -583,7 +583,7 @@
         // TODO: it might be useful for a Remoting Handler to have a 
         // StreamProvider member
         const StreamProvider& sp =
-            _nc.getVM().getRoot().runInfo().streamProvider();
+            _nc.getVM().getRoot().runResources().streamProvider();
 
         _connection.reset(sp.getStream(_url, postdata_str, 
_headers).release());
 
@@ -735,7 +735,7 @@
 {
 
     const movie_root& mr = _vm.getRoot();
-    URL uri(_uri, mr.runInfo().baseURL());
+    URL uri(_uri, mr.runResources().baseURL());
 
     std::string uriStr(uri.str());
     assert(uriStr.find("://") != std::string::npos);
@@ -841,7 +841,7 @@
     }
 
     const movie_root& mr = _vm.getRoot();
-    URL url(uri, mr.runInfo().baseURL());
+    URL url(uri, mr.runResources().baseURL());
 
     if ( url.protocol() == "rtmp" )
     {
@@ -943,7 +943,7 @@
 std::auto_ptr<IOChannel>
 NetConnection_as::getStream(const std::string& name)
 {
-    const RunInfo& ri = _vm.getRoot().runInfo();
+    const RunResources& ri = _vm.getRoot().runResources();
 
     const StreamProvider& streamProvider = ri.streamProvider();
 

=== modified file 'libcore/asobj/NetStream_as.cpp'
--- a/libcore/asobj/NetStream_as.cpp    2009-06-17 17:45:55 +0000
+++ b/libcore/asobj/NetStream_as.cpp    2009-07-13 09:04:26 +0000
@@ -96,7 +96,7 @@
     // TODO: figure out if we should take another path to get to the clock
     _playbackClock(new InterruptableVirtualClock(getVM().getClock())),
     _playHead(_playbackClock.get()), 
-    _soundHandler(_vm.getRoot().runInfo().soundHandler()),
+    _soundHandler(_vm.getRoot().runResources().soundHandler()),
     _mediaHandler(media::MediaHandler::get()),
     _audioStreamer(_soundHandler),
     _statusCode(invalidStatus)

=== modified file 'libcore/asobj/flash/media/Sound_as.cpp'
--- a/libcore/asobj/flash/media/Sound_as.cpp    2009-06-10 11:27:47 +0000
+++ b/libcore/asobj/flash/media/Sound_as.cpp    2009-07-13 09:04:26 +0000
@@ -87,7 +87,7 @@
     soundId(-1),
     externalSound(false),
     isStreaming(false),
-    _soundHandler(_vm.getRoot().runInfo().soundHandler()),
+    _soundHandler(_vm.getRoot().runResources().soundHandler()),
     _mediaHandler(media::MediaHandler::get()),
     _startTime(0),
     _leftOverData(),
@@ -353,11 +353,11 @@
     _startTime=0;
 
     const movie_root& mr = _vm.getRoot();
-    URL url(file, mr.runInfo().baseURL());
+    URL url(file, mr.runResources().baseURL());
 
     const RcInitFile& rcfile = RcInitFile::getDefaultInstance();
 
-    const StreamProvider& streamProvider = mr.runInfo().streamProvider();
+    const StreamProvider& streamProvider = mr.runResources().streamProvider();
     std::auto_ptr<IOChannel> inputStream(streamProvider.getStream(url,
                 rcfile.saveStreamingMedia()));
     if ( ! inputStream.get() )

=== modified file 'libcore/asobj/flash/net/SharedObject_as.cpp'
--- a/libcore/asobj/flash/net/SharedObject_as.cpp       2009-06-11 20:48:16 
+0000
+++ b/libcore/asobj/flash/net/SharedObject_as.cpp       2009-07-13 08:06:09 
+0000
@@ -434,7 +434,7 @@
     // loaded SWF, so that in the A loads B scenario above the
     // domain would be the one of A, not B.
     //
-    // NOTE: using the base url RunInfo::baseURL() would mean
+    // NOTE: using the base url RunResources::baseURL() would mean
     // blindly trusting the SWF publisher as base url is changed
     // by the 'base' attribute of OBJECT or EMBED tags trough
     // -P base=xxx

=== modified file 'libcore/asobj/flash/system/System_as.cpp'
--- a/libcore/asobj/flash/system/System_as.cpp  2009-07-02 09:04:07 +0000
+++ b/libcore/asobj/flash/system/System_as.cpp  2009-07-13 09:04:26 +0000
@@ -175,7 +175,7 @@
     //
         
     // Is audio available?
-    const bool hasAudio = (vm.getRoot().runInfo().soundHandler());
+    const bool hasAudio = (vm.getRoot().runResources().soundHandler());
 
     // FIXME: these need to be implemented properly. They are mostly
     // self-explanatory.

=== modified file 'libcore/fill_style.cpp'
--- a/libcore/fill_style.cpp    2009-06-15 14:10:05 +0000
+++ b/libcore/fill_style.cpp    2009-07-13 08:06:09 +0000
@@ -22,12 +22,14 @@
 #include "smart_ptr.h" // GNASH_USE_GC
 #include "fill_style.h"
 #include "log.h"
-#include "render.h"
 #include "SWFStream.h"
 #include "movie_definition.h"
 #include "SWF.h"
 #include "GnashException.h"
 #include "GnashNumeric.h"
+#include "Renderer.h"
+#include "RunResources.h"
+
 #include <cmath> // sqrt, floor
 #include <iostream> // for output operator
 
@@ -62,7 +64,7 @@
 
 void
 fill_style::read(SWFStream& in, SWF::TagType t, movie_definition& md,
-    fill_style *pOther)
+        const RunResources& r, fill_style *pOther)
 {
     const bool is_morph = (pOther != NULL);
 
@@ -236,10 +238,13 @@
                pOther->m_color = pOther->m_gradients[0].m_color;
         }
     
-        _bitmapInfo = create_gradient_bitmap();
-        if (is_morph)
-        {
-            pOther->_bitmapInfo = pOther->need_gradient_bitmap();
+        Renderer* renderer = r.renderer();
+        if (renderer) {
+
+            _bitmapInfo = create_gradient_bitmap(*renderer);
+            if (is_morph) {
+                pOther->_bitmapInfo = pOther->need_gradient_bitmap(*renderer);
+            }
         }
     }
     else if (m_type == SWF::FILL_TILED_BITMAP
@@ -320,7 +325,7 @@
 
 
 const BitmapInfo* 
-fill_style::get_bitmap_info() const 
+fill_style::get_bitmap_info(Renderer& renderer) const 
 {    
     assert(m_type != SWF::FILL_SOLID);
 
@@ -338,7 +343,7 @@
    
         case SWF::FILL_LINEAR_GRADIENT:
         case SWF::FILL_RADIAL_GRADIENT:
-            return need_gradient_bitmap();
+            return need_gradient_bitmap(renderer);
         default:
             log_error(_("Unknown fill style %d"), m_type);
             // Seems a bit drastic...
@@ -432,7 +437,7 @@
 }
 
 const BitmapInfo*
-fill_style::create_gradient_bitmap() const
+fill_style::create_gradient_bitmap(Renderer& renderer) const
 {
     assert(m_type == SWF::FILL_LINEAR_GRADIENT
         || m_type == SWF::FILL_RADIAL_GRADIENT
@@ -498,7 +503,7 @@
             break;
     }
 
-    const BitmapInfo* bi = render::createBitmapInfo(
+    const BitmapInfo* bi = renderer.createBitmapInfo(
                     static_cast<std::auto_ptr<GnashImage> >(im));
 
     return bi;
@@ -506,12 +511,12 @@
 
 
 const BitmapInfo*
-fill_style::need_gradient_bitmap() const 
+fill_style::need_gradient_bitmap(Renderer& renderer) const 
 {
 
   if (!_bitmapInfo) {
     fill_style* this_non_const = const_cast<fill_style*>(this);
-    this_non_const->_bitmapInfo = create_gradient_bitmap();
+    this_non_const->_bitmapInfo = create_gradient_bitmap(renderer);
   }
   
   return _bitmapInfo.get();

=== modified file 'libcore/fill_style.h'
--- a/libcore/fill_style.h      2009-06-15 11:32:49 +0000
+++ b/libcore/fill_style.h      2009-07-13 08:06:09 +0000
@@ -34,6 +34,8 @@
 
 class SWFStream;
 class movie_definition;
+class Renderer;
+class RunResources;
 
 class gradient_record
 {
@@ -167,21 +169,17 @@
        /// currently opened tag for reading. See stream::ensureBytes()
        ///
        void read(SWFStream& in, SWF::TagType t, movie_definition& m,
-               fill_style *pOther = NULL);
-
-       /// Read the fill style from a stream, morph version.
-       void read_morph(SWFStream& in, SWF::TagType t, movie_definition& m,
-               fill_style *pOther);
+            const RunResources& r, fill_style *pOther = 0);
 
        /// \brief
        /// Make a BitmapInfo* corresponding to our gradient.
        /// We can use this to set the gradient fill style.
-       const BitmapInfo* create_gradient_bitmap() const;
+       const BitmapInfo* create_gradient_bitmap(Renderer& renderer) const;
        
        /// \brief
        /// Makes sure that _gradientBitmapInfo is not NULL. Calls 
        /// create_gradient_bitmap() if necessary and returns 
_gradientBitmapInfo.
-       const BitmapInfo* need_gradient_bitmap() const; 
+       const BitmapInfo* need_gradient_bitmap(Renderer& renderer) const; 
        
        rgba    get_color() const { return m_color; }
 
@@ -209,7 +207,7 @@
        ///        to a DisplayObject defined in the DisplayObjects dictionary.
        ///        (it happens..)
        ///
-       const BitmapInfo* get_bitmap_info() const;
+       const BitmapInfo* get_bitmap_info(Renderer& renderer) const;
 
     BitmapSmoothingPolicy getBitmapSmoothingPolicy() const {
         return _bitmapSmoothingPolicy;

=== modified file 'libcore/fontlib.cpp'
--- a/libcore/fontlib.cpp       2009-06-15 14:10:05 +0000
+++ b/libcore/fontlib.cpp       2009-07-13 07:07:26 +0000
@@ -11,7 +11,6 @@
 
 #include "Font.h"
 #include "log.h"
-#include "render.h"
 #include "DefineShapeTag.h"
 #include "styles.h"
 #include "movie_definition.h"

=== modified file 'libcore/gnash.h'
--- a/libcore/gnash.h   2009-06-15 15:38:47 +0000
+++ b/libcore/gnash.h   2009-07-13 08:06:09 +0000
@@ -30,9 +30,8 @@
 namespace gnash {
        class IOChannel;
        class movie_definition; // for create_movie
-       class render_handler; // for set_render_handler 
        class URL; // for set_base_url
-    class RunInfo;
+    class RunResources;
 }
 
 
@@ -61,17 +60,6 @@
     QUALITY_BEST
 };
 
-// Sound callbacks stuff
-
-/// Set the render handler.  This is one of the first
-/// things you should do to initialise the player (assuming you
-/// want to display anything).
-DSOEXPORT void set_render_handler(render_handler* s);
-
-// Some helpers that may or may not be compiled into your
-// version of the library, depending on platform etc.
-DSOEXPORT render_handler*   create_render_handler_ogl(bool init = true);
-
 /// Initialize gnash core library
 //
 DSOEXPORT void gnashInit();

=== modified file 'libcore/impl.cpp'
--- a/libcore/impl.cpp  2009-06-15 14:53:11 +0000
+++ b/libcore/impl.cpp  2009-07-13 09:04:26 +0000
@@ -31,7 +31,7 @@
 #include "sprite_definition.h"
 #include "SWFMovieDefinition.h"
 #include "BitmapMovieDefinition.h"
-#include "RunInfo.h"
+#include "RunResources.h"
 #include "URL.h"
 #include "StreamProvider.h"
 #include "MovieClip.h"
@@ -54,7 +54,7 @@
 namespace {
     FileType getFileType(IOChannel& in);
     SWFMovieDefinition* createSWFMovie(std::auto_ptr<IOChannel> in,
-            const std::string& url, const RunInfo& runInfo,
+            const std::string& url, const RunResources& runResources,
             bool startLoaderThread);
 }
 
@@ -66,7 +66,7 @@
 // TODO: The pp won't display PNGs for SWF7 or below.
 static movie_definition*
 createBitmapMovie(std::auto_ptr<IOChannel> in, const std::string& url,
-        FileType type)
+        const RunResources& r, FileType type)
 {
     assert (in.get());
 
@@ -79,13 +79,16 @@
         std::auto_ptr<GnashImage> im(
                 ImageInput::readImageData(imageData, type));
 
-        if (!im.get())
-        {
+        if (!im.get()) {
             log_error(_("Can't read image file from %s"), url);
             return NULL;
-        } 
-
-        BitmapMovieDefinition* mdef = new BitmapMovieDefinition(im, url);
+        }
+
+        Renderer* renderer = r.renderer();
+
+        BitmapMovieDefinition* mdef =
+            new BitmapMovieDefinition(im, renderer, url);
+
         return mdef;
 
     }
@@ -100,7 +103,7 @@
 
 movie_definition*
 MovieFactory::makeMovie(std::auto_ptr<IOChannel> in, const std::string& url,
-        const RunInfo& runInfo, bool startLoaderThread)
+        const RunResources& runResources, bool startLoaderThread)
 {
   assert(in.get());
 
@@ -120,12 +123,12 @@
                            "image, for which we don't yet have the "
                            "concept of a 'loading thread'"));
             }
-            return createBitmapMovie(in, url, type);
+            return createBitmapMovie(in, url, runResources, type);
         }
 
 
         case GNASH_FILETYPE_SWF:
-            return createSWFMovie(in, url, runInfo, startLoaderThread);
+            return createSWFMovie(in, url, runResources, startLoaderThread);
 
         case GNASH_FILETYPE_FLV:
             log_unimpl(_("FLV can't be loaded directly as a movie"));
@@ -140,14 +143,14 @@
 }
 
 movie_definition*
-createNonLibraryMovie(const URL& url, const RunInfo& runInfo,
+createNonLibraryMovie(const URL& url, const RunResources& runResources,
         const char* reset_url, bool startLoaderThread,
         const std::string* postdata)
 {
 
   std::auto_ptr<IOChannel> in;
 
-  const StreamProvider& streamProvider = runInfo.streamProvider();
+  const StreamProvider& streamProvider = runResources.streamProvider();
 
   const RcInitFile& rcfile = RcInitFile::getDefaultInstance();
 
@@ -169,7 +172,7 @@
   }
 
   std::string movie_url = reset_url ? reset_url : url.str();
-  movie_definition* ret = MovieFactory::makeMovie(in, movie_url, runInfo,
+  movie_definition* ret = MovieFactory::makeMovie(in, movie_url, runResources,
           startLoaderThread);
 
   return ret;
@@ -264,10 +267,10 @@
 //
 SWFMovieDefinition*
 createSWFMovie(std::auto_ptr<IOChannel> in, const std::string& url,
-        const RunInfo& runInfo, bool startLoaderThread)
+        const RunResources& runResources, bool startLoaderThread)
 {
 
-    std::auto_ptr<SWFMovieDefinition> m (new SWFMovieDefinition(runInfo));
+    std::auto_ptr<SWFMovieDefinition> m (new SWFMovieDefinition(runResources));
 
     const std::string& absURL = URL(url).str();
 
@@ -315,9 +318,6 @@
     GC::cleanup();
 #endif
 
-    // By setting the render handler to NULL we avoid it being used
-    // after it's been de-referenced (fixes bug #21310)
-    set_render_handler(NULL);
 }
 
 static MovieLibrary s_movie_library;
@@ -334,7 +334,7 @@
 // return a pointer to it.
 //
 movie_definition*
-MovieFactory::makeMovie(const URL& url, const RunInfo& runInfo,
+MovieFactory::makeMovie(const URL& url, const RunResources& runResources,
         const char* real_url, bool startLoaderThread,
         const std::string* postdata)
 {
@@ -357,7 +357,7 @@
     // the loader thread now to avoid IMPORT tag loaders from 
     // calling createMovie() again and NOT finding
     // the just-created movie.
-    movie_definition* mov = createNonLibraryMovie(url, runInfo, real_url, 
false,
+    movie_definition* mov = createNonLibraryMovie(url, runResources, real_url, 
false,
             postdata);
 
     if (!mov)

=== modified file 'libcore/movie_root.cpp'
--- a/libcore/movie_root.cpp    2009-06-15 14:53:11 +0000
+++ b/libcore/movie_root.cpp    2009-07-13 09:04:26 +0000
@@ -24,7 +24,6 @@
 #include "log.h"
 #include "MovieClip.h"
 #include "Movie.h" // for implicit upcast to MovieClip
-#include "render.h"
 #include "VM.h"
 #include "ExecutableCode.h"
 #include "flash/display/Stage_as.h"
@@ -93,9 +92,9 @@
 
 
 movie_root::movie_root(const movie_definition& def,
-        VirtualClock& clock, const RunInfo& runInfo)
+        VirtualClock& clock, const RunResources& runResources)
        :
-    _runInfo(runInfo),
+    _runResources(runResources),
     _originalURL(def.get_url()),
     _vm(VM::init(def.get_version(), *this, clock)),
        _interfaceHandler(0),
@@ -425,7 +424,7 @@
 movie_root::loadLevel(unsigned int num, const URL& url)
 {
        boost::intrusive_ptr<movie_definition> md (
-            MovieFactory::makeMovie(url, _runInfo));
+            MovieFactory::makeMovie(url, _runResources));
        if (!md)
        {
                log_error(_("can't create movie_definition for %s"), url.str());
@@ -467,7 +466,7 @@
 void
 movie_root::reset()
 {
-       sound::sound_handler* sh = _runInfo.soundHandler();
+       sound::sound_handler* sh = _runResources.soundHandler();
        if ( sh ) sh->reset();
        clear();
        _disableScripts = false;
@@ -1107,7 +1106,10 @@
                return;
        }
 
-       render::begin_display(
+    Renderer* renderer = _runResources.renderer();
+    if (!renderer) return;
+
+       renderer->begin_display(
                m_background_color,
                m_viewport_x0, m_viewport_y0,
                m_viewport_width, m_viewport_height,
@@ -1132,11 +1134,11 @@
                        continue;
                }
 
-               movie->display();
+               movie->display(*renderer);
 
        }
 
-       render::end_display();
+       renderer->end_display();
 }
 
 
@@ -1401,10 +1403,9 @@
         _quality = q;
     }
 
-
     // We always tell the renderer, because it could
     // be the first time we do
-    render_handler* renderer = get_render_handler();
+    Renderer* renderer = _runResources.renderer();
     if (renderer) renderer->setQuality(_quality);
 
 }
@@ -2098,7 +2099,7 @@
         /// If there is no hosting application, call the URL launcher. For
         /// safety, we resolve the URL against the base URL for this run.
         /// The data is not sent at all.
-        URL url(urlstr, _runInfo.baseURL());
+        URL url(urlstr, _runResources.baseURL());
 
         gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
         std::string command = rcfile.getURLOpenerFormat();
@@ -2205,7 +2206,7 @@
 
     /// URL security is checked in StreamProvider::getStream() down the
     /// chain.
-    URL url(urlstr, _runInfo.baseURL());
+    URL url(urlstr, _runResources.baseURL());
 
     /// If the method is MovieClip::METHOD_NONE, we send no data.
     if (method == MovieClip::METHOD_GET)

=== modified file 'libcore/movie_root.h'
--- a/libcore/movie_root.h      2009-07-03 08:44:41 +0000
+++ b/libcore/movie_root.h      2009-07-13 09:04:26 +0000
@@ -78,7 +78,7 @@
 #include "URL.h" // for loadMovie
 #include "GnashKey.h" // key::code
 #include "Movie.h"
-#include "RunInfo.h" // for initialization
+#include "RunResources.h" // for initialization
 #include "gnash.h" // Quality
 
 #ifdef USE_SWFTREE
@@ -150,7 +150,7 @@
     /// before using any of this class methods !
     ///
     movie_root(const movie_definition& def, VirtualClock& clock,
-            const RunInfo& runInfo);
+            const RunResources& runResources);
 
     ~movie_root();
 
@@ -847,7 +847,7 @@
        ///
        const std::string& getOriginalURL() const { return _originalURL; }
 
-    const RunInfo& runInfo() const { return _runInfo; }
+    const RunResources& runResources() const { return _runResources; }
 
     /// Add a DisplayObject child on top depth
     //
@@ -867,7 +867,7 @@
 
 private:
 
-    const RunInfo& _runInfo; 
+    const RunResources& _runResources; 
 
     /// The URL of the original root movie.
     //
@@ -1173,7 +1173,7 @@
 
     /// The display quality of the entire movie.
     //
-    /// This is here, not just in the render_handler, so that AS compatibility
+    /// This is here, not just in the Renderer, so that AS compatibility
     /// does not rely on the presence of a renderer.
     Quality _quality;
 

=== modified file 'libcore/parser/BitmapMovieDefinition.cpp'
--- a/libcore/parser/BitmapMovieDefinition.cpp  2009-04-15 12:27:37 +0000
+++ b/libcore/parser/BitmapMovieDefinition.cpp  2009-07-13 09:39:21 +0000
@@ -20,12 +20,11 @@
 #include "smart_ptr.h" // GNASH_USE_GC
 #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 "Bitmap.h"
+#include "Renderer.h"
 
 namespace gnash {
 
@@ -36,7 +35,7 @@
 }
 
 BitmapMovieDefinition::BitmapMovieDefinition(std::auto_ptr<GnashImage> image,
-               const std::string& url)
+               Renderer* renderer, const std::string& url)
        :
        _version(6),
        _framesize(0, 0, image->width()*20, image->height()*20),
@@ -44,7 +43,7 @@
        _framerate(12),
        _url(url),
        _bytesTotal(image->size()),
-       _bitmap(render::createBitmapInfo(image))
+       _bitmap(renderer ? renderer->createBitmapInfo(image) : 0)
 {
 }
 
@@ -52,7 +51,6 @@
 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);
 }
 

=== modified file 'libcore/parser/BitmapMovieDefinition.h'
--- a/libcore/parser/BitmapMovieDefinition.h    2009-04-15 12:27:37 +0000
+++ b/libcore/parser/BitmapMovieDefinition.h    2009-07-13 07:07:26 +0000
@@ -30,6 +30,9 @@
 #include <memory> // for auto_ptr
 
 // Forward declarations
+namespace gnash {
+    class Renderer;
+}
 
 namespace gnash
 {
@@ -54,7 +57,7 @@
        ///  - image->size() bytes (for get_bytes_loaded()/get_bytes_total())
        ///  - provided url
        ///
-       BitmapMovieDefinition(std::auto_ptr<GnashImage> image,
+       BitmapMovieDefinition(std::auto_ptr<GnashImage> image, Renderer* 
renderer,
             const std::string& url);
 
     virtual DisplayObject* createDisplayObject(DisplayObject*, int) const;

=== modified file 'libcore/parser/SWFMovieDefinition.cpp'
--- a/libcore/parser/SWFMovieDefinition.cpp     2009-07-08 08:12:42 +0000
+++ b/libcore/parser/SWFMovieDefinition.cpp     2009-07-13 09:04:26 +0000
@@ -29,7 +29,7 @@
 #include "IOChannel.h" // for use
 #include "SWFStream.h"
 #include "GnashImageJpeg.h"
-#include "RunInfo.h"
+#include "RunResources.h"
 #include "Font.h"
 #include "VM.h"
 #include "log.h"
@@ -145,7 +145,7 @@
 // SWFMovieDefinition
 //
 
-SWFMovieDefinition::SWFMovieDefinition(const RunInfo& runInfo)
+SWFMovieDefinition::SWFMovieDefinition(const RunResources& runResources)
        :
        m_frame_rate(30.0f),
        m_frame_count(0u),
@@ -157,7 +157,7 @@
        m_jpeg_in(0),
        _loader(*this),
        _loadingCanceled(false),
-    _runInfo(runInfo),
+    _runResources(runResources),
     _as3(false)
 {
 }
@@ -479,7 +479,7 @@
        assert( ! _loader.isSelfThread() );
 #endif
 
-    SWFParser parser(*_str, this, _runInfo);
+    SWFParser parser(*_str, this, _runResources);
 
     const size_t startPos = _str->tell();
     assert (startPos <= _swf_end_pos);

=== modified file 'libcore/parser/SWFMovieDefinition.h'
--- a/libcore/parser/SWFMovieDefinition.h       2009-06-05 10:25:43 +0000
+++ b/libcore/parser/SWFMovieDefinition.h       2009-07-13 09:04:26 +0000
@@ -52,7 +52,7 @@
     class movie_root;
        class MovieClip;
        class SWFMovie;
-    class RunInfo;
+    class RunResources;
     class Font;
 }
 
@@ -179,9 +179,9 @@
 
     /// Construct a SWF movie.
     //
-    /// @param runInfo      A RunInfo containing information used for
+    /// @param runResources      A RunResources containing information used for
     ///                     parsing.
-       SWFMovieDefinition(const RunInfo& runInfo);
+       SWFMovieDefinition(const RunResources& runResources);
 
        ~SWFMovieDefinition();
 
@@ -567,8 +567,8 @@
     //
     /// @todo   Add to base class? This would make it available for other
     ///         kinds of movies (e.g. FLV) and make it easier to initialize
-    ///         movie_root with the same RunInfo as its first definition.
-    const RunInfo& _runInfo;
+    ///         movie_root with the same RunResources as its first definition.
+    const RunResources& _runResources;
 
     bool _as3;
 

=== modified file 'libcore/parser/SWFParser.cpp'
--- a/libcore/parser/SWFParser.cpp      2009-07-08 08:12:42 +0000
+++ b/libcore/parser/SWFParser.cpp      2009-07-13 09:04:26 +0000
@@ -21,7 +21,7 @@
 
 #include "SWFStream.h"
 #include "movie_definition.h"
-#include "RunInfo.h"
+#include "RunResources.h"
 #include "SWFParser.h"
 #include "TagLoadersTable.h"
 
@@ -57,7 +57,7 @@
     // we may read more than the size passed.
     _endRead += bytes;
 
-    const SWF::TagLoadersTable& tagLoaders = _runInfo.tagLoaders();
+    const SWF::TagLoadersTable& tagLoaders = _runResources.tagLoaders();
 
     while (_bytesRead < _endRead) {
         
@@ -95,7 +95,7 @@
             else if (tagLoaders.get(_tag, lf)) {
                 // call the tag loader.  The tag loader should add
                 // DisplayObjects or tags to the movie data structure.
-                lf(_stream, _tag, *_md, _runInfo);
+                lf(_stream, _tag, *_md, _runResources);
             }
             else {
                 // no tag loader for this tag type.

=== modified file 'libcore/parser/SWFParser.h'
--- a/libcore/parser/SWFParser.h        2009-07-08 08:12:42 +0000
+++ b/libcore/parser/SWFParser.h        2009-07-13 09:04:26 +0000
@@ -28,7 +28,7 @@
 namespace gnash {
     class SWFStream;
     class movie_definition;
-    class RunInfo;
+    class RunResources;
 }
 
 namespace gnash {
@@ -51,11 +51,11 @@
 {
 
 public:
-    SWFParser(SWFStream& in, movie_definition* md, const RunInfo& runInfo)
+    SWFParser(SWFStream& in, movie_definition* md, const RunResources& 
runResources)
         :
         _stream(in),
         _md(md),
-        _runInfo(runInfo),
+        _runResources(runResources),
         _bytesRead(0),
         _tagOpen(false),
         _endRead(0),
@@ -94,7 +94,7 @@
     
     movie_definition* _md;
     
-    const RunInfo& _runInfo;
+    const RunResources& _runResources;
     
     size_t _bytesRead;
     

=== modified file 'libcore/parser/sound_definition.cpp'
--- a/libcore/parser/sound_definition.cpp       2008-10-29 08:50:14 +0000
+++ b/libcore/parser/sound_definition.cpp       2009-07-13 09:04:26 +0000
@@ -15,7 +15,7 @@
 
 sound_sample::~sound_sample()
 {
-    sound::sound_handler* s = _runInfo.soundHandler();
+    sound::sound_handler* s = _runResources.soundHandler();
        
        if (s)
        {

=== modified file 'libcore/parser/sound_definition.h'
--- a/libcore/parser/sound_definition.h 2009-02-25 22:33:03 +0000
+++ b/libcore/parser/sound_definition.h 2009-07-13 09:04:26 +0000
@@ -21,7 +21,7 @@
 
 #include "ExportableResource.h"
 #include "ControlTag.h" // for sound tags inheritance
-#include "RunInfo.h" // TODO: drop.
+#include "RunResources.h" // TODO: drop.
 
 // Forward declarations
 namespace gnash {
@@ -58,10 +58,10 @@
 public:
        int     m_sound_handler_id;
 
-       sound_sample(int id, const RunInfo& r)
+       sound_sample(int id, const RunResources& r)
                :
                m_sound_handler_id(id),
-        _runInfo(r)
+        _runResources(r)
        {
        }
 
@@ -73,7 +73,7 @@
     /// destroyed after the movie_root has been destroyed, so that
     /// access through the VM (which assumes movie_root exists) causes
     /// a segfault.
-    const RunInfo& _runInfo;
+    const RunResources& _runResources;
 
 };
 

=== modified file 'libcore/parser/sprite_definition.cpp'
--- a/libcore/parser/sprite_definition.cpp      2009-07-08 08:12:42 +0000
+++ b/libcore/parser/sprite_definition.cpp      2009-07-13 09:04:26 +0000
@@ -64,7 +64,7 @@
 /*private*/
 // only called from constructors
 void
-sprite_definition::read(SWFStream& in, const RunInfo& runInfo)
+sprite_definition::read(SWFStream& in, const RunResources& runResources)
 {
     const size_t tag_end = in.get_tag_end_position();
 
@@ -77,7 +77,7 @@
 
        m_loading_frame = 0;
 
-    SWFParser parser(in, this, runInfo);
+    SWFParser parser(in, this, runResources);
 
     // This can throw a ParserException; we will let the SWFMovieDefintion
     // catch it, as a failure means the whole stream is invalid.
@@ -119,7 +119,7 @@
 }
 
 sprite_definition::sprite_definition(movie_definition& m, SWFStream& in, 
-        const RunInfo& runInfo)
+        const RunResources& runResources)
        :
        m_movie_def(m),
        m_frame_count(0),
@@ -127,7 +127,7 @@
        registeredClass(0),
        _loadingSoundStream(-1)
 {
-       read(in, runInfo);
+       read(in, runResources);
 }
 
 /*

=== modified file 'libcore/parser/sprite_definition.h'
--- a/libcore/parser/sprite_definition.h        2009-06-05 10:36:48 +0000
+++ b/libcore/parser/sprite_definition.h        2009-07-13 09:04:26 +0000
@@ -63,7 +63,7 @@
        ///     to be already positioned right before the frame count
        ///
        sprite_definition(movie_definition& m, SWFStream& in,
-            const RunInfo& runInfo);
+            const RunResources& runResources);
 
        /// Destructor, releases playlist data
        ~sprite_definition();
@@ -246,7 +246,7 @@
 
 private:
 
-       void read(SWFStream& in, const RunInfo& runInfo);
+       void read(SWFStream& in, const RunResources& runResources);
 
        /// Top-level movie definition
        /// (the definition read from SWF stream)

=== modified file 'libcore/styles.cpp'
--- a/libcore/styles.cpp        2009-06-15 14:10:05 +0000
+++ b/libcore/styles.cpp        2009-07-13 08:06:09 +0000
@@ -8,7 +8,6 @@
 
 #include "styles.h"
 #include "log.h"
-#include "render.h"
 #include "SWFStream.h"
 #include "movie_definition.h"
 #include "SWF.h"
@@ -41,7 +40,7 @@
 
 void
 line_style::read_morph(SWFStream& in, SWF::TagType t, movie_definition& md,
-    line_style *pOther)
+    const RunResources& r, line_style *pOther)
 {
     if (t == SWF::DEFINEMORPHSHAPE)
     {
@@ -80,7 +79,7 @@
         // read fill styles for strokes.
         // TODO: don't throw away this information, should be passed to 
renderer.
         fill_style f, g;
-        f.read(in, t, md, &g);
+        f.read(in, t, md, r, &g);
         m_color = f.get_color();
         pOther->m_color = g.get_color();
     }
@@ -92,7 +91,8 @@
 }
 
 void
-line_style::read(SWFStream& in, SWF::TagType t, movie_definition& md)
+line_style::read(SWFStream& in, SWF::TagType t, movie_definition& md,
+        const RunResources& r)
 {
     if (!(t == SWF::DEFINESHAPE4 || t == SWF::DEFINESHAPE4_))
     {
@@ -128,7 +128,7 @@
         // read fill styles for strokes.
         // TODO: don't throw away this information, should be passed to 
renderer.
         fill_style f;
-        f.read(in, t, md);
+        f.read(in, t, md, r);
         m_color = f.get_color();
     }
     else

=== modified file 'libcore/styles.h'
--- a/libcore/styles.h  2009-06-15 14:10:05 +0000
+++ b/libcore/styles.h  2009-07-13 08:06:09 +0000
@@ -16,6 +16,7 @@
 
 class SWFStream;
 class movie_definition;
+class RunResources;
 
   typedef enum { CAP_ROUND=0, CAP_NONE=1, CAP_SQUARE=2 } cap_style_e;
   typedef enum { JOIN_ROUND=0, JOIN_BEVEL=1, JOIN_MITER=2 } join_style_e;
@@ -82,12 +83,13 @@
        /// Throw a ParserException if there's no enough bytes in the
        /// currently opened tag for reading. See stream::ensureBytes()
        ///
-       void    read(SWFStream& in, SWF::TagType t, movie_definition& md);
+       void read(SWFStream& in, SWF::TagType t, movie_definition& md,
+            const RunResources& r);
        
        /// Read two lines styles from the SWF stream
        /// at the same time -- this is used in morphing.
        void read_morph(SWFStream& in, SWF::TagType t, movie_definition& md,
-               line_style *pOther);
+            const RunResources& r, line_style *pOther);
 
        /// Return thickness of the line, in TWIPS
        boost::uint16_t getThickness() const

=== modified file 'libcore/swf/CSMTextSettingsTag.cpp'
--- a/libcore/swf/CSMTextSettingsTag.cpp        2009-01-22 20:10:39 +0000
+++ b/libcore/swf/CSMTextSettingsTag.cpp        2009-07-13 08:06:09 +0000
@@ -32,7 +32,7 @@
 
 void
 CSMTextSettingsTag::loader(SWFStream& in, TagType tag, movie_definition& /*m*/,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
     assert(tag == SWF::CSMTEXTSETTINGS); // 73
 

=== modified file 'libcore/swf/CSMTextSettingsTag.h'
--- a/libcore/swf/CSMTextSettingsTag.h  2009-01-22 20:10:39 +0000
+++ b/libcore/swf/CSMTextSettingsTag.h  2009-07-13 08:06:09 +0000
@@ -28,7 +28,7 @@
 namespace gnash {
        class movie_definition;
        class SWFStream;
-    class RunInfo;
+    class RunResources;
 }
 
 namespace gnash {
@@ -39,7 +39,7 @@
 
        CSMTextSettingsTag(movie_definition& m, SWFStream& in);
 
-       static void loader(SWFStream& in, TagType tag, movie_definition& m, 
const RunInfo& r);
+       static void loader(SWFStream& in, TagType tag, movie_definition& m, 
const RunResources& r);
 
 private:
 

=== modified file 'libcore/swf/DefineButtonCxformTag.cpp'
--- a/libcore/swf/DefineButtonCxformTag.cpp     2009-06-26 12:57:24 +0000
+++ b/libcore/swf/DefineButtonCxformTag.cpp     2009-07-13 08:06:09 +0000
@@ -28,7 +28,7 @@
 
 void
 DefineButtonCxformTag::loader(SWFStream& in, TagType tag, movie_definition& m,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
 
     assert(tag == SWF::DEFINEBUTTONCXFORM);

=== modified file 'libcore/swf/DefineButtonCxformTag.h'
--- a/libcore/swf/DefineButtonCxformTag.h       2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DefineButtonCxformTag.h       2009-07-13 08:06:09 +0000
@@ -39,7 +39,7 @@
 public:
 
     static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& /*r*/);
+            const RunResources& /*r*/);
 
 };
 

=== modified file 'libcore/swf/DefineButtonSoundTag.cpp'
--- a/libcore/swf/DefineButtonSoundTag.cpp      2009-04-07 12:46:29 +0000
+++ b/libcore/swf/DefineButtonSoundTag.cpp      2009-07-13 08:06:09 +0000
@@ -37,7 +37,7 @@
 
 void
 DefineButtonSoundTag::loader(SWFStream& in, TagType tag, movie_definition& m,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
     assert(tag == SWF::DEFINEBUTTONSOUND);
 

=== modified file 'libcore/swf/DefineButtonSoundTag.h'
--- a/libcore/swf/DefineButtonSoundTag.h        2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DefineButtonSoundTag.h        2009-07-13 08:06:09 +0000
@@ -29,7 +29,7 @@
 
 namespace gnash {
     class SWFStream;
-    class RunInfo;
+    class RunResources;
     class movie_definition;
 }
 
@@ -69,7 +69,7 @@
     typedef std::vector<ButtonSound> Sounds;
 
     static void loader(SWFStream& in, TagType tag, movie_definition& m,
-                   const RunInfo& r);
+                   const RunResources& r);
 
     const ButtonSound& getSound(Sounds::size_type index) const
     {

=== modified file 'libcore/swf/DefineButtonTag.cpp'
--- a/libcore/swf/DefineButtonTag.cpp   2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DefineButtonTag.cpp   2009-07-13 08:06:09 +0000
@@ -70,7 +70,7 @@
 
 void
 DefineButtonTag::loader(SWFStream& in, TagType tag, movie_definition& m, 
-            const RunInfo& /*r*/)
+            const RunResources& /*r*/)
 {
     assert(tag == DEFINEBUTTON);
     in.ensureBytes(2);
@@ -87,7 +87,7 @@
 
 void
 DefineButton2Tag::loader(SWFStream& in, TagType tag, movie_definition& m, 
-            const RunInfo& /*r*/)
+            const RunResources& /*r*/)
 {
     assert(tag == DEFINEBUTTON2);
     in.ensureBytes(2);

=== modified file 'libcore/swf/DefineButtonTag.h'
--- a/libcore/swf/DefineButtonTag.h     2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DefineButtonTag.h     2009-07-13 08:06:09 +0000
@@ -200,7 +200,7 @@
 
     /// Load a DefineButtonTag.
     static void loader(SWFStream& in, TagType tag, movie_definition& m, 
-            const RunInfo& r);
+            const RunResources& r);
 
     typedef std::vector<ButtonRecord> ButtonRecords; 
     typedef std::vector<ButtonAction*> ButtonActions;
@@ -321,7 +321,7 @@
 public:
     /// Load a DefineButton2 tag.
     static void loader(SWFStream& in, TagType tag, movie_definition& m, 
-            const RunInfo& r);
+            const RunResources& r);
 };
 
 }

=== modified file 'libcore/swf/DefineEditTextTag.cpp'
--- a/libcore/swf/DefineEditTextTag.cpp 2009-06-09 07:59:09 +0000
+++ b/libcore/swf/DefineEditTextTag.cpp 2009-07-13 08:06:09 +0000
@@ -26,7 +26,7 @@
 
 void
 DefineEditTextTag::loader(SWFStream& in, TagType tag, movie_definition& m,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
        assert(tag == SWF::DEFINEEDITTEXT); // 37
 

=== modified file 'libcore/swf/DefineEditTextTag.h'
--- a/libcore/swf/DefineEditTextTag.h   2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DefineEditTextTag.h   2009-07-13 08:06:09 +0000
@@ -35,7 +35,7 @@
 namespace gnash {
        class SWFStream;
        class movie_definition;
-       class RunInfo;
+       class RunResources;
     class Font;
 }
 
@@ -63,7 +63,7 @@
 
        /// Load an SWF::DEFINEEDITTEXT (37) tag.
        static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 
     const rect& bounds() const { return _rect; }
 

=== modified file 'libcore/swf/DefineFontAlignZonesTag.cpp'
--- a/libcore/swf/DefineFontAlignZonesTag.cpp   2009-03-24 10:56:52 +0000
+++ b/libcore/swf/DefineFontAlignZonesTag.cpp   2009-07-13 08:06:09 +0000
@@ -37,7 +37,7 @@
 /* public static */
 void
 DefineFontAlignZonesTag::loader(SWFStream& in, TagType tag,
-        movie_definition& m, const RunInfo& /*r*/)
+        movie_definition& m, const RunResources& /*r*/)
 {
        assert(tag == SWF::DEFINEALIGNZONES);
 

=== modified file 'libcore/swf/DefineFontAlignZonesTag.h'
--- a/libcore/swf/DefineFontAlignZonesTag.h     2009-02-20 12:24:00 +0000
+++ b/libcore/swf/DefineFontAlignZonesTag.h     2009-07-13 08:06:09 +0000
@@ -43,7 +43,7 @@
 
 
        static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 
 private:
 

=== modified file 'libcore/swf/DefineFontNameTag.h'
--- a/libcore/swf/DefineFontNameTag.h   2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DefineFontNameTag.h   2009-07-13 08:06:09 +0000
@@ -20,7 +20,7 @@
 #include "SWF.h"
 #include "SWFStream.h"
 #include "Font.h"
-#include "RunInfo.h"
+#include "RunResources.h"
 #include "movie_definition.h"
 
 #ifndef GNASH_SWF_DEFINEFONTNAMETAG_H
@@ -39,7 +39,7 @@
 
     // Set font name for a font.
     static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& /*r*/)
+            const RunResources& /*r*/)
     {
         assert(tag == SWF::DEFINEFONTNAME);
 

=== modified file 'libcore/swf/DefineFontTag.cpp'
--- a/libcore/swf/DefineFontTag.cpp     2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DefineFontTag.cpp     2009-07-13 08:06:09 +0000
@@ -20,7 +20,7 @@
 #include "DefineFontTag.h"
 #include "SWFStream.h"
 #include "Font.h"
-#include "RunInfo.h"
+#include "RunResources.h"
 #include "SWF.h"
 #include "movie_definition.h"
 #include "ShapeRecord.h"
@@ -32,14 +32,14 @@
 
 void
 DefineFontTag::loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& /*r*/)
+            const RunResources& r)
 {
     assert(tag == DEFINEFONT || tag == DEFINEFONT2 || tag == DEFINEFONT3);
 
     in.ensureBytes(2);
     boost::uint16_t fontID = in.read_u16();
 
-    std::auto_ptr<DefineFontTag> ft(new DefineFontTag(in, m, tag));
+    std::auto_ptr<DefineFontTag> ft(new DefineFontTag(in, m, tag, r));
 
     Font* f = new Font(ft);
 
@@ -94,7 +94,8 @@
 #endif
 
 
-DefineFontTag::DefineFontTag(SWFStream& in, movie_definition& m, TagType tag)
+DefineFontTag::DefineFontTag(SWFStream& in, movie_definition& m, TagType tag,
+        const RunResources& r)
     :
     _subpixelFont(tag == DEFINEFONT3 ? true : false),
     _unicodeChars(false),
@@ -113,17 +114,18 @@
             std::abort();
             break;
         case DEFINEFONT:
-            readDefineFont(in, m);
+            readDefineFont(in, m, r);
             break;
         case DEFINEFONT2:
         case DEFINEFONT3:
-            readDefineFont2Or3(in, m);
+            readDefineFont2Or3(in, m, r);
             break;
     }
 }
 
 void
-DefineFontTag::readDefineFont(SWFStream& in, movie_definition& m)
+DefineFontTag::readDefineFont(SWFStream& in, movie_definition& m,
+        const RunResources& r)
 {
     IF_VERBOSE_PARSE(
         log_parse(_("reading DefineFont"));
@@ -175,13 +177,14 @@
         }
 
         // Create & read the shape.
-        _glyphTable[i].glyph.reset(new ShapeRecord(in, SWF::DEFINEFONT, m)); 
+        _glyphTable[i].glyph.reset(new ShapeRecord(in, SWF::DEFINEFONT, m, 
r)); 
     }
 }
 
 // Read a DefineFont2 or DefineFont3 tag
 void
-DefineFontTag::readDefineFont2Or3(SWFStream& in, movie_definition& m)
+DefineFontTag::readDefineFont2Or3(SWFStream& in, movie_definition& m,
+        const RunResources& r)
 {
     IF_VERBOSE_PARSE (
     log_parse(_("reading DefineFont2 or DefineFont3"));
@@ -282,7 +285,7 @@
         }
 
         // Create & read the shape.
-        _glyphTable[i].glyph.reset(new ShapeRecord(in, SWF::DEFINEFONT2, m));
+        _glyphTable[i].glyph.reset(new ShapeRecord(in, SWF::DEFINEFONT2, m, 
r));
     }
 
     unsigned long current_position = in.tell();
@@ -369,7 +372,7 @@
 
 void
 DefineFontInfoTag::loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& /*r*/)
+            const RunResources& /*r*/)
 {
     assert(tag == DEFINEFONTINFO || tag == DEFINEFONTINFO2); 
 

=== modified file 'libcore/swf/DefineFontTag.h'
--- a/libcore/swf/DefineFontTag.h       2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DefineFontTag.h       2009-07-13 08:06:09 +0000
@@ -38,7 +38,7 @@
 namespace gnash {
     class SWFStream;
     class movie_definition;
-    class RunInfo;
+    class RunResources;
 }
 
 namespace gnash {
@@ -53,7 +53,7 @@
     //
     /// A corresponding Font is created and added to the movie_definition.
     static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 
     /// Return the glyphs read from the DefineFont tag.
     const Font::GlyphInfoRecords& glyphTable() const {
@@ -103,13 +103,15 @@
 
 private:
 
-    DefineFontTag(SWFStream& in, movie_definition& m, TagType tag);
+    DefineFontTag(SWFStream& in, movie_definition& m, TagType tag,
+            const RunResources& r);
 
     /// Read a DefineFont tag.
-    void readDefineFont(SWFStream& in, movie_definition & m);
+    void readDefineFont(SWFStream& in, movie_definition& m, const 
RunResources& r);
 
     /// Read a DefineFont2 or DefineFont3 tag.
-    void readDefineFont2Or3(SWFStream& in, movie_definition& m);
+    void readDefineFont2Or3(SWFStream& in, movie_definition& m,
+            const RunResources& r);
 
     /// The GlyphInfo records contained in the tag.
     Font::GlyphInfoRecords _glyphTable;
@@ -143,7 +145,7 @@
     /// DefineFont tag. The information is already contained in a 
     /// DefineFont2 or DefineFont3 tag.
     static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 };
 
 }

=== modified file 'libcore/swf/DefineMorphShapeTag.cpp'
--- a/libcore/swf/DefineMorphShapeTag.cpp       2009-05-14 11:45:23 +0000
+++ b/libcore/swf/DefineMorphShapeTag.cpp       2009-07-13 08:06:09 +0000
@@ -25,17 +25,17 @@
 #include "DefineMorphShapeTag.h"
 #include "MorphShape.h"
 #include "SWFStream.h"
-#include "render.h"
 #include "movie_definition.h"
 #include "MovieClip.h"
 #include "GnashNumeric.h"
+#include "RunResources.h"
 
 namespace gnash {
 namespace SWF {
 
 void
 DefineMorphShapeTag::loader(SWFStream& in, TagType tag, movie_definition& md,
-        const RunInfo& /*r*/)
+        const RunResources& r)
 {
     in.ensureBytes(2);
     boost::uint16_t id = in.read_u16();
@@ -44,14 +44,14 @@
             log_parse("DefineMorphShapeTag: id = %d", id);
     );
 
-    DefineMorphShapeTag* morph = new DefineMorphShapeTag(in, tag, md);
+    DefineMorphShapeTag* morph = new DefineMorphShapeTag(in, tag, md, r);
     md.addDisplayObject(id, morph);
 }
 
 DefineMorphShapeTag::DefineMorphShapeTag(SWFStream& in, TagType tag,
-        movie_definition& md)
+        movie_definition& md, const RunResources& r)
 {
-    read(in, tag, md);
+    read(in, tag, md, r);
 }
 
 DisplayObject*
@@ -61,16 +61,16 @@
 }
 
 void
-DefineMorphShapeTag::display(const MorphShape& inst) const
+DefineMorphShapeTag::display(Renderer& renderer, const MorphShape& inst) const
 {
-    render::drawShape(inst.shape(), inst.get_world_cxform(),
+    renderer.drawShape(inst.shape(), inst.get_world_cxform(),
             inst.getWorldMatrix());
 }
 
 
 void
-DefineMorphShapeTag::read(SWFStream& in, TagType tag,
-        movie_definition& md)
+DefineMorphShapeTag::read(SWFStream& in, TagType tag, movie_definition& md,
+        const RunResources& r)
 {
     assert(tag == DEFINEMORPHSHAPE
         || tag == DEFINEMORPHSHAPE2
@@ -102,7 +102,7 @@
     
     fill_style fs1, fs2;
     for (size_t i = 0; i < fillCount; ++i) {
-        fs1.read(in, tag, md, &fs2);
+        fs1.read(in, tag, md, r, &fs2);
         _shape1.addFillStyle(fs1);
         _shape2.addFillStyle(fs2);
     }
@@ -110,14 +110,14 @@
     const boost::uint16_t lineCount = in.read_variable_count();
     line_style ls1, ls2;
     for (size_t i = 0; i < lineCount; ++i) {
-        ls1.read_morph(in, tag, md, &ls2);
+        ls1.read_morph(in, tag, md, r, &ls2);
         _shape1.addLineStyle(ls1);
         _shape2.addLineStyle(ls2);
     }
 
-    _shape1.read(in, tag, md);
+    _shape1.read(in, tag, md, r);
     in.align();
-    _shape2.read(in, tag, md);
+    _shape2.read(in, tag, md, r);
 
     // Set bounds as read in *this* tags rather then
     // the one computed from ShapeRecord parser

=== modified file 'libcore/swf/DefineMorphShapeTag.h'
--- a/libcore/swf/DefineMorphShapeTag.h 2009-06-15 14:04:56 +0000
+++ b/libcore/swf/DefineMorphShapeTag.h 2009-07-13 08:06:09 +0000
@@ -31,8 +31,9 @@
 namespace gnash {
     class movie_definition;
     class SWFStream;
-       class RunInfo;
+       class RunResources;
     class MorphShape;
+    class Renderer;
 }
 
 namespace gnash {
@@ -45,14 +46,14 @@
 public:
 
     static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 
     virtual ~DefineMorphShapeTag() {}
 
        virtual DisplayObject* createDisplayObject(DisplayObject* parent, int 
id)
         const;
 
-    virtual void display(const MorphShape& inst) const;
+    virtual void display(Renderer& renderer, const MorphShape& inst) const;
 
     const ShapeRecord& shape1() const { 
         return _shape1;
@@ -64,7 +65,8 @@
 
 private:
 
-    DefineMorphShapeTag(SWFStream& in, SWF::TagType tag, movie_definition& md);
+    DefineMorphShapeTag(SWFStream& in, SWF::TagType tag, movie_definition& md,
+            const RunResources& r);
     
     /// Read a DefineMorphShape tag from stream
     //
@@ -83,7 +85,8 @@
     ///        Movie definition. Used to resolv DisplayObject ids for fill 
styles.
     ///        Must be not-null or would segfault. 
     ///
-    void read(SWFStream& in, SWF::TagType tag, movie_definition& m);
+    void read(SWFStream& in, SWF::TagType tag, movie_definition& m,
+            const RunResources& r);
 
     ShapeRecord _shape1;
     ShapeRecord _shape2;

=== modified file 'libcore/swf/DefineSceneAndFrameLabelDataTag.h'
--- a/libcore/swf/DefineSceneAndFrameLabelDataTag.h     2009-06-15 11:32:49 
+0000
+++ b/libcore/swf/DefineSceneAndFrameLabelDataTag.h     2009-07-13 08:06:09 
+0000
@@ -46,7 +46,7 @@
        }
 
        static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& /*r*/)
+            const RunResources& /*r*/)
        {
                assert(tag == DEFINESCENEANDFRAMELABELDATA); 
         

=== modified file 'libcore/swf/DefineShapeTag.cpp'
--- a/libcore/swf/DefineShapeTag.cpp    2009-06-15 14:08:03 +0000
+++ b/libcore/swf/DefineShapeTag.cpp    2009-07-13 08:06:09 +0000
@@ -26,11 +26,11 @@
 #include "DefineShapeTag.h"
 #include "smart_ptr.h" // GNASH_USE_GC
 #include "log.h"
-#include "render.h"
 #include "Shape.h"
 #include "SWFStream.h"
 #include "MovieClip.h"
 #include "SWF.h"
+#include "Renderer.h"
 
 #include <algorithm>
 
@@ -43,7 +43,7 @@
 
 void
 DefineShapeTag::loader(SWFStream& in, TagType tag, movie_definition& m,
-        const RunInfo& /*r*/)
+        const RunResources& r)
 {
     assert(tag == DEFINESHAPE ||
            tag == DEFINESHAPE2 ||
@@ -57,7 +57,7 @@
         log_parse(_("DefineShapeTag(%s): id = %d"), tag, id);
     );
 
-    DefineShapeTag* ch = new DefineShapeTag(in, tag, m);
+    DefineShapeTag* ch = new DefineShapeTag(in, tag, m, r);
     m.addDisplayObject(id, ch);
 
 }
@@ -77,17 +77,17 @@
 
 
 DefineShapeTag::DefineShapeTag(SWFStream& in, TagType tag,
-        movie_definition& m)
+        movie_definition& m, const RunResources& r)
     :
     DefinitionTag(),
-    _shape(in, tag, m)
+    _shape(in, tag, m, r)
 {
 }
 
 void
-DefineShapeTag::display(const DisplayObject& inst) const
+DefineShapeTag::display(Renderer& renderer, const DisplayObject& inst) const
 {
-    render::drawShape(_shape, inst.get_world_cxform(), inst.getWorldMatrix());
+    renderer.drawShape(_shape, inst.get_world_cxform(), inst.getWorldMatrix());
 }
 
 void

=== modified file 'libcore/swf/DefineShapeTag.h'
--- a/libcore/swf/DefineShapeTag.h      2009-06-15 14:04:56 +0000
+++ b/libcore/swf/DefineShapeTag.h      2009-07-13 08:06:09 +0000
@@ -19,7 +19,8 @@
        class cxform;
     class Shape;
        class SWFMatrix;
-       class RunInfo;
+       class RunResources;
+       class Renderer;
 }
 
 namespace gnash {
@@ -33,12 +34,12 @@
 public:
 
     static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 
     virtual ~DefineShapeTag() {};
 
     // Display a Shape character.
-    virtual void display(const DisplayObject& inst) const;
+    virtual void display(Renderer& renderer, const DisplayObject& inst) const;
 
     // Create a Shape DisplayObject.
        virtual DisplayObject* createDisplayObject(DisplayObject* parent, int 
id)
@@ -64,7 +65,8 @@
 
 private:
 
-    DefineShapeTag(SWFStream& in, TagType tag, movie_definition& m);
+    DefineShapeTag(SWFStream& in, TagType tag, movie_definition& m,
+            const RunResources& r);
 
     /// The actual shape data is stored in this record.
     const ShapeRecord _shape;

=== modified file 'libcore/swf/DefineTextTag.cpp'
--- a/libcore/swf/DefineTextTag.cpp     2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DefineTextTag.cpp     2009-07-13 08:06:09 +0000
@@ -24,7 +24,7 @@
 
 void
 DefineTextTag::loader(SWFStream& in, TagType tag, movie_definition& m,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
     assert(tag == DEFINETEXT);
 
@@ -64,7 +64,7 @@
 
 void
 DefineText2Tag::loader(SWFStream& in, TagType tag, movie_definition& m,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
     assert(tag == DEFINETEXT2);
 
@@ -106,13 +106,14 @@
 }
 
 void
-DefineTextTag::display(const StaticText& inst) const
+DefineTextTag::display(Renderer& renderer, const StaticText& inst) const
 {
 
     SWFMatrix mat = inst.getWorldMatrix();
     mat.concatenate(_matrix);
 
-    TextRecord::displayRecords(mat, inst.get_world_cxform(), _textRecords);
+    TextRecord::displayRecords(renderer, mat, inst.get_world_cxform(),
+            _textRecords);
 }
 
 

=== modified file 'libcore/swf/DefineTextTag.h'
--- a/libcore/swf/DefineTextTag.h       2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DefineTextTag.h       2009-07-13 08:06:09 +0000
@@ -29,7 +29,7 @@
 namespace gnash {
     class movie_definition;
     class SWFStream;
-    class RunInfo;
+    class RunResources;
     class StaticText;
 }
 
@@ -47,10 +47,10 @@
 public:
 
     static void loader(SWFStream& in, TagType tag, movie_definition& m, 
-            const RunInfo& r);
+            const RunResources& r);
 
        /// Draw the string.
-       void display(const StaticText& inst) const;
+       void display(Renderer& renderer, const StaticText& inst) const;
        
        const rect& bounds() const {
         // TODO: There is a _matrix field in the definition(!) that's
@@ -99,7 +99,7 @@
 {
 public:
     static void loader(SWFStream& in, TagType tag, movie_definition& m, 
-            const RunInfo& r);
+            const RunResources& r);
 };
 
 } // namespace SWF

=== modified file 'libcore/swf/DefineVideoStreamTag.cpp'
--- a/libcore/swf/DefineVideoStreamTag.cpp      2009-05-14 11:45:23 +0000
+++ b/libcore/swf/DefineVideoStreamTag.cpp      2009-07-13 08:06:09 +0000
@@ -71,7 +71,7 @@
 
 void
 DefineVideoStreamTag::loader(SWFStream& in, SWF::TagType tag,
-        movie_definition& m, const RunInfo& /*r*/)
+        movie_definition& m, const RunResources& /*r*/)
 {
     assert(tag == SWF::DEFINEVIDEOSTREAM); // 60
     

=== modified file 'libcore/swf/DefineVideoStreamTag.h'
--- a/libcore/swf/DefineVideoStreamTag.h        2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DefineVideoStreamTag.h        2009-07-13 08:06:09 +0000
@@ -39,7 +39,7 @@
 namespace gnash {
     class movie_definition;
     class SWFStream;
-    class RunInfo;
+    class RunResources;
 }
 
 namespace gnash {
@@ -93,7 +93,7 @@
        /// instance of this class.
        ///
        static void loader(SWFStream& in, SWF::TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 
 
        /// Read tag SWF::VIDEOFRAME

=== modified file 'libcore/swf/DoABCTag.h'
--- a/libcore/swf/DoABCTag.h    2009-07-03 08:19:37 +0000
+++ b/libcore/swf/DoABCTag.h    2009-07-13 08:06:09 +0000
@@ -74,7 +74,7 @@
     }
        
        static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const gnash::RunInfo&)
+            const gnash::RunResources&)
        {
 
         if (!m.isAS3()) {

=== modified file 'libcore/swf/DoActionTag.h'
--- a/libcore/swf/DoActionTag.h 2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DoActionTag.h 2009-07-13 08:06:09 +0000
@@ -59,7 +59,7 @@
        }
 
        static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& /*r*/)
+            const RunResources& /*r*/)
        {
         if (m.isAS3()) {
             IF_VERBOSE_MALFORMED_SWF(

=== modified file 'libcore/swf/DoInitActionTag.h'
--- a/libcore/swf/DoInitActionTag.h     2009-06-15 11:32:49 +0000
+++ b/libcore/swf/DoInitActionTag.h     2009-07-13 08:06:09 +0000
@@ -65,7 +65,7 @@
     }
 
     static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& /*r*/)
+            const RunResources& /*r*/)
     {
         if (m.isAS3()) {
             IF_VERBOSE_MALFORMED_SWF(

=== modified file 'libcore/swf/PlaceObject2Tag.cpp'
--- a/libcore/swf/PlaceObject2Tag.cpp   2009-04-08 11:48:21 +0000
+++ b/libcore/swf/PlaceObject2Tag.cpp   2009-07-13 08:06:09 +0000
@@ -486,7 +486,7 @@
 /* public static */
 void
 PlaceObject2Tag::loader(SWFStream& in, TagType tag, movie_definition& m,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
     assert(tag == SWF::PLACEOBJECT || tag == SWF::PLACEOBJECT2 || tag == 
SWF::PLACEOBJECT3);
 

=== modified file 'libcore/swf/PlaceObject2Tag.h'
--- a/libcore/swf/PlaceObject2Tag.h     2009-06-15 11:32:49 +0000
+++ b/libcore/swf/PlaceObject2Tag.h     2009-07-13 08:06:09 +0000
@@ -37,7 +37,7 @@
     class action_buffer;
     class movie_definition;
        class DisplayList;
-    class RunInfo;
+    class RunResources;
 }
 
 namespace gnash {
@@ -115,7 +115,7 @@
     void execute(MovieClip* m, DisplayList& dlist) const;
 
     static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 
     int getPlaceType() const { 
         return m_has_flags2 & (HAS_CHARACTER_MASK | MOVE_MASK);

=== modified file 'libcore/swf/RemoveObjectTag.cpp'
--- a/libcore/swf/RemoveObjectTag.cpp   2009-06-15 11:32:49 +0000
+++ b/libcore/swf/RemoveObjectTag.cpp   2009-07-13 08:06:09 +0000
@@ -55,7 +55,7 @@
 /* public static */
 void
 RemoveObjectTag::loader(SWFStream& in, TagType tag, movie_definition& m,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
     assert(tag == SWF::REMOVEOBJECT || tag == SWF::REMOVEOBJECT2);
 

=== modified file 'libcore/swf/RemoveObjectTag.h'
--- a/libcore/swf/RemoveObjectTag.h     2009-06-15 11:32:49 +0000
+++ b/libcore/swf/RemoveObjectTag.h     2009-07-13 08:06:09 +0000
@@ -34,7 +34,7 @@
        class swf_event;
        class movie_definition;
        class DisplayList;
-    class RunInfo;
+    class RunResources;
 }
 
 namespace gnash {
@@ -63,7 +63,7 @@
        void execute(MovieClip* m, DisplayList& dlist) const;
 
        static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 
 private:
 

=== modified file 'libcore/swf/ScriptLimitsTag.h'
--- a/libcore/swf/ScriptLimitsTag.h     2009-06-15 12:07:43 +0000
+++ b/libcore/swf/ScriptLimitsTag.h     2009-07-13 08:06:09 +0000
@@ -47,7 +47,7 @@
     }
 
     static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& /*r*/)
+            const RunResources& /*r*/)
     {
         assert(tag = SWF::SCRIPTLIMITS);
         std::auto_ptr<ScriptLimitsTag> s(new ScriptLimitsTag(in));

=== modified file 'libcore/swf/SetBackgroundColorTag.h'
--- a/libcore/swf/SetBackgroundColorTag.h       2009-06-15 11:32:49 +0000
+++ b/libcore/swf/SetBackgroundColorTag.h       2009-07-13 08:06:09 +0000
@@ -94,7 +94,7 @@
 
        /// Set background color tag loader (SWF::SETBACKGROUNDCOLOR)
        static void loader(SWFStream& in, TagType tag, movie_definition& m, 
-            const RunInfo& /*r*/)
+            const RunResources& /*r*/)
        {
                assert(tag == SWF::SETBACKGROUNDCOLOR); // 9
 

=== modified file 'libcore/swf/ShapeRecord.cpp'
--- a/libcore/swf/ShapeRecord.cpp       2009-06-15 11:32:49 +0000
+++ b/libcore/swf/ShapeRecord.cpp       2009-07-13 08:06:09 +0000
@@ -19,8 +19,10 @@
 #include "SWF.h"
 #include "SWFStream.h"
 #include "movie_definition.h"
+#include "fill_style.h"
 #include "Geometry.h"
 #include "GnashNumeric.h"
+#include "RunResources.h"
 
 #include <vector>
 
@@ -30,9 +32,9 @@
 // Forward declarations
 namespace {
     void readFillStyles(ShapeRecord::FillStyles& styles, SWFStream& in,
-        SWF::TagType tag, movie_definition& md);
+        SWF::TagType tag, movie_definition& md, const RunResources& r);
     void readLineStyles(ShapeRecord::LineStyles& styles, SWFStream& in,
-        SWF::TagType tag, movie_definition& md);
+        SWF::TagType tag, movie_definition& md, const RunResources& r);
     void computeBounds(rect& bounds, const ShapeRecord::Paths& paths,
         const ShapeRecord::LineStyles& lineStyles, int swfVersion);
 }
@@ -134,9 +136,10 @@
 } // anonymous namespace
 
 
-ShapeRecord::ShapeRecord(SWFStream& in, SWF::TagType tag, movie_definition& m)
+ShapeRecord::ShapeRecord(SWFStream& in, SWF::TagType tag, movie_definition& m,
+        const RunResources& r)
 {
-    read(in, tag, m);
+    read(in, tag, m, r);
 }
 
 void
@@ -209,7 +212,8 @@
 }
 
 void
-ShapeRecord::read(SWFStream& in, SWF::TagType tag, movie_definition& m)
+ShapeRecord::read(SWFStream& in, SWF::TagType tag, movie_definition& m,
+        const RunResources& r)
 {
 
     /// TODO: is this correct?
@@ -238,8 +242,8 @@
             LOG_ONCE(log_unimpl("DEFINESHAPE4 edge boundaries and scales"));
         }
     
-        readFillStyles(_fillStyles, in, tag, m);
-        readLineStyles(_lineStyles, in, tag, m);
+        readFillStyles(_fillStyles, in, tag, m, r);
+        readLineStyles(_lineStyles, in, tag, m, r);
     }
 
     if (tag == SWF::DEFINEFONT || tag == SWF::DEFINEFONT2 )
@@ -521,8 +525,8 @@
     
                 fill_base = _fillStyles.size();
                 line_base = _lineStyles.size();
-                readFillStyles(_fillStyles, in, tag, m);
-                readLineStyles(_lineStyles, in, tag, m);
+                readFillStyles(_fillStyles, in, tag, m, r);
+                readLineStyles(_lineStyles, in, tag, m, r);
     
                 in.ensureBits(8);
                 num_fill_bits = in.read_uint(4);
@@ -627,7 +631,7 @@
 // Read fill styles, and push them onto the given style array.
 void
 readFillStyles(ShapeRecord::FillStyles& styles, SWFStream& in,
-                 SWF::TagType tag, movie_definition& m)
+                 SWF::TagType tag, movie_definition& m, const RunResources& r)
 {
     in.ensureBytes(1);
     boost::uint16_t fill_style_count = in.read_u8();
@@ -646,11 +650,10 @@
 
     // Read the styles.
     styles.reserve(styles.size()+fill_style_count);
-    for (boost::uint16_t i = 0; i < fill_style_count; ++i)
-    {
+    for (boost::uint16_t i = 0; i < fill_style_count; ++i) {
         // TODO: add a fill_style constructor directly reading from stream
         fill_style fs;
-        fs.read(in, tag, m);
+        fs.read(in, tag, m, r);
         styles.push_back(fs);
     }
 }
@@ -658,7 +661,7 @@
 // Read line styles and push them onto the back of the given array.
 void
 readLineStyles(ShapeRecord::LineStyles& styles, SWFStream& in,
-        SWF::TagType tag, movie_definition& md)
+        SWF::TagType tag, movie_definition& md, const RunResources& r)
 {
     in.ensureBytes(1);
     int line_style_count = in.read_u8();
@@ -680,7 +683,7 @@
     for (int i = 0; i < line_style_count; i++)
     {
         styles.resize(styles.size() + 1);
-        styles.back().read(in, tag, md);
+        styles.back().read(in, tag, md, r);
     }
 }
 

=== modified file 'libcore/swf/ShapeRecord.h'
--- a/libcore/swf/ShapeRecord.h 2009-04-07 14:32:06 +0000
+++ b/libcore/swf/ShapeRecord.h 2009-07-13 08:06:09 +0000
@@ -28,6 +28,7 @@
 
 namespace gnash {
     class movie_definition;
+    class RunResources;
 }
 
 namespace gnash {
@@ -63,7 +64,8 @@
     /// Construct a ShapeRecord from a SWFStream.
     //
     /// This is useful for constructing immutable tags.
-    ShapeRecord(SWFStream& in, SWF::TagType tag, movie_definition& m);
+    ShapeRecord(SWFStream& in, SWF::TagType tag, movie_definition& m,
+            const RunResources& r);
 
     ShapeRecord(const ShapeRecord& other)
         :
@@ -77,7 +79,8 @@
     //
     /// This is used by DefineMorphShapeTag as part of parsing its
     /// more complex ShapeRecords.
-    void read(SWFStream& in, SWF::TagType tag, movie_definition& m);
+    void read(SWFStream& in, SWF::TagType tag, movie_definition& m,
+            const RunResources& r);
 
     const FillStyles& fillStyles() const {
         return _fillStyles;

=== modified file 'libcore/swf/StartSoundTag.cpp'
--- a/libcore/swf/StartSoundTag.cpp     2009-06-10 11:27:47 +0000
+++ b/libcore/swf/StartSoundTag.cpp     2009-07-13 09:04:26 +0000
@@ -23,7 +23,7 @@
 #include "movie_definition.h"
 #include "log.h" // for log_parse
 #include "sound_definition.h" // for sound_sample
-#include "RunInfo.h"
+#include "RunResources.h"
 #include "SoundInfoRecord.h"
 #include "MovieClip.h"
 
@@ -35,7 +35,7 @@
 
 void
 StartSoundTag::loader(SWFStream& in, TagType tag, movie_definition& m,
-        const RunInfo& r)
+        const RunResources& r)
 {
     assert(tag == STARTSOUND); 
 
@@ -77,7 +77,7 @@
 {
 
     sound::sound_handler* handler = 
-        m->getVM().getRoot().runInfo().soundHandler();
+        m->getVM().getRoot().runResources().soundHandler();
 
     if (handler)
     {
@@ -107,7 +107,7 @@
 
 void
 StartSound2Tag::loader(SWFStream& in, TagType tag, movie_definition& /*m*/,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
     assert(tag == STARTSOUND2);
 

=== modified file 'libcore/swf/StartSoundTag.h'
--- a/libcore/swf/StartSoundTag.h       2009-06-15 11:32:49 +0000
+++ b/libcore/swf/StartSoundTag.h       2009-07-13 08:06:09 +0000
@@ -37,7 +37,7 @@
        class SWFStream;
        class movie_definition;
        class sound_sample;
-    class RunInfo;
+    class RunResources;
 }
 
 namespace gnash {
@@ -83,7 +83,7 @@
 
        /// Load a SWF::STARTSOUND tag.
        static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 
 };
 
@@ -97,7 +97,7 @@
 
        /// Load a SWF::STARTSOUND2 tag.
        static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 };
 
 } // namespace gnash::SWF

=== modified file 'libcore/swf/StreamSoundBlockTag.cpp'
--- a/libcore/swf/StreamSoundBlockTag.cpp       2009-06-09 14:04:51 +0000
+++ b/libcore/swf/StreamSoundBlockTag.cpp       2009-07-13 09:04:26 +0000
@@ -24,7 +24,7 @@
 #include "SoundInfo.h" // for loader
 #include "SWFStream.h"
 #include "log.h"
-#include "RunInfo.h"
+#include "RunResources.h"
 #include "VM.h" // For getting movie_root. TODO: drop
 
 namespace gnash {
@@ -36,7 +36,7 @@
 
     const movie_root& mr = m->getVM().getRoot();
 
-       sound::sound_handler* handler = mr.runInfo().soundHandler(); 
+       sound::sound_handler* handler = mr.runResources().soundHandler(); 
        if (handler)
        {
                // This makes it possible to stop only the stream when 
framejumping.
@@ -49,7 +49,7 @@
 /* public static */
 void
 StreamSoundBlockTag::loader(SWFStream& in, TagType tag, movie_definition& m,
-        const RunInfo& r)
+        const RunResources& r)
 {
     assert(tag == SWF::SOUNDSTREAMBLOCK); // 19
 

=== modified file 'libcore/swf/StreamSoundBlockTag.h'
--- a/libcore/swf/StreamSoundBlockTag.h 2009-06-15 11:32:49 +0000
+++ b/libcore/swf/StreamSoundBlockTag.h 2009-07-13 08:06:09 +0000
@@ -33,7 +33,7 @@
 namespace gnash {
        class SWFStream;
        class movie_definition;
-       class RunInfo;
+       class RunResources;
 }
 
 namespace gnash {
@@ -76,7 +76,7 @@
 
        /// Load an SWF::SOUNDSTREAMBLOCK (19) tag.
        static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 
        /// Not a "state" (DisplayList?) tag, so doesn't need to provide
     /// execute_state

=== modified file 'libcore/swf/SymbolClassTag.h'
--- a/libcore/swf/SymbolClassTag.h      2009-06-23 12:52:15 +0000
+++ b/libcore/swf/SymbolClassTag.h      2009-07-13 08:06:09 +0000
@@ -56,7 +56,7 @@
        }
 
        static void loader(SWFStream& in, TagType tag, movie_definition& m,
-            const RunInfo& /*r*/)
+            const RunResources& /*r*/)
        {
                assert(tag == SYMBOLCLASS); 
         

=== modified file 'libcore/swf/TagLoadersTable.h'
--- a/libcore/swf/TagLoadersTable.h     2009-06-15 12:07:43 +0000
+++ b/libcore/swf/TagLoadersTable.h     2009-07-13 08:06:09 +0000
@@ -31,7 +31,7 @@
 namespace gnash {
        class SWFStream;
        class movie_definition;
-    class RunInfo;
+    class RunResources;
 }
 
 namespace gnash {
@@ -49,7 +49,7 @@
        /// 'm' a pointer to the movie (or sprite) being read
        ///
        typedef void (*TagLoader)(SWFStream& input, TagType type,
-            movie_definition& m, const RunInfo& r);
+            movie_definition& m, const RunResources& r);
 
     typedef std::map<SWF::TagType, TagLoader> Loaders;
 

=== modified file 'libcore/swf/TextRecord.cpp'
--- a/libcore/swf/TextRecord.cpp        2009-07-08 15:08:21 +0000
+++ b/libcore/swf/TextRecord.cpp        2009-07-13 07:07:26 +0000
@@ -23,9 +23,8 @@
 #include "DisplayObject.h"
 #include "SWF.h"
 #include "log.h"
-#include "render.h"
-#include "fill_style.h"
 #include "Font.h"
+#include "Renderer.h"
 
 #include <boost/assign/list_of.hpp>
 #include <vector>
@@ -158,8 +157,8 @@
 /// The proprietary player does not display rotated or skewed device fonts.
 /// Gnash does.
 void
-TextRecord::displayRecords(const SWFMatrix& mat, const cxform& cx,
-        const TextRecords& records, bool embedded)
+TextRecord::displayRecords(Renderer& renderer, const SWFMatrix& mat,
+        const cxform& cx, const TextRecords& records, bool embedded)
 {
 
     // Starting positions.
@@ -248,7 +247,7 @@
                                            (point(480, -656))
                                            (point(32, -656))
                                            (point(32,32));
-                render::drawLine(emptyCharBox, textColor, m);
+                renderer.drawLine(emptyCharBox, textColor, m);
 #endif
 
             }
@@ -256,7 +255,7 @@
                 ShapeRecord* glyph = fnt->get_glyph(index, embedded);
 
                 // Draw the DisplayObject using the filled outline.
-                if (glyph) render::drawGlyph(*glyph, textColor, m);
+                if (glyph) renderer.drawGlyph(*glyph, textColor, m);
             }
             x += ge.advance;
         }
@@ -282,7 +281,7 @@
                 (point(startX, posY))
                 (point(endX, posY));
 
-            render::drawLine(underline, textColor, mat);
+            renderer.drawLine(underline, textColor, mat);
         }
     }
 }

=== modified file 'libcore/swf/TextRecord.h'
--- a/libcore/swf/TextRecord.h  2009-06-15 11:32:49 +0000
+++ b/libcore/swf/TextRecord.h  2009-07-10 15:44:55 +0000
@@ -28,6 +28,7 @@
     class SWFMatrix;
     class cxform;
     class Font;
+    class Renderer;
 }
 
 namespace gnash {
@@ -88,8 +89,8 @@
     bool read(SWFStream& in, movie_definition& m, int glyphBits,
             int advanceBits, TagType tag);
 
-    static void displayRecords(const SWFMatrix& mat, const cxform& cx,
-            const TextRecords& records, bool embedded = true);
+    static void displayRecords(Renderer& renderer, const SWFMatrix& mat,
+            const cxform& cx, const TextRecords& records, bool embedded = 
true);
 
     const Glyphs& glyphs() const {
         return _glyphs;

=== modified file 'libcore/swf/VideoFrameTag.cpp'
--- a/libcore/swf/VideoFrameTag.cpp     2009-04-07 12:46:29 +0000
+++ b/libcore/swf/VideoFrameTag.cpp     2009-07-13 08:06:09 +0000
@@ -31,7 +31,7 @@
 
 void
 VideoFrameTag::loader(SWFStream& in, SWF::TagType tag, movie_definition& m,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
     assert(tag == SWF::VIDEOFRAME);
 

=== modified file 'libcore/swf/VideoFrameTag.h'
--- a/libcore/swf/VideoFrameTag.h       2009-06-15 11:32:49 +0000
+++ b/libcore/swf/VideoFrameTag.h       2009-07-13 08:06:09 +0000
@@ -53,7 +53,7 @@
        /// This function is allowed to be called zero or more times, as long
        /// as a DefineVideoStreamTag was read before.
        static void loader(SWFStream& in, SWF::TagType tag, movie_definition& m,
-            const RunInfo& r);
+            const RunResources& r);
 
 };
 

=== modified file 'libcore/swf/tag_loaders.cpp'
--- a/libcore/swf/tag_loaders.cpp       2009-07-10 04:59:27 +0000
+++ b/libcore/swf/tag_loaders.cpp       2009-07-13 08:06:09 +0000
@@ -50,7 +50,6 @@
 #include "sound_handler.h"
 #include "ExportableResource.h"
 #include "MovieFactory.h"
-#include "render.h"
 
 #ifdef HAVE_ZLIB_H
 #include <zlib.h>
@@ -165,14 +164,14 @@
 
 // Silently ignore the contents of this tag.
 void null_loader(SWFStream& /*in*/, TagType /*tag*/, movie_definition& /*m*/,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
 }
 
 // Label the current frame of m with the name from the SWFStream.
 void
 frame_label_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& /*r*/)
+               const RunResources& /*r*/)
 {
     assert(tag == SWF::FRAMELABEL); // 43
 
@@ -216,7 +215,7 @@
 // images further along in the SWFStream.
 void
 jpeg_tables_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& /*r*/)
+               const RunResources& /*r*/)
 {
     //GNASH_REPORT_FUNCTION;
     assert(tag == SWF::JPEGTABLES);
@@ -274,7 +273,7 @@
 // existing JpegImageInput object stored in the movie.
 void
 define_bits_jpeg_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& /*r*/)
+               const RunResources& r)
 {
     assert(tag == SWF::DEFINEBITS); // 6
 
@@ -317,7 +316,12 @@
         return;
     }
     
-    boost::intrusive_ptr<BitmapInfo> bi = render::createBitmapInfo(im);
+    Renderer* renderer = r.renderer();
+    if (!renderer) {
+        IF_VERBOSE_PARSE(log_parse(_("No renderer, not adding bitmap")));
+        return;
+    }    
+    boost::intrusive_ptr<BitmapInfo> bi = renderer->createBitmapInfo(im);
 
     // add bitmap to movie under DisplayObject id.
     m.addBitmap(id, bi);
@@ -326,7 +330,7 @@
 
 void
 define_bits_jpeg2_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& /*r*/)
+               const RunResources& r)
 {
     assert(tag == SWF::DEFINEBITSJPEG2); // 21
 
@@ -374,7 +378,12 @@
 
     std::auto_ptr<GnashImage> im (ImageInput::readImageData(ad, ft));
 
-    boost::intrusive_ptr<BitmapInfo> bi = render::createBitmapInfo(im);
+    Renderer* renderer = r.renderer();
+    if (!renderer) {
+        IF_VERBOSE_PARSE(log_parse(_("No renderer, not adding bitmap")));
+        return;
+    }    
+    boost::intrusive_ptr<BitmapInfo> bi = renderer->createBitmapInfo(im);
 
     // add bitmap to movie under DisplayObject id.
     m.addBitmap(id, bi);
@@ -474,7 +483,7 @@
 // channel using zlib compression.
 void
 define_bits_jpeg3_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& /*r*/)
+               const RunResources& r)
 {
     assert(tag == SWF::DEFINEBITSJPEG3); // 35
 
@@ -523,8 +532,14 @@
     //  ea8bbad50ccbc52dd734dfc93a7f06a7  6964trev3c.swf
     im->mergeAlpha(buffer.get(), bufferLength);
 
+
+    Renderer* renderer = r.renderer();
+    if (!renderer) {
+        IF_VERBOSE_PARSE(log_parse(_("No renderer, not adding bitmap")));
+        return;
+    }    
     boost::intrusive_ptr<BitmapInfo> bi =
-        render::createBitmapInfo(static_cast<std::auto_ptr<GnashImage> >(im));
+        renderer->createBitmapInfo(static_cast<std::auto_ptr<GnashImage> 
>(im));
 
     // add bitmap to movie under DisplayObject id.
     m.addBitmap(id, bi);
@@ -534,7 +549,7 @@
 
 void
 define_bits_lossless_2_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& /*r*/)
+               const RunResources& r)
 {
     // tags 20 || 36
     assert(tag == SWF::DEFINELOSSLESS || tag == SWF::DEFINELOSSLESS2);
@@ -711,7 +726,12 @@
 
     }
 
-    boost::intrusive_ptr<BitmapInfo> bi = render::createBitmapInfo(image);
+    Renderer* renderer = r.renderer();
+    if (!renderer) {
+        IF_VERBOSE_PARSE(log_parse(_("No renderer, not adding bitmap")));
+        return;
+    }    
+    boost::intrusive_ptr<BitmapInfo> bi = renderer->createBitmapInfo(image);
 
     // add bitmap to movie under DisplayObject id.
     m.addBitmap(id, bi);
@@ -722,7 +742,7 @@
 // This is like null_loader except it prints a message to nag us to fix it.
 void
 fixme_loader(SWFStream& /*in*/, TagType tag, movie_definition& /*m*/,
-               const RunInfo& /*r*/)
+               const RunResources& /*r*/)
 {
     static std::set<TagType> warned;
     if (warned.insert(tag).second) {
@@ -733,7 +753,7 @@
 // Create and initialize a sprite, and add it to the movie.
 void
 sprite_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& r)
+               const RunResources& r)
 {
     assert(tag == SWF::DEFINESPRITE); // 39 - DefineSprite
 
@@ -778,7 +798,7 @@
 
 
 void export_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& /*r*/)
+               const RunResources& /*r*/)
     // Load an export tag (for exposing internal resources of m)
 {
     assert(tag == SWF::EXPORTASSETS); // 56
@@ -841,7 +861,7 @@
 
 
 void import_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& r)
+               const RunResources& r)
 {
     assert(tag == SWF::IMPORTASSETS || tag == SWF::IMPORTASSETS2);
 
@@ -940,7 +960,7 @@
 // Load a DefineSound tag.
 void
 define_sound_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& r)
+               const RunResources& r)
 {
     assert(tag == SWF::DEFINESOUND); // 14
 
@@ -1041,7 +1061,7 @@
 // Load a SoundStreamHead(2) tag.
 void
 sound_stream_head_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& r)
+               const RunResources& r)
 {
 
     // 18 || 45
@@ -1179,7 +1199,7 @@
 
 void
 file_attributes_loader(SWFStream& in, TagType tag, movie_definition& m,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
     assert(tag == SWF::FILEATTRIBUTES); // 69
 
@@ -1238,7 +1258,7 @@
 
 void
 metadata_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& /*r*/)
+               const RunResources& /*r*/)
 {
     assert(tag == SWF::METADATA); 
 
@@ -1280,7 +1300,7 @@
 
 void
 serialnumber_loader(SWFStream& in, TagType tag, movie_definition& /*m*/, 
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
     assert(tag == SWF::SERIALNUMBER); // 41
 
@@ -1314,7 +1334,7 @@
 
 void
 reflex_loader(SWFStream& in, TagType tag, movie_definition& /*m*/,
-        const RunInfo& /*r*/)
+        const RunResources& /*r*/)
 {
     assert(tag == SWF::REFLEX); // 777
 

=== modified file 'libcore/swf/tag_loaders.h'
--- a/libcore/swf/tag_loaders.h 2009-06-15 12:07:43 +0000
+++ b/libcore/swf/tag_loaders.h 2009-07-13 08:06:09 +0000
@@ -27,111 +27,111 @@
 // Forward declarations
 namespace gnash {
  class movie_definition;
-    class RunInfo;
+    class RunResources;
 }
 
 namespace gnash {
 namespace SWF {
 
 /// Silently ignore the contents of this tag.
-void null_loader(SWFStream&, TagType, movie_definition&, const RunInfo&);
+void null_loader(SWFStream&, TagType, movie_definition&, const RunResources&);
 
 /// This is like null_loader except it prints a message to nag us to fix it.
-void fixme_loader(SWFStream&, TagType, movie_definition&, const RunInfo&);
+void fixme_loader(SWFStream&, TagType, movie_definition&, const RunResources&);
 
 /// \brief
 /// Load JPEG compression tables that can be used to load
 /// images further along in the SWFStream. (SWF::JPEGTABLES)
 void jpeg_tables_loader(SWFStream&, TagType, movie_definition&,
-               const RunInfo&);
+               const RunResources&);
 
 /// \brief
 /// A JPEG image without included tables; those should be in an
 /// existing jpeg::input object stored in the movie. (SWF::DEFINEBITS)
 void define_bits_jpeg_loader(SWFStream&, TagType, movie_definition&,
-               const RunInfo&);
+               const RunResources&);
 
 /// Handler for SWF::DEFINEBITSJPEG2 tag
 void define_bits_jpeg2_loader(SWFStream&, TagType, movie_definition&,
-               const RunInfo&);
+               const RunResources&);
 
 /// \brief
 /// Loads a define_bits_jpeg3 tag. This is a jpeg file with an alpha
 /// channel using zlib compression. (SWF::DEFINEBITSJPEG3)
 void define_bits_jpeg3_loader(SWFStream&, TagType, movie_definition&,
-               const RunInfo&);
+               const RunResources&);
 
 /// SWF Tags Reflex (777)
 //
 void reflex_loader(SWFStream&, TagType, movie_definition&,
-               const RunInfo&);
+               const RunResources&);
 
 void define_bits_lossless_2_loader(SWFStream&, TagType, movie_definition&,
-               const RunInfo&);
+               const RunResources&);
 
 /// Create and initialize a sprite, and add it to the movie. 
 //
 /// Handles a SWF::DEFINESPRITE tag
 ///
-void sprite_loader(SWFStream&, TagType, movie_definition&, const RunInfo&);
+void sprite_loader(SWFStream&, TagType, movie_definition&, const 
RunResources&);
 
 // end_tag doesn't actually need to exist.
 // TODO: drop this loader ?
-void end_loader(SWFStream& in, TagType tag, movie_definition&, const RunInfo&)
+void end_loader(SWFStream& in, TagType tag, movie_definition&, const 
RunResources&)
 {
     assert(tag == SWF::END); // 0
     assert(in.tell() == in.get_tag_end_position());
 }
 
 void remove_object_2_loader(SWFStream&, TagType, movie_definition&,
-               const RunInfo&);
+               const RunResources&);
 
-void do_action_loader(SWFStream&, TagType, movie_definition&, const RunInfo&);
+void do_action_loader(SWFStream&, TagType, movie_definition&, const 
RunResources&);
 
 /// Label the current frame  (SWF::FRAMELABEL)
 void frame_label_loader(SWFStream&, TagType, movie_definition&,
-               const RunInfo&);
+               const RunResources&);
 
-void export_loader(SWFStream&, TagType, movie_definition&, const RunInfo&);
+void export_loader(SWFStream&, TagType, movie_definition&, const 
RunResources&);
 
 /// Load an SWF::IMPORTASSETS or SWF::IMPORTASSETS2 tag (for pulling in 
external resources)
-void import_loader(SWFStream&, TagType, movie_definition&, const RunInfo&);
+void import_loader(SWFStream&, TagType, movie_definition&, const 
RunResources&);
 
 /// Load a SWF::DEFINESOUND tag.
 void define_sound_loader(SWFStream&, TagType, movie_definition&,
-               const RunInfo&);
+               const RunResources&);
 
 void do_init_action_loader(SWFStream&, TagType, movie_definition&,
-               const RunInfo&);
+               const RunResources&);
 
 /// Load SWF::SOUNDSTREAMHEAD or SWF::SOUNDSTREAMHEAD2 tag.
 void sound_stream_head_loader(SWFStream&, TagType, movie_definition&,
-               const RunInfo&);
+               const RunResources&);
 
 /// Load a SWF::SOUNDSTREAMBLOCK tag.
 void sound_stream_block_loader(SWFStream&, TagType, movie_definition&,
-               const RunInfo&);
+               const RunResources&);
 
 void
 define_video_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& r);
+               const RunResources& r);
 
 void
 video_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& r);
+               const RunResources& r);
 
 void
 file_attributes_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& r);
+               const RunResources& r);
 
 void
 metadata_loader(SWFStream& in, TagType tag, movie_definition& m,
-               const RunInfo& r);
+               const RunResources& r);
 
 /// Load a SWF::SERIALNUMBER tag.
 void
 serialnumber_loader(SWFStream& in, TagType tag, movie_definition& /*m*/,
-        const RunInfo& /*r*/);
+        const RunResources& /*r*/);
 
 
 } // namespace gnash::SWF

=== modified file 'libcore/vm/ASHandlers.cpp'
--- a/libcore/vm/ASHandlers.cpp 2009-06-15 11:32:49 +0000
+++ b/libcore/vm/ASHandlers.cpp 2009-07-13 09:04:26 +0000
@@ -543,7 +543,7 @@
 #endif
 
     VM& vm = thread.env.getVM();
-    sound::sound_handler* s = vm.getRoot().runInfo().soundHandler();
+    sound::sound_handler* s = vm.getRoot().runResources().soundHandler();
     if (s)
     {
         s->stop_all_sounds();

=== modified file 'libcore/vm/VM.h'
--- a/libcore/vm/VM.h   2009-06-30 09:12:37 +0000
+++ b/libcore/vm/VM.h   2009-07-13 08:06:09 +0000
@@ -125,7 +125,7 @@
     //
     /// NOTE: this clock should drive all internal operations
     /// but maybe accessing it trough VM isn't the best idea.
-    /// TODO: consider making this accessible trough RunInfo
+    /// TODO: consider making this accessible trough RunResources
     /// instead.
     ///
     VirtualClock& getClock() {

=== modified file 'plugin/win32/plugin.h'
--- a/plugin/win32/plugin.h     2009-02-25 22:33:03 +0000
+++ b/plugin/win32/plugin.h     2009-07-10 15:44:55 +0000
@@ -33,8 +33,8 @@
 #include "Player.h"
 #include "URL.h"
 #include "sound_handler.h"
-#include "render_handler.h"
-#include "render_handler_agg.h"
+#include "Renderer.h"
+#include "Renderer_agg.h"
 #include "MovieClip.h"
 #include "movie_definition.h"
 #include "movie_root.h"
@@ -101,7 +101,7 @@
     unsigned char* _memaddr;
 
     std::auto_ptr<gnash::media::sound_handler> _sound_handler;
-    gnash::render_handler* _render_handler;
+    gnash::Renderer* _Renderer;
 
     // Mouse state.
     int mouse_x;

=== modified file 'testsuite/DummyCharacter.h'
--- a/testsuite/DummyCharacter.h        2009-04-15 05:33:51 +0000
+++ b/testsuite/DummyCharacter.h        2009-07-10 16:03:50 +0000
@@ -51,7 +51,7 @@
        {
        }
 
-    virtual void display() {}
+    virtual void display(Renderer& /*renderer*/) {}
 
     virtual rect getBounds() const { return rect(); }
 

=== modified file 'testsuite/DummyMovieDefinition.h'
--- a/testsuite/DummyMovieDefinition.h  2009-04-15 05:33:51 +0000
+++ b/testsuite/DummyMovieDefinition.h  2009-07-13 08:06:09 +0000
@@ -64,7 +64,7 @@
        ///  - 0 bytes (for get_bytes_loaded()/get_bytes_total())
        ///  - empty url
        ///
-       DummyMovieDefinition(const RunInfo& ri)
+       DummyMovieDefinition(const RunResources& ri)
                :
         SWFMovieDefinition(ri),
                _version(6),
@@ -82,7 +82,7 @@
        /// All but the target version will be initialized
        /// exactly as with the default constructor.
        ///
-       DummyMovieDefinition(const RunInfo& ri, int version)
+       DummyMovieDefinition(const RunResources& ri, int version)
                :
         SWFMovieDefinition(ri),
                _version(version),

=== modified file 'testsuite/MovieTester.cpp'
--- a/testsuite/MovieTester.cpp 2009-06-15 14:53:11 +0000
+++ b/testsuite/MovieTester.cpp 2009-07-13 09:04:26 +0000
@@ -31,20 +31,19 @@
 #include "NullSoundHandler.h"
 #include "RGBA.h" // for rgba class (pixel checking)
 #include "FuzzyPixel.h" // for pixel checking
-#include "render.h"
-#include "render_handler.h"
+#include "Renderer.h"
 #include "ManualClock.h" // for use by advance
-#include "StreamProvider.h" // for passing to RunInfo
+#include "StreamProvider.h" // for passing to RunResources
 #include "swf/TagLoadersTable.h"
 #include "swf/DefaultTagLoaders.h"
 #ifdef RENDERER_CAIRO
-# include "render_handler_cairo.h"
+# include "Renderer_cairo.h"
 #endif
 #ifdef RENDERER_OPENGL
-# include "render_handler_ogl.h"
+# include "Renderer_ogl.h"
 #endif
 #ifdef RENDERER_AGG
-# include "render_handler_agg.h"
+# include "Renderer_agg.h"
 #endif
 
 #include "MediaHandler.h"
@@ -87,15 +86,15 @@
        // Initialize the sound handler(s)
        initTestingSoundHandlers();
 
-    _runInfo.reset(new RunInfo(url));
-    _runInfo->setSoundHandler(_sound_handler);
+    _runResources.reset(new RunResources(url));
+    _runResources->setSoundHandler(_sound_handler);
     
     boost::shared_ptr<SWF::TagLoadersTable> loaders(new 
SWF::TagLoadersTable());
     addDefaultLoaders(*loaders);
 
-    _runInfo->setTagLoaders(loaders);
+    _runResources->setTagLoaders(loaders);
 
-    _runInfo->setStreamProvider(boost::shared_ptr<StreamProvider>(
+    _runResources->setStreamProvider(boost::shared_ptr<StreamProvider>(
                 new StreamProvider));
 
        if ( url == "-" )
@@ -103,7 +102,7 @@
                std::auto_ptr<IOChannel> in (
                                noseek_fd_adapter::make_stream(fileno(stdin))
                                );
-               _movie_def = MovieFactory::makeMovie(in, url, *_runInfo, false);
+               _movie_def = MovieFactory::makeMovie(in, url, *_runResources, 
false);
        }
        else
        {
@@ -123,7 +122,7 @@
 #endif
                }
                // _url should be always set at this point...
-               _movie_def = MovieFactory::makeMovie(urlObj, *_runInfo,
+               _movie_def = MovieFactory::makeMovie(urlObj, *_runResources,
                 NULL, false);
        }
 
@@ -132,7 +131,7 @@
                throw GnashException("Could not load movie from "+url);
        }
 
-       _movie_root = new movie_root(*_movie_def, _clock, *_runInfo);
+       _movie_root = new movie_root(*_movie_def, _clock, *_runResources);
 
        // Initialize viewport size with the one advertised in the header
        _width = unsigned(_movie_def->get_width_pixels());
@@ -164,13 +163,17 @@
 }
 
 void
-MovieTester::render(render_handler& h, InvalidatedRanges& invalidated_regions) 
+MovieTester::render(boost::shared_ptr<Renderer> h,
+        InvalidatedRanges& invalidated_regions) 
 {
        assert(_movie);
 
-       set_render_handler(&h);
+    // This is a bit dangerous, as there isn't really support for swapping
+    // renderers during runtime; though the only problem is likely to be
+    // that BitmapInfos are missing.
+       _runResources->setRenderer(h);
 
-       h.set_invalidated_regions(invalidated_regions);
+       h->set_invalidated_regions(invalidated_regions);
 
        // We call display here to simulate effect of a real run.
        //
@@ -217,10 +220,10 @@
                _forceRedraw = false; // reset to no forced redraw
        }
 
-       for (TRenderers::const_iterator it=_testingRenderers.begin(), 
itE=_testingRenderers.end();
-                               it != itE; ++it)
+       for (TestingRenderers::const_iterator it=_testingRenderers.begin(),
+            itE=_testingRenderers.end(); it != itE; ++it)
        {
-               TestingRenderer& rend = *(*it);
+               const TestingRenderer& rend = *it;
                render(rend.getRenderer(), ranges);
        }
        
@@ -316,12 +319,12 @@
                if (yscale < xscale) xscale = yscale;
 
         // Scale for all renderers.
-        for (TRenderers::const_iterator it=_testingRenderers.begin(), 
itE=_testingRenderers.end();
-                               it != itE; ++it)
+        for (TestingRenderers::iterator it=_testingRenderers.begin(),
+                itE=_testingRenderers.end(); it != itE; ++it)
         {
-            TestingRenderer& rend = *(*it);
-            render_handler& h = rend.getRenderer();
-            h.set_scale(xscale, yscale);
+            TestingRenderer& rend = *it;
+            Renderer* h = rend.getRenderer().get();
+            h->set_scale(xscale, yscale);
         }
        }
 
@@ -368,10 +371,10 @@
 
        //std::cout <<"chekPixel(" << color << ") called" << std::endl;
 
-       for (TRenderers::const_iterator it=_testingRenderers.begin(), 
itE=_testingRenderers.end();
-                               it != itE; ++it)
+       for (TestingRenderers::const_iterator it=_testingRenderers.begin(),
+            itE=_testingRenderers.end(); it != itE; ++it)
        {
-               const TestingRenderer& rend = *(*it);
+               const TestingRenderer& rend = *it;
 
                std::stringstream ss;
                ss << rend.getName() <<" ";
@@ -379,7 +382,7 @@
 
                rgba obt_col;
 
-               render_handler& handler = rend.getRenderer();
+               const Renderer& handler = *rend.getRenderer();
 
                if ( ! handler.getAveragePixel(obt_col, x, y, radius) )
                {
@@ -503,7 +506,7 @@
 void
 MovieTester::initTestingRenderers()
 {
-       std::auto_ptr<render_handler> handler;
+    boost::shared_ptr<Renderer> handler;
 
        // TODO: add support for testing multiple renderers
        // This is tricky as requires changes in the core lib
@@ -521,7 +524,7 @@
                const char* pixelFormat = aggPixelFormats[i];
                std::string name = "AGG_" + std::string(pixelFormat);
 
-               handler.reset( create_render_handler_agg(pixelFormat) );
+               handler.reset( create_Renderer_agg(pixelFormat) );
                if ( handler.get() )
                {
                        //log_debug("Renderer %s initialized", name.c_str());
@@ -544,13 +547,14 @@
 
 #ifdef RENDERER_OPENGL
        // Initialize opengl renderer
-       handler.reset(create_render_handler_ogl(false));
+       handler.reset(create_Renderer_ogl(false));
        addTestingRenderer(handler, "OpenGL");
 #endif
 }
 
 void
-MovieTester::addTestingRenderer(std::auto_ptr<render_handler> h, const 
std::string& name)
+MovieTester::addTestingRenderer(boost::shared_ptr<Renderer> h,
+        const std::string& name)
 {
        if ( ! h->initTestBuffer(_width, _height) )
        {
@@ -567,16 +571,16 @@
                        << " because gnash core lib is unable to support 
testing of "
                        << "multiple renderers from a single process "
                        << "and we're already testing render handler "
-                       << _testingRenderers.front()->getName()
+                       << _testingRenderers.front().getName()
                        << std::endl;
                return;
        }
 
-       _testingRenderers.push_back(TestingRendererPtr(new TestingRenderer(h, 
name)));
+       _testingRenderers.push_back(TestingRenderer(h, name));
 
        // this will be needed till we allow run-time swapping of renderers,
        // see above UNTESTED message...
-       set_render_handler(&(_testingRenderers.back()->getRenderer()));
+       _runResources->setRenderer(_testingRenderers.back().getRenderer());
 }
 
 bool

=== modified file 'testsuite/MovieTester.h'
--- a/testsuite/MovieTester.h   2009-04-14 17:49:58 +0000
+++ b/testsuite/MovieTester.h   2009-07-13 09:04:26 +0000
@@ -28,10 +28,10 @@
 #include "Range2d.h"
 #include "GnashKey.h"
 #include "sound_handler.h" // for creating the "test" sound handlers
-#include "render_handler.h" // for dtor visibility by auto_ptr
+#include "Renderer.h" // for dtor visibility by auto_ptr
 #include "Movie.h" 
 #include "ManualClock.h" // for composition
-#include "RunInfo.h" // For initialization.
+#include "RunResources.h" // For initialization.
 
 #include <memory> // for auto_ptr
 #include <string> 
@@ -73,7 +73,8 @@
 
 public:
 
-       TestingRenderer(std::auto_ptr<render_handler> renderer, const 
std::string& name)
+       TestingRenderer(boost::shared_ptr<Renderer> renderer,
+            const std::string& name)
                :
                _name(name),
                _renderer(renderer)
@@ -82,16 +83,14 @@
        const std::string& getName() const { return _name; }
 
        /// Return the underlying render handler
-       render_handler& getRenderer() const { return *_renderer; }
+    boost::shared_ptr<Renderer> getRenderer() const { return _renderer; }
 
 private:
 
        std::string _name;
-       std::auto_ptr<render_handler> _renderer;
+    boost::shared_ptr<Renderer> _renderer;
 };
 
-typedef boost::shared_ptr<TestingRenderer> TestingRendererPtr;
-
 /// An utility class for testing movie playback
 //
 /// This is a just born implementation and doesn't
@@ -251,7 +250,7 @@
        //
        /// Pixel checking will be supported as long as a testing-capable 
render handler
        /// was compiled in. Testing-capable means capable of off-screen 
rendering, which
-       /// is implementing the render_handler::initTestBuffer method.
+       /// is implementing the Renderer::initTestBuffer method.
        ///
        bool canTestRendering() const { return ! _testingRenderers.empty(); }
 
@@ -308,10 +307,13 @@
        /// @param invalidated
        ///     The invalidated ranges as computed by the core lib.
        ///
-       void render(render_handler& renderer, InvalidatedRanges& invalidated);
+       void render(boost::shared_ptr<Renderer> renderer,
+            InvalidatedRanges& invalidated);
 
-       /// Add a testing renderer to the list, initializing it with current 
viewport size
-       void addTestingRenderer(std::auto_ptr<render_handler> h, const 
std::string& name);
+       /// Add a testing renderer to the list, initializing it with current
+    //viewport size
+       void addTestingRenderer(boost::shared_ptr<Renderer> h,
+            const std::string& name);
 
        gnash::movie_root* _movie_root;
 
@@ -321,7 +323,7 @@
 
     boost::shared_ptr<sound::sound_handler> _sound_handler;
 
-    std::auto_ptr<RunInfo> _runInfo;
+    std::auto_ptr<RunResources> _runResources;
        /// Current pointer position - X ordinate
        int _x;
 
@@ -340,13 +342,9 @@
        /// information out.
        InvalidatedRanges _invalidatedBounds;
 
-       /// I'd use ptr_list here, but trying not to spread
-       /// boost 1.33 requirement for the moment.
-       /// Still, I'd like to simplify things...
-       /// is shared_ptr fine ?
-       typedef std::vector< TestingRendererPtr > TRenderers;
+    typedef std::vector<TestingRenderer> TestingRenderers;
 
-       std::vector< TestingRendererPtr > _testingRenderers;
+       TestingRenderers _testingRenderers;
 
        // When true, pass world invalidated ranges
        // to the renderer(s) at ::render time.

=== modified file 'testsuite/libcore.all/AsValueTest.cpp'
--- a/testsuite/libcore.all/AsValueTest.cpp     2009-06-07 21:14:22 +0000
+++ b/testsuite/libcore.all/AsValueTest.cpp     2009-07-13 09:04:26 +0000
@@ -107,15 +107,15 @@
     // Initialize gnash lib
     gnashInit();
     
-    RunInfo runInfo("");
+    RunResources runResources("");
 
     // Create a bogus movie with swf version 7 support
     boost::intrusive_ptr<movie_definition> md(
-            new DummyMovieDefinition(runInfo, 7));
+            new DummyMovieDefinition(runResources, 7));
 
     ManualClock clock;
 
-    movie_root stage(*md, clock, runInfo);
+    movie_root stage(*md, clock, runResources);
 
     Movie* root = md->createMovie();
     stage.setRootMovie(root);

=== modified file 'testsuite/libcore.all/DisplayListTest.cpp'
--- a/testsuite/libcore.all/DisplayListTest.cpp 2009-06-03 16:36:59 +0000
+++ b/testsuite/libcore.all/DisplayListTest.cpp 2009-07-13 08:06:09 +0000
@@ -49,7 +49,7 @@
        // Initialize gnash lib
        gnashInit();
     
-    RunInfo ri("");
+    RunResources ri("");
 
        // Initialize a VM
        boost::intrusive_ptr<movie_definition> md5(new DummyMovieDefinition(ri, 
5));

=== modified file 'testsuite/libcore.all/Makefile.am'
--- a/testsuite/libcore.all/Makefile.am 2009-05-14 15:02:29 +0000
+++ b/testsuite/libcore.all/Makefile.am 2009-07-13 10:00:05 +0000
@@ -21,6 +21,8 @@
 AM_CPPFLAGS = \
         -I$(top_srcdir)/testsuite  \
         -I$(top_srcdir)/backend  \
+        -I$(top_srcdir)/libsound  \
+        -I$(top_srcdir)/libmedia  \
         -I$(top_srcdir)/libamf  \
         -I$(top_srcdir)/libnet  \
         -I$(top_srcdir)/libbase  \

=== modified file 'testsuite/libcore.all/PropertyListTest.cpp'
--- a/testsuite/libcore.all/PropertyListTest.cpp        2009-06-03 16:36:59 
+0000
+++ b/testsuite/libcore.all/PropertyListTest.cpp        2009-07-13 09:04:26 
+0000
@@ -29,7 +29,7 @@
 #include "smart_ptr.h"
 #include "as_prop_flags.h"
 #include "ManualClock.h"
-#include "RunInfo.h"
+#include "RunResources.h"
 
 #include <iostream>
 #include <sstream>
@@ -55,18 +55,18 @@
        gnashInit();
 
     // We don't care about the base URL.
-    RunInfo runInfo("");
+    RunResources runResources("");
        
     boost::intrusive_ptr<movie_definition> md5(
-            new DummyMovieDefinition(runInfo, 5));
+            new DummyMovieDefinition(runResources, 5));
        boost::intrusive_ptr<movie_definition> md7(
-            new DummyMovieDefinition(runInfo, 7));
+            new DummyMovieDefinition(runResources, 7));
 
        // TODO: test both SWF5 and SWF7 as they are different !!
 
        ManualClock clock;
 
-    movie_root root(*md5, clock, runInfo);
+    movie_root root(*md5, clock, runResources);
 
     root.setRootMovie( md5->createMovie() );
 

=== modified file 'utilities/processor.cpp'
--- a/utilities/processor.cpp   2009-06-15 14:53:11 +0000
+++ b/utilities/processor.cpp   2009-07-13 09:04:26 +0000
@@ -123,7 +123,7 @@
 };
 
 static boost::intrusive_ptr<gnash::movie_definition> play_movie(
-        const std::string& filename, const RunInfo& runInfo);
+        const std::string& filename, const RunResources& runResources);
 
 static bool s_do_output = false;
 static bool s_stop_on_errors = true;
@@ -385,13 +385,13 @@
             e = infiles.end(); i != e; ++i)
     {
 
-        RunInfo runInfo(*i);
-        runInfo.setSoundHandler(soundHandler);
-        runInfo.setStreamProvider(sp);
-        runInfo.setTagLoaders(loaders);
+        RunResources runResources(*i);
+        runResources.setSoundHandler(soundHandler);
+        runResources.setStreamProvider(sp);
+        runResources.setTagLoaders(loaders);
 
            boost::intrusive_ptr<gnash::movie_definition> m =
-            play_movie(*i, runInfo);
+            play_movie(*i, runResources);
            if (!m) {
                if (s_stop_on_errors) {
                    // Fail.
@@ -420,7 +420,7 @@
 //
 // Return the movie definition.
 boost::intrusive_ptr<gnash::movie_definition>
-play_movie(const std::string& filename, const RunInfo& runInfo)
+play_movie(const std::string& filename, const RunResources& runResources)
 {
     boost::intrusive_ptr<gnash::movie_definition> md;
 
@@ -432,7 +432,7 @@
       {
          std::auto_ptr<IOChannel> in (
                  noseek_fd_adapter::make_stream(fileno(stdin)) );
-         md = MovieFactory::makeMovie(in, filename, runInfo, false);
+         md = MovieFactory::makeMovie(in, filename, runResources, false);
       }
       else
       {
@@ -449,7 +449,7 @@
              log_debug(_("%s appended to local sandboxes"), path.c_str());
 #endif
          }
-         md = MovieFactory::makeMovie(url, runInfo, NULL, false);
+         md = MovieFactory::makeMovie(url, runResources, NULL, false);
       }
     }
     catch (GnashException& ge)
@@ -473,7 +473,7 @@
 
     // Use a clock advanced at every iteration to match exact FPS speed.
     ManualClock cl;
-    gnash::movie_root m(*md, cl, runInfo);
+    gnash::movie_root m(*md, cl, runResources);
     
     // Register processor to receive ActionScript events (Mouse, Stage
     // System etc).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]