Add C++ API for ComponentDefinition::properties()

This commit is contained in:
Simon Hausmann 2021-03-30 14:44:24 +02:00
parent 342f77139b
commit 70653ec7cd
3 changed files with 47 additions and 0 deletions

View file

@ -580,6 +580,8 @@ public:
}
};
using PropertyDescriptor = sixtyfps::cbindgen_private::PropertyDescriptor;
/// ComponentDefinition is a representation of a compiled component from .60 markup.
///
/// It can be constructed from a .60 file using the ComponentCompiler::build_from_path() or
@ -632,6 +634,16 @@ public:
cbindgen_private::sixtyfps_interpreter_component_instance_create(&inner, &u.i);
return u.result;
}
/// Returns a vector of that contains PropertyDescriptor instances that describe the list of
/// public properties that can be read and written using ComponentInstance::set_property and
/// ComponentInstance::get_property.
sixtyfps::SharedVector<PropertyDescriptor> properties() const
{
sixtyfps::SharedVector<PropertyDescriptor> props;
cbindgen_private::sixtyfps_interpreter_component_definition_properties(&inner, &props);
return props;
}
};
using Diagnostic = sixtyfps::cbindgen_private::CDiagnostic;