osgGtk logo

osgViewer::GraphicsWindowGtk Class Reference

This class extends osgViewer::GraphicsWindow to provide an OpenGL rending context for osgViewer::Viewer inside a gtk_gl_drawing_area. More...

#include <osgGtk/GraphicsWindowGtk.h>

List of all members.

Public Member Functions

 GraphicsWindowGtk (int width, int height, int mode=GDK_GL_MODE_RGB|GDK_GL_MODE_DEPTH|GDK_GL_MODE_DOUBLE)
 Constructs the gtk graphics window of the specified width and height.
virtual ~GraphicsWindowGtk ()
virtual bool isSameKindAs (const osg::Object *object) const
virtual const char * libraryName () const
virtual const char * className () const
GtkWidget * gtk_widget ()
 Returns the gtk_gl_drawing_area that the scenegraph will be rendered into.
 operator GtkWidget * ()
 Implicitly converts the graphics window to a GtkWidget*.
virtual void grabFocus ()
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
virtual void grabFocusIfPointerInWindow ()
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
virtual bool valid () const
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
virtual bool setWindowRectangleImplementation (int x, int y, int width, int height)
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
virtual void setCursor (MouseCursor mouseCursor)
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
virtual bool setWindowDecorationImplementation (bool flag)
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
virtual void setWindowName (const std::string &name)
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
virtual bool realizeImplementation ()
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
virtual bool isRealizedImplementation () const
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
virtual bool makeCurrentImplementation ()
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
virtual bool releaseContextImplementation ()
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
virtual void closeImplementation ()
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
virtual void swapBuffersImplementation ()
 Overrides osgViewer::GraphicsWindow with Gtk specific behavior.
bool swap_buffers ()
 Convenience method to swap the OpenGL buffers if double-buffered or call glFlush() if single-buffered.
bool gl_begin ()
 Convenience method to implement glBegin() on this window's OpenGL drawable.
bool gl_end ()
 Convenience method to implement glEnd() on this window's OpenGL drawable.

Protected Member Functions

void transform_mouse_x_y (double &x, double &y)

Static Protected Member Functions

static gboolean on_button_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
static gboolean on_configure_event (GtkWidget *widget, GdkEventConfigure *event, gpointer user_data)
static gboolean on_key_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
static gboolean on_motion_notify_event (GtkWidget *widget, GdkEventMotion *event, gpointer user_data)
static gboolean on_proximity_event (GtkWidget *widget, GdkEventProximity *event, gpointer user_data)
static gboolean on_scroll_event (GtkWidget *widget, GdkEventScroll *event, gpointer user_data)

Protected Attributes

GtkWidget * m_gtk_widget
GdkGLConfig * m_gdk_gl_config


Detailed Description

This class extends osgViewer::GraphicsWindow to provide an OpenGL rending context for osgViewer::Viewer inside a gtk_gl_drawing_area.

Todo:
add a constructor that takes a traits argument and configures GL mode from traits
Author:
Rick L Vinyard Jr <rvinyard@cs.nmsu.edu>

Constructor & Destructor Documentation

osgViewer::GraphicsWindowGtk::GraphicsWindowGtk ( int  width,
int  height,
int  mode = GDK_GL_MODE_RGB|GDK_GL_MODE_DEPTH|GDK_GL_MODE_DOUBLE 
)

Constructs the gtk graphics window of the specified width and height.

References m_gdk_gl_config, m_gtk_widget, on_button_event(), on_configure_event(), on_key_event(), on_motion_notify_event(), on_proximity_event(), and on_scroll_event().

osgViewer::GraphicsWindowGtk::~GraphicsWindowGtk (  )  [virtual]


Member Function Documentation

const char * osgViewer::GraphicsWindowGtk::className (  )  const [virtual]

void osgViewer::GraphicsWindowGtk::closeImplementation (  )  [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.

bool osgViewer::GraphicsWindowGtk::gl_begin (  ) 

Convenience method to implement glBegin() on this window's OpenGL drawable.

References m_gtk_widget.

bool osgViewer::GraphicsWindowGtk::gl_end (  ) 

Convenience method to implement glEnd() on this window's OpenGL drawable.

References m_gtk_widget.

void osgViewer::GraphicsWindowGtk::grabFocus (  )  [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.

References m_gtk_widget.

void osgViewer::GraphicsWindowGtk::grabFocusIfPointerInWindow (  )  [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.

References m_gtk_widget.

GtkWidget * osgViewer::GraphicsWindowGtk::gtk_widget (  ) 

Returns the gtk_gl_drawing_area that the scenegraph will be rendered into.

References m_gtk_widget.

Referenced by osgViewer::ViewerGtk::setup_viewer_in_gtk_window().

bool osgViewer::GraphicsWindowGtk::isRealizedImplementation (  )  const [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.

References m_gtk_widget.

bool osgViewer::GraphicsWindowGtk::isSameKindAs ( const osg::Object *  object  )  const [virtual]

const char * osgViewer::GraphicsWindowGtk::libraryName (  )  const [virtual]

bool osgViewer::GraphicsWindowGtk::makeCurrentImplementation (  )  [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.

References m_gtk_widget.

gboolean osgViewer::GraphicsWindowGtk::on_button_event ( GtkWidget *  widget,
GdkEventButton *  event,
gpointer  user_data 
) [static, protected]

References transform_mouse_x_y().

Referenced by GraphicsWindowGtk().

gboolean osgViewer::GraphicsWindowGtk::on_configure_event ( GtkWidget *  widget,
GdkEventConfigure *  event,
gpointer  user_data 
) [static, protected]

Referenced by GraphicsWindowGtk().

gboolean osgViewer::GraphicsWindowGtk::on_key_event ( GtkWidget *  widget,
GdkEventKey *  event,
gpointer  user_data 
) [static, protected]

Referenced by GraphicsWindowGtk().

gboolean osgViewer::GraphicsWindowGtk::on_motion_notify_event ( GtkWidget *  widget,
GdkEventMotion *  event,
gpointer  user_data 
) [static, protected]

Referenced by GraphicsWindowGtk().

gboolean osgViewer::GraphicsWindowGtk::on_proximity_event ( GtkWidget *  widget,
GdkEventProximity *  event,
gpointer  user_data 
) [static, protected]

Referenced by GraphicsWindowGtk().

gboolean osgViewer::GraphicsWindowGtk::on_scroll_event ( GtkWidget *  widget,
GdkEventScroll *  event,
gpointer  user_data 
) [static, protected]

Referenced by GraphicsWindowGtk().

osgViewer::GraphicsWindowGtk::operator GtkWidget * (  )  [inline]

Implicitly converts the graphics window to a GtkWidget*.

References m_gtk_widget.

bool osgViewer::GraphicsWindowGtk::realizeImplementation (  )  [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.

References m_gtk_widget.

bool osgViewer::GraphicsWindowGtk::releaseContextImplementation (  )  [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.

void osgViewer::GraphicsWindowGtk::setCursor ( MouseCursor  mouseCursor  )  [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.

References m_gtk_widget.

bool osgViewer::GraphicsWindowGtk::setWindowDecorationImplementation ( bool  flag  )  [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.

References m_gtk_widget.

void osgViewer::GraphicsWindowGtk::setWindowName ( const std::string &  name  )  [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.

References m_gtk_widget.

bool osgViewer::GraphicsWindowGtk::setWindowRectangleImplementation ( int  x,
int  y,
int  width,
int  height 
) [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.

References m_gtk_widget.

bool osgViewer::GraphicsWindowGtk::swap_buffers (  ) 

Convenience method to swap the OpenGL buffers if double-buffered or call glFlush() if single-buffered.

References m_gtk_widget.

Referenced by swapBuffersImplementation().

void osgViewer::GraphicsWindowGtk::swapBuffersImplementation (  )  [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.

References swap_buffers().

void osgViewer::GraphicsWindowGtk::transform_mouse_x_y ( double &  x,
double &  y 
) [protected]

Referenced by on_button_event().

bool osgViewer::GraphicsWindowGtk::valid (  )  const [virtual]

Overrides osgViewer::GraphicsWindow with Gtk specific behavior.


Member Data Documentation

Referenced by GraphicsWindowGtk().


The documentation for this class was generated from the following files:

Generated on Thu Mar 19 10:06:43 2009 for osgGtk by doxygen 1.5.7.1