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

dump.h

Go to the documentation of this file.
00001 // 
00002 //   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
00003 //   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 #ifndef GNASH_DUMP_H
00020 #define GNASH_DUMP_H
00021 
00022 #ifdef HAVE_CONFIG_H
00023 #include "gnashconfig.h"
00024 #endif
00025 
00026 #include "dsodefs.h" // for DSOEXPORT
00027 #include "gui.h" // for inheritance
00028 #include <string>
00029 #include <fstream>
00030 #include <boost/scoped_array.hpp>
00031 
00032 namespace gnash
00033 {
00034 
00035 class Renderer_agg_base;
00036 
00037 typedef bool (*callback_t)(void*, int, void *data);
00038 
00039 class DSOEXPORT DumpGui : public Gui
00040 {
00041  public:
00042     DumpGui(unsigned long xid, float scale, bool loop, RunResources& r);
00043     ~DumpGui();
00044     void beforeRendering();
00045     bool createMenu() { return true; }
00046     bool createMenuBar() { return true; }
00047     bool createWindow(int width, int height);
00048     bool createWindow(const char* /*title*/, int width, int height,
00049             int /*x*/, int /*y*/)
00050         { return createWindow(width, height); }
00051     bool init(int argc, char **argv[]);
00052     virtual void quitUI();
00053     void renderBuffer() {return; }
00054     void render() { return; }
00055     void render(int /*minx*/, int /*miny*/, int /*maxx*/, int /*maxy*/)
00056          { render(); }
00057     bool run();
00058     void setInterval(unsigned int interval);
00059     void setTimeout(unsigned int timeout);
00060     bool setupEvents() { return true; }
00061     void setFullscreen() { return; }
00062     void setInvalidatedRegion(const SWFRect& /*bounds*/) { return; }
00063     void setInvalidatedRegions(const InvalidatedRanges& /*ranges*/) { return; }
00064     void setCursor(gnash_cursor_type /*newcursor*/) { return; }
00065     void setRenderHandlerSize(int width, int height);
00066     void unsetFullscreen() { return; }
00067     bool want_multiple_regions() { return true; }
00068     bool want_redraw() { return false; }
00069     void writeFrame();
00070 
00071 private:
00072     
00073     Renderer_agg_base* _agg_renderer;
00074 
00075     // A buffer to hold the actual image data. A boost::scoped_array
00076     // is destroyed on reset and when it goes out of scope (including on
00077     // stack unwinding after an exception), so there is no need to delete
00078     // it.
00079     boost::scoped_array<unsigned char> _offscreenbuf;
00080 
00081     int _offscreenbuf_size;             /* size of window (bytes) */
00082 
00083     unsigned int _timeout;              /* maximum length of movie */
00084     unsigned int _framecount;           /* number of frames rendered */
00085 
00086     unsigned int _bpp;                  /* bits per pixel */
00087     std::string _pixelformat;              /* colorspace name (eg, "RGB24") */
00088 
00089     std::string _fileOutput;                 /* path to output file */
00090     std::ofstream _fileStream;        /* stream for output file */
00091     void init_dumpfile();               /* convenience method to create dump file */
00092 
00093 
00094 
00095 };
00096 
00097 // end of namespace gnash 
00098 }
00099 
00100 // end of __DUMP_H__
00101 #endif

Generated on Thu Sep 30 2010 14:34:57 for Gnash by  doxygen 1.7.1