group gui
Render engine independent graphic user interface. More...
Classes
Enums
Type | Name |
---|---|
enum | GuiAlign { LEFT = 0, CENTER, RIGHT, TOP_LEFT, TOP_CENTER, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT } |
enum | GuiEventType { ACTION = 0x1, SIZE = 0x10, INNER = 0x20, POSITION = 0x40, HOVER = 0x80, FOCUS = 0x100, STATE = 0x200, INPUT = 0x400, KEY = 0x800, MOUSEBTN = 0x1000, ALL = 0x7FFFFFFF } |
Typedefs
Type | Name |
---|---|
typedef Point< float > | Pointf |
typedef Point< int > | Pointi |
typedef Point< double > | Pointd |
typedef Rect< float > | Rectf |
typedef Rect< int > | Recti |
typedef Rect< double > | Rectd |
Functions
Type | Name |
---|---|
Color | rgb (unsigned long hex) Constructs ffw::Color from a hexadecimal value. |
Color | rgb (unsigned char r, unsigned char g, unsigned char b) Constructs ffw::Color from three 8-bit balues. |
Color | rgba (unsigned long hex) Constructs ffw::Color from a hexadecimal value with alpha. |
Color | rgba (unsigned char r, unsigned char g, unsigned char b, unsigned char a) Constructs ffw::Color from three 8-bit balues with alpha. |
Color | hsl (const float h, const float s, const float l, const float a = 1.0f) Constructs ffw::Color from HSL values. |
Color | hsv (const float h, const float s, const float v, const float a = 1.0f) Constructs ffw::Color from HSV values. |
ffw::Color | normalize (const Color & col) Normalizes a color returning a copy (won't modify the original) |
ffw::Color | clamp (const ffw::Color & color) Clamps a color between 0.0 and 1.0 values returning a copy (won't modify the original) |
std::ostream & | operator<< (std::ostream & os, const ffw::Color & color) |
GuiUnits | guiPixels (float pixels) |
GuiUnits | guiPercent (float percent) |
GuiUnits | guiWrap () |
T | dot (const ffw::Point< T > & v1, const ffw::Point< T > & v2) |
T | distance (const Point< T > & v1, const Point< T > & v2) |
Point< T > | middle (const Point< T > & v1, const Point< T > & v2) |
ffw::Point< T > | normalize (const Point< T > & vec) |
double | angle (const ffw::Point< T > & v1, const ffw::Point< T > & v2) |
double | angleRad (const ffw::Point< T > & v1, const ffw::Point< T > & v2) |
std::ostream & | operator<< (std::ostream & os, const ffw::Point< T > & vec) |
std::ostream & | operator<< (std::ostream & os, const ffw::Rect< T > & rect) |
Detailed Description
This module allows creation of user interfaces (GUIs). It takes care of widget layout, automatic spacing when resized, spacing, callbacks, etc. This module provides several widgets (buttons, check boxes, text edits, radios, sliders, etc..) however, has a functionality to add custom widgets as well. All widgets can be arranged in linear layouts, similarly how HTML works, and can be also styled. This GUI is not directly linked to the OpenGL, or any other rendering engine! Instead, it can use any backend with any renderer you wish to use. However, an OpenGL backend is provided by default, if the user wishes to use. The entire module is UTF-8 enabled.
Enums Documentation
enum GuiAlign
enum gui::GuiAlign {
LEFT = 0,
CENTER,
RIGHT,
TOP_LEFT,
TOP_CENTER,
TOP_RIGHT,
BOTTOM_LEFT,
BOTTOM_CENTER,
BOTTOM_RIGHT,
};
enum GuiEventType
enum gui::GuiEventType {
ACTION = 0x1,
SIZE = 0x10,
INNER = 0x20,
POSITION = 0x40,
HOVER = 0x80,
FOCUS = 0x100,
STATE = 0x200,
INPUT = 0x400,
KEY = 0x800,
MOUSEBTN = 0x1000,
ALL = 0x7FFFFFFF,
};
Typedefs Documentation
typedef Pointf
typedef Point<float> ffw::Pointf;
typedef Pointi
typedef Point<int> ffw::Pointi;
typedef Pointd
typedef Point<double> ffw::Pointd;
typedef Rectf
typedef Rect<float> ffw::Rectf;
typedef Recti
typedef Rect<int> ffw::Recti;
typedef Rectd
typedef Rect<double> ffw::Rectd;
Functions Documentation
function rgb
Color gui::rgb (
unsigned long hex
)
Constructs ffw::Color from a hexadecimal value.
For example, ffw::rgb(0xFF0080) returns 100% red and 50% blue. Alpha is set to 100%.
Warning:
Make sure to use 0xRRGGBB formula. For example, using 0xFF00 in this function would result of color with 0% red, 100% green, and 0% blue. Also, using 0xFF would result in complete blue color.
function rgb
Color gui::rgb (
unsigned char r,
unsigned char g,
unsigned char b
)
Constructs ffw::Color from three 8-bit balues.
For example, ffw::rgb(255, 0, 128) returns 100% red and 50% blue. Alpha is set to 100%.
function rgba
Color gui::rgba (
unsigned long hex
)
Constructs ffw::Color from a hexadecimal value with alpha.
For example, ffw::rgba(0xFF0080BF) returns 100% red, 50% blue, and 80% alpha.
Warning:
Make sure to use 0xRRGGBBAA formula. For example, using 0xFF0080 in this function would result of color with 0% red, 100% green, 0% blue, and 50% alpha. Also, using 0xFF would result in complete black color with 100% alpha.
function rgba
Color gui::rgba (
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a
)
Constructs ffw::Color from three 8-bit balues with alpha.
For example, ffw::rgba(255, 0, 128, 191) returns 100% red, 50% blue, and 80% alpha.
function hsl
Color gui::hsl (
const float h,
const float s,
const float l,
const float a = 1.0f
)
Constructs ffw::Color from HSL values.
Parameters:
- h The hue component in range [0, 1]
- s The saturation component in range [0, 1]
- l The luminance component in range [0, 1]
- a The alpha component in range [0, 1]
For example, ffw::hsl(0.8f, 0.5f, 0.5f) returns purple color with 50% saturation and 50% luminance.
function hsv
Color gui::hsv (
const float h,
const float s,
const float v,
const float a = 1.0f
)
Constructs ffw::Color from HSV values.
Parameters:
- h The hue component in range [0, 1]
- s The saturation component in range [0, 1]
- v The value component in range [0, 1]
- a The alpha component in range [0, 1]
function normalize
ffw::Color gui::normalize (
const Color & col
)
Normalizes a color returning a copy (won't modify the original)
function clamp
ffw::Color gui::clamp (
const ffw::Color & color
)
Clamps a color between 0.0 and 1.0 values returning a copy (won't modify the original)
function operator<<
std::ostream & gui::operator<< (
std::ostream & os,
const ffw::Color & color
)
function guiPixels
GuiUnits gui::guiPixels (
float pixels
)
function guiPercent
GuiUnits gui::guiPercent (
float percent
)
function guiWrap
GuiUnits gui::guiWrap ()
function dot
T gui::dot (
const ffw::Point< T > & v1,
const ffw::Point< T > & v2
)
function distance
T gui::distance (
const Point< T > & v1,
const Point< T > & v2
)
function middle
Point< T > gui::middle (
const Point< T > & v1,
const Point< T > & v2
)
function normalize
ffw::Point< T > gui::normalize (
const Point< T > & vec
)
function angle
double gui::angle (
const ffw::Point< T > & v1,
const ffw::Point< T > & v2
)
function angleRad
double gui::angleRad (
const ffw::Point< T > & v1,
const ffw::Point< T > & v2
)
function operator<<
std::ostream & gui::operator<< (
std::ostream & os,
const ffw::Point< T > & vec
)
function operator<<
std::ostream & gui::operator<< (
std::ostream & os,
const ffw::Rect< T > & rect
)