pub struct XConnection {
    pub xlib: Xlib,
    pub xrandr: Xrandr_2_2_0,
    pub xrandr_1_5: Option<Xrandr>,
    pub xcursor: Xcursor,
    pub xinput2: XInput2,
    pub xlib_xcb: Xlib_xcb,
    pub xrender: Xrender,
    pub display: *mut _XDisplay,
    pub x11_fd: i32,
    pub latest_error: Mutex<RawMutex, Option<XError>>,
    pub cursor_cache: Mutex<RawMutex, HashMap<Option<CursorIcon>, u64, RandomState>>,
}
Expand description

A connection to an X server.

Fields§

§xlib: Xlib§xrandr: Xrandr_2_2_0

Exposes XRandR functions from version < 1.5

§xrandr_1_5: Option<Xrandr>

Exposes XRandR functions from version = 1.5

§xcursor: Xcursor§xinput2: XInput2§xlib_xcb: Xlib_xcb§xrender: Xrender§display: *mut _XDisplay§x11_fd: i32§latest_error: Mutex<RawMutex, Option<XError>>§cursor_cache: Mutex<RawMutex, HashMap<Option<CursorIcon>, u64, RandomState>>

Implementations§

source§

impl XConnection

source§

impl XConnection

source

pub fn get_atom<T>(&self, name: T) -> u64where T: AsRef<CStr> + Debug,

source

pub unsafe fn get_atom_unchecked(&self, name: &[u8]) -> u64

source

pub unsafe fn get_atoms( &self, names: &[*mut i8] ) -> Result<Vec<u64, Global>, XError>

source§

impl XConnection

source

pub fn send_event<T>( &self, target_window: u64, event_mask: Option<i64>, event: T ) -> Flusher<'_>where T: Into<XEvent>,

source

pub fn send_client_msg( &self, window: u64, target_window: u64, message_type: u64, event_mask: Option<i64>, data: [i64; 5] ) -> Flusher<'_>

source§

impl XConnection

source

pub fn set_cursor_icon(&self, window: u64, cursor: Option<CursorIcon>)

source§

impl XConnection

source

pub fn translate_coords( &self, window: u64, root: u64 ) -> Result<TranslatedCoords, XError>

source

pub fn get_geometry(&self, window: u64) -> Result<Geometry, XError>

source

pub fn is_top_level(&self, window: u64, root: u64) -> Option<bool>

source

pub fn get_frame_extents_heuristic( &self, window: u64, root: u64 ) -> FrameExtentsHeuristic

source§

impl XConnection

source

pub fn get_wm_hints( &self, window: u64 ) -> Result<XSmartPointer<'_, XWMHints>, XError>

source

pub fn set_wm_hints( &self, window: u64, wm_hints: XSmartPointer<'_, XWMHints> ) -> Flusher<'_>

source

pub fn get_normal_hints(&self, window: u64) -> Result<NormalHints<'_>, XError>

source

pub fn set_normal_hints( &self, window: u64, normal_hints: NormalHints<'_> ) -> Flusher<'_>

source

pub fn get_motif_hints(&self, window: u64) -> MotifHints

source

pub fn set_motif_hints(&self, window: u64, hints: &MotifHints) -> Flusher<'_>

source§

impl XConnection

source

pub fn select_xinput_events( &self, window: u64, device_id: i32, mask: i32 ) -> Flusher<'_>

source

pub fn select_xkb_events( &self, device_id: u32, mask: u64 ) -> Option<Flusher<'_>>

source

pub fn query_pointer( &self, window: u64, device_id: i32 ) -> Result<PointerState<'_>, XError>

source

pub fn lookup_utf8(&self, ic: *mut _XIC, key_event: &mut XKeyEvent) -> String

source§

impl XConnection

source

pub fn keycode_to_keysym(&self, keycode: u8) -> u64

source

pub fn lookup_keysym(&self, xkev: &mut XKeyEvent) -> u64

source

pub fn query_keymap(&self) -> Keymap

source§

impl XConnection

source§

impl XConnection

source

pub unsafe fn get_xft_dpi(&self) -> Option<f64>

source

pub unsafe fn get_output_info( &self, resources: *mut XRRScreenResources, crtc: *mut XRRCrtcInfo ) -> Option<(String, f64, Vec<VideoMode, Global>)>

source

pub fn set_crtc_config(&self, crtc_id: u64, mode_id: u64) -> Result<(), ()>

source

pub fn get_crtc_mode(&self, crtc_id: u64) -> u64

source§

impl XConnection

source

pub fn get_property<T>( &self, window: u64, property: u64, property_type: u64 ) -> Result<Vec<T, Global>, GetPropertyError>where T: Formattable,

source

pub fn change_property<T, 'a>( &'a self, window: u64, property: u64, property_type: u64, mode: PropMode, new_value: &[T] ) -> Flusher<'a>where T: Formattable,

source§

impl XConnection

source

pub fn update_cached_wm_info(&self, root: u64)

source§

impl XConnection

source§

impl XConnection

source

pub fn new( error_handler: Option<unsafe extern "C" fn(_: *mut _XDisplay, _: *mut XErrorEvent) -> i32> ) -> Result<XConnection, XNotSupported>

source

pub fn check_errors(&self) -> Result<(), XError>

Checks whether an error has been triggered by the previous function calls.

source

pub fn ignore_error(&self)

Ignores any previous error.

Trait Implementations§

source§

impl Debug for XConnection

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Drop for XConnection

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Send for XConnection

source§

impl Sync for XConnection

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.