rusty_spine/
path_attachment.rs1use crate::{
2 c::{c_float, spAttachment, spPathAttachment, spVertexAttachment},
3 c_interface::{NewFromPtr, SyncPtr},
4};
5
6#[derive(Debug)]
10pub struct PathAttachment {
11 c_path_attachment: SyncPtr<spPathAttachment>,
12}
13
14impl NewFromPtr<spPathAttachment> for PathAttachment {
15 unsafe fn new_from_ptr(c_path_attachment: *mut spPathAttachment) -> Self {
16 Self {
17 c_path_attachment: SyncPtr(c_path_attachment),
18 }
19 }
20}
21
22impl PathAttachment {
23 fn attachment(&self) -> &spAttachment {
24 unsafe { &self.c_ptr_ref().super_0.super_0 }
25 }
26
27 fn vertex_attachment(&self) -> &spVertexAttachment {
28 unsafe { &self.c_ptr_ref().super_0 }
29 }
30
31 c_attachment_accessors!();
32 c_vertex_attachment_accessors!();
33 c_accessor_bool_mut!(
34 closed,
36 set_closed,
38 closed
39 );
40 c_accessor_color_mut!(
41 color,
44 color_mut,
45 color
46 );
47 c_accessor_bool_mut!(
48 constant_speed,
51 set_constant_speed,
52 constantSpeed
53 );
54 c_accessor_passthrough!(
56 lengths,
59 lengths,
60 *mut c_float
61 );
62 c_ptr!(c_path_attachment, spPathAttachment);
63}
64
65#[cfg(feature = "mint")]
67impl PathAttachment {
68 c_vertex_attachment_accessors_mint!();
69}