• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

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 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 
00026 namespace gnash {
00027     class Renderer;
00028     class StreamProvider;
00029     namespace SWF {
00030         class TagLoadersTable;
00031     }
00032     namespace sound {
00033         class sound_handler;
00034     }
00035     namespace media {
00036         class MediaHandler;
00037     }
00038 }
00039 
00040 namespace gnash {
00041 
00043 //
00051 class RunResources
00052 {
00053 public:
00054 
00056     //
00059     RunResources(const std::string& baseURL)
00060         :
00061         _baseURL(baseURL)
00062     {}
00063 
00065     //
00067     const std::string& baseURL() const { return _baseURL; }
00068 
00070     //
00072     void setStreamProvider(boost::shared_ptr<StreamProvider> sp) {
00073         _streamProvider = sp;
00074     }
00075 
00077     //
00080     //
00082     const StreamProvider& streamProvider() const {
00083         assert (_streamProvider.get());
00084         return *_streamProvider;
00085     }
00086 
00088     //
00091     //
00094     void setSoundHandler(boost::shared_ptr<sound::sound_handler> s) {
00095         _soundHandler = s;
00096     } 
00097 
00099     //
00102     sound::sound_handler* soundHandler() const {
00103         return _soundHandler.get();
00104     }
00105 
00106     void setMediaHandler(boost::shared_ptr<media::MediaHandler> s) {
00107         _mediaHandler = s;
00108     }
00109 
00110     media::MediaHandler* mediaHandler() const {
00111         return _mediaHandler.get();
00112     }
00113 
00114     void setRenderer(boost::shared_ptr<Renderer> r) {
00115         _renderer = r;
00116     }
00117 
00118     Renderer* renderer() const {
00119         return _renderer.get();
00120     }
00121 
00123     //
00127     void setTagLoaders(boost::shared_ptr<const SWF::TagLoadersTable> loaders) {
00128         _tagLoaders = loaders;
00129     }
00130 
00132     const SWF::TagLoadersTable& tagLoaders() const {
00133         assert(_tagLoaders.get());
00134         return *_tagLoaders;
00135     }
00136 
00137 #if 1
00138 
00139 
00140 
00141     void setRenderBackend(const std::string& x) { _renderer_backend = x; }
00142     std::string& getRenderBackend() { return _renderer_backend; }
00143 
00147     std::string& getHWAccelBackend() { return _hwaccel_backend; }
00148     void setHWAccelBackend(const std::string& x) { _hwaccel_backend = x; }
00149 #endif
00150 
00151 private:
00152 
00153     const std::string _baseURL;
00154 
00155     boost::shared_ptr<StreamProvider> _streamProvider;
00156 
00157     boost::shared_ptr<sound::sound_handler> _soundHandler;
00158     
00159     boost::shared_ptr<media::MediaHandler> _mediaHandler;
00160 
00161     boost::shared_ptr<Renderer> _renderer;
00162 
00163     boost::shared_ptr<const SWF::TagLoadersTable> _tagLoaders;
00164 
00165 #if 1
00166 
00167 
00168 
00169     std::string _hwaccel_backend;
00170 
00174     std::string _renderer_backend;
00175 #endif    
00176 };
00177 
00178 } // end of gnash namespace
00179 
00180 #endif
00181 
00182 // local Variables:
00183 // mode: C++
00184 // indent-tabs-mode: t
00185 // End:
00186 

Generated on Fri Mar 16 2012 15:46:12 for Gnash by  doxygen 1.7.1