Skip to content

Commit

Permalink
Add SvgSimpleNode to API
Browse files Browse the repository at this point in the history
  • Loading branch information
fschutt committed Sep 15, 2023
1 parent e0039db commit d185e6e
Show file tree
Hide file tree
Showing 8 changed files with 525 additions and 6 deletions.
38 changes: 38 additions & 0 deletions api.json
Original file line number Diff line number Diff line change
Expand Up @@ -11952,6 +11952,7 @@
"enum_fields": [
{"MultiPolygonCollection": {"type": "SvgMultiPolygonVec"}},
{"MultiPolygon": {"type": "SvgMultiPolygon"}},
{"MultiShape": {"type": "SvgSimpleNodeVec"}},
{"Path": {"type": "SvgPath"}},
{"Circle": {"type": "SvgCircle"}},
{"Rect": {"type": "SvgRect"}}
Expand Down Expand Up @@ -12001,6 +12002,16 @@
}
}
},
"SvgSimpleNode": {
"external": "azul_impl::svg::SvgSimpleNode",
"enum_fields": [
{"Path": {"type": "SvgPath"}},
{"Circle": {"type": "SvgCircle"}},
{"Rect": {"type": "SvgRect"}},
{"CircleHole": {"type": "SvgCircle"}},
{"RectHole": {"type": "SvgRect"}}
]
},
"SvgStyledNode": {
"external": "azul_impl::svg::SvgStyledNode",
"struct_fields": [
Expand Down Expand Up @@ -14021,6 +14032,17 @@
{ "destructor": { "type": "SvgMultiPolygonVecDestructor" } }
]
},
"SvgSimpleNodeVec": {
"doc": "Wrapper over a Rust-allocated `Vec<SvgSimpleNode>`",
"custom_destructor": true,
"external": "azul_impl::svg::SvgSimpleNodeVec",
"struct_fields": [
{ "ptr": { "type": "*const SvgSimpleNode" } },
{ "len": { "type": "usize" } },
{ "cap": { "type": "usize" } },
{ "destructor": { "type": "SvgSimpleNodeVecDestructor" } }
]
},
"SvgPathVec": {
"doc": "Wrapper over a Rust-allocated `Vec<SvgPath>`",
"custom_destructor": true,
Expand Down Expand Up @@ -14916,6 +14938,22 @@
]
}
},
"SvgSimpleNodeVecDestructor": {
"external": "azul_impl::svg::SvgSimpleNodeVecDestructor",
"derive": ["Copy"],
"enum_fields": [
{"DefaultRust": {}},
{"NoDestructor": {}},
{"External": {"type": "SvgSimpleNodeVecDestructorType"}}
]
},
"SvgSimpleNodeVecDestructorType": {
"callback_typedef": {
"fn_args": [
{"type": "SvgSimpleNodeVec", "ref": "refmut"}
]
}
},
"SvgPathVecDestructor": {
"external": "azul_impl::svg::SvgPathVecDestructor",
"derive": ["Copy"],
Expand Down
1 change: 1 addition & 0 deletions api/_patches/azul-dll/test-sizes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@
impl ::core::fmt::Debug for AzTagIdToNodeIdMappingVecDestructor { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { use AzTagIdToNodeIdMappingVecDestructor::*; match self { DefaultRust => write!(f, "DefaultRust"), NoDestructor => write!(f, "NoDestructor"), External(_) => write!(f, "External"), }}}
impl ::core::fmt::Debug for AzParentWithNodeDepthVecDestructor { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { use AzParentWithNodeDepthVecDestructor::*; match self { DefaultRust => write!(f, "DefaultRust"), NoDestructor => write!(f, "NoDestructor"), External(_) => write!(f, "External"), }}}
impl ::core::fmt::Debug for AzNodeDataVecDestructor { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { use AzNodeDataVecDestructor::*; match self { DefaultRust => write!(f, "DefaultRust"), NoDestructor => write!(f, "NoDestructor"), External(_) => write!(f, "External"), }}}
impl ::core::fmt::Debug for AzSvgSimpleNodeVecDestructor { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { use AzSvgSimpleNodeVecDestructor::*; match self { DefaultRust => write!(f, "DefaultRust"), NoDestructor => write!(f, "NoDestructor"), External(_) => write!(f, "External"), }}}
}
5 changes: 2 additions & 3 deletions api/_patches/azul.rs/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,13 @@
impl_vec_clone!(AzStyleFilter, AzStyleFilterVec, AzStyleFilterVecDestructor);
impl_vec!(AzListViewRow, AzListViewRowVec, AzListViewRowVecDestructor, az_list_view_vec_destructor, AzListViewRowVec_delete);
impl_vec_clone!(AzListViewRow, AzListViewRowVec, AzListViewRowVecDestructor);

impl_vec!(AzAccessibilityState, AzAccessibilityStateVec, AzAccessibilityStateVecDestructor, az_accessibility_state_vec_destructor, AzAccessibilityStateVec_delete);
impl_vec_clone!(AzAccessibilityState, AzAccessibilityStateVec, AzAccessibilityStateVecDestructor);

impl_vec!(AzMenuItem, AzMenuItemVec, AzMenuItemVecDestructor, az_menu_item_vec_destructor, AzMenuItemVec_delete);
impl_vec_clone!(AzMenuItem, AzMenuItemVec, AzMenuItemVecDestructor);
impl_vec!(AzSvgSimpleNode, AzSvgSimpleNodeVec, AzSvgSimpleNodeVecDestructor, az_svg_simple_node_vec_destructor, AzSvgSimpleNodeVec_delete);
impl_vec_clone!(AzSvgSimpleNode, AzSvgSimpleNodeVec, AzSvgSimpleNodeVecDestructor);


impl From<vec::Vec<string::String>> for crate::vec::StringVec {
fn from(v: vec::Vec<string::String>) -> crate::vec::StringVec {
let vec: Vec<AzString> = v.into_iter().map(Into::into).collect();
Expand Down
Loading

0 comments on commit d185e6e

Please sign in to comment.