Gnash  0.8.11dev
gtk_glue_cairo.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 "gtk_glue.h"
20 
21 #include <gtk/gtk.h>
22 #include <gdk/gdk.h>
23 
24 # include <cairo.h>
25 
26 namespace gnash
27 {
28 
29 class GtkCairoGlue : public GtkGlue
30 {
31  public:
32  GtkCairoGlue();
33  ~GtkCairoGlue();
34 
35  bool init(int argc, char ***argv);
36  bool needsDrawingArea() { return true; };
37  void prepDrawingArea(GtkWidget *drawing_area);
39  void beforeRendering();
40  void render();
41  void render(int minx, int miny, int maxx, int maxy);
42  void configure(GtkWidget *const widget, GdkEventConfigure *const event);
43  private:
44  cairo_surface_t* createGdkImageSurface(const int& width, const int& height);
45  cairo_surface_t* createSimilarSurface(const int& width, const int& height);
46  cairo_surface_t* createMemorySurface(const int& width, const int& height);
47 
48  cairo_t* _cairo_handle;
49  cairo_t* _cairo_offscreen;
50  Renderer* _renderer;
51  GdkImage* _image;
52 };
53 
54 } // namespace gnash
gnash::GtkCairoGlue::render
void render()
Definition: gtk_glue_cairo.cpp:111
gnash::GtkCairoGlue::needsDrawingArea
bool needsDrawingArea()
Definition: gtk_glue_cairo.h:36
height
@ height
Definition: klash_part.cpp:329
gnash::GtkCairoGlue::~GtkCairoGlue
~GtkCairoGlue()
Definition: gtk_glue_cairo.cpp:40
gtk_cairo_create.h
gnash::renderer::cairo::set_context
DSOEXPORT void set_context(Renderer *handler, cairo_t *context)
Make sure to call this before starting display.
Definition: Renderer_cairo.cpp:1143
y
std::int32_t y
Definition: BitmapData_as.cpp:435
gnash::GtkCairoGlue::beforeRendering
void beforeRendering()
Definition: gtk_glue_cairo.cpp:71
_
#define _(String)
Definition: log.h:44
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
GNASH_REPORT_FUNCTION
#define GNASH_REPORT_FUNCTION
Definition: log.h:452
gnash::Renderer
Base class for render handlers.
Definition: Renderer.h:189
gtk_glue_cairo.h
gnash::GtkCairoGlue
Definition: gtk_glue_cairo.h:30
gtk_glue.h
gnash::log_error
void log_error(StringType msg, Args... args)
Definition: log.h:283
gnash::GtkCairoGlue::GtkCairoGlue
GtkCairoGlue()
Definition: gtk_glue_cairo.cpp:31
Renderer_cairo.h
gnash::GtkGlue
Definition: gtk_glue.h:41
gnash::renderer::cairo::create_handler
DSOEXPORT Renderer * create_handler()
Create a render handler.
Definition: Renderer_cairo.cpp:1136
gnash::cairoFormatFromVisual
bool cairoFormatFromVisual(const GdkVisual *visual, cairo_format_t *format)
Definition: gtk_glue_cairo.cpp:122
log.h
gnash::GtkGlue::_drawing_area
GtkWidget * _drawing_area
Definition: gtk_glue.h:77
gnash::GtkCairoGlue::createRenderHandler
Renderer * createRenderHandler()
Definition: gtk_glue_cairo.cpp:63
gnash::GtkCairoGlue::prepDrawingArea
void prepDrawingArea(GtkWidget *drawing_area)
Definition: gtk_glue_cairo.cpp:54
gnash::GtkCairoGlue::init
bool init(int argc, char ***argv)
Definition: gtk_glue_cairo.cpp:48
gnash::GtkCairoGlue::configure
void configure(GtkWidget *const widget, GdkEventConfigure *const event)
Definition: gtk_glue_cairo.cpp:198
width
@ width
Definition: klash_part.cpp:329
x
std::int32_t x
Definition: BitmapData_as.cpp:434