Gnash  0.8.11dev
fltksup.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010,
3 // 2011 Free Software 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
18 
19 #ifndef GNASH_FLTKSUP_H
20 #define GNASH_FLTKSUP_H
21 
22 #ifdef HAVE_CONFIG_H
23 #include "gnashconfig.h"
24 #endif
25 
26 
27 #include "log.h"
28 #include "gui.h"
29 
30 #include <vector>
31 #include <fltk/Window.h>
32 #include <fltk/PopupMenu.h>
33 
34 #ifdef RENDERER_AGG
35 # include "fltk_glue_agg.h"
36 #elif defined(RENDERER_CAIRO)
37 # include "fltk_glue_cairo.h"
38 #endif
39 
40 namespace gnash
41 {
42 
43 class FltkGui : public fltk::Window, public Gui
44 {
45 public:
46  FltkGui(unsigned long xid, float scale, bool loop, RunResources& r);
47 
48  virtual ~FltkGui();
49  virtual bool init(int argc, char **argv[]);
50 
51  virtual void setInterval(unsigned int);
52  virtual void setTimeout(unsigned int) { }
53  virtual bool createWindow(const char *title, int width, int height,
54  int xPosition = 0, int yPosition = 0);
55  virtual void renderBuffer();
56 
57  virtual bool run();
58  virtual bool createMenu();
59  virtual void setCursor(gnash_cursor_type newcursor);
60  virtual bool setupEvents() { return true;}
61 
62  void setInvalidatedRegions(const InvalidatedRanges& ranges);
63 
64  void create();
65  int handle(int event);
66  void layout();
67  void addMenuItems();
68  private:
69  void handleKey(unsigned key);
70 
71  fltk::PopupMenu *_popup_menu;
72  float _interval;
73  unsigned int _menu_height;
74 
75  std::vector< geometry::Range2d<int> > _drawbounds_vec;
76 
77 #ifdef RENDERER_AGG
78  FltkAggGlue *_glue;
79 #elif defined(RENDERER_CAIRO)
80  FltkCairoGlue* _glue;
81 #endif
82 };
83 
84 } // end of namespace gnash
85 
86 #endif // end of __FLTKSUP_H__
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: fltk.cpp:447
Definition: fltk_glue_agg.h:38
virtual bool setupEvents()
Definition: fltksup.h:60
virtual bool createMenu()
Definition: fltk.cpp:396
virtual ~FltkGui()
Definition: fltk.cpp:61
virtual bool run()
Start main rendering loop.
Definition: fltk.cpp:197
virtual void setTimeout(unsigned int)
Set the time in milliseconds after which the programme should exit.
Definition: fltksup.h:52
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
int handle(int event)
Definition: fltk.cpp:99
Definition: klash_part.cpp:329
void layout()
Definition: fltk.cpp:411
Parent class from which all GUI implementations will depend.
Definition: gui.h:88
Definition: GnashKey.h:164
virtual bool init(int argc, char **argv[])
/ Initialise the gui and the associated renderer.
Definition: fltk.cpp:205
virtual void setCursor(gnash_cursor_type newcursor)
Sets the current mouse cursor for the Gui window.
Definition: fltk.cpp:428
virtual void renderBuffer()
Definition: fltk.cpp:68
Definition: klash_part.cpp:329
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:53
void addMenuItems()
Definition: fltk.cpp:356
virtual void setInterval(unsigned int)
Set main loop delay in milliseconds.
Definition: fltk.cpp:212
void create()
Definition: fltk.cpp:219
Definition: fltksup.h:43
virtual bool createWindow(const char *title, int width, int height, int xPosition=0, int yPosition=0)
Create and display our window.
Definition: fltk.cpp:232
Definition: fltk_glue_cairo.h:51
FltkGui(unsigned long xid, float scale, bool loop, RunResources &r)
Definition: fltk.cpp:54