26 #include <boost/intrusive_ptr.hpp>
27 #include <boost/scoped_ptr.hpp>
61 #define ENABLE_KEYBOARD_MOUSE_MOVEMENTS 1
69 class movie_definition;
99 virtual bool init(
int argc,
char **argv[]) = 0;
114 virtual void setTimeout(
unsigned int timeout) = 0;
127 int xPosition = 0,
int yPosition = 0) = 0;
132 virtual bool run() = 0;
189 return std::make_pair(0, 0);
371 #ifdef GNASH_FPS_DEBUG
376 void setFpsTimerInterval(
float interval)
378 assert(interval >= 0.0);
379 fps_timer_interval = interval;
381 #endif // def GNASH_FPS_DEBUG
385 std::auto_ptr<movie_root::InfoTree> getMovieInfo()
const;
412 virtual void error(
const std::string& ) {}
424 virtual bool yesno(
const std::string& question);
433 float getFPS()
const {
return (_movieDef) ? _movieDef->get_frame_rate() : 0;
464 std::exit(EXIT_SUCCESS);
476 log_unimpl(
"This GUI does not implement FD watching.");
548 boost::int32_t _xoffset;
551 boost::int32_t _yoffset;
555 #ifdef GNASH_FPS_DEBUG
556 unsigned int fps_counter;
558 float fps_rate_min, fps_rate_max;
562 unsigned int fps_counter_total;
564 boost::uint64_t fps_timer, fps_start_timer;
570 float fps_timer_interval;
573 unsigned int frames_dropped;
581 void fpsCounterTick();
583 #endif // def GNASH_FPS_DEBUG
587 boost::intrusive_ptr<movie_definition> _movieDef;
599 bool _showUpdatedRegions;
605 boost::scoped_ptr<ScreenShotter> _screenShotter;
607 #ifdef ENABLE_KEYBOARD_MOUSE_MOVEMENTS
610 bool _keyboardMouseMovements;
611 int _keyboardMouseMovementsStep;
612 #endif // ENABLE_KEYBOARD_MOUSE_MOVEMENTS
617 std::auto_ptr<Gui>
createFBGui(
unsigned long xid,
float scale,
bool loop, RunResources&
r);
619 std::auto_ptr<Gui>
createGTKGui(
unsigned long xid,
float scale,
bool loop, RunResources&
r);
620 std::auto_ptr<Gui>
createKDEGui(
unsigned long xid,
float scale,
bool loop, RunResources&
r);
621 std::auto_ptr<Gui>
createQt4Gui(
unsigned long xid,
float scale,
bool loop, RunResources&
r);
622 std::auto_ptr<Gui>
createSDLGui(
unsigned long xid,
float scale,
bool loop, RunResources&
r);
623 std::auto_ptr<Gui>
createFLTKGui(
unsigned long xid,
float scale,
bool loop, RunResources&
r);
624 std::auto_ptr<Gui>
createAQUAGui(
unsigned long xid,
float scale,
bool loop, RunResources&
r);
625 std::auto_ptr<Gui>
createRISCOSGui(
unsigned long xid,
float scale,
bool loop, RunResources&
r);
626 std::auto_ptr<Gui>
createAOS4Gui(
unsigned long xid,
float scale,
bool loop, RunResources&
r);
627 std::auto_ptr<Gui>
createHaikuGui(
unsigned long xid,
float scale,
bool loop, RunResources&
r);
628 std::auto_ptr<Gui>
createDumpGui(
unsigned long xid,
float scale,
bool loop, RunResources&
r);
float getXScale() const
Width of a window pixel, in stage pseudopixel units.
Definition: gui.h:427
virtual double getPixelAspectRatio() const
Definition: gui.h:186
void stop()
Put the application in "stop" mode.
Definition: gui.cpp:853
std::string _audioDump
Name of a file to dump audio to.
Definition: gui.h:524
std::auto_ptr< Gui > createGTKGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_gtk.cpp:41
unsigned int _interval
Main loop interval: the time between successive advance_movie calls.
Definition: gui.h:502
bool showUpdatedRegions() const
Definition: gui.h:354
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
std::auto_ptr< Gui > createRISCOSGui(unsigned long xid, float scale, bool loop, RunResources &r)
std::auto_ptr< Gui > createKDEGui(unsigned long xid, float scale, bool loop, RunResources &r)
bool loops() const
Definition: gui.h:204
A system-clock based virtual clock.
Definition: SystemClock.h:36
bool isFullscreen() const
Definition: gui.h:207
void notify_key_event(gnash::key::code k, int modifier, bool pressed)
Key event notification to be called when a key is pressed or depressed.
Definition: gui.cpp:561
std::auto_ptr< Gui > createDumpGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_dump.cpp:40
virtual bool run()=0
Start main rendering loop.
virtual bool createWindow(const char *title, int width, int height, int xPosition=0, int yPosition=0)=0
Create and display our window.
virtual bool watchFD(int)
Watch a file descriptor.
Definition: gui.h:474
std::map< std::string, std::string > VariableMap
Definition: gui.h:389
int _height
Desired window height.
Definition: gui.h:496
virtual bool yesno(const std::string &question)
Prompt user with a question she can answer with yes/no.
Definition: gui.cpp:1264
virtual bool showMouse(bool show)
Sets whether the gui should show the system mouse pointer.
Definition: gui.cpp:234
void setScreenShotter(std::auto_ptr< ScreenShotter > ss)
Definition: gui.cpp:1004
virtual bool visible()
Determines whether the Gui is visible (not obscured).
Definition: gui.h:534
Definition: GnashKey.h:163
std::auto_ptr< Gui > createHaikuGui(unsigned long xid, float scale, bool loop, RunResources &r)
void toggleFullscreen()
Definition: gui.cpp:259
void notifyMouseWheel(int delta)
Send a mouse wheel event to the stage.
Definition: gui.cpp:516
void showUpdatedRegions(bool x)
Definition: gui.h:353
Definition: GnashKey.h:157
virtual std::string getScreenColor() const
Get the screen color type.
Definition: gui.h:199
bool _loop
Determines if playback should restart after the movie ends.
Definition: gui.h:482
void pause()
Toggle between "stop" and "play" mode.
Definition: gui.cpp:875
bool isPlugin() const
Whether gnash is is running as a plugin.
Definition: gui.h:345
void toggleSound()
Definition: gui.cpp:454
std::auto_ptr< Gui > createAQUAGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_aqua.cpp:40
void resize_view(int width, int height)
Resize the client area view and the window accordingly.
Definition: gui.cpp:430
virtual ~Gui()
Definition: gui.cpp:177
void refreshView()
Definition: gui.cpp:548
gnash_cursor_type
Enumerates mouse cursor types.
Definition: gui.h:80
Quality
Definition: GnashEnums.h:34
virtual void unsetFullscreen()
Definition: gui.cpp:210
virtual void setInvalidatedRegion(const SWFRect &bounds)
Gives the GUI a hint which region of the stage should be redrawn.
Definition: gui.cpp:1039
void setMaxAdvances(unsigned long ul)
Set the maximum number of frame advances before Gnash exits.
Definition: gui.h:351
virtual VirtualClock & getClock()
Return the clock provided by this Gui.
Definition: gui.h:111
Definition: klash_part.cpp:329
virtual void setClipboard(const std::string ©)
Definition: gui.cpp:192
bool _redraw_flag
Definition: gui.h:509
virtual void playHook()
Called by Gui::play().
Definition: gui.h:531
void restart()
Definition: gui.cpp:270
code
Definition: GnashKey.h:43
Parent class from which all GUI implementations will depend.
Definition: gui.h:87
Definition: GnashKey.h:164
std::auto_ptr< Gui > createQt4Gui(unsigned long xid, float scale, bool loop, RunResources &r)
movie_root * getStage()
The root movie, or "Stage".
Definition: gui.h:406
RunResources & _runResources
Per-run resources.
Definition: gui.h:499
virtual void setCursor(gnash_cursor_type newcursor)
Sets the current mouse cursor for the Gui window.
Definition: gui.cpp:1027
void setMovieDefinition(movie_definition *md)
Set the definition of top-level movie.
Definition: gui.cpp:1249
bool _fullscreen
Definition: gui.h:512
boost::shared_ptr< Renderer > _renderer
The handler which is called to update the client area of our window.
Definition: gui.h:505
bool isStopped() const
See stop(), play() and pause()
Definition: gui.h:342
Definition: klash_part.cpp:329
bool _mouseShown
Definition: gui.h:515
virtual bool want_redraw()
Asks the GUI handler if the next frame should be redrawn completely.
Definition: gui.cpp:1033
float getFPS() const
Height of a window pixel, in stage pseudopixel units.
Definition: gui.h:433
std::auto_ptr< Gui > createAOS4Gui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_aos4.cpp:40
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:43
unsigned long _advances
Counter to keep track of frame advances.
Definition: gui.h:521
virtual void setFullscreen()
Definition: gui.cpp:198
virtual void allowScale(bool allow)
Sets whether scaling should be allowed (for fscommand)
Definition: gui.cpp:247
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:275
virtual void error(const std::string &)
Handle error message from the core.
Definition: gui.h:412
void setAudioDump(const std::string &fname)
Set the name of a file to dump audio to.
Definition: gui.h:401
boost::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:271
void takeScreenShot()
Take a screenshot now!
Definition: gui.cpp:1010
void notifyMouseClick(bool mouse_pressed)
Mouse notification callback to be called when the mouse is clicked.
Definition: gui.cpp:532
virtual void resizeWindow(int width, int height)
Definition: gui.cpp:204
virtual void renderBuffer()=0
std::auto_ptr< Gui > createFBGui(unsigned long windowid, float scale, bool do_loop, RunResources &r)
Definition: fb.cpp:141
virtual void showMenu(bool show)
Sets whether the menus should be shown (for fscommand)
Definition: gui.cpp:241
Gui(RunResources &r)
Default constructor. Initialises members to safe defaults.
Definition: gui.cpp:91
void updateStageMatrix()
Definition: gui.cpp:278
void play()
Put the application in "play" mode.
Definition: gui.cpp:830
virtual void beforeRendering()
Definition: gui.h:166
virtual void hideMenu()
Definition: gui.cpp:228
virtual bool init(int argc, char **argv[])=0
/ Initialise the gui and the associated renderer.
float getYScale() const
Height of a window pixel, in stage pseudopixel units.
Definition: gui.h:430
void setQuality(Quality q)
Set rendering quality, if not locked by RC file..
Definition: gui.cpp:1272
unsigned long _maxAdvances
Definition: gui.h:518
boost::int32_t y
Definition: BitmapData_as.cpp:435
virtual void stopHook()
Definition: gui.h:528
virtual std::pair< int, int > screenResolution() const
Definition: gui.h:188
Rectangle class, see swf defined rectangle record.
Definition: SWFRect.h:44
int _width
Desired window width.
Definition: gui.h:493
virtual void setTimeout(unsigned int timeout)=0
Set the time in milliseconds after which the programme should exit.
virtual void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: gui.cpp:1045
virtual double getScreenDPI() const
Definition: gui.h:192
unsigned long _xid
The X Window ID to attach to. If zero, we create a new window.
Definition: gui.h:485
void start()
Start the movie.
Definition: gui.cpp:899
void notifyMouseMove(int x, int y)
Mouse notification callback to be called when the mouse is moved.
Definition: gui.cpp:470
std::auto_ptr< Gui > createSDLGui(unsigned long xid, float scale, bool loop, RunResources &r)
virtual bool want_multiple_regions()
Definition: gui.h:170
Quality getQuality() const
Get current rendering quality.
Definition: gui.cpp:1282
void addFlashVars(VariableMap &vars)
Add variables to set into instances of the top-level movie definition.
Definition: gui.cpp:1241
std::auto_ptr< Gui > createFLTKGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_fltk.cpp:40
Definition: GnashKey.h:159
void quit()
Always called on exit.
Definition: gui.cpp:216
geometry::Range2d< int > _validbounds
Definition: gui.h:490
void setStage(movie_root *stage)
Set the stage to advance/display.
Definition: gui.cpp:1256
virtual void quitUI()
End main rendering loop calling GUI-specific exit functions.
Definition: gui.h:463
virtual void setInterval(unsigned int interval)
Set main loop delay in milliseconds.
Definition: gui.h:102
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