Coin Logo http://www.sim.no
http://www.coin3d.org

SoXtDevice Class Reference
[Xt Device Classes]

#include <Inventor/Xt/devices/SoXtDevice.h>

Inheritance diagram for SoXtDevice:

SoXtObject SoXtKeyboard SoXtMouse SoXtSpaceball List of all members.

Detailed Description

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

The SoXt device classes provide glue functionality for translating native GUI events from the underlying toolkit to Inventor scenegraph 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.


Public Member Functions

virtual ~SoXtDevice ()
virtual void enable (Widget w, SoXtEventHandler *handler, void *closure)=0
virtual void disable (Widget w, SoXtEventHandler *handler, void *closure)=0
virtual const SoEvent * translateEvent (XAnyEvent *event)=0
void setWindowSize (const SbVec2s size)
SbVec2s getWindowSize (void) const

Static Public Member Functions

static void initClasses (void)

Protected Member Functions

 SoXtDevice (void)
void setEventPosition (SoEvent *event, int x, int y) const
void addEventHandler (Widget, SoXtEventHandler *, void *)
void removeEventHandler (Widget, SoXtEventHandler *, void *)
void invokeHandlers (XAnyEvent *event)

Static Protected Member Functions

static SbVec2s getLastEventPosition (void)

Friends

class SoXtDeviceP


Constructor & Destructor Documentation

SoXtDevice::~SoXtDevice (  )  [virtual]

Public virtual destructor.

SoXtDevice::SoXtDevice ( void   )  [protected]

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


Member Function Documentation

void SoXtDevice::enable ( Widget  widget,
SoXtEventHandler *  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 SoXtMouse, SoXtKeyboard, and SoXtSpaceball.

void SoXtDevice::disable ( Widget  widget,
SoXtEventHandler *  handler,
void *  closure 
) [pure virtual]

This method will disable the handler for the device.

Implemented in SoXtMouse, SoXtKeyboard, and SoXtSpaceball.

const SoEvent * SoXtDevice::translateEvent ( XAnyEvent *  event  )  [pure virtual]

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

Implemented in SoXtMouse, SoXtKeyboard, and SoXtSpaceball.

void SoXtDevice::setWindowSize ( const SbVec2s  size  ) 

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

SbVec2s SoXtDevice::getWindowSize ( void   )  const

This method returns the cached window size.

void SoXtDevice::initClasses ( void   )  [static]

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

void SoXtDevice::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.

SbVec2s SoXtDevice::getLastEventPosition ( void   )  [static, protected]

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

void SoXtDevice::addEventHandler ( Widget  widget,
SoXtEventHandler *  handler,
void *  closure 
) [protected]

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

void SoXtDevice::removeEventHandler ( Widget  widget,
SoXtEventHandler *  handler,
void *  closure 
) [protected]

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

void SoXtDevice::invokeHandlers ( XAnyEvent *  event  )  [protected]

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


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

Copyright © 1998-2005 by Systems in Motion AS. All rights reserved.

Generated on Tue Dec 2 23:15:45 2008 for SoXt by Doxygen. 1.4.7