cogl/
vertex_p3c4.rs

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