CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
UIAppearance.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "Forward.hpp"
12
13#include "UIUtility.hpp"
14
16
22
25
26namespace CeresEngine {
27
79
82
85
88
91
120
125
128
131
132 extern template void UIAppearance::set(const UIAppearanceProperty<double>& property, const double& value);
134
137
138} // namespace CeresEngine
#define CE_ASSERT(...)
Definition Macros.hpp:323
Definition Optional.hpp:17
A class that encapsulates a 2D paint object.
Definition Shape.hpp:27
A simple reference counter base class.
Definition SmartPtr.hpp:438
An object that describes the appearance of a UI view.
Definition UIAppearance.hpp:93
HashMap< String, PropertyVariant > mProperties
Definition UIAppearance.hpp:96
Optional< const T & > get(const UIAppearanceProperty< T > &property) const
Tries to find an override for the given appearance property.
void set(const UIAppearanceProperty< T > &property, const T &value)
Sets a new property override on the appearance.
The infrastructure for drawing and handling events in a UI.
Definition UIView.hpp:153
Definition Application.hpp:19
Color UIColor
Definition UIUtility.hpp:187
auto move(Vector3 position)
Moves a entity to the given position.
Definition Helpers.hpp:22
std::unordered_map< Key, T, Hash, KeyEqual, ScopedAllocatorAdaptor< StdAllocator< Pair< const Key, T >, RawAllocator > > > HashMap
HashMap is an associative container that contains key-value pairs with unique keys.
Definition Map.hpp:33
FunctionBase< true, false, fu2::capacity_default, true, false, Signatures... > UniqueFunction
An owning non copyable function wrapper for arbitrary callable types.
Definition Function.hpp:59
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition Span.hpp:668
A UI appearance property that returns a color.
Definition UIAppearance.hpp:30
UniqueFunction< T(const UIView &) const > DefaultValueFunction
A function that computes a default value.
Definition UIAppearance.hpp:32
UIAppearanceProperty(const StringView &name, DefaultValueFunction &&defaultValueFunction)
Creates a new UIAppearanceProperty by using a computation function.
Definition UIAppearance.hpp:54
T operator[](const UIView *const aView) const noexcept
Definition UIAppearance.hpp:74
UIAppearanceProperty(const StringView &name, const UIAppearanceProperty &aliasedProperty)
Creates a new UIAppearanceProperty by aliasing another property.
Definition UIAppearance.hpp:60
DefaultValueVariant defaultValue
The properties default value, to be used in case the appearance don't offer a custom value.
Definition UIAppearance.hpp:43
StringView name
A name for the appearance property.
Definition UIAppearance.hpp:39
T getDefaultValue(const UIView &aView) const noexcept
Gets the default value for the property.
UIAppearanceProperty(const StringView &name, const T &defaultValue=T())
Creates a new UIAppearanceProperty.
Definition UIAppearance.hpp:48
T operator[](const UIView &view) const noexcept
Computes the appearance property value for the given view.