Public Member Functions | Static Public Member Functions

glv::GLV Class Reference

The topmost view. More...

#include <glv_core.h>

Inheritance diagram for glv::GLV:
glv::View glv::DataModel glv::Notifier glv::SmartObject< View >

List of all members.

Public Member Functions

 GLV (drawCallback drawFunc=0, space_t width=800, space_t height=600)
virtual const char * className () const
 Get class name.
const Mousemouse () const
 Get current keyboard state.
Event::t eventType () const
 Get last event type propagated.
ViewfocusedView () const
 Get currently focused View.
GraphicsDatagraphicsData ()
 Get reference to temporary graphics data for rendering.
void broadcastEvent (Event::t e)
 Sends an event to everyone in tree (including self).
virtual void drawGLV (unsigned int w, unsigned int h, double dsec)
 GLV MAIN RENDER LOOP: draw all Views in the GLV.
void drawWidgets (unsigned int w, unsigned int h, double dsec)
 Draws all acive widgest in the GLV.
void eventType (Event::t e)
 Set event type to propagate.
bool propagateEvent ()
 Propagates event through view tree adhering to bubbling rules.
void setFocus (View *v)
 Set current event target.
void setKeyDown (int keycode)
 Sets keyboard and GLV event state.
void setKeyUp (int keycode)
 Sets keyboard and GLV event state.
void setMouseDown (space_t &x, space_t &y, int button, int clicks)
 Set state from mouse down event.
void setMouseDrag (space_t &x, space_t &y)
 Set state from mouse drag event.
void setMousePos (int x, int y, space_t relx, space_t rely)
 Set mouse position state.
void setMouseUp (space_t &x, space_t &y, int button, int clicks)
 Set state from mouse up event.
void setMouseMotion (space_t &x, space_t &y, Event::t e)
 Set state from mouse motion event.
void setMouseMove (space_t &x, space_t &y)
 Set state from mouse motion event.
void setMouseWheel (int wheelDelta)
 Set state from mouse wheel event.
ModelManagermodelManager ()
 Get model manager.
void refreshModels ()
 Add models of named children to model manager.

Static Public Member Functions

static bool valid (const GLV *g)
 Returns true if there is a valid GLV instance at this address.

Detailed Description

The topmost view.

The GLV is the topmost view that serves as an interface between OS events (windowing, device input) and GLV events. The GLV is responsible for sending events to views and rendering the GUI.


Constructor & Destructor Documentation

glv::GLV::GLV ( drawCallback  drawFunc = 0,
space_t  width = 800,
space_t  height = 600 
)
Parameters:
[in] drawFunc drawing callback
[in] width width
[in] height height

Member Function Documentation

void glv::GLV::drawGLV ( unsigned int  w,
unsigned int  h,
double  dsec 
) [virtual]

GLV MAIN RENDER LOOP: draw all Views in the GLV.

The assumption is that we are inside an OpenGL context of size [w, h] dsec is the time, in seconds, from the last frame

const Mouse& glv::GLV::mouse (  )  const [inline]

Get current keyboard state.

Get current mouse state

bool glv::GLV::propagateEvent (  ) 

Propagates event through view tree adhering to bubbling rules.

Be sure to set the eventType first! Returns whether the event was consumed.

void glv::GLV::setMouseDown ( space_t &  x,
space_t &  y,
int  button,
int  clicks 
)

Set state from mouse down event.

Input coordinates will be modified to be relative to the target View's origin

void glv::GLV::setMouseDrag ( space_t &  x,
space_t &  y 
)

Set state from mouse drag event.

Input coordinates will be modified to be relative to the target View's origin

void glv::GLV::setMouseMotion ( space_t &  x,
space_t &  y,
Event::t  e 
)

Set state from mouse motion event.

Input coordinates will be modified to be relative to the target View's origin

void glv::GLV::setMouseMove ( space_t &  x,
space_t &  y 
)

Set state from mouse motion event.

Input coordinates will be modified to be relative to the target View's origin

void glv::GLV::setMouseUp ( space_t &  x,
space_t &  y,
int  button,
int  clicks 
)

Set state from mouse up event.

Input coordinates will be modified to be relative to the target View's origin


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