Gnash 0.8.10dev
RunResources.h
Go to the documentation of this file.
00001 // RunResources.h    Hold external and per-run resources for Gnash core.
00002 // 
00003 //   Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
00004 // 
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 3 of the License, or
00008 // (at your option) any later version.
00009 // 
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 // 
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019 
00020 #ifndef GNASH_RUN_INFO_H
00021 #define GNASH_RUN_INFO_H
00022 
00023 #include <string>
00024 #include <boost/shared_ptr.hpp>
00025 #include "StreamProvider.h"
00026 #include "Renderer.h"
00027 #include "sound_handler.h"
00028 #include "MediaHandler.h"
00029 #include "TagLoadersTable.h"
00030 
00031 namespace gnash {
00032 
00034 //
00042 class RunResources
00043 {
00044 public:
00045 
00047     //
00050     RunResources() {}
00051 
00053     //
00055     void setStreamProvider(boost::shared_ptr<StreamProvider> sp) {
00056         _streamProvider = sp;
00057     }
00058 
00060     //
00063     //
00065     const StreamProvider& streamProvider() const {
00066         assert (_streamProvider.get());
00067         return *_streamProvider;
00068     }
00069 
00071     //
00074     //
00077     void setSoundHandler(boost::shared_ptr<sound::sound_handler> s) {
00078         _soundHandler = s;
00079     } 
00080 
00082     //
00085     sound::sound_handler* soundHandler() const {
00086         return _soundHandler.get();
00087     }
00088 
00089     void setMediaHandler(boost::shared_ptr<media::MediaHandler> s) {
00090         _mediaHandler = s;
00091     }
00092 
00093     media::MediaHandler* mediaHandler() const {
00094         return _mediaHandler.get();
00095     }
00096 
00097     void setRenderer(boost::shared_ptr<Renderer> r) {
00098         _renderer = r;
00099     }
00100 
00101     Renderer* renderer() const {
00102         return _renderer.get();
00103     }
00104 
00106     //
00110     void setTagLoaders(boost::shared_ptr<const SWF::TagLoadersTable> loaders) {
00111         _tagLoaders = loaders;
00112     }
00113 
00115     const SWF::TagLoadersTable& tagLoaders() const {
00116         assert(_tagLoaders.get());
00117         return *_tagLoaders;
00118     }
00119 
00120 #if 1
00121 
00122 
00123 
00124     void setRenderBackend(const std::string& x) { _renderer_backend = x; }
00125     std::string& getRenderBackend() { return _renderer_backend; }
00126 
00130     std::string& getHWAccelBackend() { return _hwaccel_backend; }
00131     void setHWAccelBackend(const std::string& x) { _hwaccel_backend = x; }
00132 #endif
00133 
00134 private:
00135 
00136     boost::shared_ptr<StreamProvider> _streamProvider;
00137 
00138     boost::shared_ptr<sound::sound_handler> _soundHandler;
00139     
00140     boost::shared_ptr<media::MediaHandler> _mediaHandler;
00141 
00142     boost::shared_ptr<Renderer> _renderer;
00143 
00144     boost::shared_ptr<const SWF::TagLoadersTable> _tagLoaders;
00145 
00146 #if 1
00147 
00148 
00149 
00150     std::string _hwaccel_backend;
00151 
00155     std::string _renderer_backend;
00156 #endif    
00157 };
00158 
00159 } // end of gnash namespace
00160 
00161 #endif
00162 
00163 // local Variables:
00164 // mode: C++
00165 // indent-tabs-mode: t
00166 // End:
00167