animate/legacy/
path_node.rs

1use glib::translate::*;
2use std::mem;
3
4glib_wrapper! {
5    #[derive(Debug, PartialOrd, Ord)] // Hash
6    pub struct PathNode(Boxed<ffi::ClutterPathNode>);
7
8    match fn {
9        copy => |ptr| ffi::clutter_path_node_copy(mut_override(ptr)),
10        free => |ptr| ffi::clutter_path_node_free(ptr),
11        get_type => || ffi::clutter_path_node_get_type(),
12    }
13}
14
15impl PathNode {
16    /// Compares two nodes and checks if they are the same type with the
17    /// same coordinates.
18    /// ## `node_b`
19    /// Second node
20    ///
21    /// # Returns
22    ///
23    /// `true` if the nodes are the same.
24    fn equal(&self, node_b: &PathNode) -> bool {
25        unsafe {
26            from_glib(ffi::clutter_path_node_equal(
27                self.to_glib_none().0,
28                node_b.to_glib_none().0,
29            ))
30        }
31    }
32}
33
34impl PartialEq for PathNode {
35    #[inline]
36    fn eq(&self, other: &Self) -> bool {
37        self.equal(other)
38    }
39}
40
41impl Eq for PathNode {}
42
43#[doc(hidden)]
44impl Uninitialized for PathNode {
45    #[inline]
46    unsafe fn uninitialized() -> Self {
47        mem::zeroed()
48    }
49}