1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::{
    c::spAnimation,
    c_interface::{NewFromPtr, SyncPtr},
};

/// Stores timelines for animating a skeleton.
///
/// [Spine API Reference](http://esotericsoftware.com/spine-api-reference#Animation)
#[derive(Debug)]
pub struct Animation {
    c_animation: SyncPtr<spAnimation>,
}

impl NewFromPtr<spAnimation> for Animation {
    unsafe fn new_from_ptr(c_animation: *const spAnimation) -> Self {
        Self {
            c_animation: SyncPtr(c_animation as *mut spAnimation),
        }
    }
}

impl Animation {
    c_accessor_string!(name, name);
    c_accessor!(duration, duration, f32);
    c_ptr!(c_animation, spAnimation);
    // TODO: timeline accessors
}