ZenitUI
Retained-mode C++20 UI framework
Loading...
Searching...
No Matches
CoreTypes.hpp File Reference

Small value types shared by the layout, rendering and input layers. More...

#include "Common.hpp"
#include "SmallVector.hpp"
#include <algorithm>
#include <atomic>

Go to the source code of this file.

Classes

struct  ZenitUI::Vec2
 2D vector with component-wise arithmetic. More...
struct  ZenitUI::Vec3
 3D vector. More...
struct  ZenitUI::Vec4
 4D vector with an implicit w = 1 default. More...
struct  ZenitUI::Rect
 Axis-aligned rectangle in screen coordinates. More...
struct  ZenitUI::EdgeInsets
 Four-sided edge inset (used for padding, margin, borders). More...
struct  ZenitUI::Color
 8-bit-per-channel RGBA color, non-premultiplied. More...
struct  ZenitUI::Vertex2D
 Interleaved 2D vertex passed to IRenderer::drawGeometry. More...
struct  ZenitUI::TextureHandle
 Opaque handle to a GPU/software texture owned by the asset provider. More...
struct  ZenitUI::FontHandle
 Opaque handle to a font loaded by TextEngine. More...
struct  ZenitUI::EffectHandle
 Opaque handle to a shader/effect owned by the asset provider. More...
struct  ZenitUI::TargetHandle
 Opaque handle to an off-screen render target. More...
struct  ZenitUI::NineSlice
 Nine-slice inset values for scalable textures. More...
struct  ZenitUI::Transform2D
 2D affine transform stored as pivot + translate + rotation + scale. More...
class  ZenitUI::FontStack
 Ordered list of font family names to try, first match wins. More...
struct  ZenitUI::ButtonState
 Per-button state snapshot for the current frame. More...
struct  ZenitUI::PointerState
 Pointer position, wheel delta, and per-button state for one frame. More...
struct  ZenitUI::ModifierState
 Keyboard modifier snapshot. More...
struct  ZenitUI::InputEvents
 One frame's worth of keyboard input. More...

Namespaces

namespace  ZenitUI::Colors
 Named color constants.
namespace  ZenitUI::Key
 Global viewport metrics, updated once per frame from the platform.

Enumerations

enum class  ZenitUI::MouseButton : uint8_t { Left , Right , Middle , Count }
 Mouse buttons tracked by the input system. More...
enum class  ZenitUI::Align : uint8_t {
  Align::Auto , Align::Start , Align::Center , Align::End ,
  Align::Stretch
}
 Cross-axis alignment for flex items and content. More...
enum class  ZenitUI::Justify : uint8_t { Justify::Start , Justify::Center , Justify::End , Justify::SpaceBetween }
 Main-axis distribution for flex containers. More...

Functions

Vec2 ZenitUI::operator+ (Vec2 a, Vec2 b)
Vec2 ZenitUI::operator- (Vec2 a, Vec2 b)
Vec2 ZenitUI::operator* (Vec2 a, float k)
Vec2 ZenitUI::applyTransform (const Transform2D &t, Vec2 p)
 Apply a Transform2D to a point.
Vec2 ZenitUI::applyInverseTransform (const Transform2D &t, Vec2 p)
 Invert a Transform2D and apply it to a point.

Variables

constexpr Color ZenitUI::Colors::White {255, 255, 255, 255}
constexpr Color ZenitUI::Colors::Black {0, 0, 0, 255}
constexpr Color ZenitUI::Colors::Blank {0, 0, 0, 0}
constexpr Color ZenitUI::Colors::Red {230, 41, 55, 255}
constexpr Color ZenitUI::Colors::Maroon {190, 33, 55, 255}
constexpr Color ZenitUI::Colors::Green {0, 228, 48, 255}
constexpr Color ZenitUI::Colors::DarkGreen {0, 117, 44, 255}
constexpr Color ZenitUI::Colors::Blue {0, 121, 241, 255}
constexpr Color ZenitUI::Colors::Yellow {253, 249, 0, 255}
constexpr Color ZenitUI::Colors::Gray {130, 130, 130, 255}
constexpr Color ZenitUI::Colors::DarkGray {80, 80, 80, 255}
constexpr Color ZenitUI::Colors::LightGray {200, 200, 200, 255}
constexpr int ZenitUI::Key::Backspace = 1
constexpr int ZenitUI::Key::Delete = 2
constexpr int ZenitUI::Key::Enter = 3
constexpr int ZenitUI::Key::Escape = 4
constexpr int ZenitUI::Key::Left = 5
constexpr int ZenitUI::Key::Right = 6
constexpr int ZenitUI::Key::Home = 7
constexpr int ZenitUI::Key::End = 8
constexpr int ZenitUI::Key::Tab = 9
constexpr int ZenitUI::Key::Space = 10
constexpr int ZenitUI::Key::Up = 11
constexpr int ZenitUI::Key::Down = 12
constexpr int ZenitUI::Key::A = 65
constexpr int ZenitUI::Key::C = 67
constexpr int ZenitUI::Key::V = 86
constexpr int ZenitUI::Key::X = 88
constexpr int ZenitUI::Key::Y = 89
constexpr int ZenitUI::Key::Z = 90

Detailed Description

Small value types shared by the layout, rendering and input layers.

Nothing in this header depends on other ZenitUI headers except Common.hpp and SmallVector.hpp, so it can be included from anywhere.