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>, u32, 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>, u32, RandomState>>
Implementations§
source§impl XConnection
impl XConnection
pub fn get_monitor_for_window( &self, window_rect: Option<AaRect> ) -> MonitorHandle
pub fn available_monitors(&self) -> Vec<MonitorHandle, Global>
pub fn primary_monitor(&self) -> MonitorHandle
pub fn select_xrandr_input(&self, root: u32) -> Result<i32, XError>
source§impl XConnection
impl XConnection
source§impl XConnection
impl XConnection
source§impl XConnection
impl XConnection
pub fn set_cursor_icon(&self, window: u32, cursor: Option<CursorIcon>)
source§impl XConnection
impl XConnection
pub fn translate_coords( &self, window: u32, root: u32 ) -> Result<TranslatedCoords, XError>
pub fn get_geometry(&self, window: u32) -> Result<Geometry, XError>
pub fn is_top_level(&self, window: u32, root: u32) -> Option<bool>
pub fn get_frame_extents_heuristic( &self, window: u32, root: u32 ) -> FrameExtentsHeuristic
source§impl XConnection
impl XConnection
pub fn get_wm_hints( &self, window: u32 ) -> Result<XSmartPointer<'_, XWMHints>, XError>
pub fn set_wm_hints( &self, window: u32, wm_hints: XSmartPointer<'_, XWMHints> ) -> Flusher<'_>
pub fn get_normal_hints(&self, window: u32) -> Result<NormalHints<'_>, XError>
pub fn set_normal_hints( &self, window: u32, normal_hints: NormalHints<'_> ) -> Flusher<'_>
pub fn get_motif_hints(&self, window: u32) -> MotifHints
pub fn set_motif_hints(&self, window: u32, hints: &MotifHints) -> Flusher<'_>
source§impl XConnection
impl XConnection
pub fn select_xinput_events( &self, window: u32, device_id: i32, mask: i32 ) -> Flusher<'_>
pub fn select_xkb_events( &self, device_id: u32, mask: u32 ) -> Option<Flusher<'_>>
pub fn query_pointer( &self, window: u32, device_id: i32 ) -> Result<PointerState<'_>, XError>
pub fn lookup_utf8(&self, ic: *mut _XIC, key_event: &mut XKeyEvent) -> String
source§impl XConnection
impl XConnection
pub fn keycode_to_keysym(&self, keycode: u8) -> u32
pub fn lookup_keysym(&self, xkev: &mut XKeyEvent) -> u32
pub fn query_keymap(&self) -> Keymap
source§impl XConnection
impl XConnection
pub fn alloc_class_hint(&self) -> XSmartPointer<'_, XClassHint>
pub fn alloc_size_hints(&self) -> XSmartPointer<'_, XSizeHints>
pub fn alloc_wm_hints(&self) -> XSmartPointer<'_, XWMHints>
source§impl XConnection
impl XConnection
pub unsafe fn get_xft_dpi(&self) -> Option<f64>
pub unsafe fn get_output_info( &self, resources: *mut XRRScreenResources, crtc: *mut XRRCrtcInfo ) -> Option<(String, f64, Vec<VideoMode, Global>)>
pub fn set_crtc_config(&self, crtc_id: u32, mode_id: u32) -> Result<(), ()>
pub fn get_crtc_mode(&self, crtc_id: u32) -> u32
source§impl XConnection
impl XConnection
pub fn get_property<T>( &self, window: u32, property: u32, property_type: u32 ) -> Result<Vec<T, Global>, GetPropertyError>where T: Formattable,
pub fn change_property<T, 'a>( &'a self, window: u32, property: u32, property_type: u32, mode: PropMode, new_value: &[T] ) -> Flusher<'a>where T: Formattable,
source§impl XConnection
impl XConnection
pub fn update_cached_wm_info(&self, root: u32)
source§impl XConnection
impl XConnection
pub fn flush_requests(&self) -> Result<(), XError>
pub fn sync_with_server(&self) -> Result<(), XError>
source§impl XConnection
impl XConnection
pub fn new( error_handler: Option<unsafe extern "C" fn(_: *mut _XDisplay, _: *mut XErrorEvent) -> i32> ) -> Result<XConnection, XNotSupported>
sourcepub fn check_errors(&self) -> Result<(), XError>
pub fn check_errors(&self) -> Result<(), XError>
Checks whether an error has been triggered by the previous function calls.
sourcepub fn ignore_error(&self)
pub fn ignore_error(&self)
Ignores any previous error.
Trait Implementations§
source§impl Debug for XConnection
impl Debug for XConnection
source§impl Drop for XConnection
impl Drop for XConnection
impl Send for XConnection
impl Sync for XConnection
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more