gvnc 0.3.0

Rust bindings for the GVnc library
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::slice;

use glib::translate::*;

use crate::Cursor;

impl Cursor {
    #[doc(alias = "vnc_cursor_get_data")]
    pub fn data(&self) -> &[u8] {
        let len = self.width() * self.height() * 4;
        unsafe {
            slice::from_raw_parts(ffi::vnc_cursor_get_data(self.to_glib_none().0), len.into())
        }
    }
}