2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
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.
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.
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
24 #include "gnashconfig.h"
27 #include "aos4_gnash_prefs.h"
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>
41 #include <graphics/blitattr.h>
42 #include <graphics/composite.h>
46 #include <cairo-amigaos.h>
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"
64 #include "Renderer_agg.h"
66 static struct TimeVal os4timer_starttime
;
71 class AOS4Gui
: public Gui
74 AOS4Gui(unsigned long xid
, float scale
, bool loop
, RunResources
& r
);
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);
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);
94 geometry::Range2d
<int> _validbounds
;
95 std::vector
< geometry::Range2d
<int> > _drawbounds
;
97 unsigned int _timeout
;
99 struct MsgPort
*_port
;
101 struct TimeRequest
*_timerio
;
102 struct TimerIFace
*ITimer
;
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();
121 #elif defined(RENDERER_CAIRO)
123 #elif defined(RENDERER_OPENGL)
129 // void xt_event_handler(Widget xtwidget, gpointer instance,
130 // XEvent *xevent, Boolean *b);
132 // end of namespace gnash
135 // end of __AOS4SUP_H__