| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
use glib::translate::*; |
| 7 |
|
| 8 |
use crate::{Cicp, MemoryFormat, ffi}; |
| 9 |
|
| 10 |
glib::wrapper! { |
| 11 |
#[doc(alias = "GlyFrame")] |
| 12 |
pub struct Frame(Object<ffi::GlyFrame, ffi::GlyFrameClass>); |
| 13 |
|
| 14 |
match fn { |
| 15 |
type_ => || ffi::gly_frame_get_type(), |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
impl Frame { |
| 20 |
#[doc(alias = "gly_frame_get_buf_bytes")] |
| 21 |
#[doc(alias = "get_buf_bytes")] |
| 22 |
pub fn buf_bytes(&self) -> glib::Bytes { |
| 23 |
unsafe { from_glib_none(ffi::gly_frame_get_buf_bytes(self.to_glib_none().0)) } |
| 24 |
} |
| 25 |
|
| 26 |
#[doc(alias = "gly_frame_get_color_cicp")] |
| 27 |
#[doc(alias = "get_color_cicp")] |
| 28 |
pub fn color_cicp(&self) -> Option<Cicp> { |
| 29 |
unsafe { from_glib_full(ffi::gly_frame_get_color_cicp(self.to_glib_none().0)) } |
| 30 |
} |
| 31 |
|
| 32 |
#[doc(alias = "gly_frame_get_delay")] |
| 33 |
#[doc(alias = "get_delay")] |
| 34 |
pub fn delay(&self) -> i64 { |
| 35 |
unsafe { ffi::gly_frame_get_delay(self.to_glib_none().0) } |
| 36 |
} |
| 37 |
|
| 38 |
#[doc(alias = "gly_frame_get_height")] |
| 39 |
#[doc(alias = "get_height")] |
| 40 |
pub fn height(&self) -> u32 { |
| 41 |
unsafe { ffi::gly_frame_get_height(self.to_glib_none().0) } |
| 42 |
} |
| 43 |
|
| 44 |
#[doc(alias = "gly_frame_get_memory_format")] |
| 45 |
#[doc(alias = "get_memory_format")] |
| 46 |
pub fn memory_format(&self) -> MemoryFormat { |
| 47 |
unsafe { from_glib(ffi::gly_frame_get_memory_format(self.to_glib_none().0)) } |
| 48 |
} |
| 49 |
|
| 50 |
#[doc(alias = "gly_frame_get_stride")] |
| 51 |
#[doc(alias = "get_stride")] |
| 52 |
pub fn stride(&self) -> u32 { |
| 53 |
unsafe { ffi::gly_frame_get_stride(self.to_glib_none().0) } |
| 54 |
} |
| 55 |
|
| 56 |
#[doc(alias = "gly_frame_get_width")] |
| 57 |
#[doc(alias = "get_width")] |
| 58 |
pub fn width(&self) -> u32 { |
| 59 |
unsafe { ffi::gly_frame_get_width(self.to_glib_none().0) } |
| 60 |
} |
| 61 |
} |
| 62 |
|
| 63 |
unsafe impl Send for Frame {} |
| 64 |
unsafe impl Sync for Frame {} |