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:
gnash::geometry::SnappingRanges2d< std::int32_t >
OpenVGRenderer.h
gnash::renderer::GnashDevice::native_window_t
long native_window_t
Definition: GnashDevice.h:43
height
@ height
Definition: klash_part.cpp:329
gnash::GnashException
Top-level gnash exception.
Definition: GnashException.h:31
gnash::log_debug
void log_debug(StringType msg, Args... args)
Definition: log.h:301
y
std::int32_t y
Definition: BitmapData_as.cpp:435
gnash::key::i
@ i
Definition: GnashKey.h:155
gnash::renderer::GnashDevice::GNASH_NODEV
@ GNASH_NODEV
Definition: GnashDevice.h:48
gnash::renderer::EGLDevice::bindClient
bool bindClient(GnashDevice::rtype_t rtype)
Definition: eglDevice.cpp:332
_
#define _(String)
Definition: log.h:44
Renderer.h
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
gnash::gui::GtkOvgGlue::~GtkOvgGlue
~GtkOvgGlue()
Definition: gtk_glue_ovg.cpp:59
gnash::gui::GtkOvgGlue::createRenderHandler
Renderer * createRenderHandler()
Definition: gtk_glue_ovg.cpp:164
gnash::renderer::GnashDevice::OPENVG
@ OPENVG
Definition: GnashDevice.h:46
gnash::renderer::GnashDevice::DIRECTFB
@ DIRECTFB
Definition: GnashDevice.h:48
gnash::renderer::GnashDevice::EGL
@ EGL
Definition: GnashDevice.h:48
gtk_glue.h
gnash::log_error
void log_error(StringType msg, Args... args)
Definition: log.h:283
gnash::gui::GtkOvgGlue::setRenderHandlerSize
void setRenderHandlerSize(int width, int height)
Definition: gtk_glue_ovg.cpp:190
gnash::renderer::openvg::create_handler
DSOEXPORT Renderer * create_handler(const char *)
Definition: OpenVGRenderer.cpp:1265
gnash::DeviceGlue::_device
std::unique_ptr< renderer::GnashDevice > _device
Definition: DeviceGlue.h:139
gnash::GtkGlue
Definition: gtk_glue.h:41
gnash::gui::GtkOvgGlue::configure
void configure(GtkWidget *const widget, GdkEventConfigure *const event)
Definition: gtk_glue_ovg.cpp:302
gnash::gui::GtkOvgGlue::GtkOvgGlue
GtkOvgGlue()
Definition: gtk_glue_ovg.cpp:50
gnash::DeviceGlue::probeDevices
std::unique_ptr< renderer::GnashDevice::dtype_t[]> probeDevices()
Definition: DeviceGlue.h:47
gnash::gui::GtkOvgGlue::prepDrawingArea
void prepDrawingArea(GtkWidget *drawing_area)
Definition: gtk_glue_ovg.cpp:131
gtk_glue_ovg.h
gnash::renderer::openvg::Renderer_ovg
Definition: OpenVGRenderer.h:73
gnash::renderer::EGLDevice::swapBuffers
bool swapBuffers()
Definition: eglDevice.h:204
gnash::gui::GtkOvgGlue::render
void render()
Definition: gtk_glue_ovg.cpp:248
gnash::gui::GtkOvgGlue::beforeRendering
void beforeRendering()
Definition: gtk_glue_ovg.cpp:236
gnash::gui::GtkOvgGlue::init
bool init(int argc, char **argv[])
Definition: gtk_glue_ovg.cpp:72
log.h
gnash::GtkGlue::_drawing_area
GtkWidget * _drawing_area
Definition: gtk_glue.h:77
gnashconfig.h
gnash::renderer::EGLDevice::printEGLSurface
void printEGLSurface()
Definition: eglDevice.h:188
gnash::renderer::EGLDevice
Definition: eglDevice.h:57
RunResources.h
gnash::renderer::EGLDevice::printEGLContext
void printEGLContext()
Definition: eglDevice.h:186
gnash::config
struct lirc_config * config
Definition: lirc_ext.cpp:43
gnash::renderer::GnashDevice::RAWFB
@ RAWFB
Definition: GnashDevice.h:48
gnash::gui::GtkOvgGlue
Definition: gtk_glue_ovg.h:46
gnash::renderer::GnashDevice::X11
@ X11
Definition: GnashDevice.h:48
width
@ width
Definition: klash_part.cpp:329
GnashException.h
x
std::int32_t x
Definition: BitmapData_as.cpp:434
gnash::geometry::SnappingRanges2d::setWorld
void setWorld()
Resets to one range with world flags.
Definition: snappingrange.h:303
gnash::DeviceGlue::setDevice
void setDevice(renderer::GnashDevice::dtype_t dtype)
Definition: DeviceGlue.cpp:41