1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT

use crate::ffi;
use glib::translate::*;

glib::wrapper! {
    /// the contents of a [`GLDisplayX11`][crate::GLDisplayX11] are private and should only be accessed
    /// through the provided API
    ///
    /// # Implements
    ///
    /// [`trait@gst_gl::prelude::GLDisplayExt`], [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`]
    #[doc(alias = "GstGLDisplayX11")]
    pub struct GLDisplayX11(Object<ffi::GstGLDisplayX11, ffi::GstGLDisplayX11Class>) @extends gst_gl::GLDisplay, gst::Object;

    match fn {
        type_ => || ffi::gst_gl_display_x11_get_type(),
    }
}

impl GLDisplayX11 {
    pub const NONE: Option<&'static GLDisplayX11> = None;

    /// Create a new [`GLDisplayX11`][crate::GLDisplayX11] from the x11 display name. See `XOpenDisplay`()
    /// for details on what is a valid name.
    /// ## `name`
    /// a display name
    ///
    /// # Returns
    ///
    /// a new [`GLDisplayX11`][crate::GLDisplayX11] or [`None`]
    #[doc(alias = "gst_gl_display_x11_new")]
    pub fn new(name: Option<&str>) -> Result<GLDisplayX11, glib::BoolError> {
        assert_initialized_main_thread!();
        unsafe {
            Option::<_>::from_glib_full(ffi::gst_gl_display_x11_new(name.to_glib_none().0))
                .ok_or_else(|| glib::bool_error!("Failed to create X11 display"))
        }
    }

    //#[doc(alias = "gst_gl_display_x11_new_with_display")]
    //#[doc(alias = "new_with_display")]
    //pub fn with_display(display: /*Unimplemented*/Basic: Pointer) -> GLDisplayX11 {
    //    unsafe { TODO: call ffi:gst_gl_display_x11_new_with_display() }
    //}
}

unsafe impl Send for GLDisplayX11 {}
unsafe impl Sync for GLDisplayX11 {}