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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
use crate::Matrix;
use glib::translate::*;
use std::boxed::Box as Box_;
glib_wrapper! {
#[derive(Debug, PartialOrd, Ord)]
pub struct Euler(Boxed<ffi::CoglEuler>);
match fn {
copy => |ptr| ffi::cogl_euler_copy(mut_override(ptr)),
free => |ptr| ffi::cogl_euler_free(ptr),
get_type => || ffi::cogl_euler_get_gtype(),
}
}
impl Euler {
pub fn init(&mut self, heading: f32, pitch: f32, roll: f32) {
unsafe {
ffi::cogl_euler_init(self.to_glib_none_mut().0, heading, pitch, roll);
}
}
pub fn init_from_matrix(&mut self, matrix: &Matrix) {
unsafe {
ffi::cogl_euler_init_from_matrix(self.to_glib_none_mut().0, matrix.to_glib_none().0);
}
}
fn equal(v1: &Self, v2: &Self) -> bool {
let a = Box_::into_raw(Box::new(v1)) as *mut _;
let b = Box_::into_raw(Box::new(v2)) as *mut _;
unsafe { ffi::cogl_euler_equal(a, b) == crate::TRUE }
}
}
impl PartialEq for Euler {
#[inline]
fn eq(&self, other: &Self) -> bool {
Euler::equal(self, other)
}
}
impl Eq for Euler {}