Gnash  0.8.11dev
aos4sup.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 
20 #ifndef __AOS4SUP_H__
21 #define __AOS4SUP_H__
22 
23 #ifdef HAVE_CONFIG_H
24 #include "gnashconfig.h"
25 #endif
26 
27 #include "aos4_gnash_prefs.h"
28 
29 #include <vector>
30 #include <proto/intuition.h>
31 #include <proto/graphics.h>
32 #include <proto/Picasso96API.h>
33 #include <proto/layers.h>
34 #include <proto/Picasso96API.h>
35 #include <proto/dos.h>
36 #include <proto/exec.h>
37 #include <proto/timer.h>
38 #include <exec/execbase.h>
39 #include <devices/timer.h>
40 
41 #include <graphics/blitattr.h>
42 #include <graphics/composite.h>
43 
44 #ifdef RENDERER_CAIRO
45 #include <cairo.h>
46 #include <cairo-amigaos.h>
47 #endif
48 
49 #undef End
50 #undef ACTION_END
51 #include "gui.h"
52 
53 #ifdef RENDERER_AGG
54 # include "aos4_agg_glue.h"
55 #elif defined(RENDERER_CAIRO)
56 # include "aos4_cairo_glue.h"
57 #elif defined(RENDERER_OPENGL)
58 # include "aos4_ogl_glue.h"
59 #endif
60 
61 #define End TAG_END
62 
63 #include "Renderer.h"
64 #include "Renderer_agg.h"
65 
66 static struct TimeVal os4timer_starttime;
67 
68 namespace gnash
69 {
70 
71 class AOS4Gui : public Gui
72 {
73 public:
74  AOS4Gui(unsigned long xid, float scale, bool loop, RunResources& r);
75  virtual ~AOS4Gui();
76  virtual bool init(int argc, char **argv[]);
77  virtual bool createWindow(const char *title, int width, int height, int xPosition = 0, int yPosition = 0);
78  virtual bool run();
79  virtual bool createMenu();
80  virtual bool setupEvents();
81  virtual void renderBuffer();
82  virtual void setInterval(unsigned int interval);
83  virtual void disableCoreTrap();
84  virtual void setTimeout(unsigned int timeout);
85  void setInvalidatedRegions(const InvalidatedRanges& ranges);
86  void key_event(gnash::key::code key, int state, bool down);
87  void resize(int width, int height);
88  virtual bool showMouse(bool show);
89  virtual void setFullscreen();
90  virtual void unsetFullscreen();
91  virtual void showAboutDialog();
92  virtual struct GnashPrefs *ReadPrefs(void);
93 private:
94  geometry::Range2d<int> _validbounds;
95  std::vector< geometry::Range2d<int> > _drawbounds;
96 
97  unsigned int _timeout;
98  bool _core_trap;
99  struct MsgPort *_port;
100  uint32 _timerSig;
101  struct TimeRequest *_timerio;
102  struct TimerIFace *ITimer;
103  char *_window_title;
104 
105  static key::code os4_to_gnash_key(struct IntuiMessage *imsg);
106  static int os4_to_gnash_modifier(int state);
107  uint32 OS4_GetTicks();
108  void PrintMsg( CONST_STRPTR text );
109  void TimerExit(void);
110  bool TimerInit(void);
111  void TimerReset(uint32 microDelay);
112  void killAudioTask();
113 
114  int _orig_width;
115  int _orig_height;
116  int _orig_xPosition;
117  int _orig_yPosition;
118 
119 #ifdef RENDERER_AGG
120  AOS4AggGlue _glue;
121 #elif defined(RENDERER_CAIRO)
122  AOS4CairoGlue _glue;
123 #elif defined(RENDERER_OPENGL)
124  AOS4OglGlue _glue;
125 #endif
126 
127 };
128 
129 // void xt_event_handler(Widget xtwidget, gpointer instance,
130 // XEvent *xevent, Boolean *b);
131 
132 // end of namespace gnash
133 }
134 
135 // end of __AOS4SUP_H__
136 #endif
virtual bool createWindow(const char *title, int width, int height, int xPosition=0, int yPosition=0)
Create and display our window.
Definition: aos4.cpp:619
virtual bool setupEvents()
Definition: aos4.cpp:677
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: aos4.cpp:653
virtual void setFullscreen()
Definition: aos4.cpp:683
Definition: aos4_cairo_glue.h:39
virtual struct GnashPrefs * ReadPrefs(void)
Definition: aos4.cpp:888
virtual bool init(int argc, char **argv[])
/ Initialise the gui and the associated renderer.
Definition: aos4.cpp:592
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
Definition: klash_part.cpp:329
virtual bool showMouse(bool show)
Sets whether the gui should show the system mouse pointer.
Definition: aos4.cpp:708
code
Definition: GnashKey.h:43
Parent class from which all GUI implementations will depend.
Definition: gui.h:88
void resize(int width, int height)
Definition: GnashKey.h:164
Definition: aos4_agg_glue.h:37
Definition: aos4_gnash_prefs.h:61
virtual bool run()
Start main rendering loop.
Definition: aos4.cpp:171
Definition: klash_part.cpp:329
virtual void renderBuffer()
Definition: aos4.cpp:659
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:53
Definition: aos4sup.h:71
AOS4Gui(unsigned long xid, float scale, bool loop, RunResources &r)
Definition: aos4.cpp:79
virtual void showAboutDialog()
Definition: aos4.cpp:867
virtual void setTimeout(unsigned int timeout)
Set the time in milliseconds after which the programme should exit.
Definition: aos4.cpp:586
void key_event(gnash::key::code key, int state, bool down)
Definition: aos4.cpp:822
virtual ~AOS4Gui()
Definition: aos4.cpp:87
virtual bool createMenu()
Definition: aos4.cpp:671
virtual void unsetFullscreen()
Definition: aos4.cpp:695
virtual void setInterval(unsigned int interval)
Set main loop delay in milliseconds.
Definition: aos4.cpp:665
virtual void disableCoreTrap()
Definition: aos4.cpp:647