Backslash ${prefix} for kde3 too...
[gnash.git] / gui / aos4 / aos4sup.h
blob54e4181a4d7a5f0a694bd47dd6c9b894114ab546
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
3 // 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.
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
20 #ifndef __AOS4SUP_H__
21 #define __AOS4SUP_H__
23 #ifdef HAVE_CONFIG_H
24 #include "gnashconfig.h"
25 #endif
27 #include "aos4_gnash_prefs.h"
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>
41 #include <graphics/blitattr.h>
42 #include <graphics/composite.h>
44 #ifdef RENDERER_CAIRO
45 #include <cairo.h>
46 #include <cairo-amigaos.h>
47 #endif
49 #undef End
50 #undef ACTION_END
51 #include "gui.h"
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
61 #define End TAG_END
63 #include "Renderer.h"
64 #include "Renderer_agg.h"
66 static struct TimeVal os4timer_starttime;
68 namespace gnash
71 class AOS4Gui : public Gui
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;
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;
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();
114 int _orig_width;
115 int _orig_height;
116 int _orig_xPosition;
117 int _orig_yPosition;
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
129 // void xt_event_handler(Widget xtwidget, gpointer instance,
130 // XEvent *xevent, Boolean *b);
132 // end of namespace gnash
135 // end of __AOS4SUP_H__
136 #endif