26 #include <boost/intrusive_ptr.hpp> 62 #define ENABLE_KEYBOARD_MOUSE_MOVEMENTS 1 70 class movie_definition;
100 virtual bool init(
int argc,
char **argv[]) = 0;
104 _interval = interval;
115 virtual void setTimeout(
unsigned int timeout) = 0;
117 void setScreenShotter(std::unique_ptr<ScreenShotter> ss);
127 virtual bool createWindow(
const char* title,
int width,
int height,
128 int xPosition = 0,
int yPosition = 0) = 0;
130 virtual void resizeWindow(
int width,
int height);
133 virtual bool run() = 0;
142 virtual void renderBuffer() = 0;
162 virtual void setInvalidatedRegion(
const SWFRect& bounds);
178 virtual bool want_redraw();
183 virtual void setClipboard(
const std::string& copy);
190 return std::make_pair(0, 0);
205 bool loops()
const {
return _loop; }
216 void notifyMouseMove(
int x,
int y);
222 void notifyMouseClick(
bool mouse_pressed);
227 void notifyMouseWheel(
int delta);
244 void resize_view(
int width,
int height);
252 void updateStageMatrix();
265 bool advanceMovie(
bool doDisplay =
true);
288 virtual void setFullscreen();
292 virtual void unsetFullscreen();
296 virtual void hideMenu();
302 virtual bool showMouse(
bool show);
307 virtual void showMenu(
bool show);
312 virtual void allowScale(
bool allow);
315 void toggleFullscreen();
349 void takeScreenShot();
372 #ifdef GNASH_FPS_DEBUG 377 void setFpsTimerInterval(
float interval)
379 assert(interval >= 0.0);
380 fps_timer_interval = interval;
382 #endif // def GNASH_FPS_DEBUG 386 std::unique_ptr<movie_root::InfoTree> getMovieInfo()
const;
393 void addFlashVars(VariableMap& vars);
413 virtual void error(
const std::string& ) {}
425 virtual bool yesno(
const std::string& question);
434 float getFPS()
const {
return (_movieDef) ? _movieDef->get_frame_rate() : 0;
465 std::exit(EXIT_SUCCESS);
477 log_unimpl(
"This GUI does not implement FD watching.");
540 std::map<
int , std::function<void ()> > _fd_callbacks;
549 std::int32_t _xoffset;
552 std::int32_t _yoffset;
556 #ifdef GNASH_FPS_DEBUG 557 unsigned int fps_counter;
559 float fps_rate_min, fps_rate_max;
563 unsigned int fps_counter_total;
565 std::uint64_t fps_timer, fps_start_timer;
571 float fps_timer_interval;
574 unsigned int frames_dropped;
582 void fpsCounterTick();
584 #endif // def GNASH_FPS_DEBUG 586 VariableMap _flashVars;
588 boost::intrusive_ptr<movie_definition> _movieDef;
600 bool _showUpdatedRegions;
606 std::unique_ptr<ScreenShotter> _screenShotter;
608 #ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS 611 bool _keyboardMouseMovements;
612 int _keyboardMouseMovementsStep;
613 #endif // ENABLE_KEYBOARD_MOUSE_MOVEMENTS
std::string _audioDump
Name of a file to dump audio to.
Definition: gui.h:525
unsigned int _interval
Main loop interval: the time between successive advance_movie calls.
Definition: gui.h:503
std::unique_ptr< Gui > createFBGui(unsigned long windowid, float scale, bool do_loop, RunResources &r)
Definition: fb.cpp:141
modifier
Definition: GnashKey.h:33
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:95
A class used to virtualize time flow.
Definition: VirtualClock.h:33
float getYScale() const
Height of a window pixel, in stage pseudopixel units.
Definition: gui.h:431
bool isFullscreen() const
Definition: gui.h:208
A system-clock based virtual clock.
Definition: SystemClock.h:36
std::unique_ptr< Gui > createAQUAGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_aqua.cpp:40
Definition: klash_part.cpp:330
std::unique_ptr< Gui > createQt4Gui(unsigned long xid, float scale, bool loop, RunResources &r)
virtual bool watchFD(int)
Watch a file descriptor.
Definition: gui.h:475
std::unique_ptr< Gui > createDumpGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_dump.cpp:40
std::map< std::string, std::string > VariableMap
Definition: gui.h:390
int _height
Desired window height.
Definition: gui.h:497
virtual bool visible()
Determines whether the Gui is visible (not obscured).
Definition: gui.h:535
Definition: GnashKey.h:163
void showUpdatedRegions(bool x)
Definition: gui.h:354
Definition: GnashKey.h:157
bool _loop
Determines if playback should restart after the movie ends.
Definition: gui.h:483
float getXScale() const
Width of a window pixel, in stage pseudopixel units.
Definition: gui.h:428
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
gnash_cursor_type
Enumerates mouse cursor types.
Definition: gui.h:81
Quality
Definition: GnashEnums.h:34
void setMaxAdvances(unsigned long ul)
Set the maximum number of frame advances before Gnash exits.
Definition: gui.h:352
virtual std::string getScreenColor() const
Get the screen color type.
Definition: gui.h:200
virtual VirtualClock & getClock()
Return the clock provided by this Gui.
Definition: gui.h:112
Definition: klash_part.cpp:329
bool _redraw_flag
Definition: gui.h:510
virtual void playHook()
Called by Gui::play().
Definition: gui.h:532
std::unique_ptr< Gui > createGTKGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_gtk.cpp:41
Definition: klash_part.cpp:330
code
Definition: GnashKey.h:43
Parent class from which all GUI implementations will depend.
Definition: gui.h:88
Definition: GnashKey.h:164
movie_root * getStage()
The root movie, or "Stage".
Definition: gui.h:407
RunResources & _runResources
Per-run resources.
Definition: gui.h:500
bool loops() const
Definition: gui.h:205
bool _fullscreen
Definition: gui.h:513
bool isStopped() const
See stop(), play() and pause()
Definition: gui.h:343
Definition: klash_part.cpp:329
bool _mouseShown
Definition: gui.h:516
void log_unimpl(StringType msg, Args... args)
Definition: log.h:289
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:53
virtual std::pair< int, int > screenResolution() const
Definition: gui.h:189
virtual double getScreenDPI() const
Definition: gui.h:193
unsigned long _advances
Counter to keep track of frame advances.
Definition: gui.h:522
bool isPlugin() const
Whether gnash is is running as a plugin.
Definition: gui.h:346
A VirtualClock wrapper adding pause/resume capabilities.
Definition: VirtualClock.h:54
bool allow(const URL &url, const URL &baseurl)
Return true if access to given url is allowed, false otherwise.
Definition: URLAccessManager.cpp:273
virtual void error(const std::string &)
Handle error message from the core.
Definition: gui.h:413
bool showUpdatedRegions() const
Definition: gui.h:355
void setAudioDump(const std::string &fname)
Set the name of a file to dump audio to.
Definition: gui.h:402
std::int32_t x
Definition: BitmapData_as.cpp:434
static bool advance_movie(Gui *gui)
Convenience static wrapper around advanceMovie for callbacks happiness.
Definition: gui.h:272
virtual void beforeRendering()
Definition: gui.h:167
std::unique_ptr< Gui > createSDLGui(unsigned long xid, float scale, bool loop, RunResources &r)
std::shared_ptr< Renderer > _renderer
The handler which is called to update the client area of our window.
Definition: gui.h:506
unsigned long _maxAdvances
Definition: gui.h:519
std::int32_t y
Definition: BitmapData_as.cpp:435
float getFPS() const
Height of a window pixel, in stage pseudopixel units.
Definition: gui.h:434
std::unique_ptr< Gui > createFLTKGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_fltk.cpp:40
virtual void stopHook()
Definition: gui.h:529
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:44
int _width
Desired window width.
Definition: gui.h:494
Definition: klash_part.cpp:330
std::unique_ptr< Gui > createKDEGui(unsigned long xid, float scale, bool loop, RunResources &r)
unsigned long _xid
The X Window ID to attach to. If zero, we create a new window.
Definition: gui.h:486
std::unique_ptr< Gui > createRISCOSGui(unsigned long xid, float scale, bool loop, RunResources &r)
virtual bool want_multiple_regions()
Definition: gui.h:171
std::unique_ptr< Gui > createHaikuGui(unsigned long xid, float scale, bool loop, RunResources &r)
Definition: GnashKey.h:159
std::unique_ptr< Gui > createAOS4Gui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_aos4.cpp:40
virtual double getPixelAspectRatio() const
Definition: gui.h:187
geometry::Range2d< int > _validbounds
Definition: gui.h:491
virtual void quitUI()
End main rendering loop calling GUI-specific exit functions.
Definition: gui.h:464
virtual void setInterval(unsigned int interval)
Set main loop delay in milliseconds.
Definition: gui.h:103
bool advanceMovie(bool doDisplay=true)
Give movie an heart-beat.
Definition: gui.cpp:935
This class represents the 'Stage' and top-level movie.
Definition: movie_root.h:150