Make property conneciton binding in the C++

(somehow plus/minus is not working yet)
This commit is contained in:
Olivier Goffart 2020-05-28 14:52:11 +02:00
parent e227f8a46e
commit 74898a1386
4 changed files with 21 additions and 15 deletions

View file

@ -20,7 +20,7 @@ struct Property
void set(const T &value) const { this->value = value; }
const T &get(internal::EvaluationContext *context) const
const T &get(const internal::EvaluationContext *context) const
{
internal::sixtyfps_property_update(&inner, context, &value);
return value;
@ -31,8 +31,8 @@ struct Property
{
internal::sixtyfps_property_set_binding(
&inner,
[](void *user_data, const void *value) {
*reinterpret_cast<T *>(value) = (*reinterpret_cast<F *>(user_data))();
[](void *user_data, const internal::EvaluationContext *context, void *value) {
*reinterpret_cast<T *>(value) = (*reinterpret_cast<F *>(user_data))(context);
},
new F(binding),
[](void *user_data) { delete reinterpret_cast<F *>(user_data); });