- Your Widget Set For OpenGL
Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

ufo::UXDisplay Class Reference

The Display is the connection to the underlying windowing system. More...

#include <uxdisplay.hpp>

Inheritance diagram for ufo::UXDisplay:

ufo::UAbstractDisplay ufo::UDisplay ufo::UObject ufo::UCollectable List of all members.

Public Member Functions

 UXDisplay (const std::string &videoDriver="")
virtual bool isValid () const
virtual UVideoDrivergetVideoDriver () const
virtual UXFramecreateFrame ()
virtual std::vector< UXFrame * > getFrames () const
virtual void pumpEvents ()
virtual std::vector< UContext * > getContexts () const
virtual void setModState (UMod_t modifiers)
virtual void pushMouseButtonDown (UContext *context, int x, int y, UMod_t button)
virtual void pushMouseButtonUp (UContext *context, int x, int y, UMod_t button)
virtual void pushMouseWheelDown (UContext *context, int x, int y, int delta=-120, int mouseWheelNum=0)
virtual void pushMouseWheelUp (UContext *context, int x, int y, int delta=120, int mouseWheelNum=0)
virtual void pushMouseMove (UContext *context, int x, int y)
virtual void pushKeyDown (UContext *context, UKeyCode_t keyCode, wchar_t keyChar)
virtual void pushKeyUp (UContext *context, UKeyCode_t keyCode, wchar_t keyChar)
void pushMouseButtonDown (UContext *context, UMod_t modifiers, int x, int y, UMod_t button)
void pushMouseButtonUp (UContext *context, UMod_t modifiers, int x, int y, UMod_t button)
void pushMouseWheelDown (UContext *context, UMod_t modifiers, int x, int y, int delta=-120, int mouseWheelNum=0)
void pushMouseWheelUp (UContext *context, UMod_t modifiers, int x, int y, int delta=120, int mouseWheelNum=0)
void pushMouseMove (UContext *context, UMod_t modifiers, int x, int y)
void pushKeyDown (UContext *context, UMod_t modifiers, UKeyCode_t keyCode, wchar_t keyChar)
void pushKeyUp (UContext *context, UMod_t modifiers, UKeyCode_t keyCode, wchar_t keyChar)
virtual bool dispatchMouseButtonDown (UContext *context, int x, int y, UMod_t button)
virtual bool dispatchMouseButtonUp (UContext *context, int x, int y, UMod_t button)
virtual bool dispatchMouseWheelDown (UContext *context, int x, int y, int delta=-120, int mouseWheelNum=0)
virtual bool dispatchMouseWheelUp (UContext *context, int x, int y, int delta=120, int mouseWheelNum=0)
virtual bool dispatchMouseMove (UContext *context, int x, int y)
virtual bool dispatchKeyDown (UContext *context, UKeyCode_t keyCode, wchar_t keyChar)
virtual bool dispatchKeyUp (UContext *context, UKeyCode_t keyCode, wchar_t keyChar)

Protected Member Functions

void registerContext (UXContext *context)
void unregisterContext (UXContext *context)
virtual bool mouseButtonDown (UContext *context, int x, int y, UMod_t button, bool push=true)
virtual bool mouseButtonUp (UContext *context, int x, int y, UMod_t button, bool push=true)
virtual bool mouseWheelDown (UContext *context, int x, int y, int delta=-120, int mouseWheelNum=0, bool push=true)
virtual bool mouseWheelUp (UContext *context, int x, int y, int delta=120, int mouseWheelNum=0, bool push=true)
virtual bool mouseMove (UContext *context, int x, int y, bool push=true)
virtual bool keyDown (UContext *context, UKeyCode_t keyCode, wchar_t keyChar, bool push=true)
virtual bool keyUp (UContext *context, UKeyCode_t keyCode, wchar_t keyChar, bool push=true)

Detailed Description

The Display is the connection to the underlying windowing system.

On construction, a video driver is loaded and initialized. The display can create frames. On destruction, all frames and system ressources allocated by this object are cleaned up. You may use the dummy video driver (by specifying "dummy" at construction) if you want to use your custom OpenGL context. In this case, you have to pump your own events to the event queue (either by calling pushEvent(UEvent*) or the convenience push-methods).

Author:
Johannes Schmidt


Constructor & Destructor Documentation

ufo::UXDisplay::UXDisplay const std::string &  videoDriver = ""  ) 
 

Creates a new UX display object and registers it as default display.

Parameters:
videoDriver The display driver to use. If empty, all available drivers are tested.


Member Function Documentation

virtual UXFrame* ufo::UXDisplay::createFrame  )  [virtual]
 

Uses the video driver to create a valid video device. If this was succesful, a frame is returned, otherwise NULL. The returned frame should have a title bar, is resizable, closable, maximizable and iconifyable.

See also:
UXFrame::setFrameStyle

virtual bool ufo::UXDisplay::dispatchKeyDown UContext context,
UKeyCode_t  keyCode,
wchar_t  keyChar
[virtual]
 

Like pushKeyDown, but the event is dispatched immediately

Returns:
TRUE, if the event got consumed, otherwise FALSE

virtual bool ufo::UXDisplay::dispatchKeyUp UContext context,
UKeyCode_t  keyCode,
wchar_t  keyChar
[virtual]
 

Like pushKeyUp, but the event is dispatched immediately

Returns:
TRUE, if the event got consumed, otherwise FALSE

virtual bool ufo::UXDisplay::dispatchMouseButtonDown UContext context,
int  x,
int  y,
UMod_t  button
[virtual]
 

Like pushMouseButtonDown, but the event is dispatched immediately

Returns:
TRUE, if the event got consumed, otherwise FALSE

virtual bool ufo::UXDisplay::dispatchMouseButtonUp UContext context,
int  x,
int  y,
UMod_t  button
[virtual]
 

Like pushMouseButtonUp, but the event is dispatched immediately

Returns:
TRUE, if the event got consumed, otherwise FALSE

virtual bool ufo::UXDisplay::dispatchMouseMove UContext context,
int  x,
int  y
[virtual]
 

Like pushMouseMove , but the event is dispatched immediately

Returns:
TRUE, if the event got consumed, otherwise FALSE

virtual bool ufo::UXDisplay::dispatchMouseWheelDown UContext context,
int  x,
int  y,
int  delta = -120,
int  mouseWheelNum = 0
[virtual]
 

Like pushMouseWheelDown, but the event is dispatched immediately

Returns:
TRUE, if the event got consumed, otherwise FALSE

virtual bool ufo::UXDisplay::dispatchMouseWheelUp UContext context,
int  x,
int  y,
int  delta = 120,
int  mouseWheelNum = 0
[virtual]
 

Like pushMouseWheelUp, but the event is dispatched immediately

virtual std::vector<UContext*> ufo::UXDisplay::getContexts  )  const [virtual]
 

Returns a vector with all contextes which were registered at this display object.

Implements ufo::UDisplay.

virtual std::vector<UXFrame*> ufo::UXDisplay::getFrames  )  const [virtual]
 

Returns all frames created by this display object.

virtual UVideoDriver* ufo::UXDisplay::getVideoDriver  )  const [virtual]
 

Returns the video driver used by this object for all system operations. If this display is not valid, returns NULL.

virtual bool ufo::UXDisplay::isValid  )  const [virtual]
 

Returns true if this UXDisplay is a valid display connection with a valid video driver.

virtual void ufo::UXDisplay::pumpEvents  )  [virtual]
 

Pumps system events to the event queue. May be a no-op on some systems.

Implements ufo::UDisplay.

virtual void ufo::UXDisplay::pushKeyDown UContext context,
UKeyCode_t  keyCode,
wchar_t  keyChar
[virtual]
 

Pushes a new key down event on the event queue.

Parameters:
context The context this event belongs to
keyCode The UFO key symbol
keyChar The unicode representation of the key

virtual void ufo::UXDisplay::pushKeyUp UContext context,
UKeyCode_t  keyCode,
wchar_t  keyChar
[virtual]
 

Pushes a new key up event on the event queue.

Parameters:
context The context this event belongs to
keyCode The UFO key symbol
keyChar The unicode representation of the key

void ufo::UXDisplay::pushMouseButtonDown UContext context,
UMod_t  modifiers,
int  x,
int  y,
UMod_t  button
[inline]
 

This class or method is obsolete, it is provided for compatibility only.

virtual void ufo::UXDisplay::pushMouseButtonDown UContext context,
int  x,
int  y,
UMod_t  button
[virtual]
 

Pushes a new mouse down event on the event queue.

Parameters:
context The context this event belongs to
x The x coordinate of the mouse event
y The y coordinate of the mouse event
button The mouse button which has been pressed

virtual void ufo::UXDisplay::pushMouseButtonUp UContext context,
int  x,
int  y,
UMod_t  button
[virtual]
 

Pushes a new mouse up event on the event queue.

Parameters:
context The context this event belongs to
x The x coordinate of the mouse event
y The y coordinate of the mouse event
button The mouse button which has been released

virtual void ufo::UXDisplay::pushMouseMove UContext context,
int  x,
int  y
[virtual]
 

Pushes a new mouse move event on the event queue.

Parameters:
context The context this event belongs to
x The x coordinate of the mouse event
y The y coordinate of the mouse event

virtual void ufo::UXDisplay::pushMouseWheelDown UContext context,
int  x,
int  y,
int  delta = -120,
int  mouseWheelNum = 0
[virtual]
 

Pushes a new mouse wheel down event on the event queue.

Parameters:
context The context this event belongs to
x The x coordinate of the mouse event
y The y coordinate of the mouse event
delta The number of units to be scrolled (mod 120)
mouseWheelNum The number of the mouse wheel

virtual void ufo::UXDisplay::pushMouseWheelUp UContext context,
int  x,
int  y,
int  delta = 120,
int  mouseWheelNum = 0
[virtual]
 

Pushes a new mouse wheel up event on the event queue.

Parameters:
context The context this event belongs to
x The x coordinate of the mouse event
y The y coordinate of the mouse event
delta The number of units to be scrolled (mod 120)
mouseWheelNum The number of the mouse wheel

void ufo::UXDisplay::registerContext UXContext context  )  [protected]
 

registers a new UXContext.

virtual void ufo::UXDisplay::setModState UMod_t  modifiers  )  [virtual]
 

Resets the modifier states. LibUFO usually keeps track of the pressed modifiers. But if a key is pressed while the UFO frame isn't focused, i.e. UFO does not receive the key event, the modifier state has to be updated.

Reimplemented from ufo::UAbstractDisplay.


The documentation for this class was generated from the following file:
The libUFO Project - written by Johannes Schmidt