SoGtk  0.1.0
Coin3D GUI toolkit binding
All Classes Functions Variables Typedefs Enumerations Enumerator Modules Pages
SoGtkDevice Class Referenceabstract

The SoGtkDevice class is the base class for the translation devices. More...

#include <Inventor/Gtk/devices/SoGtkDevice.h>

Inheritance diagram for SoGtkDevice:
SoGtkObject SoGtkKeyboard SoGtkMouse

Public Member Functions

virtual ~SoGtkDevice ()
 
virtual void disable (GtkWidget *w, SoGtkEventHandler *handler, void *closure)=0
 
virtual void enable (GtkWidget *w, SoGtkEventHandler *handler, void *closure)=0
 
SbVec2s getWindowSize (void) const
 
void setWindowSize (const SbVec2s size)
 
virtual const SoEvent * translateEvent (GdkEvent *event)=0
 
- Public Member Functions inherited from SoGtkObject
virtual SoType getTypeId (void) const =0
 
SbBool isOfType (SoType type) const
 

Static Public Member Functions

static void initClasses (void)
 
- Static Public Member Functions inherited from SoGtkObject
static SoType getClassTypeId (void)
 
static void init (void)
 
static void initClass (void)
 

Protected Member Functions

 SoGtkDevice (void)
 
void addEventHandler (GtkWidget *, SoGtkEventHandler *, void *)
 
void invokeHandlers (GdkEvent *event)
 
void removeEventHandler (GtkWidget *, SoGtkEventHandler *, void *)
 
void setEventPosition (SoEvent *event, int x, int y) const
 

Static Protected Member Functions

static SbVec2s getLastEventPosition (void)
 

Detailed Description

The SoGtkDevice class is the base class for the translation devices.

The SoGtk device classes provide glue functionality for translating native GUI events from the underlying toolkit to Inventor scene graph SoEvent events.

The device classes are mainly of interest to application programmers when writing extensions for new types of devices, and seldom in other contexts – so they can most often be ignored.

Constructor & Destructor Documentation

◆ ~SoGtkDevice()

SoGtkDevice::~SoGtkDevice ( )
virtual

Public virtual destructor.

◆ SoGtkDevice()

SoGtkDevice::SoGtkDevice ( void )
protected

Constructor. Protected to only enable invocation from derived device classes.

Member Function Documentation

◆ addEventHandler()

void SoGtkDevice::addEventHandler ( GtkWidget * widget,
SoGtkEventHandler * handler,
void * closure )
protected

Stores an event handler for the widget, which can later be invoked with SoGtkDevice::invokeHandlers(). Used by extension device types.

◆ disable()

void SoGtkDevice::disable ( GtkWidget * widget,
SoGtkEventHandler * handler,
void * closure )
pure virtual

This method will disable the handler for the device.

Implemented in SoGtkKeyboard, and SoGtkMouse.

◆ enable()

void SoGtkDevice::enable ( GtkWidget * widget,
SoGtkEventHandler * handler,
void * closure )
pure virtual

This method will enable the device for the widget.

handler is invoked with the closure argument when an event occur in widget.

Implemented in SoGtkKeyboard, and SoGtkMouse.

◆ getLastEventPosition()

SbVec2s SoGtkDevice::getLastEventPosition ( void )
staticprotected

Returns last event position that was set with SoGtkDevice::setEventPosition().

◆ getWindowSize()

SbVec2s SoGtkDevice::getWindowSize ( void ) const

This method returns the cached window size.

◆ initClasses()

void SoGtkDevice::initClasses ( void )
static

This function initializes the type system for all the SoGtk device classes. It is called indirectly when calling SoGtk::init(), so the application programmer doesn't have to bother with it.

◆ invokeHandlers()

void SoGtkDevice::invokeHandlers ( GdkEvent * event)
protected

Invoke all handlers registered with SoGtkDevice::addEventHandler().

◆ removeEventHandler()

void SoGtkDevice::removeEventHandler ( GtkWidget * widget,
SoGtkEventHandler * handler,
void * closure )
protected

Remove a handler registered with SoGtkDevice::addEventHandler().

◆ setEventPosition()

void SoGtkDevice::setEventPosition ( SoEvent * event,
int x,
int y ) const
protected

This method fills in the position information of event, translating the coordinates into the correct coordinate system.

◆ setWindowSize()

void SoGtkDevice::setWindowSize ( const SbVec2s size)

This method sets the cached size of the window the device is "attached" to.

◆ translateEvent()

const SoEvent * SoGtkDevice::translateEvent ( GdkEvent * event)
pure virtual

This method translates from native events to Open Inventor SoEvent events.

Implemented in SoGtkKeyboard, and SoGtkMouse.


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