|
psychic-ui 0.0.0
|
Namespaces | |
| namespace | paint |
| namespace | palette |
| namespace | themes |
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 |
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.
| 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)
| using psychic_ui::ClickCallback = std::function<void()> |
Shortcut type for click signal slot
| using psychic_ui::MouseCallback = std::function<void(const MouseEvent &event)> |
Shortcut type for mouse signal slot
| using psychic_ui::PropertyMask = std::bitset<propertyCount> |
A set of properties
|
strong |
Cross axis alignment, CSS's align-items, align-self and align-content
|
strong |
An avatar's size, as a class: 16 px (xs), 20 px (sm), 24 px (md, the default) or 32 px (lg)
|
strong |
Whether a theme is light or dark, and what the system asks for (Unknown when it doesn't say)
|
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
|
strong |
Flex direction: the axis children are laid out along
|
strong |
|
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)
|
strong |
How an element of an icon is painted, in the icon's color
|
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.
|
strong |
Main axis distribution, CSS's justify-content
|
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
|
strong |
|
strong |
Orientation of sliders and scroll bars
|
strong |
Where a popup lines up along its anchor's side: its start (left or top), center or end
|
strong |
Identifies a style property, for the operations on several at once (masks, Style::has)
|
strong |
The side of its anchor a popup goes on
|
strong |
The order a DataGrid's rows are sorted in by a column; None is the order they were added in
|
strong |
Text (and layout) direction, CSS's direction
|
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
|
strong |
What kind of news a toast brings: its icon's tile and color
|
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).
Give a div the class of a tone, removing the others'
|
constexpr |
A color from 0xAARRGGBB, alpha first like Skia
| 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
|
constexpr |
Whether an edit changed anything of what is asked (has(edit, Edit::Text))
|
constexpr |
Percent of the parent, 0-100 like CSS: width(50_pct)
|
constexpr |
Pixels, for when it reads better than a plain number: width(24_px)
| 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.
| std::string_view psychic_ui::propertyName | ( | Property | property | ) |
The property's name, as in the setters
|
constexpr |
An opaque color from 0xRRGGBB
|
constexpr |
An opaque color from its components
|
constexpr |
The class a component has for its tone: "neutral", "accent", "success", "warning" or "danger"
|
inlineconstexpr |
Every property, in declaration order
|
inlineconstexpr |
Properties a transition can blend
|
inlineconstexpr |
The auto length: width(Auto), margin(Auto)
|
inlineconstexpr |
Properties a Div takes from its parent when nothing sets them
|
inlineconstexpr |
Properties Yoga reads: changing one of them means a new layout
|
inlineconstexpr |
Properties that only change how a Div is painted