36 template <
typename R,
typename... Args>
38 template <
typename R,
class C,
typename... Args>
41 typedef R(
C::* callable_type)(Args...) const;
45 template <
typename R,
class C,
typename... Args>
48 typedef R(
C::* callable_type)(Args...);
92 virtual const void*
data()
const = 0;
112 template <
typename,
typename>
135 virtual const std::type_info&
type()
const = 0;
136 virtual const std::type_info&
category()
const = 0;
155 virtual const void*
data()
const = 0;
160 template <
typename T>
163 return *
static_cast<const T*
>(
data());
165 template <
typename T>
168 return *
static_cast<T*
>(
data());
170 template <
typename Context,
typename Callable,
typename... Args>
175 if constexpr(std::is_convertible_v<const Context&, const i_property_owner&>)
176 return (
static_cast<const Context&
>(
owner()).*calculator)(std::forward<Args>(aArgs)...);
178 return (
dynamic_cast<const Context&
>(
owner()).*calculator)(std::forward<Args>(aArgs)...);
182 template <
typename T,
typename Getter = std::function<T()>>
189 iSubject{ aSubject }, iProxy{ aProxy }, iGetter{ aGetter }
202 auto const& ov = iGetter();
209 const void*
data()
const override
240 template <
typename PropertyOwner>
243 return *
static_cast<i_property_owner&
>(Owner).properties().property_map().find(
string{ aPropertyName })->second();
250 iProperty{ aProperty }, iWasSuppressed{ aProperty.transition_suppressed() }
267 iProperty{ aProperty }, iWasReadOnly{ aProperty.read_only() }
virtual property_variant get(const i_property &aProperty) const =0
virtual ~i_property_delegate()=default
virtual const void * data() const =0
virtual ~i_property_owner()=default
virtual const i_properties & properties() const =0
virtual void property_changed(i_property &aProperty)=0
virtual i_properties & properties()=0
virtual void set_delegate(i_property_delegate &aDelegate)=0
virtual const std::type_info & category() const =0
virtual const void * data() const =0
virtual const i_string & name() const =0
virtual void suppress_transition(bool aSuppress)=0
virtual i_property_owner & owner() const =0
virtual void set_transition(i_animator &aAnimator, easing aEasingFunction, double aDuration, bool aEnabled=true)=0
virtual ~i_property()=default
virtual const std::type_info & type() const =0
virtual void *const * calculator_function() const =0
virtual bool transition_suppressed() const =0
virtual bool transition_set() const =0
declare_event(property_changed, const property_variant &) declare_event(property_changed_from_to
virtual void set_read_only(bool aReadOnly)=0
virtual void unset_delegate()=0
auto calculate(Args &&... aArgs) const
virtual i_property_delegate & delegate()=0
virtual bool has_delegate() const =0
virtual property_variant get_as_variant() const =0
virtual bool read_only() const =0
virtual void clear_transition()=0
virtual void set_from_variant(const property_variant &aValue)=0
virtual bool optional() const =0
virtual i_transition & transition() const =0
virtual i_property_delegate const & delegate() const =0
property_delegate(i_property &aSubject, i_property &aProxy, Getter aGetter)
i_property const & proxy() const
i_property const & subject() const
const void * data() const override
property_variant get(i_property const &) const override
~scoped_property_read_only()
scoped_property_read_only(i_property &aProperty)
scoped_property_transition_suppression(i_property &aProperty)
~scoped_property_transition_suppression()
basic_box_areas< double > box_areas
i_property & get_property(PropertyOwner &Owner, std::string const &aPropertyName)
basic_point< coordinate > point
basic_size< coordinate > size
ref_ptr< ConcreteType > make_ref(Args &&... args)
#define declare_event(declName,...)
static constexpr bool is_custom_type