Gnash  0.8.11dev
haiku_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 #ifndef HAIKU_AGG_GLUE_H
20 #define HAIKU_AGG_GLUE_H
21 
22 #include <vector>
23 #include <cstdint> // for boost::?int??_t
24 #include <Renderer.h>
25 
26 #include <SupportDefs.h>
27 
28 class BWindow;
29 
30 namespace gnash
31 {
32 
33 class Gui;
34 class BeV;
35 
36 /* copy in plugin.cpp */
37 const int GNASH_MOUSE_CLICKED = 'GMCL';
38 const int GNASH_MOUSE_MOVED = 'GMMV';
39 const int GNASH_KEY_EVENT = 'GKKE';
40 const int GNASH_RESIZE = 'GRSZ';
41 const int GNASH_HIDDEN = 'GHID';
42 const int GNASH_SHOWN = 'GSHN';
43 
44 
45 const int GNASH_SET_FULLSCREEN = 'GSFS';
46 const int GNASH_UNSET_FULLSCREEN = 'GUFS';
47 
49 {
50  public:
51  HaikuAggGlue(Gui *gui, unsigned long xid);
52  virtual ~HaikuAggGlue();
53 
54  bool init(int argc, char **argv[], BWindow **win, std::string sharefilename);
55  Renderer* createRenderHandler(int depth);
56  void setInvalidatedRegions(const InvalidatedRanges& ranges);
57  void ViewNoMore();
58  void ViewNeeded();
59  bool prepDrawingArea(int width, int height, std::uint32_t sdl_flags);
60  std::uint32_t maskFlags(std::uint32_t sdl_flags);
61  void render();
62  void render(int minx, int miny, int maxx, int maxy);
63  void Shown();
64  void Hidden();
65  //void BlankScreen();
66  private:
67  unsigned char *_offscreenbuf;
68  unsigned char *_sharebuf;
69  int _width, _height;
70  unsigned int _bufsize;
71  Renderer *_agg_renderer;
72 
73  geometry::Range2d<int> _validbounds;
74  std::vector< geometry::Range2d<int> > _drawbounds;
75  int _bpp;
76  BWindow **_win;
77  BeV *_view;
78  Gui *_gui;
79  unsigned long _xid;
80  std::string _sharefilename;
81  int _sharefd;
82  bool _viewhidden;
83 };
84 
85 }
86 
87 #endif
88 
gnash::geometry::SnappingRanges2d< std::int32_t >
Renderer_agg.h
optind
int optind
gnash::geometry::Range2d< int >
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::DOWN
@ DOWN
Definition: GnashKey.h:207
gnash::HaikuAggGlue::~HaikuAggGlue
virtual ~HaikuAggGlue()
Definition: haiku_agg_glue.cpp:231
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::GNASH_SHOWN
const int GNASH_SHOWN
Definition: haiku_agg_glue.h:42
gnash::HaikuAggGlue::ViewNeeded
void ViewNeeded()
Definition: haiku_agg_glue.cpp:312
adipe.h
height
@ height
Definition: klash_part.cpp:329
gnash::GnashException
Top-level gnash exception.
Definition: GnashException.h:31
gnash::geometry::Range2d::getMaxY
T getMaxY() const
Get max Y ordinate.
Definition: Range2d.h:633
gnash::HaikuGui::Hidden
void Hidden()
Definition: haiku.cpp:586
gnash::GNASH_QUITTING
const int32 GNASH_QUITTING
Definition: haiku.cpp:49
gnash::HaikuAggGlue::setInvalidatedRegions
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: haiku_agg_glue.cpp:440
gnash::log_debug
void log_debug(StringType msg, Args... args)
Definition: log.h:301
gnash::HaikuAggGlue::render
void render()
Definition: haiku_agg_glue.cpp:459
y
std::int32_t y
Definition: BitmapData_as.cpp:435
gnash::key::i
@ i
Definition: GnashKey.h:155
aquasup.h
kdesup.h
gnash::HaikuGui::init
virtual bool init(int argc, char **argv[])
/ Initialise the gui and the associated renderer.
Definition: haiku.cpp:364
gnash::HaikuGui::createMenu
virtual bool createMenu()
Definition: haiku.cpp:485
getopt
int getopt(int, char *const *, const char *)
gnash::HaikuGui::createMenuBar
virtual bool createMenuBar()
Definition: haiku.cpp:492
_
#define _(String)
Definition: log.h:44
Renderer.h
dump.h
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::geometry::Range2d::getMaxX
T getMaxX() const
Get max X ordinate.
Definition: Range2d.h:613
gnash::GNASH_MOUSE_CLICKED
const int GNASH_MOUSE_CLICKED
Definition: haiku_agg_glue.h:37
GNASH_REPORT_FUNCTION
#define GNASH_REPORT_FUNCTION
Definition: log.h:452
gnash::Renderer
Base class for render handlers.
Definition: Renderer.h:189
gnash::key::m
@ m
Definition: GnashKey.h:159
gnash::key::s
@ s
Definition: GnashKey.h:165
gnash::HaikuGui::setInterval
virtual void setInterval(unsigned int interval)
Set main loop delay in milliseconds.
Definition: haiku.cpp:447
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::HaikuGui::setupEvents
virtual bool setupEvents()
Definition: haiku.cpp:499
gnash::createFLTKGui
std::unique_ptr< Gui > createFLTKGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_fltk.cpp:40
gnash::createKDEGui
std::unique_ptr< Gui > createKDEGui(unsigned long xid, float scale, bool loop, RunResources &r)
gnash::HaikuGui::resize_view
virtual void resize_view(int width, int height)
Definition: haiku.cpp:572
gnash::HaikuAggGlue::createRenderHandler
Renderer * createRenderHandler(int depth)
Definition: haiku_agg_glue.cpp:270
gnash::log_error
void log_error(StringType msg, Args... args)
Definition: log.h:283
gnash::HaikuAggGlue::prepDrawingArea
bool prepDrawingArea(int width, int height, std::uint32_t sdl_flags)
Definition: haiku_agg_glue.cpp:329
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
gnash::GNASH_MOUSE_MOVED
const int GNASH_MOUSE_MOVED
Definition: haiku_agg_glue.h:38
gnash::createSDLGui
std::unique_ptr< Gui > createSDLGui(unsigned long xid, float scale, bool loop, RunResources &r)
gnash::HaikuGui::getInterval
unsigned int getInterval()
Definition: haiku.cpp:566
gnash::key::RIGHT
@ RIGHT
Definition: GnashKey.h:208
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::HaikuGui::GnashPulse
void GnashPulse()
Definition: haiku.cpp:554
gnash::HaikuGui::unsetFullscreen
virtual void unsetFullscreen()
Definition: haiku.cpp:532
gnash::key::r
@ r
Definition: GnashKey.h:164
gnash::HaikuAggGlue::HaikuAggGlue
HaikuAggGlue(Gui *gui, unsigned long xid)
Definition: haiku_agg_glue.cpp:213
QQ
#define QQ(x)
Definition: adipe.h:7
gnash::geometry::Point2d::x
std::int32_t x
The x coordinate.
Definition: Point2d.h:43
gnash::HaikuGui::setFullscreenEtc
virtual void setFullscreenEtc()
Definition: haiku.cpp:513
gnash::HaikuGui::renderBuffer
virtual void renderBuffer()
Definition: haiku.cpp:441
gnash::GNASH_HIDDEN
const int GNASH_HIDDEN
Definition: haiku_agg_glue.h:41
gnash::key::INSERT
@ INSERT
Definition: GnashKey.h:210
gnash::key::PGDN
@ PGDN
Definition: GnashKey.h:214
gnash::key::END
@ END
Definition: GnashKey.h:212
gnash::GNASH_PULSE
const int32 GNASH_PULSE
Definition: haiku.cpp:47
gnash::Renderer::world_to_pixel
virtual geometry::Range2d< int > world_to_pixel(const SWFRect &worldbounds) const =0
Converts world coordinates to pixel coordinates.
gnash::GNASH_SEND_PULSE
const int32 GNASH_SEND_PULSE
Definition: haiku.cpp:48
gnash::key::code
code
Definition: GnashKey.h:44
gnash::geometry::Range2d::getMinY
T getMinY() const
Get min Y ordinate.
Definition: Range2d.h:623
gnash::HaikuGui::error
virtual void error(const std::string &msg)
Handle error message from the core.
Definition: haiku.cpp:460
gnash::HaikuGui::run
virtual bool run()
Start main rendering loop.
Definition: haiku.cpp:433
gnash::Gui::_width
int _width
Desired window width.
Definition: gui.h:494
gnash::HaikuGui::~HaikuGui
virtual ~HaikuGui()
Definition: haiku.cpp:356
gnash::Gui::advance_movie
static bool advance_movie(Gui *gui)
Convenience static wrapper around advanceMovie for callbacks happiness.
Definition: gui.h:272
gnash::key::INVALID
@ INVALID
Definition: GnashKey.h:45
gnash::HaikuAggGlue
Definition: haiku_agg_glue.h:49
gnash::GNASH_RESIZE
const int GNASH_RESIZE
Definition: haiku_agg_glue.h:40
gnash::HaikuGui::setTimeout
virtual void setTimeout(unsigned int timeout)
Set the time in milliseconds after which the programme should exit.
Definition: haiku.cpp:453
gnash::key::UP
@ UP
Definition: GnashKey.h:206
gnash::point
geometry::Point2d point
Definition: Point2d.h:143
gnash::key::HOME
@ HOME
Definition: GnashKey.h:211
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::GNASH_UNSET_FULLSCREEN
const int GNASH_UNSET_FULLSCREEN
Definition: haiku_agg_glue.h:46
gnash::RunResources
Class to group together per-run and external resources for Gnash.
Definition: RunResources.h:54
Qt4Gui.h
gnash::geometry::SnappingRanges2d::size
size_type size() const
Returns the number of ranges in the list.
Definition: snappingrange.h:320
CHUNK_SIZE
#define CHUNK_SIZE
gnash::createAOS4Gui
std::unique_ptr< Gui > createAOS4Gui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_aos4.cpp:40
gnash::HaikuGui::setInvalidatedRegions
void setInvalidatedRegions(const InvalidatedRanges &ranges)
Definition: haiku.cpp:479
gnash::createGTKGui
std::unique_ptr< Gui > createGTKGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_gtk.cpp:41
gnash::HaikuGui::unsetFullscreenEtc
virtual void unsetFullscreenEtc()
Definition: haiku.cpp:539
gnash::createQt4Gui
std::unique_ptr< Gui > createQt4Gui(unsigned long xid, float scale, bool loop, RunResources &r)
gnash::createAQUAGui
std::unique_ptr< Gui > createAQUAGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_aqua.cpp:40
gnash::HaikuAggGlue::init
bool init(int argc, char **argv[], BWindow **win, std::string sharefilename)
Definition: haiku_agg_glue.cpp:247
log.h
haikusup.h
gnash::HaikuGui
Definition: haikusup.h:47
gnash::HaikuGui::Shown
void Shown()
Definition: haiku.cpp:580
gnash::Renderer_agg_base
Definition: Renderer_agg.h:30
gnashconfig.h
RunResources.h
gnash::Gui::_xid
unsigned long _xid
The X Window ID to attach to. If zero, we create a new window.
Definition: gui.h:486
gnash::key::c
@ c
Definition: GnashKey.h:149
gnash::HaikuAggGlue::Shown
void Shown()
Definition: haiku_agg_glue.cpp:489
gnash::geometry::Range2d::setTo
Range2d< T > & setTo(T x, T y)
Set ourself to bound the given point.
Definition: Range2d.h:339
gnash::HaikuAggGlue::maskFlags
std::uint32_t maskFlags(std::uint32_t sdl_flags)
gnash::Gui::_interval
unsigned int _interval
Main loop interval: the time between successive advance_movie calls.
Definition: gui.h:503
gnash::geometry::Point2d::y
std::int32_t y
The y coordinate.
Definition: Point2d.h:46
haiku_agg_glue.h
gnash::HaikuGui::yesno
virtual bool yesno(const std::string &question)
Prompt user with a question she can answer with yes/no.
Definition: haiku.cpp:469
gui.h
win
Object * win
Definition: aos4_gnash_prefs.cpp:31
gtksup.h
gnash::HaikuGui::setFullscreen
virtual void setFullscreen()
Definition: haiku.cpp:506
optarg
char * optarg
fbsup.h
gnash::createDumpGui
std::unique_ptr< Gui > createDumpGui(unsigned long, float, bool, RunResourcesfloat, bool, unsigned int)
Definition: gui_dump.cpp:40
gnash::geometry::SnappingRanges2d::getRange
const RangeType & getRange(size_type index) const
Returns the range at the specified index.
Definition: snappingrange.h:326
width
@ width
Definition: klash_part.cpp:329
gnash::HaikuAggGlue::Hidden
void Hidden()
Definition: haiku_agg_glue.cpp:495
gnash::gui::createFBGui
std::unique_ptr< Gui > createFBGui(unsigned long windowid, float scale, bool do_loop, RunResources &r)
Definition: fb.cpp:141
gnash::HaikuGui::createWindow
virtual bool createWindow(const char *title, int width, int height, int xPosition=0, int yPosition=0)
Create and display our window.
Definition: haiku.cpp:403
GnashException.h
x
std::int32_t x
Definition: BitmapData_as.cpp:434
sdlsup.h
gnash::createHaikuGui
std::unique_ptr< Gui > createHaikuGui(unsigned long xid, float scale, bool loop, RunResources &r)
gnash::key::b
@ b
Definition: GnashKey.h:148
data
SimpleBuffer data
Definition: LocalConnection_as.cpp:151
gnash::Gui::_height
int _height
Desired window height.
Definition: gui.h:497
gnash::GNASH_SET_FULLSCREEN
const int GNASH_SET_FULLSCREEN
Definition: haiku_agg_glue.h:45
gnash::GNASH_KEY_EVENT
const int GNASH_KEY_EVENT
Definition: haiku_agg_glue.h:39
gnash::HaikuAggGlue::ViewNoMore
void ViewNoMore()
Definition: haiku_agg_glue.cpp:306
fltksup.h