psychic-ui 0.0.0
Loading...
Searching...
No Matches
psychic_ui Namespace Reference

Namespaces

namespace  paint
namespace  palette
namespace  themes

Classes

class  Animated
class  Animation
struct  Approach
class  AppShell
class  Atom
class  Avatar
class  AvatarSkin
class  AvatarSkinBase
class  Badge
class  Box
class  Button
class  ButtonSkin
class  ButtonSkinBase
class  CheckBox
class  CheckBoxSkin
class  CheckBoxSkinBase
class  CheckMenuItem
class  Chip
class  Color
class  ColorSwatches
class  ColorSwatchesSkin
class  ColorSwatchesSkinBase
class  ColorUtils
class  Component
struct  Constraint
class  DataContainer
class  DataGrid
struct  DataGridColumn
class  DataGridRow
class  DeskSkins
class  Dialog
class  Div
struct  Ease
struct  Elevation
class  EmptyState
class  FloatSkins
struct  Font
class  GLFWSystemWindow
class  GroupMenuItem
class  HBox
class  Icon
struct  IconDefinition
struct  IconElement
class  IconRegistry
struct  IconShape
class  Inspector
class  InspectorField
class  InspectorSection
struct  Interpolation
struct  Interpolation< Color >
struct  Interpolation< float >
struct  Interpolation< Length >
class  Kbd
class  Label
struct  Length
class  List
class  ListRow
class  Menu
class  MenuBar
class  MenuButton
class  MenuButtonSkin
class  MenuButtonSkinBase
class  MenuItem
class  MenuRadioGroup
struct  Metrics
struct  Mod
struct  Motion
struct  MouseEvent
class  NoDestructor
class  NumberStepper
class  NumberStepperSkin
class  NumberStepperSkinBase
class  Observer
class  Overlay
class  PageHeader
struct  Palette
class  PivotalAvatarSkin
class  PivotalSkins
struct  Placement
class  Popup
struct  Radii
class  RadioMenuItem
class  Range
class  RangeSkin
class  RangeSkinBase
class  RowGroup
class  ScopedSlot
class  ScrollBar
class  ScrollBarSkin
class  ScrollBarSkinBase
class  Scroller
class  SDL3Application
class  SDL3SystemWindow
class  SearchField
class  SearchFieldSkin
class  SearchFieldSkinBase
struct  Segment
class  SegmentedControl
class  SegmentedControlSkin
class  SegmentedControlSkinBase
class  Select
class  SelectableRow
class  SeparatorMenuItem
struct  Shadow
class  Shape
class  Sidebar
class  SidebarHeader
class  SidebarItem
class  SidebarSection
class  Signal
class  SimpleMenuItem
struct  Size
struct  Sizes
class  Skin
class  SkinRegistry
class  SkinSet
struct  SkinState
class  Slot
class  SlotBase
class  Spacer
struct  Spring
class  StatusDot
class  Style
class  StyleDeclaration
class  StyleManager
class  StyleSelector
class  StyleSheet
struct  StyleValues
class  SubMenuItem
class  Switch
class  SwitchSkin
class  SwitchSkinBase
class  SystemWindow
class  TabButtonSkin
class  TabContainer
class  Tabs
class  Text
class  TextArea
class  TextAreaSkin
class  TextAreaSkinBase
class  TextEditing
class  TextField
class  TextFieldBase
class  TextGeometry
class  TextInput
class  TextInputSkin
class  TextInputSkinBase
class  TextLayout
struct  TextLayoutStyle
struct  TextStep
struct  Theme
class  Timing
class  TitleBar
class  TitleBarButtonSkin
class  Toast
struct  ToastAction
struct  ToastOptions
class  ToastStack
class  ToolBar
class  Tooltip
class  Transition
class  Tree
class  TreeNode
class  TreeRow
class  Tween
struct  Typography
class  VBox
class  Window
class  WindowControls

Concepts

concept  Interpolable

Typedefs

using Channels = std::array<float, 4>
using MenuItems = std::vector<std::shared_ptr<MenuItem>>
using ScrollDirection = Orientation
using ClickCallback = std::function<void()>
using MouseCallback = std::function<void(const MouseEvent &event)>
using PropertyMask = std::bitset<propertyCount>

Enumerations

enum class  AvatarSize : std::uint8_t { XSmall , Small , Medium , Large }
enum class  SortOrder : std::uint8_t { None , Ascending , Descending }
enum class  RangeMode : std::uint8_t { Linear , Logarithmic , LogarithmicInverse }
enum class  ToastVariant : std::uint8_t { Info , Success , Warning , Danger }
enum class  Tone : std::uint8_t {
  Neutral , Accent , Success , Warning ,
  Danger
}
enum class  MouseEventStatus : std::uint8_t { Out , Over , Handled }
enum class  IconPaint : std::uint8_t { Stroke , Fill }
enum class  Fit : std::uint8_t { Exact , AtMost , Unbounded }
enum class  Side : std::uint8_t { Bottom , Top , Right , Left }
enum class  PopupAlign : std::uint8_t { Start , Center , End }
enum class  MouseButton : std::uint8_t { NONE = 0 , LEFT = 1 , MIDDLE = 2 , RIGHT = 4 }
enum class  InputMode : std::uint8_t { Pointer , Touch , Pen }
enum class  Key : std::uint8_t {
  UNKNOWN , SPACE , APOSTROPHE , COMMA ,
  MINUS , PERIOD , SLASH , ZERO ,
  ONE , TWO , THREE , FOUR ,
  FIVE , SIX , SEVEN , EIGHT ,
  NINE , SEMICOLON , EQUAL , A ,
  B , C , D , E ,
  F , G , H , I ,
  J , K , L , M ,
  N , O , P , Q ,
  R , S , T , U ,
  V , W , X , Y ,
  Z , LEFT_BRACKET , BACKSLASH , RIGHT_BRACKET ,
  GRAVE_ACCENT , WORLD_1 , WORLD_2 , ESCAPE ,
  ENTER , TAB , BACKSPACE , INSERT ,
  DELETE , RIGHT , LEFT , DOWN ,
  UP , PAGE_UP , PAGE_DOWN , HOME ,
  END , CAPS_LOCK , SCROLL_LOCK , NUM_LOCK ,
  PRINT_SCREEN , PAUSE , F1 , F2 ,
  F3 , F4 , F5 , F6 ,
  F7 , F8 , F9 , F10 ,
  F11 , F12 , F13 , F14 ,
  F15 , F16 , F17 , F18 ,
  F19 , F20 , F21 , F22 ,
  F23 , F24 , F25 , KP_0 ,
  KP_1 , KP_2 , KP_3 , KP_4 ,
  KP_5 , KP_6 , KP_7 , KP_8 ,
  KP_9 , KP_DECIMAL , KP_DIVIDE , KP_MULTIPLY ,
  KP_SUBTRACT , KP_ADD , KP_ENTER , KP_EQUAL ,
  LEFT_SHIFT , LEFT_CONTROL , LEFT_ALT , LEFT_SUPER ,
  RIGHT_SHIFT , RIGHT_CONTROL , RIGHT_ALT , RIGHT_SUPER ,
  MENU
}
enum class  Property : std::uint8_t
enum class  Pseudo : std::uint8_t {
  Focus , FocusVisible , Hover , Active ,
  Disabled , Empty , FirstChild , LastChild ,
  Touch
}
enum class  Token : std::uint8_t { Tag , Id , Class , Pseudo }
enum class  Direction : std::uint8_t { Column , ColumnReverse , Row , RowReverse }
enum class  TextDirection : std::uint8_t { Inherit , Ltr , Rtl }
enum class  Justify : std::uint8_t {
  Start , Center , End , SpaceBetween ,
  SpaceAround , SpaceEvenly
}
enum class  Align : std::uint8_t {
  Auto , Start , Center , End ,
  Stretch , Baseline , SpaceBetween , SpaceAround ,
  SpaceEvenly
}
enum class  Position : std::uint8_t { Static , Relative , Absolute }
enum class  Wrap : std::uint8_t { NoWrap , Wrap , WrapReverse }
enum class  Overflow : std::uint8_t { Visible , Hidden , Scroll }
enum class  Display : std::uint8_t { Flex , None , Contents }
enum class  BoxSizing : std::uint8_t { BorderBox , ContentBox }
enum class  TextAlign : std::uint8_t {
  Start , End , Left , Right ,
  Center , Justify
}
enum class  FontSmoothing : std::uint8_t { None , Grayscale , Subpixel }
enum class  TextOverflow : std::uint8_t { Clip , Ellipsis }
enum class  Cursor : std::uint8_t {
  Arrow , IBeam , Crosshair , Hand ,
  HResize , VResize
}
enum class  Orientation : std::uint8_t { Horizontal , Vertical }
enum class  ColorScheme : std::uint8_t { Unknown , Light , Dark }
enum class  Density : std::uint8_t { Pointer , Touch }

Functions

std::ostream & operator<< (std::ostream &os, const Timing &timing)
void applyTone (Div &div, const Tone tone)
constexpr std::string_view toneClass (const Tone tone)
Placement placePopup (const SkRect &anchor, const float width, const float height, const SkRect &bounds, const Side side, const PopupAlign align, const float sideOffset, const float alignOffset)
std::ostream & operator<< (std::ostream &os, const Atom &atom)
std::ostream & operator<< (std::ostream &os, const Color &color)
constexpr Color rgb (std::uint32_t rgb)
constexpr Color rgb (std::uint8_t r, std::uint8_t g, std::uint8_t b)
constexpr Color argb (std::uint32_t argb)
std::ostream & operator<< (std::ostream &os, const Length &length)
constexpr Length operator""_pct (long double value)
constexpr Length operator""_pct (unsigned long long value)
constexpr Length operator""_px (long double value)
constexpr Length operator""_px (unsigned long long value)
constexpr std::size_t index (Property property)
constexpr PropertyMask mask (std::initializer_list< Property > properties)
std::ostream & operator<< (std::ostream &os, const Transition &transition)
std::string_view propertyName (Property property)
constexpr TextEditing::Edit operator| (TextEditing::Edit a, TextEditing::Edit b)
constexpr TextEditing::Edit & operator|= (TextEditing::Edit &a, TextEditing::Edit b)
constexpr bool has (TextEditing::Edit edit, TextEditing::Edit what)
std::filesystem::path executableDirectory ()

Variables

constexpr std::array allTones {Tone::Neutral, Tone::Accent, Tone::Success, Tone::Warning, Tone::Danger}
constexpr Length Auto {0.0f, Length::Unit::Auto}
constexpr std::array allProperties
constexpr std::size_t propertyCount = allProperties.size()
constexpr PropertyMask inheritedProperties
constexpr PropertyMask layoutProperties
constexpr PropertyMask paintProperties = ~layoutProperties
constexpr PropertyMask animatableProperties

Detailed Description

How a value moves to a new one: a duration along an easing curve, or a spring.

What an icon is made of, as data: the bundled sets are tables of these (generated by tools/icons/generate.py), and an application registers its own the same way (IconRegistry::add).

The types of the style properties: lengths, colors, enumerated values and interned strings. Each is checked when the call is compiled, so a typo or a wrong kind of value is a compile error.

Typedef Documentation

◆ Channels

using psychic_ui::Channels = std::array<float, 4>

A value as up to four numbers that move together (Interpolation<T> turns values into channels and back)

◆ ClickCallback

using psychic_ui::ClickCallback = std::function<void()>

Shortcut type for click signal slot

◆ MouseCallback

using psychic_ui::MouseCallback = std::function<void(const MouseEvent &event)>

Shortcut type for mouse signal slot

◆ PropertyMask

using psychic_ui::PropertyMask = std::bitset<propertyCount>

A set of properties

Enumeration Type Documentation

◆ Align

enum class psychic_ui::Align : std::uint8_t
strong

Cross axis alignment, CSS's align-items, align-self and align-content

◆ AvatarSize

enum class psychic_ui::AvatarSize : std::uint8_t
strong

An avatar's size, as a class: 16 px (xs), 20 px (sm), 24 px (md, the default) or 32 px (lg)

◆ ColorScheme

enum class psychic_ui::ColorScheme : std::uint8_t
strong

Whether a theme is light or dark, and what the system asks for (Unknown when it doesn't say)

◆ Density

enum class psychic_ui::Density : std::uint8_t
strong

How dense the controls are: for a mouse, trackpad or pen (Pointer), or for fingers (Touch), which the style manager switches to while the window is in touch mode

◆ Direction

enum class psychic_ui::Direction : std::uint8_t
strong

Flex direction: the axis children are laid out along

◆ Fit

enum class psychic_ui::Fit : std::uint8_t
strong

How a measured dimension must fit the space the layout offers

Enumerator
Exact 

The dimension is decided: report the size given

AtMost 

Report what the content needs, up to the size given

Unbounded 

Report what the content needs, the size given means nothing

◆ FontSmoothing

enum class psychic_ui::FontSmoothing : std::uint8_t
strong

How glyph edges are smoothed, CSS's -webkit-font-smoothing: not at all (aliased), in grey levels, or per LCD subpixel (sharper on a still, opaque background; wrong in layers with opacity or transforms, as popups enter)

◆ IconPaint

enum class psychic_ui::IconPaint : std::uint8_t
strong

How an element of an icon is painted, in the icon's color

◆ InputMode

enum class psychic_ui::InputMode : std::uint8_t
strong

What the user is pointing with, as the window last saw it (Window::inputMode()): a mouse or trackpad, a finger on a touch screen, or a pen. Touch makes the style manager switch to touch density.

◆ Justify

enum class psychic_ui::Justify : std::uint8_t
strong

Main axis distribution, CSS's justify-content

◆ Key

enum class psychic_ui::Key : std::uint8_t
strong

Since we support either SDL2 or GLFW, we have to map keyboard keys to something we can use (they don't use the same values)

Here we're using the set of keys from GLFW since it names less keys than SDL

◆ MouseEventStatus

enum class psychic_ui::MouseEventStatus : std::uint8_t
strong

Return status of the mouse event methods

Enumerator
Out 

Mouse was outside the component

Over 

Mouse was over the component but no event was handled

Handled 

Mouse is over the component and an event was handled

◆ Orientation

enum class psychic_ui::Orientation : std::uint8_t
strong

Orientation of sliders and scroll bars

◆ PopupAlign

enum class psychic_ui::PopupAlign : std::uint8_t
strong

Where a popup lines up along its anchor's side: its start (left or top), center or end

◆ Property

enum class psychic_ui::Property : std::uint8_t
strong

Identifies a style property, for the operations on several at once (masks, Style::has)

◆ Side

enum class psychic_ui::Side : std::uint8_t
strong

The side of its anchor a popup goes on

◆ SortOrder

enum class psychic_ui::SortOrder : std::uint8_t
strong

The order a DataGrid's rows are sorted in by a column; None is the order they were added in

◆ TextDirection

enum class psychic_ui::TextDirection : std::uint8_t
strong

Text (and layout) direction, CSS's direction

◆ TextOverflow

enum class psychic_ui::TextOverflow : std::uint8_t
strong

How one line of text that doesn't fit its box ends, CSS's text-overflow: cut after the last whole character that fits (text being edited runs past the box instead), or before an ellipsis that fits

◆ ToastVariant

enum class psychic_ui::ToastVariant : std::uint8_t
strong

What kind of news a toast brings: its icon's tile and color

◆ Tone

enum class psychic_ui::Tone : std::uint8_t
strong

What a badge, a status dot, a chip or an avatar's status means, which the skin set colors from the theme: Neutral (secondary text, a strong hairline), Accent, Success, Warning and Danger. A component shows it as the class toneClass names (Badge.success).

Function Documentation

◆ applyTone()

void psychic_ui::applyTone ( Div & div,
Tone tone )

Give a div the class of a tone, removing the others'

◆ argb()

Color psychic_ui::argb ( std::uint32_t argb)
constexpr

A color from 0xAARRGGBB, alpha first like Skia

◆ executableDirectory()

std::filesystem::path psychic_ui::executableDirectory ( )

The running executable's directory (/proc/self/exe on Linux, _NSGetExecutablePath on macOS, GetModuleFileNameW on Windows), or an empty path when it can't be found

◆ has()

bool psychic_ui::has ( TextEditing::Edit edit,
TextEditing::Edit what )
constexpr

Whether an edit changed anything of what is asked (has(edit, Edit::Text))

◆ operator""_pct()

Length psychic_ui::literals::operator""_pct ( long double value)
constexpr

Percent of the parent, 0-100 like CSS: width(50_pct)

◆ operator""_px()

Length psychic_ui::literals::operator""_px ( long double value)
constexpr

Pixels, for when it reads better than a plain number: width(24_px)

◆ placePopup()

Placement psychic_ui::placePopup ( const SkRect & anchor,
float width,
float height,
const SkRect & bounds,
Side side,
PopupAlign align,
float sideOffset = 0,
float alignOffset = 0 )

Place a popup of this size beside an anchor (both in the same coordinates), inside bounds: on side, unless it doesn't fit there and the opposite side fits or has more room (it flips), sideOffset away from the anchor; along the side, aligned by align (alignOffset further along it from the start or toward the start from the end), then shifted to stay inside the bounds. A popup larger than the bounds starts at their start.

◆ propertyName()

std::string_view psychic_ui::propertyName ( Property property)

The property's name, as in the setters

◆ rgb() [1/2]

Color psychic_ui::rgb ( std::uint32_t rgb)
constexpr

An opaque color from 0xRRGGBB

◆ rgb() [2/2]

Color psychic_ui::rgb ( std::uint8_t r,
std::uint8_t g,
std::uint8_t b )
constexpr

An opaque color from its components

◆ toneClass()

std::string_view psychic_ui::toneClass ( const Tone tone)
constexpr

The class a component has for its tone: "neutral", "accent", "success", "warning" or "danger"

Variable Documentation

◆ allProperties

std::array psychic_ui::allProperties
inlineconstexpr
Initial value:
{
}

Every property, in declaration order

◆ animatableProperties

PropertyMask psychic_ui::animatableProperties
inlineconstexpr
Initial value:
= [] {
#define PSYCHIC_UI_X(name, Type, Argument, defaultValue, inherited, layout, animatable)
return m;
}()
std::bitset< propertyCount > PropertyMask
Definition Properties.hpp:211

Properties a transition can blend

◆ Auto

Length psychic_ui::Auto {0.0f, Length::Unit::Auto}
inlineconstexpr

The auto length: width(Auto), margin(Auto)

◆ inheritedProperties

PropertyMask psychic_ui::inheritedProperties
inlineconstexpr
Initial value:
= [] {
#define PSYCHIC_UI_X(name, Type, Argument, defaultValue, inherited, layout, animatable)
return m;
}()

Properties a Div takes from its parent when nothing sets them

◆ layoutProperties

PropertyMask psychic_ui::layoutProperties
inlineconstexpr
Initial value:
= [] {
#define PSYCHIC_UI_X(name, Type, Argument, defaultValue, inherited, layout, animatable)
return m;
}()

Properties Yoga reads: changing one of them means a new layout

◆ paintProperties

PropertyMask psychic_ui::paintProperties = ~layoutProperties
inlineconstexpr

Properties that only change how a Div is painted