pub fn from_descriptor(descriptor: &NativeGraphicsMetadataDescriptor)
                           -> NativeGraphicsMetadata {
        // WARNING: We currently rely on the X display connection being the
        // same in both the Painting and Compositing contexts, as otherwise
        // the X Pixmap will not be sharable across them. Using this
        // method breaks that assumption.
        unsafe {
            let c_str = CString::new(descriptor.display.as_bytes()).unwrap();
            let display = XOpenDisplay(c_str.as_ptr() as *mut _);
            if display.is_null() {
                panic!("XOpenDisplay() failed!");
            }
            NativeGraphicsMetadata {
                display: display,
            }
        }
    }
/// Creates graphics metadata from a metadata descriptor.
Creates graphics metadata from a metadata descriptor.
Creates graphics metadata from a metadata descriptor .
pub fn from_descriptor(descriptor: &NativeGraphicsMetadataDescriptor)
                           -> NativeGraphicsMetadata {
        // WARNING: We currently rely on the X display connection being the
        // same in both the Painting and Compositing contexts, as otherwise
        // the X Pixmap will not be sharable across them. Using this
        // method breaks that assumption.
        unsafe {
            let c_str = CString::new(descriptor.display.as_bytes()).unwrap();
            let display = XOpenDisplay(c_str.as_ptr() as *mut _);
            if display.is_null() {
                panic!("XOpenDisplay() failed!");
            }
            NativeGraphicsMetadata {
                display: display,
            }
        }
    }
pub fn from_descriptor ( descriptor : & NativeGraphicsMetadataDescriptor ) -> NativeGraphicsMetadata { // WARNING: We currently rely on the X display connection being the // same in both the Painting and Compositing contexts, as otherwise // the X Pixmap will not be sharable across them. Using this // method breaks that assumption. unsafe { let c_str = CString :: new ( descriptor . display . as_bytes ( ) ) . unwrap ( ) ; let display = XOpenDisplay ( c_str . as_ptr ( ) as * mut _ ) ; if display . is_null ( ) { panic ! ( " " ) ; } NativeGraphicsMetadata { display : display , } } }
Creates graphics metadata from a metadata descriptor.
Creates graphics metadata from a metadata descriptor .
descriptor
&NativeGraphicsMetadataDescriptor
descriptor
&NativeGraphicsMetadataDescriptor