Gnash  0.8.11dev
aos4_agg_glue.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 #include "aos4_glue.h"
20 #undef ACTION_END
21 #include "Renderer.h"
22 #include "Renderer_agg.h"
23 
24 #include <proto/intuition.h>
25 #include <proto/graphics.h>
26 #include <graphics/blitattr.h>
27 #include <proto/Picasso96API.h>
28 #include <proto/layers.h>
29 #include <proto/dos.h>
30 #include <proto/gadtools.h>
31 
32 #include <cstdint> // for boost::?int??_t
33 #include <vector>
34 
35 namespace gnash
36 {
37  class AOS4AggGlue : public AOS4Glue
38  {
39  public:
40  AOS4AggGlue();
41  virtual ~AOS4AggGlue();
42 
43  bool init(int argc, char **argv[]);
44  Renderer *createRenderHandler(int depth);
46  bool prepDrawingArea(int width, int height);
47  void render();
48  void render(int minx, int miny, int maxx, int maxy);
49  void setInvalidatedRegions(const InvalidatedRanges& ranges);
50  struct Window *getWindow(void);
51  struct Menu *getMenu(void);
52  void setFullscreen();
53  void unsetFullscreen();
54  void resize(int width, int height);
55  void saveOrigiginalDimension(int width, int height, int xPosition, int yPosition);
56  private:
57  geometry::Range2d<int> _validbounds;
58  std::vector< geometry::Range2d<int> > _drawbounds;
59  unsigned char *_offscreenbuf;
60  Renderer *_agg_renderer;
61  struct Window *_window;
62  struct Screen *_screen;
63  bool _fullscreen;
64  int _width;
65  int _orig_width;
66  int _height;
67  int _orig_height;
68  int _xPosition;
69  int _orig_xPosition;
70  int _yPosition;
71  int _orig_yPosition;
72  int _stride;
73  int _btype;
74  struct Menu *_menu;
75  RGBFTYPE _ftype;
76  };
77 }
gnash::geometry::SnappingRanges2d< std::int32_t >
Renderer_agg.h
gnash::AOS4AggGlue::unsetFullscreen
void unsetFullscreen()
Definition: aos4_agg_glue.cpp:164
gnash::key::GNASH_MOD_CONTROL
@ GNASH_MOD_CONTROL
Definition: GnashKey.h:37
gnash::geometry::Range2d< int >
OBJ_OS_VALUE
@ OBJ_OS_VALUE
Definition: aos4_gnash_prefs.h:124
gnash::Renderer::set_invalidated_regions
virtual void set_invalidated_regions(const InvalidatedRanges &)
Sets the update region (called prior to begin_display).
Definition: Renderer.h:340
gnash::key::L
@ L
Definition: GnashKey.h:124
gnash::key::DOWN
@ DOWN
Definition: GnashKey.h:207
gnash::Gui::_renderer
std::shared_ptr< Renderer > _renderer
The handler which is called to update the client area of our window.
Definition: gui.h:506
gnash::create_Renderer_agg
DSOEXPORT Renderer_agg_base * create_Renderer_agg(const char *pixelformat)
Create a render handler.
Definition: Renderer_agg.cpp:2048
gnash::key::BACKSPACE
@ BACKSPACE
Definition: GnashKey.h:53
GnashPrefs::maxsizemovielib
int maxsizemovielib
Definition: aos4_gnash_prefs.h:86
height
@ height
Definition: klash_part.cpp:329
gnash::key::F2
@ F2
Definition: GnashKey.h:191
gnash::AOS4Gui::init
virtual bool init(int argc, char **argv[])
/ Initialise the gui and the associated renderer.
Definition: aos4.cpp:592
gnash::key::F9
@ F9
Definition: GnashKey.h:198
aos4_glue.h
OBJ_SAVEMEDIASTREAMS
@ OBJ_SAVEMEDIASTREAMS
Definition: aos4_gnash_prefs.h:119
gnash::geometry::Range2d::getMaxY
T getMaxY() const
Get max Y ordinate.
Definition: Range2d.h:633
OBJ_CONNECTLOCALHOST
@ OBJ_CONNECTLOCALHOST
Definition: aos4_gnash_prefs.h:107
gnash::log_debug
void log_debug(StringType msg, Args... args)
Definition: log.h:301
GAD
#define GAD(x)
Definition: aos4.cpp:58
GnashPrefs::logparser
int logparser
Definition: aos4_gnash_prefs.h:66
nm
struct NewMenu nm[]
Definition: aos4_agg_glue.cpp:30
gnash::AOS4Gui::createWindow
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
rc.h
gnash::AOS4AggGlue
Definition: aos4_agg_glue.h:38
_
#define _(String)
Definition: log.h:44
Renderer.h
gnash::AOS4AggGlue::saveOrigiginalDimension
void saveOrigiginalDimension(int width, int height, int xPosition, int yPosition)
Definition: aos4_agg_glue.cpp:155
OBJ_SCROLLER_VALUE
@ OBJ_SCROLLER_VALUE
Definition: aos4_gnash_prefs.h:98
gnash::key::modifier
modifier
Definition: GnashKey.h:34
GnashPrefs::loglocalconn
int loglocalconn
Definition: aos4_gnash_prefs.h:70
OBJ_CONNECTLOCALDOMAIN
@ OBJ_CONNECTLOCALDOMAIN
Definition: aos4_gnash_prefs.h:108
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::Gui
Parent class from which all GUI implementations will depend.
Definition: gui.h:88
gnash::AOS4Gui::run
virtual bool run()
Start main rendering loop.
Definition: aos4.cpp:171
gnash::geometry::Range2d::getMaxX
T getMaxX() const
Get max X ordinate.
Definition: Range2d.h:613
gnash::key::CONTROL
@ CONTROL
Definition: GnashKey.h:62
gnash::key::F1
@ F1
Definition: GnashKey.h:190
gnash::AOS4AggGlue::render
void render()
Definition: aos4_agg_glue.cpp:337
aos4_agg_glue.h
GnashPrefs::savemediadir
char savemediadir[255]
Definition: aos4_gnash_prefs.h:82
gnash::key::F4
@ F4
Definition: GnashKey.h:193
GNASH_REPORT_FUNCTION
#define GNASH_REPORT_FUNCTION
Definition: log.h:452
gnash::AOS4AggGlue::setFullscreen
void setFullscreen()
Definition: aos4_agg_glue.cpp:135
gnash::Renderer
Base class for render handlers.
Definition: Renderer.h:189
gnash::AOS4AggGlue::setInvalidatedRegions
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: aos4_agg_glue.cpp:318
boost
Definition: gui.h:74
OBJ_NETWORKTIMEOUT
@ OBJ_NETWORKTIMEOUT
Definition: aos4_gnash_prefs.h:115
gnash::key::GNASH_MOD_NONE
@ GNASH_MOD_NONE
Definition: GnashKey.h:35
GnashPrefs::detectedos
char detectedos[32]
Definition: aos4_gnash_prefs.h:84
gnash::Renderer_agg_base::init_buffer
virtual void init_buffer(unsigned char *mem, int size, int x, int y, int rowstride)=0
gnash::geometry::Range2d::getMinX
T getMinX() const
Get min X ordinate.
Definition: Range2d.h:603
gnash::AOS4AggGlue::getWindow
struct Window * getWindow(void)
Definition: aos4_agg_glue.cpp:305
gnash::AOS4Glue::_bpp
int _bpp
Definition: aos4_glue.h:39
GnashPrefs::verbosity
int verbosity
Definition: aos4_gnash_prefs.h:63
gnash::AOS4AggGlue::init
bool init(int argc, char **argv[])
Definition: aos4_agg_glue.cpp:88
gnash::AOS4Gui::unsetFullscreen
virtual void unsetFullscreen()
Definition: aos4.cpp:695
gnash::Gui::pause
void pause()
Toggle between "stop" and "play" mode.
Definition: gui.cpp:875
AppPort
struct MsgPort * AppPort
Definition: aos4_gnash_prefs.cpp:33
OBJ
#define OBJ(x)
Definition: aos4.cpp:59
audioTaskID
int audioTaskID
Definition: sound_handler_ahi.cpp:56
OBJ_SCROLLER
@ OBJ_SCROLLER
Definition: aos4_gnash_prefs.h:97
gnash::log_error
void log_error(StringType msg, Args... args)
Definition: log.h:283
gnash::Gui::showUpdatedRegions
bool showUpdatedRegions() const
Definition: gui.h:355
GnashPrefs::logmalformedswf
int logmalformedswf
Definition: aos4_gnash_prefs.h:68
gnash::AOS4AggGlue::AOS4AggGlue
AOS4AggGlue()
Definition: aos4_agg_glue.cpp:65
gnash::geometry::Range2d::isNull
bool isNull() const
Returns true if this is the NULL Range2d.
Definition: Range2d.h:181
gnash::key::PGUP
@ PGUP
Definition: GnashKey.h:213
gnash::Gui::_runResources
RunResources & _runResources
Per-run resources.
Definition: gui.h:500
gnash::RunResources::setRenderer
void setRenderer(std::shared_ptr< Renderer > r)
Definition: RunResources.h:108
gnash::key::LEFT
@ LEFT
Definition: GnashKey.h:209
OBJ_ONLYLOCALSHAREDOBJ
@ OBJ_ONLYLOCALSHAREDOBJ
Definition: aos4_gnash_prefs.h:112
gnash::Gui::_fullscreen
bool _fullscreen
Definition: gui.h:513
gnash::key::RIGHT
@ RIGHT
Definition: GnashKey.h:208
gnash::Gui::notifyMouseClick
void notifyMouseClick(bool mouse_pressed)
Mouse notification callback to be called when the mouse is clicked.
Definition: gui.cpp:531
gnash::AOS4AggGlue::getMenu
struct Menu * getMenu(void)
Definition: aos4_agg_glue.cpp:311
OBJ_NUM
@ OBJ_NUM
Definition: aos4_gnash_prefs.h:131
gnash::Gui::refreshView
void refreshView()
Definition: gui.cpp:547
gnash::geometry::Intersection
Range2d< T > Intersection(const Range2d< T > &r1, const Range2d< T > &r2)
Return a rectangle being the intersetion of the two rectangles.
Definition: Range2d.h:762
gnash::AOS4Gui::setInvalidatedRegions
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: aos4.cpp:653
OBJ_DONTWRITESHAREDOBJ
@ OBJ_DONTWRITESHAREDOBJ
Definition: aos4_gnash_prefs.h:111
gnash::key::r
@ r
Definition: GnashKey.h:164
make_window
Object * make_window(struct GnashPrefs *preferences)
Definition: aos4_gnash_prefs.cpp:36
GnashSleep.h
Objects
Object * Objects[OBJ_NUM]
Definition: aos4_gnash_prefs.cpp:23
gnash::AOS4Gui::disableCoreTrap
virtual void disableCoreTrap()
Definition: aos4.cpp:647
GnashPrefs::dontwriteso
int dontwriteso
Definition: aos4_gnash_prefs.h:75
OBJ_OK
@ OBJ_OK
Definition: aos4_gnash_prefs.h:129
gnash::key::GNASH_MOD_SHIFT
@ GNASH_MOD_SHIFT
Definition: GnashKey.h:36
OBJ_LOGLOCALCONNECTION
@ OBJ_LOGLOCALCONNECTION
Definition: aos4_gnash_prefs.h:105
gnash::key::INSERT
@ INSERT
Definition: GnashKey.h:210
gnash::key::ALT
@ ALT
Definition: GnashKey.h:63
gnash::AOS4Gui::showAboutDialog
virtual void showAboutDialog()
Definition: aos4.cpp:867
gnash::key::PGDN
@ PGDN
Definition: GnashKey.h:214
gnash::key::END
@ END
Definition: GnashKey.h:212
gnash::Renderer::world_to_pixel
virtual geometry::Range2d< int > world_to_pixel(const SWFRect &worldbounds) const =0
Converts world coordinates to pixel coordinates.
gnash::key::code
code
Definition: GnashKey.h:44
gnash::geometry::Range2d::getMinY
T getMinY() const
Get min Y ordinate.
Definition: Range2d.h:623
gnash::key::ENTER
@ ENTER
Definition: GnashKey.h:58
OBJ_URLOPENER_VALUE
@ OBJ_URLOPENER_VALUE
Definition: aos4_gnash_prefs.h:125
OBJ_STARTINPAUSE
@ OBJ_STARTINPAUSE
Definition: aos4_gnash_prefs.h:127
gnash::Gui::notifyMouseMove
void notifyMouseMove(int x, int y)
Mouse notification callback to be called when the mouse is moved.
Definition: gui.cpp:469
OBJ_DISABLESSL
@ OBJ_DISABLESSL
Definition: aos4_gnash_prefs.h:109
gnash::Gui::_width
int _width
Desired window width.
Definition: gui.h:494
gnash::key::TAB
@ TAB
Definition: GnashKey.h:54
gnash::Gui::advance_movie
static bool advance_movie(Gui *gui)
Convenience static wrapper around advanceMovie for callbacks happiness.
Definition: gui.h:272
OBJ_LOGMALFORMEDSWF
@ OBJ_LOGMALFORMEDSWF
Definition: aos4_gnash_prefs.h:103
gnash::key::INVALID
@ INVALID
Definition: GnashKey.h:45
gnash::key::F3
@ F3
Definition: GnashKey.h:192
gnash::key::SHIFT
@ SHIFT
Definition: GnashKey.h:61
gnash::Gui::toggleFullscreen
void toggleFullscreen()
Definition: gui.cpp:258
GnashPrefs::logfilename
char logfilename[255]
Definition: aos4_gnash_prefs.h:65
gnash::key::UP
@ UP
Definition: GnashKey.h:206
gnash::key::F7
@ F7
Definition: GnashKey.h:196
gnash::key::HOME
@ HOME
Definition: GnashKey.h:211
gnash::AOS4AggGlue::resize
void resize(int width, int height)
Definition: aos4_agg_glue.cpp:388
GnashPrefs::logswf
int logswf
Definition: aos4_gnash_prefs.h:67
gnash::Gui::resize_view
void resize_view(int width, int height)
Resize the client area view and the window accordingly.
Definition: gui.cpp:429
aos4sup.h
gnash::key::F5
@ F5
Definition: GnashKey.h:194
gnash::RunResources
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
gnash::key::F8
@ F8
Definition: GnashKey.h:197
gnash::Gui::_mouseShown
bool _mouseShown
Definition: gui.h:516
RESET_TIME
#define RESET_TIME
Definition: aos4.cpp:61
gnash::AOS4Gui::setInterval
virtual void setInterval(unsigned int interval)
Set main loop delay in milliseconds.
Definition: aos4.cpp:665
GnashPrefs::logtofile
int logtofile
Definition: aos4_gnash_prefs.h:64
gnash::geometry::SnappingRanges2d::size
size_type size() const
Returns the number of ranges in the list.
Definition: snappingrange.h:320
gnash::Gui::play
void play()
Put the application in "play" mode.
Definition: gui.cpp:830
OBJ_SIZEMOVIELIB
@ OBJ_SIZEMOVIELIB
Definition: aos4_gnash_prefs.h:126
OBJ_SHAREDOBJDIR_VALUE
@ OBJ_SHAREDOBJDIR_VALUE
Definition: aos4_gnash_prefs.h:110
gnash::AOS4Gui::~AOS4Gui
virtual ~AOS4Gui()
Definition: aos4.cpp:87
GnashPrefs::nettimeout
int nettimeout
Definition: aos4_gnash_prefs.h:78
OBJ_SEVEDYNAMICSTREAMS
@ OBJ_SEVEDYNAMICSTREAMS
Definition: aos4_gnash_prefs.h:120
GnashPrefs::urlopener
char urlopener[255]
Definition: aos4_gnash_prefs.h:85
GnashPrefs::usesound
int usesound
Definition: aos4_gnash_prefs.h:79
OBJ_CANCEL
@ OBJ_CANCEL
Definition: aos4_gnash_prefs.h:130
GnashPrefs::connectlocalhost
int connectlocalhost
Definition: aos4_gnash_prefs.h:71
GnashPrefs::savemedia
int savemedia
Definition: aos4_gnash_prefs.h:80
GnashPrefs::connectlocaldomain
int connectlocaldomain
Definition: aos4_gnash_prefs.h:72
log.h
gnash::gnashSleep
void gnashSleep(time_t useconds)
Sleep compatibly for the specified number of microseconds.
Definition: GnashSleep.h:35
gnash::Gui::restart
void restart()
Definition: gui.cpp:269
gnash::key::F6
@ F6
Definition: GnashKey.h:195
GnashPrefs::playerversion
char playerversion[32]
Definition: aos4_gnash_prefs.h:83
OBJ_LOGFILENAME_VALUE
@ OBJ_LOGFILENAME_VALUE
Definition: aos4_gnash_prefs.h:100
OBJ_LOGPARSER
@ OBJ_LOGPARSER
Definition: aos4_gnash_prefs.h:101
gnash::key::F10
@ F10
Definition: GnashKey.h:199
gnash::Renderer_agg_base
Definition: Renderer_agg.h:30
gnashconfig.h
gnash::key::F11
@ F11
Definition: GnashKey.h:200
gnash::RcInitFile::getDefaultInstance
static RcInitFile & getDefaultInstance()
Return the default instance of RC file.
Definition: rc.cpp:61
gnash::AOS4Gui::createMenu
virtual bool createMenu()
Definition: aos4.cpp:671
RunResources.h
gnash::key::c
@ c
Definition: GnashKey.h:149
OBJ_PLAYERVERSION_VALUE
@ OBJ_PLAYERVERSION_VALUE
Definition: aos4_gnash_prefs.h:123
aos4_gnash_prefs.h
gnash::AOS4Gui::setFullscreen
virtual void setFullscreen()
Definition: aos4.cpp:683
gnash::key::F12
@ F12
Definition: GnashKey.h:201
gnash::AOS4Gui::renderBuffer
virtual void renderBuffer()
Definition: aos4.cpp:659
gnash::AOS4Glue
Definition: aos4_glue.h:29
VERSION
#define VERSION
Definition: gnashconfig.h:731
GnashPrefs::savedynamic
int savedynamic
Definition: aos4_gnash_prefs.h:81
gnash::AOS4Gui::setTimeout
virtual void setTimeout(unsigned int timeout)
Set the time in milliseconds after which the programme should exit.
Definition: aos4.cpp:586
gnash::geometry::Range2d::setTo
Range2d< T > & setTo(T x, T y)
Set ourself to bound the given point.
Definition: Range2d.h:339
gnash::Gui::_interval
unsigned int _interval
Main loop interval: the time between successive advance_movie calls.
Definition: gui.h:503
OBJ_USESOUNDHANDLER
@ OBJ_USESOUNDHANDLER
Definition: aos4_gnash_prefs.h:118
gnash::AOS4AggGlue::createRenderHandler
Renderer * createRenderHandler()
Definition: aos4_agg_glue.cpp:123
OBJ_LOGSWF
@ OBJ_LOGSWF
Definition: aos4_gnash_prefs.h:102
GnashPrefs::disablelocal
int disablelocal
Definition: aos4_gnash_prefs.h:77
__attribute__
__attribute__((used)) static const char *stackcookie
gnash::key::GNASH_MOD_ALT
@ GNASH_MOD_ALT
Definition: GnashKey.h:38
win
Object * win
Definition: aos4_gnash_prefs.cpp:31
gnash::AOS4Gui::ReadPrefs
virtual struct GnashPrefs * ReadPrefs(void)
Definition: aos4.cpp:888
gnash::AOS4Gui::key_event
void key_event(gnash::key::code key, int state, bool down)
Definition: aos4.cpp:822
gnash::key::SPACE
@ SPACE
Definition: GnashKey.h:77
GnashPrefs::logactionscript
int logactionscript
Definition: aos4_gnash_prefs.h:69
OBJ_LOGTOFILE
@ OBJ_LOGTOFILE
Definition: aos4_gnash_prefs.h:99
gnash::AOS4Gui::setupEvents
virtual bool setupEvents()
Definition: aos4.cpp:677
GnashPrefs::onlylocalso
int onlylocalso
Definition: aos4_gnash_prefs.h:76
gnash::Gui::notify_key_event
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:560
gnash::geometry::SnappingRanges2d::getRange
const RangeType & getRange(size_type index) const
Returns the range at the specified index.
Definition: snappingrange.h:326
OBJ_DISABLELOCALCONNOBJ
@ OBJ_DISABLELOCALCONNOBJ
Definition: aos4_gnash_prefs.h:113
width
@ width
Definition: klash_part.cpp:329
OBJ_LOGACTIONSCRIPT
@ OBJ_LOGACTIONSCRIPT
Definition: aos4_gnash_prefs.h:104
gnash::AOS4Gui::showMouse
virtual bool showMouse(bool show)
Sets whether the gui should show the system mouse pointer.
Definition: aos4.cpp:708
OBJ_MEDIASAVEDIR_VALUE
@ OBJ_MEDIASAVEDIR_VALUE
Definition: aos4_gnash_prefs.h:121
GnashPrefs::disablessl
int disablessl
Definition: aos4_gnash_prefs.h:73
gnash::AOS4AggGlue::~AOS4AggGlue
virtual ~AOS4AggGlue()
Definition: aos4_agg_glue.cpp:75
gnash::key::e
@ e
Definition: GnashKey.h:151
nm
struct NewMenu nm[]
Definition: aos4_agg_glue.cpp:30
gnash::Gui::_height
int _height
Desired window height.
Definition: gui.h:497
GnashPrefs::sharedobjdir
char sharedobjdir[255]
Definition: aos4_gnash_prefs.h:74
GnashPrefs::startpaused
int startpaused
Definition: aos4_gnash_prefs.h:87
GnashPrefs
Definition: aos4_gnash_prefs.h:62
gnash::RcInitFile
Definition: rc.h:44
gnash::AOS4AggGlue::prepDrawingArea
bool prepDrawingArea(int width, int height)
Definition: aos4_agg_glue.cpp:181
gnash::Gui::stop
void stop()
Put the application in "stop" mode.
Definition: gui.cpp:853
CHUNK_SIZE
#define CHUNK_SIZE