Gnash  0.8.11dev
gtk_glue_ovg.h
Go to the documentation of this file.
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.
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 
20 #ifdef HAVE_CONFIG_H
21 #include "gnashconfig.h"
22 #endif
23 
24 #include "gtk_glue.h"
25 
26 #include <gtk/gtk.h>
27 #include <gdk/gdk.h>
28 #include <memory>
29 #include "openvg/OpenVGRenderer.h"
30 
31 #ifdef HAVE_VG_OPENVG_H
32 #include <VG/openvg.h>
33 #endif
34 
35 #ifdef HAVE_EGL_EGL_H
36 # include <EGL/egl.h>
37 #else
38 # error "This file needs EGL, which is part of OpenGL-ES"
39 #endif
40 
41 namespace gnash {
42 
43 namespace gui {
44 
45 class GtkOvgGlue : public GtkGlue
46 {
47  public:
48  GtkOvgGlue();
49  ~GtkOvgGlue();
50 
51  // Initialize EGL
52  bool init(int argc, char **argv[]);
53 
54  // Prepare the drawing area
55  void prepDrawingArea(GtkWidget *drawing_area);
56 
57  // Create the renderer
59 
60  // Set the size of the rendering window
61  void setRenderHandlerSize(int width, int height);
62  void beforeRendering();
63 
64  void configure(GtkWidget *const widget, GdkEventConfigure *const event);
65 
66  // Render the drawing area to the display
67  void render();
68  void render(int minx, int miny, int maxx, int maxy);
69 
70  private:
71  // offscreenbuf is only used with ENABLE_EGL_OFFSCREEN
72  GdkImage *_offscreenbuf;
73  unsigned int _bpp;
74  unsigned int _width;
75  unsigned int _height;
76 
77  std::shared_ptr<renderer::openvg::Renderer_ovg> _renderer;
78 };
79 
80 } // namespace gui
81 } // namespace gnash
82 
83 // local Variables:
84 // mode: C++
85 // indent-tabs-mode: nil
86 // End:
~GtkOvgGlue()
Definition: gtk_glue_ovg.cpp:59
Renderer * createRenderHandler()
Definition: gtk_glue_ovg.cpp:164
Definition: gtk_glue_ovg.h:45
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
Definition: klash_part.cpp:329
void setRenderHandlerSize(int width, int height)
Definition: gtk_glue_ovg.cpp:190
Base class for render handlers.
Definition: Renderer.h:188
void configure(GtkWidget *const widget, GdkEventConfigure *const event)
Definition: gtk_glue_ovg.cpp:302
GtkOvgGlue()
Definition: gtk_glue_ovg.cpp:50
void beforeRendering()
Definition: gtk_glue_ovg.cpp:236
Definition: klash_part.cpp:329
void render()
Definition: gtk_glue_ovg.cpp:248
bool init(int argc, char **argv[])
Definition: gtk_glue_ovg.cpp:72
Definition: gtk_glue.h:40
void prepDrawingArea(GtkWidget *drawing_area)
Definition: gtk_glue_ovg.cpp:131