Avoid using cbindgen_private in generated C++ code

Instead, pull in the types manually.
This commit is contained in:
Simon Hausmann 2020-08-25 15:35:24 +02:00
parent 697aa61a0c
commit 9dd6101494
2 changed files with 4 additions and 2 deletions

View file

@ -39,6 +39,7 @@ extern const cbindgen_private::ItemVTable WindowVTable;
// Bring opaque structure in scope
using cbindgen_private::ComponentVTable;
using cbindgen_private::ItemVTable;
using ItemTreeNode = cbindgen_private::ItemTreeNode<uint8_t>;
using ComponentRef = VRef<ComponentVTable>;
using ItemVisitorRefMut = VRefMut<cbindgen_private::ItemVisitorVTable>;
@ -47,6 +48,7 @@ using cbindgen_private::EasingCurve;
using cbindgen_private::TextHorizontalAlignment;
using cbindgen_private::TextVerticalAlignment;
using cbindgen_private::Slice;
using cbindgen_private::PropertyAnimation;
struct ComponentWindow
{

View file

@ -251,7 +251,7 @@ fn property_animation_code(
) -> Option<String> {
if let Some(animation) = element.property_animations.get(property_name) {
Some(new_struct_with_bindings(
"sixtyfps::cbindgen_private::PropertyAnimation",
"sixtyfps::PropertyAnimation",
&animation.borrow().bindings,
component,
))
@ -658,7 +658,7 @@ fn generate_component(
Access::Public,
Declaration::Function(Function {
name: "root_item".into(),
signature: "() -> VRef<sixtyfps::cbindgen_private::ItemVTable>".into(),
signature: "() -> VRef<sixtyfps::ItemVTable>".into(),
statements: Some(vec![format!(
"return {{ &sixtyfps::{vt}, &this->{id} }};",
vt = root_elem.base_type.as_native().vtable_symbol,