NvUI.h File Reference
A cross-platform, GL/GLES-based, simple user interface widget framework. More...
#include <NvFoundation.h>
#include <NvUI/NvGestureEvent.h>
#include "NvUI/NvPackedColor.h"
#include "NV/NvVector.h"
#include <string.h>
#include <string>
#include <map>
Go to the source code of this file.
Classes | |
| struct | NvReactFlag |
| This enum defines bit flags for extra/other info about a particular NvUIReaction. More... | |
| struct | NvUIReaction |
| A structure holding some 'reaction' to a given user input event. More... | |
| class | NvUIDrawState |
| A class that manages all draw-related state. More... | |
| class | NvUIRect |
| A class that abstracts on onscreen rectangular region. More... | |
| class | NvUIElement |
| The abstract base class of the NvUI framework. More... | |
| class | NvUIProxy |
| A UI element that 'proxies' calls to another element. More... | |
| class | NvGraphicShader |
| A helper object for managing a shader program for NvUIGraphic and subclasses. More... | |
| class | NvUITexture |
| Abstraction of a GL texture object, allowing for texture caching, lookup, and reuse/refcounting. More... | |
| class | NvUIGraphic |
| A graphical element, with no interactivity. More... | |
| class | NvGraphicFrameShader |
| This adds NvUIGraphicFrame features to the NvGraphicShader 'template'. More... | |
| class | NvUIGraphicFrame |
| A graphical frame element, representing a background and border combined. More... | |
| struct | NvUIFontFamily |
| Default font families you may reference. More... | |
| struct | NvUITextAlign |
| Basic text alignment. More... | |
| class | NvUIText |
| A UI element that renders text strings to the view. More... | |
| struct | NvUIButtonState |
| Basic button states. More... | |
| struct | NvUIButtonType |
| Basic button types. More... | |
| class | NvUIButton |
| A class that implements a variety of standard interactive button widgets. More... | |
| class | NvUIContainer |
| An object that holds and manages a group of UI elements and interactions with them. More... | |
| class | NvUIWindow |
| A single, top-level container that can manage all NvUIElements in the view. More... | |
| class | NvUIValueBar |
| A generic "value bar" element, for progress, time/length, indicators. More... | |
| class | NvUISlider |
| An interactive ValueBar with draggable thumb, for volume, play position, etc. More... | |
| class | NvUIPopupMenu |
| The NvUIPopupMenu is a specialized container class that simulates a popup menu. More... | |
| class | NvUIPopup |
| The NvUIPopup class encapsulates the text/button that causes the NvUIPopupMenu to appear. More... | |
Defines | |
| #define | INHERIT_FROM(c) typedef c INHERITED; |
| This macro offers "INHERITED::" access to superclass in each NvUI class. | |
| #define | UST2SECS(t) ((double)(((double)(t)) / 1.0e9)); |
| Convert 64-bit usecs value to floating-point seconds. | |
| #define | SECS2UST(t) ((NvUST)(((double)(t)) * 1.0e9)); |
| Convert floating-point seconds to a 64-bit usecs value. | |
| #define | NV_PURE_VIRTUAL 0 |
| A big bold constant to make pure virtual methods more visible in code. | |
Typedefs | |
| typedef uint64_t | NvUST |
| Generalize a 64-bit integer time value in microseconds. | |
Enumerations | |
| enum | NvUIEventResponse { nvuiEventNotHandled = 0x000, nvuiEventHandled = 0x001, nvuiEventWantsHover = 0x010, nvuiEventHandledHover = nvuiEventHandled | nvuiEventWantsHover, nvuiEventWantsFocus = 0x020, nvuiEventHandledFocus = nvuiEventHandled | nvuiEventWantsFocus, nvuiEventHadReaction = 0x100, nvuiEventHandledReaction = nvuiEventHandled | nvuiEventHadReaction, nvuiEventHandledFocusReaction = nvuiEventHandled | nvuiEventWantsFocus | nvuiEventHadReaction, nvuiEventNoReaction = ~nvuiEventHadReaction } |
| Event handling response flags. More... | |
Detailed Description
A cross-platform, GL/GLES-based, simple user interface widget framework.An basic user interface framework built up from a starting primitive widget, the NvUIElement base class. In order to keep to the basics, it uses no multiple-inheritance, no STL or templates, no RTT, no operator overloads.
In terms of accessible functionality, the UI framework exposes:
- positioning and sizing of elements
- overall visibility, as well as more precision alpha fading
- drawing a given element (or contained hierarchy)
- giving an element a chance to handle user input events
- giving an element a chance to react to other elements' event handling
Some of the specific UI elements covered so far include:
- graphics (icons, frames, backgrounds -- including texture loading)
- frames/boxes (resizable border+background)
- text (single or multi-line, aligned, wrapped, font/size/style)
- buttons (push, radio, and checkbox style interactions)
- progress indicators & sliders
- generic containers (hold other elements and pass along drawing/handling)
Combined with custom code, the system allows for great flexibility. For example, you could easily create an 'animated icon' by moving a graphic's origin around each frame based on some custom animation code, or even swap the texture a graphic is rendering each frame to produce 'flipbook' style animations.
You can also use the classes as 'helper objects', instantiating even just a single graphic object to help quickly render textures/bitmaps to screen without the need to write a line of GL code, or custom shaders.
Define Documentation
| #define INHERIT_FROM | ( | c | ) | typedef c INHERITED; |
This macro offers "INHERITED::" access to superclass in each NvUI class.
| #define NV_PURE_VIRTUAL 0 |
A big bold constant to make pure virtual methods more visible in code.
| #define SECS2UST | ( | t | ) | ((NvUST)(((double)(t)) * 1.0e9)); |
Convert floating-point seconds to a 64-bit usecs value.
| #define UST2SECS | ( | t | ) | ((double)(((double)(t)) / 1.0e9)); |
Convert 64-bit usecs value to floating-point seconds.
Typedef Documentation
| typedef uint64_t NvUST |
Generalize a 64-bit integer time value in microseconds.
Enumeration Type Documentation
| enum NvUIEventResponse |
Event handling response flags.
All UI objects have the ability/opportunity to handle input events, and must return an NvUIResponse flag for what occurred as a result.
In general, the response notes that an object has handled the event, wants to keep the 'focus' as a result of it, and/or has a NvUIReaction (a side effect) that is triggered based on it.
- Enumerator:
-
nvuiEventNotHandled Flag/mask that we didn't handle the event. nvuiEventHandled Flag/mask that we handled the event. nvuiEventWantsHover Flag/mask that we want hover highlight as a result of the event. nvuiEventHandledHover We handled the event AND want hover highlight. nvuiEventWantsFocus Flag/mask that we want focus as a result of the event. nvuiEventHandledFocus We handled the event AND want focus. nvuiEventHadReaction Flag/mask that we have a NvUIReaction as a side effect. nvuiEventHandledReaction We handled the event AND 'posted' an NvUIReaction. nvuiEventHandledFocusReaction We handled the event AND want the focus AND had an NvUIReaction. nvuiEventNoReaction Mask to clear a prior Reaction flag from the response.