clutter/auto/
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
41#[doc(hidden)]
42impl Uninitialized for PathNode {
43    #[inline]
44    unsafe fn uninitialized() -> Self {
45        mem::zeroed()
46    }
47}
48
49impl Eq for PathNode {}