This commit is contained in:
Olivier Goffart 2020-05-28 17:11:05 +02:00
parent dc276290e9
commit 619e21295d
4 changed files with 26 additions and 33 deletions

View file

@ -18,7 +18,8 @@ struct Property
set(value);
}*/
void set(const T &value) const {
void set(const T &value) const
{
this->value = value;
internal::sixtyfps_property_set_changed(&inner);
}
@ -37,8 +38,7 @@ struct Property
[](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); });
new F(binding), [](void *user_data) { delete reinterpret_cast<F *>(user_data); });
}
private:

View file

@ -1,14 +1,17 @@
#pragma once
template<typename T>
struct VRefMut {
struct VRefMut
{
const T *vtable;
void *instance;
};
// For the C++'s purpose, they are all the same
template<typename T> using VRef = VRefMut<T>;
template<typename T> using VBox = VRefMut<T>;
template<typename T>
using VRef = VRefMut<T>;
template<typename T>
using VBox = VRefMut<T>;
/*
template<typename T>
@ -23,4 +26,3 @@ struct VRef {
const void *instance;
};
*/