cogl/
vertex_p3t2c4.rs

1use glib::translate::*;
2use std::mem;
3
4#[repr(C)]
5#[derive(Clone, Copy, Debug, PartialEq)]
6pub struct VertexP3T2C4 {
7    pub x: f32,
8    pub y: f32,
9    pub z: f32,
10    pub s: f32,
11    pub t: f32,
12    pub r: u8,
13    pub g: u8,
14    pub b: u8,
15    pub a: u8,
16}
17
18#[doc(hidden)]
19impl Uninitialized for VertexP3T2C4 {
20    #[inline]
21    unsafe fn uninitialized() -> Self {
22        mem::zeroed()
23    }
24}
25
26#[doc(hidden)]
27impl<'a> ToGlibPtr<'a, *const ffi::CoglVertexP3T2C4> for VertexP3T2C4 {
28    type Storage = &'a Self;
29
30    #[inline]
31    fn to_glib_none(&'a self) -> Stash<'a, *const ffi::CoglVertexP3T2C4, Self> {
32        let ptr: *const VertexP3T2C4 = &*self;
33        Stash(ptr as *const ffi::CoglVertexP3T2C4, self)
34    }
35}
36
37#[doc(hidden)]
38impl<'a> ToGlibPtrMut<'a, *mut ffi::CoglVertexP3T2C4> for VertexP3T2C4 {
39    type Storage = &'a mut Self;
40
41    #[inline]
42    fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut ffi::CoglVertexP3T2C4, Self> {
43        let ptr: *mut VertexP3T2C4 = &mut *self;
44        StashMut(ptr as *mut ffi::CoglVertexP3T2C4, self)
45    }
46}
47
48#[doc(hidden)]
49impl FromGlibPtrNone<*const ffi::CoglVertexP3T2C4> for VertexP3T2C4 {
50    unsafe fn from_glib_none(ptr: *const ffi::CoglVertexP3T2C4) -> Self {
51        *(ptr as *const VertexP3T2C4)
52    }
53}
54
55#[doc(hidden)]
56impl FromGlibPtrNone<*mut ffi::CoglVertexP3T2C4> for VertexP3T2C4 {
57    unsafe fn from_glib_none(ptr: *mut ffi::CoglVertexP3T2C4) -> Self {
58        *(ptr as *mut VertexP3T2C4)
59    }
60}
61
62#[doc(hidden)]
63impl FromGlibPtrBorrow<*mut ffi::CoglVertexP3T2C4> for VertexP3T2C4 {
64    unsafe fn from_glib_borrow(ptr: *mut ffi::CoglVertexP3T2C4) -> glib::translate::Borrowed<Self> {
65        glib::translate::Borrowed::new(*(ptr as *mut VertexP3T2C4))
66    }
67}
68
69#[doc(hidden)]
70impl FromGlibPtrBorrow<*const ffi::CoglVertexP3T2C4> for VertexP3T2C4 {
71    unsafe fn from_glib_borrow(
72        ptr: *const ffi::CoglVertexP3T2C4,
73    ) -> glib::translate::Borrowed<Self> {
74        glib::translate::Borrowed::new(*(ptr as *const VertexP3T2C4))
75    }
76}