The topmost view. More...
#include <glv_core.h>
Public Member Functions | |
GLV (drawCallback drawFunc=0, space_t width=800, space_t height=600) | |
virtual const char * | className () const |
Get class name. | |
const Mouse & | mouse () const |
Get current keyboard state. | |
Event::t | eventType () const |
Get last event type propagated. | |
View * | focusedView () const |
Get currently focused View. | |
GraphicsData & | graphicsData () |
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. | |
ModelManager & | modelManager () |
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. |
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.
glv::GLV::GLV | ( | drawCallback | drawFunc = 0 , |
|
space_t | width = 800 , |
|||
space_t | height = 600 | |||
) |
[in] | drawFunc | drawing callback |
[in] | width | width |
[in] | height | height |
void glv::GLV::drawGLV | ( | unsigned int | w, | |
unsigned int | h, | |||
double | dsec | |||
) | [virtual] |
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