Drop the bool operator for ObjectURI, to avoid getting the kind of side-effect that...
[gnash.git] / gui / dump.h
blobe60d9bbaf9a9e6913ba5b4cf1f55ea94a79899e4
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
3 // Foundation, Inc
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef GNASH_DUMP_H
20 #define GNASH_DUMP_H
22 #ifdef HAVE_CONFIG_H
23 #include "gnashconfig.h"
24 #endif
26 #include "dsodefs.h" // for DSOEXPORT
27 #include "gui.h" // for inheritance
28 #include <string>
29 #include <fstream>
30 #include <boost/scoped_array.hpp>
32 namespace gnash
35 class Renderer_agg_base;
37 typedef bool (*callback_t)(void*, int, void *data);
39 class DSOEXPORT DumpGui : public Gui
41 public:
42 DumpGui(unsigned long xid, float scale, bool loop, RunResources& r);
43 ~DumpGui();
44 void beforeRendering();
45 bool createMenu() { return true; }
46 bool createMenuBar() { return true; }
47 bool createWindow(int width, int height);
48 bool createWindow(const char* /*title*/, int width, int height,
49 int /*x*/, int /*y*/)
50 { return createWindow(width, height); }
51 bool init(int argc, char **argv[]);
52 virtual void quitUI();
53 void renderBuffer() {return; }
54 void render() { return; }
55 void render(int /*minx*/, int /*miny*/, int /*maxx*/, int /*maxy*/)
56 { render(); }
57 bool run();
58 void setInterval(unsigned int interval);
59 void setTimeout(unsigned int timeout);
60 bool setupEvents() { return true; }
61 void setFullscreen() { return; }
62 void setInvalidatedRegion(const SWFRect& /*bounds*/) { return; }
63 void setInvalidatedRegions(const InvalidatedRanges& /*ranges*/) { return; }
64 void setCursor(gnash_cursor_type /*newcursor*/) { return; }
65 void setRenderHandlerSize(int width, int height);
66 void unsetFullscreen() { return; }
67 bool want_multiple_regions() { return true; }
68 bool want_redraw() { return false; }
69 void writeFrame();
71 private:
73 Renderer_agg_base* _agg_renderer;
75 // A buffer to hold the actual image data. A boost::scoped_array
76 // is destroyed on reset and when it goes out of scope (including on
77 // stack unwinding after an exception), so there is no need to delete
78 // it.
79 boost::scoped_array<unsigned char> _offscreenbuf;
81 int _offscreenbuf_size; /* size of window (bytes) */
83 unsigned int _timeout; /* maximum length of movie */
84 unsigned int _framecount; /* number of frames rendered */
86 unsigned int _bpp; /* bits per pixel */
87 std::string _pixelformat; /* colorspace name (eg, "RGB24") */
89 std::string _fileOutput; /* path to output file */
90 std::ofstream _fileStream; /* stream for output file */
91 void init_dumpfile(); /* convenience method to create dump file */
97 // end of namespace gnash
100 // end of __DUMP_H__
101 #endif