mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Rename PropertyListenerScope to PropertyTracker
This commit is contained in:
parent
8a14e15233
commit
b21aa4f9e7
9 changed files with 43 additions and 48 deletions
|
@ -103,20 +103,20 @@ void Property<float>::set_animated_binding(F binding,
|
|||
&animation_data);
|
||||
}
|
||||
|
||||
struct PropertyListenerScope
|
||||
struct PropertyTracker
|
||||
{
|
||||
PropertyListenerScope() { internal::sixtyfps_property_listener_scope_init(&inner); }
|
||||
~PropertyListenerScope() { internal::sixtyfps_property_listener_scope_drop(&inner); }
|
||||
PropertyListenerScope(const PropertyListenerScope &) = delete;
|
||||
PropertyListenerScope &operator=(const PropertyListenerScope &) = delete;
|
||||
PropertyTracker() { internal::sixtyfps_property_tracker_init(&inner); }
|
||||
~PropertyTracker() { internal::sixtyfps_property_tracker_drop(&inner); }
|
||||
PropertyTracker(const PropertyTracker &) = delete;
|
||||
PropertyTracker &operator=(const PropertyTracker &) = delete;
|
||||
|
||||
bool is_dirty() const {
|
||||
return internal::sixtyfps_property_listener_scope_is_dirty(&inner);
|
||||
return internal::sixtyfps_property_tracker_is_dirty(&inner);
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
void evaluate(const F &f) const {
|
||||
internal::sixtyfps_property_listener_scope_evaluate(
|
||||
internal::sixtyfps_property_tracker_evaluate(
|
||||
&inner,
|
||||
[](void *f){ (*reinterpret_cast<const F*>(f))(); },
|
||||
const_cast<F*>(&f)
|
||||
|
@ -124,7 +124,7 @@ struct PropertyListenerScope
|
|||
}
|
||||
|
||||
private:
|
||||
internal::PropertyListenerOpaque inner;
|
||||
internal::PropertyTrackerOpaque inner;
|
||||
};
|
||||
|
||||
} // namespace sixtyfps
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue