Skip to main content

Display

Struct Display 

Source
pub struct Display { /* private fields */ }
Expand description

Handler for an X11 connection.

Implementations§

Source§

impl Display

Source

pub fn open() -> Result<Self>

Opens connection to X11 display.

Source

pub fn from_xcb(conn: Connection, screen_num: i32) -> Result<Self>

Constructs the object from existing XCB connection.

Source

pub fn into_xcb(self) -> (Connection, i32)

Consumes the object and returns the underlying XCB connection. Returns a (conn, screen_num) pair just as xcb::Connection::connect.

Source

pub fn conn(&self) -> &Connection

Returns reference to the XCB connection.

Source

pub fn default_screen_num(&self) -> i32

Returns the default screen number.

Source

pub fn default_screen(&self) -> Result<&Screen, BadScreenNumber>

Returns the default screen.

Source

pub fn monitors(&self) -> Result<Vec<Monitor>>

Returns list of active monitors.

Uses RandR extensions to query the dimensions of the monitors. Requires RandR extension version 1.5 or newer to work.

Source

pub fn root_pixmap(&self) -> Result<RootPixmap<'_>>

Returns a representation of the root window’s background pixmap.

The object can be used to draw on the pixmap before finally setting it as the root window’s pixmap. It’s dimensions and depth matches the default screen’s.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.